Ben
when writting to mtd0, Permission denied, unwritable? March 10, 2018 10:10PM |
Can't open /dev/mtd0: Permission denied
root@PogoMob:~# uname -a Linux PogoMob 3.14.0-kirkwood-tld-1 #1 PREEMPT Tue Apr 1 22:54:58 PDT 2014 armv5tel GNU/Linux cat /proc/cmdline console=ttyS0,115200 root=/dev/mmcblk0p1 rootdelay=10 mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112(root) cat /proc/mtd dev: size erasesize name mtd0: 00100000 00020000 "u-boot" mtd1: 00400000 00020000 "uImage" mtd2: 07b00000 00020000 "root" root@PogoMob:~# dmesg | grep -i mtd [ 0.000000] Kernel command line: console=ttyS0,115200 root=/dev/mmcblk0p1 rootdelay=10 mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112(root) [ 9.792464] mtd: partition size too small (70) [ 9.805155] Creating 3 MTD partitions on "orion_nand": dmesg | grep -i mtd [ 0.000000] Kernel command line: console=ttyS0,115200 root=/dev/mmcblk0p1 rootdelay=10 mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112(root) [ 9.792464] mtd: partition size too small (70) [ 9.805155] Creating 3 MTD partitions on "orion_nand": root@PogoMob:~# dmesg | grep -i 0x000 [ 8.073712] pci 0000:00:00.0: reg 0x18: [mem 0x00000000-0x07ffffff] [ 9.693105] Bad eraseblock 13 at 0x0000001a0000 [ 9.711792] Bad eraseblock 190 at 0x0000017c0000 [ 9.738856] Bad eraseblock 470 at 0x000003ac0000 [ 9.767051] Bad eraseblock 764 at 0x000005f80000 [ 9.810293] 0x000000000000-0x000000100000 : "u-boot" [ 9.815784] 0x000000100000-0x000000500000 : "uImage" [ 9.821117] 0x000000500000-0x000008000000 : "root" cat /etc/fw_env.config /dev/mtd0 0xc0000 0x20000 0x20000 ls -l /dev/mtd* crw------- 1 root root 90, 0 Dec 31 16:00 /dev/mtd0 crw------- 1 root root 90, 1 Dec 31 16:00 /dev/mtd0ro crw------- 1 root root 90, 2 Dec 31 16:00 /dev/mtd1 crw------- 1 root root 90, 3 Dec 31 16:00 /dev/mtd1ro crw------- 1 root root 90, 4 Dec 31 16:00 /dev/mtd2 crw------- 1 root root 90, 5 Dec 31 16:00 /dev/mtd2ro cat /etc/fstab # /etc/fstab: static file system information. # # <file system> <mount point> <type> <options> <dump> <pass> /dev/root / ext3 noatime,errors=remount-ro 0 1 tmpfs /tmp tmpfs defaults 0 0
Ben
Re: when writting to mtd0, Permission denied, unwritable? March 10, 2018 10:15PM |
root@PogoMob:~# fw_printenv arcNumber=2097 baudrate=115200 bootcmd=usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run mmc_bootcmd bootdelay=3 console=ttyS0,115200 ethact=egiga0 ethaddr=02:50:43:3e:e9:18 force_rescue=0 force_rescue_bootcmd=if test $force_rescue -eq 1 || ext2load usb 0:1 0x1700000 /rescueme 1 || fatload usb 0:1 0x1700000 /rescueme.txt 1; then run rescue_bootcmd; fi if_netconsole=ping $serverip ipaddr=192.168.2.35 ippaddr=192.168.2.22 led_error=orange blinking led_exit=green off led_init=green blinking mainlineLinux=yes mmc_boot=mw 0x800000 0 1; ext2load mmc 0:1 0x00800000 /boot/uImage; if ext2load mmc 0:1 0x01100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi mmc_bootcmd=mmc init; mmc init; run mmc_set_bootargs; run mmc_boot mmc_root=/dev/mmcblk0p1 mmc_set_bootargs=setenv bootargs console=$console root=$mmc_root rootdelay=$usb_rootdelay mtdids=nand0=orion_nand mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112(root) partition=nand0,2 pogo_bootcmd=if fsload uboot-original-mtd0.kwb; then go 0x800200; fi preboot=run if_netconsole start_netconsole rescue_bootcmd=if test $rescue_installed -eq 1; then run rescue_set_bootargs; nand read.e 0x800000 0x100000 0x400000; bootm 0x800000; else run pogo_bootcmd; fi rescue_installed=0 rescue_set_bootargs=setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts $rescue_custom_params serverip=192.168.2.140 start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version; stderr=serial stdin=serial stdout=serial ubifs_bootcmd=run ubifs_set_bootargs; if ubi part data && ubifsmount rootfs && ubifsload 0x800000 /boot/uImage && ubifsload 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; fi ubifs_mtd=3 ubifs_set_bootargs=setenv bootargs console=$console ubi.mtd=$ubifs_mtd root=ubi0:rootfs rootfstype=ubifs $mtdparts $ubifs_custom_params usb_boot=mw 0x800000 0 1; ext2load usb $usb_device 0x800000 /boot/uImage; if ext2load usb $usb_device 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi usb_bootcmd=run usb_init; run usb_set_bootargs; run usb_boot usb_device=0:1 usb_init=run usb_scan usb_root=/dev/sda1 usb_rootdelay=10 usb_rootfstype=ext2 usb_scan=usb_scan_done=0;for scan in $usb_scan_list; do run usb_scan_$scan; if test $usb_scan_done -eq 0 && ext2load usb $usb 0x800000 /boot/uImage 1; then usb_scan_done=1; echo "Found bootable drive on usb $usb"; setenv usb_device $usb; setenv usb_root /dev/$dev; fi; done usb_scan_1=usb=0:1 dev=sda1 usb_scan_2=usb=1:1 dev=sdb1 usb_scan_3=usb=2:1 dev=sdc1 usb_scan_4=usb=3:1 dev=sdd1 usb_scan_list=1 2 3 4 usb_set_bootargs=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts $usb_custom_params
Re: when writting to mtd0, Permission denied, unwritable? March 11, 2018 12:22AM |
Admin Registered: 13 years ago Posts: 18,550 |
mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112(root)
mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)
cat /etc/fw_env.config fw_printenv
Ben
Re: when writting to mtd0, Permission denied, unwritable? March 11, 2018 11:23PM |
U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:34:01 -0700) Pogoplug V4 SoC: Kirkwood 88F6192_A1 DRAM: 128 MiB WARNING: Caches not enabled NAND: 128 MiB MMC: MVEBU_MMC: 0 In: serial Out: serial Err: serial Net: egiga0 Hit any key to stop autoboot: 0 starting USB... USB0: USB EHCI 1.00 scanning bus 0 for devices... 1 USB Device(s) found scanning usb for storage devices... 0 Storage Device(s) found Reset IDE: ide_preinit failed MMC rescan: current device # 0 initialized OK ## Unknown partition table type 0 ## Unknown partition table type 0 ## Unknown partition table type 0 ## Unknown partition table type 0 ## Unknown partition table type 0 ## Unknown partition table type 0 ## Unknown partition table type 0 loading envs from usb 0 ... ** Bad device usb 0 ** no IDE devices available Partition Map for MMC device 0 -- Partition Type: DOS Part Start Sector Num Sectors UUID Type 1 63 7213122 0dd70bad-01 83 2 7213185 530145 0dd70bad-02 82 loading envs from mmc 0 ... 87 bytes read in 21 ms (3.9 KiB/s) importing envs ... running scan_disk ... Scan device usb device usb 0:1 ** Bad device usb 0 ** device usb 1:1 ** Bad device usb 1 ** device usb 2:1 ** Bad device usb 2 ** device usb 3:1 ** Bad device usb 3 ** Scan device ide Reset IDE: ide_preinit failed device ide 0:1 ** Bad device ide 0 ** device ide 1:1 ** Bad device ide 1 ** device ide 2:1 ** Bad device ide 2 ** device ide 3:1 ** Bad device ide 3 ** Scan device mmc MMC rescan: current device # 0 initialized OK device mmc 0:1 1 bytes read in 17 ms (0 Bytes/s) Found bootable drive on mmc 0 ** Bad device usb 0 ** ** Bad device usb 0 ** ** Bad device usb 0 ** Wrong Image Format for bootm command ERROR: can't get kernel image! Pogov4>
Pogov4> printenv arcNumber=3960 bootargs=console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root) bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec bootcmd_exec=run load_uimage; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm $load_uimage_addr; fi; fi bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi bootdelay=10 bootdev=mmc device=0:1 devices=usb ide mmc disks=0 1 2 3 dtb_file=/boot/dts/kirkwood-pogo_e02.dtb ethact=egiga0 ethaddr=02:50:43:3f:e9:18 fileaddr=800000 filesize=1 if_netconsole=ping $serverip init_ide=ide reset init_mmc=mmc rescan init_usb=usb start ipaddr=192.168.0.231 led_error=orange blinking led_exit=green off led_init=green blinking load_dtb=ext2load usb 0:1 0x1c00000 /boot/dts/kirkwood-pogoplug_v4.dtb load_dtb_addr=0x1c00000 load_initrd=ext2load usb 0:1 0x1100000 /boot/uInitrd load_initrd_addr=0x1100000 load_uimage=ext2load usb 0:1 0x800000 /boot/uImage load_uimage_addr=0x800000 machid=f78 mainlineLinux=yes mtdids=nand0=orion_nand mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root) partition=nand0,2 preboot_nc=run if_netconsole start_netconsole scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start"; setenv scan_ide "ide reset"; setenv scan_mmc "mmc rescan"; for dev in $devices; do if test $scan_done -eq 0; then echo Scan device $dev; run scan_$dev; for disknum in $disks; do if test $scan_done -eq 0; then echo device $dev $disknum:1; if load $dev $disknum:1 $load_uimage_addr /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done scan_ide=ide reset scan_mmc=mmc rescan scan_usb=usb start serverip=192.168.0.220 set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version; stderr=serial stdin=serial stdout=serial uenv_addr=0x810000 uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize uenv_init_devices=setenv init_usb "usb start"; setenv init_ide "ide reset"; setenv init_mmc "mmc rescan"; for devtype in $devices; do run init_$devtype; done; uenv_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices; do for disknum in 0; do run uenv_read_disk; done; done; uenv_loaded=1 uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi uenv_read_disk=if test $devtype -eq mmc; then if $devtype part; then run uenv_read; fi; else if $devtype part $disknum; then run uenv_read; fi; fi usb_boot=run load_dtb; run load_uimage; if run load_initrd; then bootm 0x800000 0x1100000 0x1c00000; else bootm 0x800000 - 0x1c00000; fi usb_ready_retry=15 Environment size: 3234/131068 bytes Pogov4>
Re: when writting to mtd0, Permission denied, unwritable? March 12, 2018 02:46PM |
Admin Registered: 13 years ago Posts: 18,550 |
setenv devices ‘mmc usb ide’
Ben
Re: when writting to mtd0, Permission denied, unwritable? March 12, 2018 04:41PM |
setenv devices ‘mmc usb ide’but it didn't work. In my understanding of the booting message, there's an error preventing the device from locating the SD card. Can you find where to change the setting to let it see the SD card?
Ben
Re: when writting to mtd0, Permission denied, unwritable? March 12, 2018 04:47PM |
Ben
Re: when writting to mtd0, Permission denied, unwritable? March 12, 2018 05:58PM |
U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:34:01 -0700) Pogoplug V4 SoC: Kirkwood 88F6192_A1 DRAM: 128 MiB WARNING: Caches not enabled NAND: 128 MiB MMC: MVEBU_MMC: 0 In: serial Out: serial Err: serial Net: egiga0 Hit any key to stop autoboot: 0 starting USB... USB0: USB EHCI 1.00 scanning bus 0 for devices... 1 USB Device(s) found scanning usb for storage devices... 0 Storage Device(s) found Reset IDE: ide_preinit failed MMC rescan: current device # 0 initialized OK ## Unknown partition table type 0 ## Unknown partition table type 0 ## Unknown partition table type 0 ## Unknown partition table type 0 ## Unknown partition table type 0 ## Unknown partition table type 0 ## Unknown partition table type 0 loading envs from usb 0 ... ** Bad device usb 0 ** no IDE devices available Partition Map for MMC device 0 -- Partition Type: DOS Part Start Sector Num Sectors UUID Type 1 63 7743425 3ba23039-01 83 loading envs from mmc 0 ... 87 bytes read in 26 ms (2.9 KiB/s) importing envs ... running scan_disk ... Scan device usb device usb 0:1 ** Bad device usb 0 ** device usb 1:1 ** Bad device usb 1 ** device usb 2:1 ** Bad device usb 2 ** device usb 3:1 ** Bad device usb 3 ** Scan device ide Reset IDE: ide_preinit failed device ide 0:1 ** Bad device ide 0 ** device ide 1:1 ** Bad device ide 1 ** device ide 2:1 ** Bad device ide 2 ** device ide 3:1 ** Bad device ide 3 ** Scan device mmc MMC rescan: current device # 0 initialized OK device mmc 0:1 1 bytes read in 16 ms (0 Bytes/s) Found bootable drive on mmc 0 ** Bad device usb 0 ** ** Bad device usb 0 ** ** Bad device usb 0 ** Wrong Image Format for bootm command ERROR: can't get kernel image!
Ben
Re: when writting to mtd0, Permission denied, unwritable? March 12, 2018 06:15PM |
Re: when writting to mtd0, Permission denied, unwritable? March 12, 2018 06:38PM |
Admin Registered: 13 years ago Posts: 18,550 |
setenv devices mmc setenv dtb_file ‘/boot/dts/kirkwood-pogoplug_v4.dtb’ printenv boot
Ben
Re: when writting to mtd0, Permission denied, unwritable? March 12, 2018 08:10PM |
Ben
Re: when writting to mtd0, Permission denied, unwritable? March 12, 2018 10:32PM |
Ben
Re: when writting to mtd0, Permission denied, unwritable? March 13, 2018 12:38AM |
Pogov4> boot MMC rescan: current device # 0 initialized OK Partition Map for MMC device 0 -- Partition Type: DOS Part Start Sector Num Sectors UUID Type 1 2048 7923712 00000000-01 83 loading envs from mmc 0 ... 87 bytes read in 18 ms (3.9 KiB/s) importing envs ... running scan_disk ... Scan device mmc MMC rescan: current device # 0 initialized OK device mmc 0:1 1 bytes read in 16 ms (0 Bytes/s) Found bootable drive on mmc 0 ** Bad device usb 0 ** ** Bad device usb 0 ** ** Bad device usb 0 ** Wrong Image Format for bootm command ERROR: can't get kernel image!
Re: when writting to mtd0, Permission denied, unwritable? March 13, 2018 12:43AM |
Admin Registered: 13 years ago Posts: 18,550 |
Quote
bodhi
And then post the entire serial console log here
Ben
Re: when writting to mtd0, Permission denied, unwritable? March 13, 2018 12:51AM |
Pogov4> U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:34:01 -0700) Pogoplug V4 SoC: Kirkwood 88F6192_A1 DRAM: 128 MiB WARNING: Caches not enabled NAND: 128 MiB MMC: MVEBU_MMC: 0 In: serial Out: serial Err: serial Net: egiga0 Hit any key to stop autoboot: 0 Pogov4> setenv devices mmc Pogov4> setenv dtb_file '/boot/dts/kirkwood-pogoplug_v4.dtb' Pogov4> printenv arcNumber=3960 bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec bootcmd_exec=run load_uimage; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm $load_uimage_addr; fi; fi bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi bootdelay=10 bootdev=usb device=0:1 devices=mmc disks=0 1 2 3 dtb_file=/boot/dts/kirkwood-pogoplug_v4.dtb ethact=egiga0 ethaddr=02:50:43:3f:e9:18 if_netconsole=ping $serverip ipaddr=192.168.0.231 led_error=orange blinking led_exit=green off led_init=green blinking load_dtb=ext2load usb 0:1 0x1c00000 /boot/dts/kirkwood-pogoplug_v4.dtb load_dtb_addr=0x1c00000 load_initrd=ext2load usb 0:1 0x1100000 /boot/uInitrd load_initrd_addr=0x1100000 load_uimage=ext2load usb 0:1 0x800000 /boot/uImage load_uimage_addr=0x800000 machid=f78 mainlineLinux=yes mtdids=nand0=orion_nand mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root) partition=nand0,2 preboot_nc=run if_netconsole start_netconsole scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start"; setenv scan_ide "ide reset"; setenv scan_mmc "mmc rescan"; for dev in $devices; do if test $scan_done -eq 0; then echo Scan device $dev; run scan_$dev; for disknum in $disks; do if test $scan_done -eq 0; then echo device $dev $disknum:1; if load $dev $disknum:1 $load_uimage_addr /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done serverip=192.168.0.220 set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version; stderr=serial stdin=serial stdout=serial uenv_addr=0x810000 uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize uenv_init_devices=setenv init_usb "usb start"; setenv init_ide "ide reset"; setenv init_mmc "mmc rescan"; for devtype in $devices; do run init_$devtype; done; uenv_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices; do for disknum in 0; do run uenv_read_disk; done; done; uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi uenv_read_disk=if test $devtype -eq mmc; then if $devtype part; then run uenv_read; fi; else if $devtype part $disknum; then run uenv_read; fi; fi usb_boot=run load_dtb; run load_uimage; if run load_initrd; then bootm 0x800000 0x1100000 0x1c00000; else bootm 0x800000 - 0x1c00000; fi usb_ready_retry=15 Environment size: 2913/131068 bytes Pogov4> boot MMC rescan: current device # 0 initialized OK Partition Map for MMC device 0 -- Partition Type: DOS Part Start Sector Num Sectors UUID Type 1 2048 7923712 00000000-01 83 loading envs from mmc 0 ... 87 bytes read in 18 ms (3.9 KiB/s) importing envs ... running scan_disk ... Scan device mmc MMC rescan: current device # 0 initialized OK device mmc 0:1 1 bytes read in 16 ms (0 Bytes/s) Found bootable drive on mmc 0 ** Bad device usb 0 ** ** Bad device usb 0 ** ** Bad device usb 0 ** Wrong Image Format for bootm command ERROR: can't get kernel image! Pogov4>
Re: when writting to mtd0, Permission denied, unwritable? March 13, 2018 03:31AM |
Admin Registered: 13 years ago Posts: 18,550 |
Quote
8. Flashing default u-boot envs image (if you are upgrading from 2016.05-tld-1 u-boot, you can skip this step 8).
As described in step 1, u-boot envs must be defined in /etc/fw_env.config as
# MTD device name Device offset Env. size Flash sector size Number of sectors
/dev/mtd0 0xc0000 0x20000 0x20000
This default envs image supports booting with multiple disk drives (and hubs) attached. The disk drives could be any type (usb, sata, sd card). The scanning logic and default envs were set to automatically boot the box with the following required configuration:
For whatever reason, if you can't set up your configuration to satisfy the following 4 requirements, then don't flash this defaut envs image. It might not boot properly. In this case, section C below can be used to tailor the envs to your specific configuration.
r1. There must be only one partition among all partitions from all drives that contains the kernel files. The 2 kernel files are /boot/uImage and /boot/uInitrd.
r2. The partition that contains the 2 kernel files must be partition 1 in a disk drive
r3. The partition that contains the rootfs must be labeled rootfs
r4. The rootfs partition is recommended to be type Ext3 (this is not a hard requirement, ext4 should boot OK, but Ext3 will ensure no problem).
So the bottom line is if you have only one rootfs in a single Ext3 partition, which is labeled as rootfs, then you're all set.
a. Download the default u-boot envs at Dropbox:
uboot.2016.05-tld-1.environment.bodhi.tar
md5:
3823eef10011b864859d31a76470e0e3
sha256:
c8db95a4225e8d78bdaaaa372bd5a87e4b98f3448dd9c62fc96c72b2df1a997c
This tarball includes 3 files:
uboot.2016.05-tld-1.environment.img (the default envs image to be flashed)
uboot.2016.05-tld-1.environment (the content of the default envs in text format)
uboot.2016.05-tld-1.environment.64K.img (small envs image to be flashed on HP T5325 only).
b. Extract the archive to /tmp
cd /tmp
tar -xf uboot.2016.05-tld-1.environment.bodhi.tar
c. Save current envs with fw_printenv, or just copy/paste the listing into a text file.
fw_printenv > current_envs.txt
d. Flash u-boot envs to NAND location 0xC0000.
Be extra careful with the next 2 commands, you should see output that look like below. If there is error, then do not reboot, post your problem here so we can help.
/usr/sbin/flash_erase /dev/mtd0 0xc0000 1
Expected output:
Erase Total 1 Units
Performing Flash Erase of length 131072 at offset 0xc0000 done
/usr/sbin/nandwrite -s 786432 /dev/mtd0 uboot.2016.05-tld-1.environment.img
Expected output:
Writing data to block 6 at offset 0xc0000
e. Modify the following u-boot variables using fw_setenv:
Note that arcNumber and machid are not necessary if you are booting with FDT kernel 3.17+ in the latest kernel and rootfs thread. But it does not hurt to set them anyway.
archNumber and machid are required for non-FDT kernel (3.16.x or earlier)
Also note that only some boxes need machid, some don't (so the command fw_setenv machid below clears them).
for Pogo V4/Mobile:
fw_setenv arcNumber 3960
fw_setenv machid f78
for iConnect:
fw_setenv arcNumber 2870
fw_setenv machid
for Stora:
fw_setenv arcNumber 2743
fw_setenv machid
for Dockstar:
fw_setenv arcNumber 2998
fw_setenv machid
for Pogo E02:
fw_setenv arcNumber 3542
fw_setenv machid dd6
for GoFlex Home:
fw_setenv arcNumber 3338
fw_setenv machid
for GoFlex Net:
fw_setenv arcNumber 3089
fw_setenv machid
for Sheevaplug:
fw_setenv arcNumber 2097
fw_setenv machid
for NSA325:
fw_setenv arcNumber 4495
fw_setenv machid
for NSA320:
fw_setenv arcNumber 3956
fw_setenv machid
for NSA310S/320S:
fw_setenv arcNumber 4931
fw_setenv machid
for NSA310:
fw_setenv arcNumber 4022
fw_setenv machid
Then for all boxes, restore these 2 envs using the saved envs text in step c (replace xxx with the real saved values)
fw_setenv mtdparts 'xxxxxxxxx'
fw_setenv ethaddr 'xx:xx:xx:xx:xx:xx'
Note: for boxes that boot with SATA as rootfs. Please make this adjustment if your boot drive is SATA:
fw_setenv bootcmd_uenv 'run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi; sleep 3'
(This will help the "ide reset" to work properly. There seems to be a bug in u-boot that if you do "ide reset" too quickly in succession, the SATA drive might have problem spinning up).
f. Adjust the DTB name to boot with a rootfs that has FDT kernel 3.17+ (this is the normal case):
Find your box DTB file in the rootfs /boot/dts directory and adjust the env to it. For example, if the box is the Dockstar
fw_setenv dtb_file '/boot/dts/kirkwood-dockstar.dtb'
In the special case when you are booting with a non-FDT kernel 3.16 or earlier, or if you have appended the DTB to uImage. Remove the DTB file env. If not sure please post question before continuing.
fw_setenv dtb_file
h. For sanity check, list you envs again
fw_printenv
If there is error in listing u-boot envs, stop here and post your problem so we can help.
Remember to save away your old envs text file created in step c for future reference in case more need to be restored.
i. Done step 8.
setenv devices 'usb ide' setenv ethaddr xx:xx:xx:xx:xx:xx setenv dtb_file '/boot/dts/kirkwood-goflexnet.dtb' boot
setenv devices 'mmc usb ide' setenv ethaddr xx:xx:xx:xx:xx:xx setenv dtb_file '/boot/dts/kirkwood-pogoplug_v4.dtb' boot
Ben
Re: when writting to mtd0, Permission denied, unwritable? March 13, 2018 04:02PM |
[....] Waiting for /dev to be fully populated...[ 28.736136] marvell-cesa f1030000.crypto: CESA device successfully registered [ 28.778489] orion_wdt: Initial timeout 25 sec done (timeout).
Re: when writting to mtd0, Permission denied, unwritable? March 13, 2018 05:01PM |
Admin Registered: 13 years ago Posts: 18,550 |
Ben
Re: when writting to mtd0, Permission denied, unwritable? March 13, 2018 05:42PM |
Setting up ntp (1:4.2.8p10+dfsg-3+deb9u2) ... insserv: script checkroot.sh: service mtab already provided! [....] Starting NTP server: ntpdAutomated Options Processing Error! /usr/sbin/ntpd called AutoOpts function with structure version 41:0:1. This exceeds the compiled library version: AO_CURRENT:AO_REVISION:AO_AGE failed! invoke-rc.d: initscript ntp, action "start" failed. dpkg: error processing package ntp (--configure): subprocess installed post-installation script returned error exit status 70 Errors were encountered while processing: ntp E: Sub-process /usr/bin/dpkg returned an error code (1)
Re: when writting to mtd0, Permission denied, unwritable? March 13, 2018 07:51PM |
Admin Registered: 13 years ago Posts: 18,550 |