当前位置: 技术问答>linux和unix
嵌入式 linux 内核加载和文件系统
来源: 互联网 发布时间:2017-05-11
本文导语: 有一个设备 内嵌的linux系统 我想对系统进行一下改造 但是我每次我在系统做了修改之后重启 系统的修改就不见了 系统自动就还原了 有网友说这事由于我这个文件系统是ramdisk的 但是我查看挂载 发现好像只有ho...
有一个设备 内嵌的linux系统 我想对系统进行一下改造 但是我每次我在系统做了修改之后重启 系统的修改就不见了 系统自动就还原了 有网友说这事由于我这个文件系统是ramdisk的 但是我查看挂载 发现好像只有home目录是ramds的
# mount
rootfs on / type rootfs (rw)
/dev/root on / type ext2 (rw,relatime)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
ramfs on /home type ramfs (rw,relatime)
udev on /dev type tmpfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
/dev/ubi1_0 on /dav type ubifs (rw,relatime)
/dev/ubi3_0 on /davinci type ubifs (rw,relatime)
/dev/ubi4_0 on /config type ubifs (rw,relatime)
# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 7.9M 7.0M 887.0K 89% /
/dev/root 7.9M 7.0M 887.0K 89% /
udev 46.6M 76.0K 46.5M 0% /dev
/dev/ubi1_0 19.7M 8.2M 10.5M 44% /dav
/dev/ubi3_0 1.3M 68.0K 1.1M 6% /davinci
/dev/ubi4_0 1.3M 48.0K 1.1M 4% /config
可能我对这些挂载信息认识的不一定准确 但是我想请教 我想对我这个设备做一些改动 先如何才能做到修改不被还原 或者说 如何能找到被挂载到ram的文件 新手想高手前辈请教 问题已经困扰一周了 实在没办法才在这里打搅大家 望会的朋友好心帮我个忙 在这里先谢过了
下面是dmsey的信息
# dmesg
[ 0.000000] Linux version 2.6.38.8 (baigaoping@ipcteam2) (gcc version 4.6.1 (Sourcery CodeBench Lite 2011.09-70) )
[ 0.000000] #358 PREEMPT Mon Sep 2 15:03:44 CST 2013
[ 0.000000] CPU: ARMv6-compatible processor [4117b365] revision 5 (ARMv6TEJ), cr=00c5387f
[ 0.000000] CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[ 0.000000] Machine: Coconut
[ 0.000000] Memory policy: ECC disabled, Data cache writeback
[ 0.000000] Ambarella: AHB = 0x60000000[0xf0000000],0x01000000 0
[ 0.000000] Ambarella: APB = 0x70000000[0xf1000000],0x01000000 0
[ 0.000000] Ambarella: PPM = 0xc0000000[0xe0000000],0x00200000 9
[ 0.000000] Ambarella: BSB = 0xc8c00000[0xe8c00000],0x00400000 9
[ 0.000000] Ambarella: DSP = 0xc9000000[0xe9000000],0x07000000 9
[ 0.000000] Ambarella: HAL = 0xc00a0000[0xfee00000],0x0000e708 9
[ 0.000000] On node 0 totalpages: 25344
[ 0.000000] free_area_init_node: node 0, pgdat c04dcf88, node_mem_map c0503000
[ 0.000000] Normal zone: 198 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 25146 pages, LIFO batch:7
[ 0.000000] bootmem_init: high_memory = 0xc8a00000
[ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 25146
[ 0.000000] Kernel command line: console=ttyS0 initrd=0xc0a00000,0x400000 rw root=/dev/ram dbg=0 KRN_PRT=pri RMD_PRT=pri reserved=0xc6500000,0x100000,99 video=amb0fb:720x480,720x480,1,0
[ 0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Memory: 99MB = 99MB total
[ 0.000000] Memory: 91192k/91192k available, 10184k reserved, 0K highmem
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
[ 0.000000] DMA : 0xfe600000 - 0xfee00000 ( 8 MB)
[ 0.000000] vmalloc : 0xc9000000 - 0xe0000000 ( 368 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc8a00000 ( 138 MB)
[ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)
[ 0.000000] .init : 0xc0008000 - 0xc002d000 ( 148 kB)
[ 0.000000] .text : 0xc002d000 - 0xc04a9000 (4592 kB)
[ 0.000000] .data : 0xc04aa000 - 0xc04dd640 ( 206 kB)
[ 0.000000] Preemptable hierarchical RCU implementation.
[ 0.000000] RCU-based detection of stalled CPUs is disabled.
[ 0.000000] Verbose stalled-CPUs detection is disabled.
[ 0.000000] NR_IRQS:224
[ 0.000000] sched_clock: 32 bits at 60MHz, resolution 16ns, wraps every 71582ms
[ 0.000000] Console: colour dummy device 80x30
[ 0.000000] console [ttyS0] enabled
[ 0.000590] Calibrating delay loop... 478.41 BogoMIPS (lpj=2392064)
[ 0.250124] pid_max: default: 32768 minimum: 301
[ 0.250592] Mount-cache hash table entries: 512
[ 0.251460] CPU: Testing write buffer coherency: ok
[ 0.258689] NET: Registered protocol family 16
[ 0.265132] Ambarella Coconut:
[ 0.265168] chip id: 5100
[ 0.265182] board type: 3
[ 0.265195] board revision: 10
[ 0.265210] chip name: a5m
[ 0.265223] HAL version: 176869
[ 0.265241] reference clock: 24000000
[ 0.265260] system configuration: 0x177804ea
[ 0.265280] boot type: 0x00000002
[ 0.265296] hif type: 0x00000000
[ 0.296429] bio: create slab at 0
[ 0.299221] ambarella-spi ambarella-spi.0: ambarella SPI Controller 0 created
[ 0.311198] ambarella-i2c ambarella-i2c.0: Ambarella Media Processor I2C adapter[i2c-0] probed!
[ 0.312931] ambarella-i2c ambarella-i2c.1: Ambarella Media Processor I2C adapter[i2c-1] probed!
[ 0.314475] i2c i2c-0: Added multiplexed i2c bus 2
[ 0.314522] ambarella-i2cmux ambarella-i2cmux.0: mux on ambarella-i2c adapter
[ 0.317714] Advanced Linux Sound Architecture Driver Version 1.0.23.
[ 0.322139] cfg80211: Calling CRDA to update world regulatory domain
[ 0.323969] Switching to clocksource ambarella-cs-timer
[ 0.330159] Switched to NOHz mode on CPU #0
[ 0.393250] NET: Registered protocol family 2
[ 0.393648] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.394982] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.395211] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.395369] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.395393] TCP reno registered
[ 0.395422] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.395472] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.396168] NET: Registered protocol family 1
[ 0.397167] RPC: Registered udp transport module.
[ 0.397208] RPC: Registered tcp transport module.
[ 0.397231] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.397793] Trying to unpack rootfs image as initramfs...
[ 0.400347] rootfs image is not initramfs (no cpio magic); looks like an initrd
[ 0.437009] Freeing initrd memory: 4096K
[ 0.440222] [ kernel version: svn-50562 ]
[ 0.440328] mmc0 power register success!
[ 0.440373] mmc1 power register success!
[ 0.440533] reboot times :1
[ 0.466735] msgmni has been set to 186
[ 0.476421] alg: No test for stdrng (krng)
[ 0.476595] io scheduler noop registered
[ 0.476625] io scheduler deadline registered
[ 0.476823] io scheduler cfq registered (default)
[ 0.480970] ambarella-fb ambarella-fb.0: probe p[720x480] v[720x576] c[1] b[0] l[736] @ [0xc5980000:0x00068000]!
[ 0.482964] ambarella-uart.0: ttyS0 at MMIO 0x70005000 (irq = 9) is a ambuart
[ 0.514234] ambarella-uart.1: ttyS1 at MMIO 0x7001f000 (irq = 25) is a ambuart
[ 0.557603] brd: module loaded
[ 0.573258] loop: module loaded
[ 0.577139] NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
[ 0.577191] ambarella_nand_config_flash: 0x02e00140, 0x02c00140
[ 0.577676] Bad block table found at page 65472, version 0x01
[ 0.578290] Bad block table found at page 65408, version 0x01
[ 0.578645] nand_read_bbt: Bad block at 0x000002ec0000
[ 0.585532] ambarella-nand ambarella-nand: ambarella_nand_probe: Partition infomation found!
[ 0.585605] Creating 18 MTD partitions on "ambnand":
[ 0.585645] 0x000000000000-0x000000020000 : "bst"
[ 0.589895] 0x000000020000-0x000000120000 : "ptb"
[ 0.593974] 0x000000120000-0x000000220000 : "bld"
[ 0.598436] 0x000000220000-0x000000320000 : "hal"
[ 0.602605] 0x000000320000-0x000000420000 : "ano_ptb"
[ 0.607155] 0x000000420000-0x0000004a0000 : "env"
[ 0.611450] 0x0000004a0000-0x000000520000 : "param"
[ 0.616155] 0x000000520000-0x000000620000 : "dpt"
[ 0.620561] 0x000000620000-0x000001020000 : "rcvy"
[ 0.625299] 0x000001020000-0x000001820000 : "krn_pri"
[ 0.629567] 0x000001820000-0x000002020000 : "krn_sec"
[ 0.633825] 0x000002020000-0x000002420000 : "rmd_pri"
[ 0.638470] 0x000002420000-0x000002820000 : "rmd_sec"
[ 0.642836] 0x000002820000-0x000004020000 : "app_pri"
[ 0.647640] 0x000004020000-0x000005820000 : "app_sec"
[ 0.652169] 0x000005820000-0x000005c20000 : "cfg_pri"
[ 0.656998] 0x000005c20000-0x000006020000 : "cfg_sec"
[ 0.661561] 0x000006020000-0x000007020000 : "dbg"
[ 0.673474] PPP generic driver version 2.4.2
[ 0.675277] PPP Deflate Compression module registered
[ 0.675323] PPP BSD Compression module registered
二楼继续信息
# mount
rootfs on / type rootfs (rw)
/dev/root on / type ext2 (rw,relatime)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
ramfs on /home type ramfs (rw,relatime)
udev on /dev type tmpfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
/dev/ubi1_0 on /dav type ubifs (rw,relatime)
/dev/ubi3_0 on /davinci type ubifs (rw,relatime)
/dev/ubi4_0 on /config type ubifs (rw,relatime)
# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 7.9M 7.0M 887.0K 89% /
/dev/root 7.9M 7.0M 887.0K 89% /
udev 46.6M 76.0K 46.5M 0% /dev
/dev/ubi1_0 19.7M 8.2M 10.5M 44% /dav
/dev/ubi3_0 1.3M 68.0K 1.1M 6% /davinci
/dev/ubi4_0 1.3M 48.0K 1.1M 4% /config
可能我对这些挂载信息认识的不一定准确 但是我想请教 我想对我这个设备做一些改动 先如何才能做到修改不被还原 或者说 如何能找到被挂载到ram的文件 新手想高手前辈请教 问题已经困扰一周了 实在没办法才在这里打搅大家 望会的朋友好心帮我个忙 在这里先谢过了
下面是dmsey的信息
# dmesg
[ 0.000000] Linux version 2.6.38.8 (baigaoping@ipcteam2) (gcc version 4.6.1 (Sourcery CodeBench Lite 2011.09-70) )
[ 0.000000] #358 PREEMPT Mon Sep 2 15:03:44 CST 2013
[ 0.000000] CPU: ARMv6-compatible processor [4117b365] revision 5 (ARMv6TEJ), cr=00c5387f
[ 0.000000] CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[ 0.000000] Machine: Coconut
[ 0.000000] Memory policy: ECC disabled, Data cache writeback
[ 0.000000] Ambarella: AHB = 0x60000000[0xf0000000],0x01000000 0
[ 0.000000] Ambarella: APB = 0x70000000[0xf1000000],0x01000000 0
[ 0.000000] Ambarella: PPM = 0xc0000000[0xe0000000],0x00200000 9
[ 0.000000] Ambarella: BSB = 0xc8c00000[0xe8c00000],0x00400000 9
[ 0.000000] Ambarella: DSP = 0xc9000000[0xe9000000],0x07000000 9
[ 0.000000] Ambarella: HAL = 0xc00a0000[0xfee00000],0x0000e708 9
[ 0.000000] On node 0 totalpages: 25344
[ 0.000000] free_area_init_node: node 0, pgdat c04dcf88, node_mem_map c0503000
[ 0.000000] Normal zone: 198 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 25146 pages, LIFO batch:7
[ 0.000000] bootmem_init: high_memory = 0xc8a00000
[ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 25146
[ 0.000000] Kernel command line: console=ttyS0 initrd=0xc0a00000,0x400000 rw root=/dev/ram dbg=0 KRN_PRT=pri RMD_PRT=pri reserved=0xc6500000,0x100000,99 video=amb0fb:720x480,720x480,1,0
[ 0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Memory: 99MB = 99MB total
[ 0.000000] Memory: 91192k/91192k available, 10184k reserved, 0K highmem
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
[ 0.000000] DMA : 0xfe600000 - 0xfee00000 ( 8 MB)
[ 0.000000] vmalloc : 0xc9000000 - 0xe0000000 ( 368 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc8a00000 ( 138 MB)
[ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)
[ 0.000000] .init : 0xc0008000 - 0xc002d000 ( 148 kB)
[ 0.000000] .text : 0xc002d000 - 0xc04a9000 (4592 kB)
[ 0.000000] .data : 0xc04aa000 - 0xc04dd640 ( 206 kB)
[ 0.000000] Preemptable hierarchical RCU implementation.
[ 0.000000] RCU-based detection of stalled CPUs is disabled.
[ 0.000000] Verbose stalled-CPUs detection is disabled.
[ 0.000000] NR_IRQS:224
[ 0.000000] sched_clock: 32 bits at 60MHz, resolution 16ns, wraps every 71582ms
[ 0.000000] Console: colour dummy device 80x30
[ 0.000000] console [ttyS0] enabled
[ 0.000590] Calibrating delay loop... 478.41 BogoMIPS (lpj=2392064)
[ 0.250124] pid_max: default: 32768 minimum: 301
[ 0.250592] Mount-cache hash table entries: 512
[ 0.251460] CPU: Testing write buffer coherency: ok
[ 0.258689] NET: Registered protocol family 16
[ 0.265132] Ambarella Coconut:
[ 0.265168] chip id: 5100
[ 0.265182] board type: 3
[ 0.265195] board revision: 10
[ 0.265210] chip name: a5m
[ 0.265223] HAL version: 176869
[ 0.265241] reference clock: 24000000
[ 0.265260] system configuration: 0x177804ea
[ 0.265280] boot type: 0x00000002
[ 0.265296] hif type: 0x00000000
[ 0.296429] bio: create slab at 0
[ 0.299221] ambarella-spi ambarella-spi.0: ambarella SPI Controller 0 created
[ 0.311198] ambarella-i2c ambarella-i2c.0: Ambarella Media Processor I2C adapter[i2c-0] probed!
[ 0.312931] ambarella-i2c ambarella-i2c.1: Ambarella Media Processor I2C adapter[i2c-1] probed!
[ 0.314475] i2c i2c-0: Added multiplexed i2c bus 2
[ 0.314522] ambarella-i2cmux ambarella-i2cmux.0: mux on ambarella-i2c adapter
[ 0.317714] Advanced Linux Sound Architecture Driver Version 1.0.23.
[ 0.322139] cfg80211: Calling CRDA to update world regulatory domain
[ 0.323969] Switching to clocksource ambarella-cs-timer
[ 0.330159] Switched to NOHz mode on CPU #0
[ 0.393250] NET: Registered protocol family 2
[ 0.393648] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.394982] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.395211] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.395369] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.395393] TCP reno registered
[ 0.395422] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.395472] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.396168] NET: Registered protocol family 1
[ 0.397167] RPC: Registered udp transport module.
[ 0.397208] RPC: Registered tcp transport module.
[ 0.397231] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.397793] Trying to unpack rootfs image as initramfs...
[ 0.400347] rootfs image is not initramfs (no cpio magic); looks like an initrd
[ 0.437009] Freeing initrd memory: 4096K
[ 0.440222] [ kernel version: svn-50562 ]
[ 0.440328] mmc0 power register success!
[ 0.440373] mmc1 power register success!
[ 0.440533] reboot times :1
[ 0.466735] msgmni has been set to 186
[ 0.476421] alg: No test for stdrng (krng)
[ 0.476595] io scheduler noop registered
[ 0.476625] io scheduler deadline registered
[ 0.476823] io scheduler cfq registered (default)
[ 0.480970] ambarella-fb ambarella-fb.0: probe p[720x480] v[720x576] c[1] b[0] l[736] @ [0xc5980000:0x00068000]!
[ 0.482964] ambarella-uart.0: ttyS0 at MMIO 0x70005000 (irq = 9) is a ambuart
[ 0.514234] ambarella-uart.1: ttyS1 at MMIO 0x7001f000 (irq = 25) is a ambuart
[ 0.557603] brd: module loaded
[ 0.573258] loop: module loaded
[ 0.577139] NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
[ 0.577191] ambarella_nand_config_flash: 0x02e00140, 0x02c00140
[ 0.577676] Bad block table found at page 65472, version 0x01
[ 0.578290] Bad block table found at page 65408, version 0x01
[ 0.578645] nand_read_bbt: Bad block at 0x000002ec0000
[ 0.585532] ambarella-nand ambarella-nand: ambarella_nand_probe: Partition infomation found!
[ 0.585605] Creating 18 MTD partitions on "ambnand":
[ 0.585645] 0x000000000000-0x000000020000 : "bst"
[ 0.589895] 0x000000020000-0x000000120000 : "ptb"
[ 0.593974] 0x000000120000-0x000000220000 : "bld"
[ 0.598436] 0x000000220000-0x000000320000 : "hal"
[ 0.602605] 0x000000320000-0x000000420000 : "ano_ptb"
[ 0.607155] 0x000000420000-0x0000004a0000 : "env"
[ 0.611450] 0x0000004a0000-0x000000520000 : "param"
[ 0.616155] 0x000000520000-0x000000620000 : "dpt"
[ 0.620561] 0x000000620000-0x000001020000 : "rcvy"
[ 0.625299] 0x000001020000-0x000001820000 : "krn_pri"
[ 0.629567] 0x000001820000-0x000002020000 : "krn_sec"
[ 0.633825] 0x000002020000-0x000002420000 : "rmd_pri"
[ 0.638470] 0x000002420000-0x000002820000 : "rmd_sec"
[ 0.642836] 0x000002820000-0x000004020000 : "app_pri"
[ 0.647640] 0x000004020000-0x000005820000 : "app_sec"
[ 0.652169] 0x000005820000-0x000005c20000 : "cfg_pri"
[ 0.656998] 0x000005c20000-0x000006020000 : "cfg_sec"
[ 0.661561] 0x000006020000-0x000007020000 : "dbg"
[ 0.673474] PPP generic driver version 2.4.2
[ 0.675277] PPP Deflate Compression module registered
[ 0.675323] PPP BSD Compression module registered
二楼继续信息
|
flash有18个分区,有一个是 rcvy ,应该是恢复的,从打印信息看:
[ 3.994207] UBIFS: recovery needed
[ 4.052371] UBIFS: recovery completed
楼主找一下是为什么这么做吧
[ 3.994207] UBIFS: recovery needed
[ 4.052371] UBIFS: recovery completed
楼主找一下是为什么这么做吧