Rescue System for Pogo V4/Mobile using OpenWrt (Install with NetConsole) April 27, 2020 05:52PM |
Registered: 11 years ago Posts: 22 |
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? April 27, 2020 06:00PM |
Admin Registered: 13 years ago Posts: 19,006 |
Quote
Rescue Systems
...
Rescue System for Pogo E02 using LEDE/OpenWrt
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? April 27, 2020 06:05PM |
Admin Registered: 13 years ago Posts: 19,006 |
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? April 27, 2020 06:18PM |
Registered: 11 years ago Posts: 22 |
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? April 27, 2020 10:18PM |
Admin Registered: 13 years ago Posts: 19,006 |
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? April 27, 2020 10:49PM |
Registered: 11 years ago Posts: 22 |
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? April 27, 2020 11:17PM |
Admin Registered: 13 years ago Posts: 19,006 |
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? April 28, 2020 12:02AM |
Registered: 11 years ago Posts: 22 |
uboot> setenv ipaddr 192.168.1.2 uboot> setenv serverip 192.168.1.4 uboot> tftpboot openwrt-19.07.2-kirkwood-cloudengines_pogoe02-initramfs-uImage uboot> bootm 0x800000
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? April 28, 2020 01:32AM |
Admin Registered: 13 years ago Posts: 19,006 |
> uboot> setenv ipaddr 192.168.1.2 > uboot> setenv serverip 192.168.1.4 > uboot> tftpboot > openwrt-19.07.2-kirkwood-cloudengines_pogoe02-initramfs-uImage > uboot> bootm 0x800000 >
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? April 28, 2020 02:13AM |
Registered: 11 years ago Posts: 22 |
fw_setenv mtdparts 'mtdparts=orion_nand:0x200000@0x0(u-boot),-@0x200000(ubi)'?
Quote
openwrt-19.07.2-kirkwood-cloudengines_pogoe02-initramfs-uImage is the OpenWrt image for Pogo E02. You probably can boot with it, but it will crash eventually. You need to find this image for Pogo V4/Mobile.
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? April 28, 2020 03:40AM |
Admin Registered: 13 years ago Posts: 19,006 |
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? April 28, 2020 06:05PM |
Registered: 11 years ago Posts: 22 |
~ # cat /etc/fw_env.config # Configuration file for fw_(printenv/saveenv) utility. # Up to two entries are valid, in this case the redundant # environment sector is assumed present. # Notice, that the "Number of sectors" is ignored on NOR. # MTD device name Device offset Env. size Flash sector size Number of sectors /dev/mtd0 0xc0000 0x20000 0x20000Noted that fw_printenv does not work yet...
~ # fw_printenv Warning: Bad CRC, using default environment bootcmd=bootp; setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm bootdelay=5 baudrate=115200...but it will once the new U-Boot and its environment have been flashed.
# Check that the first eight NAND blocks (1 MB) are good dmesg | grep -i bad # Install U-Boot flash_erase /dev/mtd0 0 4 nandwrite /dev/mtd0 uboot.2017.07-tld-1.pogo_v4.mtd0.kwb # Install U-Boot environment flash_erase /dev/mtd0 0xc0000 1 nandwrite -s 786432 /dev/mtd0 uboot.2016.05-tld-1.environment.img # Check that the environment looks sane fw_printenv # Set variables for Pogoplug Mobile/V4 fw_setenv arcNumber 3960 fw_setenv machid f78 # Set 2MB U-Boot partition, and give everything else to ubifs fw_setenv mtdparts 'mtdparts=orion_nand:0x200000@0x0(u-boot),-@0x200000(ubi)' # Restore original MAC address # (actual value redacted) fw_setenv ethaddr '00:25:XX:XX:XX:XX' # (Skipped the uEnv.txt-loading bit, by request) # No SATA on this device, so no adjustment to bootcmd_uenv # No dtb_file in the OpenWRT filesystem # Set up netconsole fw_setenv preboot_nc 'setenv nc_ready 0; for pingstat in 1 2 3 4 5; do; sleep 1; if run if_netconsole; then setenv nc_ready 1; fi; done; if test $nc_ready -eq 1; then run start_netconsole; fi' fw_setenv preboot 'run preboot_nc' fw_setenv ipaddr '192.168.100.15' fw_setenv serverip '192.168.100.10' # Modification to boot Debian on USB, but fall back to OpenWRT on NAND fw_setenv bootcmd_exec 'if run load_uimage; then; 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; fi' # Reboot!
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? April 28, 2020 10:40PM |
Admin Registered: 13 years ago Posts: 19,006 |
cat /etc/fw_env.config
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? April 29, 2020 03:54AM |
Registered: 11 years ago Posts: 22 |
$ ssh root@192.168.100.15 Unable to negotiate with 192.168.100.15 port 22: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? April 29, 2020 04:14AM |
Admin Registered: 13 years ago Posts: 19,006 |
dmesg | grep -i bad
flash_erase /dev/mtd0 0 4 nandwrite /dev/mtd0 uboot.2017.07-tld-1.pogo_v4.mtd0.kwb
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? April 29, 2020 07:00PM |
Registered: 11 years ago Posts: 22 |
# Check that the first eight NAND blocks (1 MB) are good /tmp # dmesg | grep -i bad <6>[ 1.010000] Scanning device for bad blocks <4>[ 1.030000] Bad eraseblock 360 at 0x000002d00000 <5>[ 1.370000] UBI: number of bad PEBs: 1 <5>[ 1.410000] UBI: number of PEBs reserved for bad PEB handling: 8 # (360 is a long way after 8, so we're good for flashing U-Boot) # Install U-Boot /tmp # ./flash_erase /dev/mtd0 0 4 Erasing 128 Kibyte @ 60000 -- 100 % complete /tmp # ./nandwrite /dev/mtd0 uboot.2017.07-tld-1.pogo_v4.mtd0.kwb Writing data to block 0 at offset 0x0 Writing data to block 1 at offset 0x20000 Writing data to block 2 at offset 0x40000 Writing data to block 3 at offset 0x60000 # Install U-Boot environment /tmp # ./flash_erase /dev/mtd0 0xc0000 1 Erasing 128 Kibyte @ c0000 -- 100 % complete /tmp # ./nandwrite -s 786432 /dev/mtd0 uboot.2016.05-tld-1.environment.img Writing data to block 6 at offset 0xc0000 # Check that the environment looks sane /tmp # ./fw_printenv arcNumber=2097 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=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi bootdelay=10 bootdev=usb device=0:1 devices=usb ide mmc disks=0 1 2 3 ethact=egiga0 ethaddr=52:3b:20:9c:11:51 if_netconsole=ping $serverip ipaddr=192.168.0.231 led_error=orange blinking led_exit=green off led_init=green blinking dtb_file=/boot/dts/kirkwood-pogo_e02.dtb load_dtb_addr=0x1c00000 load_initrd_addr=0x1100000 load_uimage_addr=0x800000 load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage machid=0x831 mainlineLinux=yes mtdids=nand0=orion_nand mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data) 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_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 uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi usb_ready_retry=15 # (No errors reading the variables, so we're good) # Note that fw_setenv normally does not have any output, # so this next section is a little boring # Set variables for Pogoplug Mobile/V4 /tmp # ./fw_setenv arcNumber 3960 /tmp # ./fw_setenv machid f78 # Set 2MB U-Boot partition, and give everything else to ubifs /tmp # ./fw_setenv mtdparts 'mtdparts=orion_nand:0x200000@0x0(u-boot),-@0x200000(ubi)' # Restore original MAC address # (actual value redacted) /tmp # ./fw_setenv ethaddr '00:25:XX:XX:XX:XX' # Set up netconsole /tmp # ./fw_setenv preboot_nc 'setenv nc_ready 0; for pingstat in 1 2 3 4 5; do; sleep 1; if run if_netconsole; then setenv nc_ready 1; fi; done; if test $nc_ready -eq 1; then run start_netconsole; fi' /tmp # ./fw_setenv preboot 'run preboot_nc' /tmp # ./fw_setenv ipaddr '192.168.100.15' /tmp # ./fw_setenv serverip '192.168.100.10' # Modification to boot Debian on USB, but fall back to OpenWRT on NAND /tmp # ./fw_setenv bootcmd_exec 'if run load_uimage; then; 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; fi' # I noticed that dtb_file was set to a file that is incorrect for this device, # and that I don't have anyway, so I cleared its value /tmp # ./fw_setenv dtb_file # And last, but not least... /tmp # rebootConnection closed by foreign host.
$ nc -l -u -p 6666
U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:34:01 -0700)
Pogoplug V4
gcc (Debian 6.3.0-18) 6.3.0 20170516
GNU ld (GNU Binutils for Debian) 2.28
Hit any key to stop autoboot: 5
Hit any key to stop autoboot: 5
0
Pogov4>
Pogov4>
Pogov4> printenv
printenv
arcNumber=3960
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec
[...]
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? April 29, 2020 09:33PM |
Admin Registered: 13 years ago Posts: 19,006 |
> # Check that the first eight NAND > blocks (1 MB) are good > > /tmp # dmesg | grep -i bad > <6>[ 1.010000] Scanning device > for bad blocks > <4>[ 1.030000] Bad eraseblock 360 at > 0x000002d00000 > <5>[ 1.370000] UBI: number of bad PEBs: > 1 > <5>[ 1.410000] UBI: number of PEBs reserved for > bad PEB handling: 8 > > # (360 is a long way after 8, so > we're good for flashing U-Boot) > > > # Install U-Boot > > /tmp # ./flash_erase /dev/mtd0 0 > 4 > Erasing 128 Kibyte @ 60000 -- 100 % > complete > > /tmp # ./nandwrite /dev/mtd0 > uboot.2017.07-tld-1.pogo_v4.mtd0.kwb > Writing data to block 0 at offset > 0x0 > Writing data to block 1 at offset 0x20000 > Writing data to block 2 at offset 0x40000 > Writing data to block 3 at offset 0x60000 > > > # Install U-Boot > environment > > /tmp # ./flash_erase /dev/mtd0 > 0xc0000 1 > Erasing 128 Kibyte @ c0000 -- 100 % > complete > > /tmp # ./nandwrite -s 786432 > /dev/mtd0 > uboot.2016.05-tld-1.environment.img > Writing data to block 6 at offset > 0xc0000 > > > # Check that the environment looks > sane > > /tmp # ./fw_printenv > arcNumber=2097 > 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=run bootcmd_uenv; run scan_disk; run > set_bootargs; run bootcmd_exec > bootcmd_uenv=run uenv_load; if test $uenv_loaded > -eq 1; then run uenv_import; fi > bootdelay=10 > bootdev=usb > device=0:1 > devices=usb ide mmc > disks=0 1 2 3 > ethact=egiga0 > ethaddr=52:3b:20:9c:11:51 > if_netconsole=ping $serverip > ipaddr=192.168.0.231 > led_error=orange blinking > led_exit=green off > led_init=green blinking > dtb_file=/boot/dts/kirkwood-pogo_e02.dtb > load_dtb_addr=0x1c00000 > load_initrd_addr=0x1100000 > load_uimage_addr=0x800000 > load_dtb=echo loading DTB $dtb_file ...; load > $bootdev $device $load_dtb_addr $dtb_file > load_initrd=echo loading uInitrd ...; load > $bootdev $device $load_initrd_addr /boot/uInitrd > load_uimage=echo loading uImage ...; load $bootdev > $device $load_uimage_addr /boot/uImage > machid=0x831 > mainlineLinux=yes > mtdids=nand0=orion_nand > mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data) > 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_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 > uenv_read=echo loading envs from $devtype $disknum > ...; if load $devtype $disknum:1 $uenv_addr > /boot/uEnv.txt; then setenv uenv_loaded 1; fi > usb_ready_retry=15 > > # (No errors reading the variables, > so we're good) > > > # Note that fw_setenv normally does > not have any output, > # so this next section is a little boring > > # Set variables for Pogoplug > Mobile/V4 > /tmp # ./fw_setenv arcNumber > 3960 > /tmp # ./fw_setenv machid > f78 > > # Set 2MB U-Boot partition, and > give everything else to ubifs > /tmp # ./fw_setenv mtdparts > 'mtdparts=orion_nand:0x200000@0x0(u-boot),-@0x200000(ubi)' > > # Restore original MAC address > # (actual value redacted) > /tmp # ./fw_setenv ethaddr > '00:25:XX:XX:XX:XX' > > # Set up netconsole > /tmp # ./fw_setenv preboot_nc > 'setenv nc_ready 0; for pingstat in 1 2 3 4 5; do; > sleep 1; if run if_netconsole; then setenv > nc_ready 1; fi; done; if test $nc_ready -eq 1; > then run start_netconsole; fi' > /tmp # ./fw_setenv preboot 'run > preboot_nc' > /tmp # ./fw_setenv ipaddr > '192.168.100.15' > /tmp # ./fw_setenv serverip > '192.168.100.10' > > # Modification to boot Debian on > USB, but fall back to OpenWRT on NAND > /tmp # ./fw_setenv bootcmd_exec 'if > run load_uimage; then; 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; fi' > > # I noticed that dtb_file was set > to a file that is incorrect for this device, > # and that I don't have anyway, so I cleared its > value > > /tmp # ./fw_setenv > dtb_file > > # And last, but not > least... > > /tmp # > rebootConnection > closed by foreign host. >>
> $ nc -l -u -p 6666
>
> U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:34:01
> -0700)
> Pogoplug V4
> gcc (Debian 6.3.0-18) 6.3.0 20170516
> GNU ld (GNU Binutils for Debian) 2.28
> Hit any key to stop autoboot: 5
>
>
nc -lup 6666 192.168.100.15 6666
> Hit any key to stop autoboot: 5
> 0
> Pogov4>
>
> Pogov4>
>
> Pogov4> printenv
> printenv
> arcNumber=3960
> bootcmd=run bootcmd_uenv; run scan_disk; run
> set_bootargs; run bootcmd_exec
> [...]
>
>
nand erase.part ubi
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? April 29, 2020 09:51PM |
Registered: 11 years ago Posts: 22 |
Quote
bodhi
And in this case, nc_ready is really transient because without a saveenv, nothing got written to NAND during the next boot.
Quote
bodhi
That's where UBIFS comes in. The bad blocks are gathered by this file system and will be marked, so it is not in the ubi volume. Note that joerg erased the ubi partition at u-boot prompt in his instruction. It is prudent to do this to avoid problem once you log into OpenWrt and format the rest.
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? April 30, 2020 05:31PM |
Registered: 11 years ago Posts: 22 |
Pogov4> nand erase.part ubi NAND erase.part: invalid partition number 2 for device nand0 (orion_nand) no such partition device 0 offset 0x200000, size 0x7e00000 Skipping bad block at 0x02d00000 Erasing at 0x7fe0000 -- 100% complete. OK # (I later figured out that the above error is due to the "partition" # variable referencing a NAND partition that doesn't exist. # In any event, the error appears to be harmless.) # Because I don't have a USB drive handy, I've set up a TFTP server # at the IP address in the "serverip" variable, with an appropriate # copy of an OpenWRT uImage file # (You can also load this file off an attached FAT32-formatted USB drive # if that's easier; search for "fatload" in this thread) # This downloads the uImage file into memory via TFTP Pogov4> tftpboot openwrt-19.07.2-kirkwood-cloudengines_pogoplugv4-initramfs-uImage Using egiga0 device TFTP from server 192.168.100.10; our IP address is 192.168.100.15 Filename 'openwrt-19.07.2-kirkwood-cloudengines_pogoplugv4-initramfs-uImage'. Load address: 0x800000 Loading: ################################################################# ################################################################# ################################################################# ################################################### 8.7 MiB/s done Bytes transferred = 3605263 (37030f hex) # And this boots it Pogov4> bootm 0x800000 ## Booting kernel from Legacy Image at 00800000 ... Image Name: ARM OpenWrt Linux-4.14.171 Created: 2020-02-27 21:05:12 UTC Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 3605199 Bytes = 3.4 MiB Load Address: 00008000 Entry Point: 00008000 Verifying Checksum ... OK Starting kernel ...
$ ssh root@192.168.100.25 The authenticity of host '192.168.100.25 (192.168.100.25)' can't be established. RSA key fingerprint is SHA256:ZW5fg5lnzTuCQrmCpygs4SxcvWrNq/fRfF7COTLvswk. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.100.25' (RSA) to the list of known hosts. BusyBox v1.30.1 () built-in shell (ash) _______ ________ __ | |.-----.-----.-----.| | | |.----.| |_ | - || _ | -__| || | | || _|| _| |_______|| __|_____|__|__||________||__| |____| |__| W I R E L E S S F R E E D O M ----------------------------------------------------- OpenWrt 19.07.2, r10947-65030d81f3 ----------------------------------------------------- === WARNING! ===================================== There is no root password defined on this device! Use the "passwd" command to set up a new password in order to prevent unauthorized SSH logins. -------------------------------------------------- root@OpenWrt:~# # Note that this OpenWRT environment is only running in RAM! # It has not been installed to the device's NAND yet # The stock fw_env.config is not correct for this device... root@OpenWrt:~# cat /etc/fw_env.config /dev/mtd1 0x0 0x20000 0x20000 # ...so fw_printenv doesn't work root@OpenWrt:~# fw_printenv Warning: Bad CRC, using default environment bootcmd=bootp; setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm bootdelay=5 baudrate=115200 # So we set the correct values... root@OpenWrt:~# echo /dev/mtd0 0xc0000 0x20000 0x20000 >/etc/fw_env.config # ...and now fw_printenv works root@OpenWrt:/tmp# fw_printenv bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi bootdelay=10 bootdev=usb device=0:1 devices=usb ide mmc disks=0 1 2 3 ethact=egiga0 if_netconsole=ping $serverip led_error=orange blinking led_exit=green off led_init=green blinking load_dtb_addr=0x1c00000 load_initrd_addr=0x1100000 load_uimage_addr=0x800000 load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage mainlineLinux=yes mtdids=nand0=orion_nand partition=nand0,2 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 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_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 uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi usb_ready_retry=15 arcNumber=3960 machid=f78 mtdparts=mtdparts=orion_nand:0x200000@0x0(u-boot),-@0x200000(ubi) ethaddr=00:25:XX:XX:XX:XX preboot_nc=setenv nc_ready 0; for pingstat in 1 2 3 4 5; do; sleep 1; if run if_netconsole; then setenv nc_ready 1; fi; done; if test $nc_ready -eq 1; then run start_netconsole; fi preboot=run preboot_nc ipaddr=192.168.100.15 serverip=192.168.100.10 bootcmd_exec=if run load_uimage; then; 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; fi # Now, set some variables to address booting OpenWRT from NAND root@OpenWrt:~# fw_setenv partition 'nand0,0' root@OpenWrt:~# fw_setenv set_bootargs_owrt 'setenv bootargs console=ttyS0,115200 $mtdparts' root@OpenWrt:~# fw_setenv bootcmd_owrt 'run set_bootargs_owrt; ubi part ubi; ubi read 0x800000 kernel; bootm 0x800000' # This next variable, we're actually appending to the end of it # (you might have a value different from this) root@OpenWrt:~# fw_printenv bootcmd bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec # Add "; run bootcmd_owrt" to the end root@OpenWrt:~# fw_setenv bootcmd 'run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; run bootcmd_owrt' # Copy an OpenWRT sysupgrade image file to the /tmp dir on the device # (probably the same OpenWRT version as the uImage used previously) # and double-check for the correct MD5/SHA256 hash root@OpenWrt:/tmp# md5sum openwrt-19.07.2-kirkwood-cloudengines_pogoplugv4-squashfs-sysupgrade.bin b297f8ed76cc9b2d9e4ad0ac57523a75 openwrt-19.07.2-kirkwood-cloudengines_pogoplugv4-squashfs-sysupgrade.bin # Run sysupgrade (which will promptly kick you out) root@OpenWrt:/tmp# sysupgrade -v openwrt-19.07.2-kirkwood-cloudengines_pogoplugv4-squashfs-sysupgrade.bin Cannot save config while running from ramdisk. Commencing upgrade. Closing all shell sessions. Connection to 192.168.100.25 closed by remote host. Connection to 192.168.100.25 closed.
$ nc -l -u -p 6666 U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:34:01 -0700) Pogoplug V4 gcc (Debian 6.3.0-18) 6.3.0 20170516 GNU ld (GNU Binutils for Debian) 2.28 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 Card did not respond to voltage select! mmc_init: -95, time 11 ## 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 Card did not respond to voltage select! mmc_init: -95, time 10 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 Card did not respond to voltage select! mmc_init: -95, time 10 device mmc 0:1 Card did not respond to voltage select! mmc_init: -95, time 11 Card did not respond to voltage select! mmc_init: -95, time 10 ** Bad device mmc 0 ** device mmc 1:1 MMC Device 1 not found MMC Device 1 not found ** Bad device mmc 1 ** device mmc 2:1 MMC Device 2 not found MMC Device 2 not found ** Bad device mmc 2 ** device mmc 3:1 MMC Device 3 not found MMC Device 3 not found ** Bad device mmc 3 ** loading uImage ... ** Bad device usb 0 ** ubi0: attaching mtd1 ubi0: scanning is finished ubi0: attached mtd1 (name "mtd=1", size 126 MiB) ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512 ubi0: VID header offset: 512 (aligned 512), data offset: 2048 ubi0: good PEBs: 1007, bad PEBs: 1, corrupted PEBs: 0 ubi0: user volume: 3, internal volumes: 1, max. volumes count: 128 ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 2773805143 ubi0: available PEBs: 0, total reserved PEBs: 1007, PEBs reserved for bad PEB handling: 19 Read 0 bytes from volume kernel to 800000 No size specified -> Using max size (2193408) ## Booting kernel from Legacy Image at 00800000 ... Image Name: ARM OpenWrt Linux-4.14.171 Created: 2020-02-27 21:05:12 UTC Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 2079191 Bytes = 2 MiB Load Address: 00008000 Entry Point: 00008000 Verifying Checksum ... OK Starting kernel ...
# Make sure to delete the old entry for the device from your # ~/.ssh/known_hosts file, or else you will get a big scary warning # about the host key having changed $ ssh root@192.168.100.25 The authenticity of host '192.168.100.25 (192.168.100.25)' can't be established. RSA key fingerprint is SHA256:yAqh277tA08JMFh5GSbZkka/gcfpIMcoIsP3HMK8Gmg. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.100.25' (RSA) to the list of known hosts. BusyBox v1.30.1 () built-in shell (ash) _______ ________ __ | |.-----.-----.-----.| | | |.----.| |_ | - || _ | -__| || | | || _|| _| |_______|| __|_____|__|__||________||__| |____| |__| W I R E L E S S F R E E D O M ----------------------------------------------------- OpenWrt 19.07.2, r10947-65030d81f3 ----------------------------------------------------- === WARNING! ===================================== There is no root password defined on this device! Use the "passwd" command to set up a new password in order to prevent unauthorized SSH logins. -------------------------------------------------- root@OpenWrt:~# # *Now* this system is installed! root@OpenWrt:~# cat /etc/fw_env.config /dev/mtd1 0x0 0x20000 0x20000 # We need to set up fw_env.config again, because # the first time around it was just a file in RAM root@OpenWrt:~# echo /dev/mtd0 0xc0000 0x20000 0x20000 >/etc/fw_env.config # Here's what the MTD partitions look like, just for reference root@OpenWrt:~# cat /proc/mtd dev: size erasesize name mtd0: 00200000 00020000 "u-boot" mtd1: 07e00000 00020000 "ubi" # A 126 MB partition for OpenWRT, not bad # Now, connect to port 80 in a browser and start OpenWRT'ing!
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? April 30, 2020 08:27PM |
Admin Registered: 13 years ago Posts: 19,006 |
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? May 01, 2020 07:20AM |
Registered: 11 years ago Posts: 1,303 |
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? May 01, 2020 08:44PM |
Registered: 11 years ago Posts: 22 |
Quote
bodhi
Could you make one new post that shows the whole thing. You can call it Part I and Part II, if you like.
# Now, set some variables to address booting OpenWRT from NAND root@OpenWrt:~# fw_setenv partition 'nand0,0' Can't open /dev/mtd0: Permission denied Error: can't write fw_env to flash
root@OpenWrt:~# fw_printenv | grep mtd mtdids=nand0=orion_nand set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params mtdparts=mtdparts=orion_nand:0x200000@0x0(u-boot),-@0x200000(ubi)
root@OpenWrt:~# dmesg | grep -i bad [ 0.805751] Scanning device for bad blocks [ 0.826173] Bad eraseblock 146 at 0x000001240000 [ 0.919265] Bad eraseblock 941 at 0x0000075a0000
root@OpenWrt:~# cat /proc/mtd dev: size erasesize name mtd0: 001c0000 00020000 "uboot" mtd1: 00040000 00020000 "uboot_env" mtd2: 07e00000 00020000 "ubi"
[ 0.933031] 3 fixed-partitions partitions found on MTD device orion_nand [ 0.939722] Creating 3 MTD partitions on "orion_nand": [ 0.944860] 0x000000000000-0x0000001c0000 : "uboot" [ 0.950503] 0x0000001c0000-0x000000200000 : "uboot_env" [ 0.956429] 0x000000200000-0x000008000000 : "ubi"
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? May 01, 2020 09:48PM |
Admin Registered: 13 years ago Posts: 19,006 |
> [ 0.933031] 3 fixed-partitions partitions found > on MTD device orion_nand > [ 0.939722] Creating 3 MTD partitions on > "orion_nand": > [ 0.944860] 0x000000000000-0x0000001c0000 : > "uboot" > [ 0.950503] 0x0000001c0000-0x000000200000 : > "uboot_env" > [ 0.956429] 0x000000200000-0x000008000000 : > "ubi" >>
printenvAnd in OpenWrt, post the full dmesg, or at least:
uname -a cat /proc/cmdline
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? May 01, 2020 10:40PM |
Registered: 11 years ago Posts: 22 |
Pogov4> printenv arcNumber=3960 bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec bootcmd_exec=if run load_uimage; then 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; 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=usb ide mmc disks=0 1 2 3 ethact=egiga0 ethaddr=00:25:XX:XX:XX:XX if_netconsole=ping $serverip ipaddr=192.168.100.15 led_error=orange blinking led_exit=green off led_init=green blinking load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file load_dtb_addr=0x1c00000 load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd load_initrd_addr=0x1100000 load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage load_uimage_addr=0x800000 machid=f78 mainlineLinux=yes mtdids=nand0=orion_nand mtdparts=mtdparts=orion_nand:0x200000@0x0(u-boot),-@0x200000(ubi) nc_ready=1 ncip=192.168.100.10 partition=nand0,2 preboot=run preboot_nc preboot_nc=setenv nc_ready 0; for pingstat in 1 2 3 4 5; do; sleep 1; if run if_netconsole; then setenv nc_ready 1; fi; done; if test $nc_ready -eq 1; then run start_netconsole; fi 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.100.10 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=nc stdin=nc stdout=nc 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_ready_retry=15 Environment size: 3004/131068 bytes
root@OpenWrt:~# uname -a Linux OpenWrt 4.14.171 #0 Thu Feb 27 21:05:12 2020 armv5tel GNU/Linux root@OpenWrt:~# cat /proc/cmdline console=ttyS0,115200 root@OpenWrt:~# dmesg [ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 4.14.171 (builder@buildhost) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r10947-65030d81f3)) #0 Thu Feb 27 21:05:12 2020 [ 0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f [ 0.000000] CPU: VIVT data cache, VIVT instruction cache [ 0.000000] OF: fdt: Machine model: Cloud Engines PogoPlug Series 4 [ 0.000000] Memory policy: Data cache writeback [ 0.000000] On node 0 totalpages: 32768 [ 0.000000] free_area_init_node: node 0, pgdat c0d28538, node_mem_map c7efa000 [ 0.000000] Normal zone: 256 pages used for memmap [ 0.000000] Normal zone: 0 pages reserved [ 0.000000] Normal zone: 32768 pages, LIFO batch:7 [ 0.000000] random: get_random_bytes called from 0xc0700980 with crng_init=0 [ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768 [ 0.000000] pcpu-alloc: [0] 0 [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 32512 [ 0.000000] Kernel command line: console=ttyS0,115200 [ 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: 117148K/131072K available (4804K kernel code, 162K rwdata, 728K rodata, 6144K init, 208K bss, 13924K reserved, 0K cma-reserved) [ 0.000000] Virtual kernel memory layout: [ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB) [ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB) [ 0.000000] vmalloc : 0xc8800000 - 0xff800000 ( 880 MB) [ 0.000000] lowmem : 0xc0000000 - 0xc8000000 ( 128 MB) [ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB) [ 0.000000] .text : 0xc0008000 - 0xc05b1250 (5797 kB) [ 0.000000] .init : 0xc0700000 - 0xc0d00000 (6144 kB) [ 0.000000] .data : 0xc0d00000 - 0xc0d28ba0 ( 163 kB) [ 0.000000] .bss : 0xc0d28ba0 - 0xc0d5cf84 ( 209 kB) [ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16 [ 0.000000] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 11467562657 ns [ 0.000013] sched_clock: 32 bits at 166MHz, resolution 6ns, wraps every 12884901885ns [ 0.000060] Switching to timer-based delay loop, resolution 6ns [ 0.000173] Calibrating delay loop (skipped), value calculated using timer frequency.. 333.33 BogoMIPS (lpj=1666666) [ 0.000206] pid_max: default: 32768 minimum: 301 [ 0.000410] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.000444] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.001270] CPU: Testing write buffer coherency: ok [ 0.002433] Setting up static identity map for 0x100000 - 0x10003c [ 0.002823] mvebu-soc-id: MVEBU SoC ID=0x6281, Rev=0x3 [ 0.007678] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns [ 0.007718] futex hash table entries: 256 (order: -1, 3072 bytes) [ 0.007850] pinctrl core: initialized pinctrl subsystem [ 0.009441] NET: Registered protocol family 16 [ 0.010042] DMA: preallocated 256 KiB pool for atomic coherent allocations [ 0.011547] cpuidle: using governor ladder [ 0.012065] Feroceon L2: Enabling L2 [ 0.012126] Feroceon L2: Cache support initialised. [ 0.012517] [Firmware Info]: /ocp@f1000000/ethernet-controller@72000/ethernet0-port@0: local-mac-address is not set [ 0.017638] No ATAGs? [ 0.040396] SCSI subsystem initialized [ 0.041035] libata version 3.00 loaded. [ 0.041347] usbcore: registered new interface driver usbfs [ 0.041436] usbcore: registered new interface driver hub [ 0.041513] usbcore: registered new device driver usb [ 0.044185] clocksource: Switched to clocksource orion_clocksource [ 0.045310] NET: Registered protocol family 2 [ 0.046151] TCP established hash table entries: 1024 (order: 0, 4096 bytes) [ 0.046184] TCP bind hash table entries: 1024 (order: 0, 4096 bytes) [ 0.046212] TCP: Hash tables configured (established 1024 bind 1024) [ 0.046328] UDP hash table entries: 256 (order: 0, 4096 bytes) [ 0.046363] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) [ 0.046552] NET: Registered protocol family 1 [ 0.046592] PCI: CLS 0 bytes, default 32 [ 0.185067] Crashlog allocated RAM at address 0x3f00000 [ 0.186197] workingset: timestamp_bits=30 max_order=15 bucket_order=0 [ 0.192392] squashfs: version 4.0 (2009/01/31) Phillip Lougher [ 0.192411] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc. [ 0.290651] io scheduler noop registered [ 0.290673] io scheduler deadline registered (default) [ 0.292192] kirkwood-pinctrl f1010000.pin-controller: registered pinctrl driver [ 0.294289] mvebu-pcie mbus@f1000000:pcie@82000000: PCI host bridge to bus 0000:00 [ 0.294316] pci_bus 0000:00: root bus resource [io 0x1000-0xfffff] [ 0.294332] pci_bus 0000:00: root bus resource [mem 0xe0000000-0xefffffff] [ 0.294350] pci_bus 0000:00: root bus resource [bus 00-ff] [ 0.294399] pci 0000:00:01.0: [11ab:6281] type 01 class 0x060400 [ 0.294685] PCI: bus0: Fast back to back transfers disabled [ 0.294706] pci 0000:00:01.0: bridge configuration invalid ([bus 00-00]), reconfiguring [ 0.294836] PCI: bus1: Fast back to back transfers enabled [ 0.294859] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01 [ 0.294891] pci 0000:00:01.0: PCI bridge to [bus 01] [ 0.295506] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled [ 0.298080] console [ttyS0] disabled [ 0.298177] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 25, base_baud = 10416666) is a 16550A [ 0.766761] console [ttyS0] enabled [ 0.771452] sata_mv f1080000.sata: version 1.28 [ 0.771701] sata_mv f1080000.sata: slots 32 ports 1 [ 0.779735] scsi host0: sata_mv [ 0.783085] ata1: SATA max UDMA/133 irq 32 [ 0.787991] nand: device found, Manufacturer ID: 0xad, Chip ID: 0xf1 [ 0.794357] nand: Hynix H27U1G8F2BTR-BC [ 0.798182] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64 [ 0.805751] Scanning device for bad blocks [ 0.826173] Bad eraseblock 146 at 0x000001240000 [ 0.919265] Bad eraseblock 941 at 0x0000075a0000 [ 0.933031] 3 fixed-partitions partitions found on MTD device orion_nand [ 0.939722] Creating 3 MTD partitions on "orion_nand": [ 0.944860] 0x000000000000-0x0000001c0000 : "uboot" [ 0.950503] 0x0000001c0000-0x000000200000 : "uboot_env" [ 0.956429] 0x000000200000-0x000008000000 : "ubi" [ 0.963148] libphy: Fixed MDIO Bus: probed [ 0.967605] libphy: orion_mdio_bus: probed [ 0.983894] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4 [ 0.993199] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 00:25:31:03:fb:72 [ 1.002004] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver [ 1.008526] ehci-pci: EHCI PCI platform driver [ 1.013022] ehci-orion: EHCI orion driver [ 1.017281] orion-ehci f1050000.ehci: EHCI Host Controller [ 1.022795] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1 [ 1.030626] orion-ehci f1050000.ehci: irq 29, io mem 0xf1050000 [ 1.064205] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00 [ 1.070944] hub 1-0:1.0: USB hub found [ 1.074996] hub 1-0:1.0: 1 port detected [ 1.079510] usbcore: registered new interface driver usb-storage [ 1.295609] ata1: SATA link down (SStatus 0 SControl F300) [ 2.164197] rtc-mv f1010300.rtc: internal RTC not ticking [ 2.169712] i2c /dev entries driver [ 2.174053] orion_wdt: Initial timeout 25 sec [ 2.179252] mvsdio f1090000.mvsdio: Got CD GPIO [ 2.183795] mvsdio f1090000.mvsdio: Got WP GPIO [ 2.250152] random: fast init done [ 2.340159] marvell-cesa f1030000.crypto: CESA device successfully registered [ 2.348601] NET: Registered protocol family 10 [ 2.355602] Segment Routing with IPv6 [ 2.359342] NET: Registered protocol family 17 [ 2.363807] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this. [ 2.376742] 8021q: 802.1Q VLAN Support v1.8 [ 2.384598] UBI error: no valid UBI magic found inside mtd2 [ 2.390423] hctosys: unable to open rtc device (rtc0) [ 2.421775] Freeing unused kernel memory: 6144K [ 2.442881] init: Console is alive [ 2.446608] init: - watchdog - [ 2.458331] kmodloader: loading kernel modules from /etc/modules-boot.d/* [ 2.465453] kmodloader: done loading kernel modules from /etc/modules-boot.d/* [ 2.475561] init: - preinit - [ 2.611760] random: jshn: uninitialized urandom read (4 bytes read) [ 2.658997] random: jshn: uninitialized urandom read (4 bytes read) [ 2.692930] random: jshn: uninitialized urandom read (4 bytes read) [ 2.787977] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled [ 2.797831] mv643xx_eth_port mv643xx_eth_port.0 eth0: link down [ 2.805566] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready [ 5.922010] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled [ 5.931930] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready [ 5.983180] procd: - early - [ 5.986825] procd: - watchdog - [ 6.544019] procd: - watchdog - [ 6.547470] procd: - ubus - [ 6.555403] urandom_read: 3 callbacks suppressed [ 6.555412] random: ubusd: uninitialized urandom read (4 bytes read) [ 6.600790] random: ubusd: uninitialized urandom read (4 bytes read) [ 6.607560] random: ubusd: uninitialized urandom read (4 bytes read) [ 6.615193] procd: - init - [ 6.994656] kmodloader: loading kernel modules from /etc/modules.d/* [ 7.016494] ip6_tables: (C) 2000-2006 Netfilter Core Team [ 7.037479] ip_tables: (C) 2000-2006 Netfilter Core Team [ 7.060612] nf_conntrack version 0.5.0 (2048 buckets, 8192 max) [ 7.135886] xt_time: kernel timezone is -0000 [ 7.156637] PPP generic driver version 2.4.2 [ 7.175137] NET: Registered protocol family 24 [ 7.182791] kmodloader: done loading kernel modules from /etc/modules.d/* [ 7.193800] urngd: v1.0.2 started. [ 7.301847] random: crng init done [ 7.305274] random: 1 urandom warning(s) missed due to ratelimiting [ 17.323269] br-lan: port 1(eth0) entered blocking state [ 17.328541] br-lan: port 1(eth0) entered disabled state [ 17.334052] device eth0 entered promiscuous mode [ 17.423694] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready [ 19.931141] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled [ 19.941021] br-lan: port 1(eth0) entered blocking state [ 19.946264] br-lan: port 1(eth0) entered forwarding state [ 19.953831] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? May 01, 2020 11:12PM |
Admin Registered: 13 years ago Posts: 19,006 |
boot
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? May 01, 2020 11:48PM |
Registered: 11 years ago Posts: 22 |
setenv partition nand0,0 nand erase.part ubi tftpboot openwrt-19.07.2-kirkwood-cloudengines_pogoplugv4-initramfs-uImage bootm 0x800000
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? May 01, 2020 11:56PM |
Admin Registered: 13 years ago Posts: 19,006 |
> setenv partition nand0,0 > > nand erase.part ubi > > tftpboot > openwrt-19.07.2-kirkwood-cloudengines_pogoplugv4-initramfs-uImage > > bootm 0x800000 >>
run set_bootargs
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? May 02, 2020 12:43AM |
Registered: 11 years ago Posts: 22 |
# Set bootargs so that OpenWRT will start up correctly Pogov4> setenv bootargs console=ttyS0,115200 $mtdparts(since "set_bootargs_owrt" has not yet been written to the environment)
bootargs=console=ttyS0,115200 mtdparts=orion_nand:0x200000@0x0(u-boot),-@0x200000(ubi)
root@OpenWrt:~# cat /proc/mtd dev: size erasesize name mtd0: 00200000 00020000 "u-boot" mtd1: 07e00000 00020000 "ubi"
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? May 02, 2020 01:44AM |
Admin Registered: 13 years ago Posts: 19,006 |
Re: Pogoplug Mobile with bodhi's U-Boot and OpenWRT? May 02, 2020 10:37PM |
Registered: 11 years ago Posts: 22 |
# Username is "root", default password is "ceadmin" # You can SSH in, but newer clients will refuse to connect due # to an old security algorithm $ ssh root@192.168.100.25 Unable to negotiate with 192.168.100.25 port 22: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1 # You can do this... $ ssh -o KexAlgorithms=diffie-hellman-group1-sha1 root@192.168.100.25 The authenticity of host '192.168.100.25 (192.168.100.25)' can't be established. RSA key fingerprint is SHA256:2mfYb77dWKJAYgFmUwy3rqSNMINATCJpZj+5aE/FNf0. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.100.25' (RSA) to the list of known hosts. root@192.168.100.25's password: ~ # # ...or this (if telnet is enabled) $ telnet 192.168.100.25 Trying 192.168.100.25... Connected to 192.168.100.25. Escape character is '^]'. PogoplugMobile login: root Password: ~ # # First things first: Grab the stock U-Boot environment ~ # /usr/local/cloudengines/bin/blparam bootdelay=1 baudrate=115200 loads_echo=0 rootpath=/mnt/ARM_FS/ netmask=255.255.0.0 run_diag=yes stdin=serial stdout=serial stderr=serial mainlineLinux=no CASset=min enaMonExt=no enaCpuStream=no enaWrAllo=no pexMode=RC disL2Cache=no setL2CacheWT=yes disL2Prefetch=yes enaICPref=yes enaDCPref=yes sata_dma_mode=yes MALLOC_len=1 ethprime=egiga0 netbsd_en=no vxworks_en=no load_nand=nboot 0x800000 0 0x200000 load_nand2=nboot 0x800000 0 0x500000 boot=bootm 0x800000 boot_nand=run load_nand boot || run load_nand2 boot disaMvPnp=no ethmtu=1500 usb0Mode=host nandEcc=1bit hddPowerCtrl=no pcieTune=no ethact=egiga0 ethaddr=00:25:XX:XX:XX:XX cesvcid=XXXXXXXXXXXXXXXXXXXXXXXXXX ceboardver=PPV4A1 ipaddr=192.168.58.233 serverip=192.168.58.188 bootargs=console=ttyS0,115200 root=ubi0:rootfs ubi.mtd=4,2048 rootfstype=ubifs bootcmd=run boot_nand # Copy-and-paste all that information somewhere safe # (you'll be needing the value of "ethaddr", at least) # Just for reference, the stock MTD partition table ~ # cat /proc/mtd dev: size erasesize name mtd0: 00200000 00020000 "u-boot" mtd1: 00300000 00020000 "uImage" mtd2: 00300000 00020000 "uImage2" mtd3: 00800000 00020000 "failsafe" mtd4: 07000000 00020000 "root"
# md5sum is available on the system, so check those hashes! # Any corruption in these files could lead to bricking! /tmp # md5sum linux* uboot* e58f442411eb35e641d40ea0577e00ff linux-tools-installation-bodhi.tar.gz 3823eef10011b864859d31a76470e0e3 uboot.2016.05-tld-1.environment.bodhi.tar e2c2b4927dcd8189f0c97dd81b72ad7e uboot.2017.07-tld-1.pogo_v4.bodhi.tar # Unpack all three files, keeping everything in /tmp # The system has no /etc/fw_env.config file, which we need in order # to use fw_printenv / fw_saveenv (to view/set U-Boot variables) /tmp # ./tools/fw_printenv Cannot parse config file: No such file or directory # We can set one up with the correct values easily... /tmp # echo /dev/mtd0 0xc0000 0x20000 0x20000 >/etc/fw_env.config -sh: can't create /etc/fw_env.config: Read-only file system # ...if we briefly remount root as read-write /tmp # mount -o remount,rw,noatime / /tmp # echo /dev/mtd0 0xc0000 0x20000 0x20000 >/etc/fw_env.config /tmp # mount -o remount,ro / # fw_printenv still won't work, but it will soon /tmp # ./tools/fw_printenv Warning: Bad CRC, using default environment bootcmd=bootp; setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm bootdelay=5 baudrate=115200 # Very important thing to do before we flash: # Check that the first eight NAND blocks (1 MB) are good /tmp # dmesg | grep -i bad <6>[ 1.010000] Scanning device for bad blocks <4>[ 1.030000] Bad eraseblock 360 at 0x000002d00000 <5>[ 1.370000] UBI: number of bad PEBs: 1 <5>[ 1.410000] UBI: number of PEBs reserved for bad PEB handling: 8 # Block 360 is bad, but fortunately, this isn't one of the first 8, # so we're good for flashing U-Boot. If a block in 0-7 is bad, then # DO NOT PROCEED FURTHER! BRICKING WILL ENSUE! Ask bodhi for help # Install U-Boot /tmp # ./tools/flash_erase /dev/mtd0 0 4 Erasing 128 Kibyte @ 60000 -- 100 % complete /tmp # ./tools/nandwrite /dev/mtd0 uboot.2017.07-tld-1.pogo_v4.mtd0.kwb Writing data to block 0 at offset 0x0 Writing data to block 1 at offset 0x20000 Writing data to block 2 at offset 0x40000 Writing data to block 3 at offset 0x60000 # Install U-Boot environment /tmp # ./tools/flash_erase /dev/mtd0 0xc0000 1 Erasing 128 Kibyte @ c0000 -- 100 % complete /tmp # ./tools/nandwrite -s 786432 /dev/mtd0 uboot.2016.05-tld-1.environment.img Writing data to block 6 at offset 0xc0000 # fw_printenv should work now; check that the environment looks sane /tmp # ./tools/fw_printenv arcNumber=2097 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=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi bootdelay=10 bootdev=usb device=0:1 devices=usb ide mmc disks=0 1 2 3 ethact=egiga0 ethaddr=52:3b:20:9c:11:51 if_netconsole=ping $serverip ipaddr=192.168.0.231 led_error=orange blinking led_exit=green off led_init=green blinking dtb_file=/boot/dts/kirkwood-pogo_e02.dtb load_dtb_addr=0x1c00000 load_initrd_addr=0x1100000 load_uimage_addr=0x800000 load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage machid=0x831 mainlineLinux=yes mtdids=nand0=orion_nand mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data) 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_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 uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi usb_ready_retry=15 # (No errors reading the variables, so we're good) # bodhi's U-Boot flashing utilities package does not include fw_setenv # because it's the same as fw_printenv, it just needs to be run under # a different name /tmp # ./tools/fw_setenv -sh: ./tools/fw_setenv: not found # We can use a symlink, or just copy the file to fw_setenv /tmp # ln -s fw_printenv tools/fw_setenv /tmp # ./tools/fw_setenv # Note that fw_setenv normally does not have any output, # so this next section is a little boring # Set variables for Pogoplug Mobile/V4 /tmp # ./tools/fw_setenv arcNumber 3960 /tmp # ./tools/fw_setenv machid f78 # Set 2MB U-Boot partition, and give everything else to ubifs /tmp # ./tools/fw_setenv mtdparts 'mtdparts=orion_nand:0x200000@0x0(u-boot),-@0x200000(ubi)' # Restore original MAC address from the stock U-Boot environment # (actual value redacted) /tmp # ./tools/fw_setenv ethaddr '00:25:XX:XX:XX:XX' # Set up netconsole /tmp # ./tools/fw_setenv preboot_nc 'setenv nc_ready 0; for pingstat in 1 2 3 4 5; do; sleep 1; if run if_netconsole; then setenv nc_ready 1; fi; done; if test $nc_ready -eq 1; then run start_netconsole; fi' /tmp # ./tools/fw_setenv preboot 'run preboot_nc' # Note that "ipaddr" is the IP address that the device will use # (only when U-Boot is active), and "serverip" is the IP address of the # system that will be viewing the console /tmp # ./tools/fw_setenv ipaddr '192.168.100.15' /tmp # ./tools/fw_setenv serverip '192.168.100.10' # Modification to boot Debian on USB, but fall back to OpenWRT on NAND /tmp # ./tools/fw_setenv bootcmd_exec 'if run load_uimage; then 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; fi' # OpenWRT neither provides nor needs a DTB file, so unset that variable /tmp # ./tools/fw_setenv dtb_file # And with that, we're ready to reboot # Note: The stock Pogoplug OS can't be booted by the new U-Boot, # so if you need anything from there, then grab it now, because this is # the last time you'll have the chance! # See you on the other side... /tmp # rebootConnection closed by foreign host.
# Use the IP address that you set in the "ipaddr" variable # (this ensures that you only get output from the Pogoplug) # # Note: If the command exits immediately, then use "nc -lup 6666" instead. # You'll be needing this command again later, so be sure to remember it $ nc -lup 6666 192.168.100.25 6666 U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:34:01 -0700) Pogoplug V4 gcc (Debian 6.3.0-18) 6.3.0 20170516 GNU ld (GNU Binutils for Debian) 2.28 Hit any key to stop autoboot: 5
Hit any key to stop autoboot: 5 0 Pogov4> Pogov4> # Double-check the environment Pogov4> printenv arcNumber=3960 bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec bootcmd_exec=if run load_uimage; then 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; 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=usb ide mmc disks=0 1 2 3 ethact=egiga0 ethaddr=00:25:XX:XX:XX:XX if_netconsole=ping $serverip ipaddr=192.168.100.15 led_error=orange blinking led_exit=green off led_init=green blinking load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file load_dtb_addr=0x1c00000 load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd load_initrd_addr=0x1100000 load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage load_uimage_addr=0x800000 machid=f78 mainlineLinux=yes mtdids=nand0=orion_nand mtdparts=mtdparts=orion_nand:0x200000@0x0(u-boot),-@0x200000(ubi) nc_ready=1 ncip=192.168.100.10 partition=nand0,2 preboot=run preboot_nc preboot_nc=setenv nc_ready 0; for pingstat in 1 2 3 4 5; do; sleep 1; if run if_netconsole; then setenv nc_ready 1; fi; done; if test $nc_ready -eq 1; then run start_netconsole; fi 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.80.10 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=nc stdin=nc stdout=nc 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_ready_retry=15 Environment size: 3004/131068 bytes
# This will prevent the next command from giving an error Pogov4> setenv partition nand0,0 # Erase the MTD partition table so that OpenWRT can set it up later Pogov4> nand erase.part ubi NAND erase.part: device 0 offset 0x200000, size 0x7e00000 Skipping bad block at 0x02d00000 Erasing at 0x7fe0000 -- 100% complete. OK # Because I didn't have a USB drive handy, I set up a TFTP server # at the IP address in the "serverip" variable, with the OpenWRT uImage file # You can also load this file off an attached FAT32-formatted USB drive # if that's easier for you; search for "fatload" in this thread # Download the uImage file into memory via TFTP Pogov4> tftpboot openwrt-19.07.2-kirkwood-cloudengines_pogoplugv4-initramfs-uImage Using egiga0 device TFTP from server 192.168.100.10; our IP address is 192.168.100.15 Filename 'openwrt-19.07.2-kirkwood-cloudengines_pogoplugv4-initramfs-uImage'. Load address: 0x800000 Loading: ################################################################# ################################################################# ################################################################# ################################################### 8.7 MiB/s done Bytes transferred = 3605263 (37030f hex) # Set bootargs so that OpenWRT partitions the NAND correctly Pogov4> setenv bootargs console=ttyS0,115200 $mtdparts # And finally, boot up OpenWRT Pogov4> bootm 0x800000 ## Booting kernel from Legacy Image at 00800000 ... Image Name: ARM OpenWrt Linux-4.14.171 Created: 2020-02-27 21:05:12 UTC Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 3605199 Bytes = 3.4 MiB Load Address: 00008000 Entry Point: 00008000 Verifying Checksum ... OK Starting kernel ...
# You might have to remove the previous host key from ~/.ssh/known_hosts # if you had used SSH earlier to log into the old Pogoplug OS $ ssh root@192.168.100.25 The authenticity of host '192.168.100.25 (192.168.100.25)' can't be established. RSA key fingerprint is SHA256:ZW5fg5lnzTuCQrmCpygs4SxcvWrNq/fRfF7COTLvswk. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.100.25' (RSA) to the list of known hosts. BusyBox v1.30.1 () built-in shell (ash) _______ ________ __ | |.-----.-----.-----.| | | |.----.| |_ | - || _ | -__| || | | || _|| _| |_______|| __|_____|__|__||________||__| |____| |__| W I R E L E S S F R E E D O M ----------------------------------------------------- OpenWrt 19.07.2, r10947-65030d81f3 ----------------------------------------------------- === WARNING! ===================================== There is no root password defined on this device! Use the "passwd" command to set up a new password in order to prevent unauthorized SSH logins. -------------------------------------------------- root@OpenWrt:~# # Note that this OpenWRT environment is only running in RAM! # It has not been installed to the device's NAND yet # The stock fw_env.config is not correct for our setup... root@OpenWrt:~# cat /etc/fw_env.config /dev/mtd1 0x0 0x20000 0x20000 # ...so fw_printenv doesn't work root@OpenWrt:~# fw_printenv Warning: Bad CRC, using default environment bootcmd=bootp; setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm bootdelay=5 baudrate=115200 # So we set the correct values... root@OpenWrt:~# echo /dev/mtd0 0xc0000 0x20000 0x20000 >/etc/fw_env.config # ...and now fw_printenv works root@OpenWrt:/tmp# fw_printenv bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi bootdelay=10 bootdev=usb device=0:1 devices=usb ide mmc disks=0 1 2 3 ethact=egiga0 if_netconsole=ping $serverip led_error=orange blinking led_exit=green off led_init=green blinking load_dtb_addr=0x1c00000 load_initrd_addr=0x1100000 load_uimage_addr=0x800000 load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage mainlineLinux=yes mtdids=nand0=orion_nand partition=nand0,2 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 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_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 uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi usb_ready_retry=15 arcNumber=3960 machid=f78 mtdparts=mtdparts=orion_nand:0x200000@0x0(u-boot),-@0x200000(ubi) ethaddr=00:25:XX:XX:XX:XX preboot_nc=setenv nc_ready 0; for pingstat in 1 2 3 4 5; do; sleep 1; if run if_netconsole; then setenv nc_ready 1; fi; done; if test $nc_ready -eq 1; then run start_netconsole; fi preboot=run preboot_nc ipaddr=192.168.100.15 serverip=192.168.100.10 bootcmd_exec=if run load_uimage; then; 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; fi # The MTD partition table should look like this root@OpenWrt:~# cat /proc/mtd dev: size erasesize name mtd0: 00200000 00020000 "u-boot" mtd1: 07e00000 00020000 "ubi" # Now, set some variables to address booting OpenWRT from NAND root@OpenWrt:~# fw_setenv partition 'nand0,0' root@OpenWrt:~# fw_setenv set_bootargs_owrt 'setenv bootargs console=ttyS0,115200 $mtdparts' root@OpenWrt:~# fw_setenv bootcmd_owrt 'run set_bootargs_owrt; ubi part ubi; ubi read 0x800000 kernel; bootm 0x800000' # This next variable, we're actually appending to the end of it # (you might have a value different from this) root@OpenWrt:~# fw_printenv bootcmd bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec # Just add "; run bootcmd_owrt" to the end root@OpenWrt:~# fw_setenv bootcmd 'run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; run bootcmd_owrt' # Copy the OpenWRT sysupgrade image file to the /tmp dir on the device # and double-check for the correct hash root@OpenWrt:/tmp# $ sha256sum openwrt-19.07.2-kirkwood-cloudengines_pogoplugv4-squashfs-sysupgrade.bin b2d97fe30f163ed757a2992e9c92fa90d945d917bccac9c40cd3521b354d8913 openwrt-19.07.2-kirkwood-cloudengines_pogoplugv4-squashfs-sysupgrade.bin # Run sysupgrade (which will promptly kick you out) root@OpenWrt:/tmp# sysupgrade openwrt-19.07.2-kirkwood-cloudengines_pogoplugv4-squashfs-sysupgrade.bin Cannot save config while running from ramdisk. Commencing upgrade. Closing all shell sessions. Connection to 192.168.100.25 closed by remote host. Connection to 192.168.100.25 closed.
# Use the same command you used before $ nc -lup 6666 192.168.100.25 6666 U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:34:01 -0700) Pogoplug V4 gcc (Debian 6.3.0-18) 6.3.0 20170516 GNU ld (GNU Binutils for Debian) 2.28 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 Card did not respond to voltage select! mmc_init: -95, time 11 ## 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 Card did not respond to voltage select! mmc_init: -95, time 10 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 Card did not respond to voltage select! mmc_init: -95, time 10 device mmc 0:1 Card did not respond to voltage select! mmc_init: -95, time 11 Card did not respond to voltage select! mmc_init: -95, time 10 ** Bad device mmc 0 ** device mmc 1:1 MMC Device 1 not found MMC Device 1 not found ** Bad device mmc 1 ** device mmc 2:1 MMC Device 2 not found MMC Device 2 not found ** Bad device mmc 2 ** device mmc 3:1 MMC Device 3 not found MMC Device 3 not found ** Bad device mmc 3 ** loading uImage ... ** Bad device usb 0 ** ubi0: attaching mtd1 ubi0: scanning is finished ubi0: attached mtd1 (name "mtd=1", size 126 MiB) ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512 ubi0: VID header offset: 512 (aligned 512), data offset: 2048 ubi0: good PEBs: 1007, bad PEBs: 1, corrupted PEBs: 0 ubi0: user volume: 3, internal volumes: 1, max. volumes count: 128 ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 2773805143 ubi0: available PEBs: 0, total reserved PEBs: 1007, PEBs reserved for bad PEB handling: 19 Read 0 bytes from volume kernel to 800000 No size specified -> Using max size (2193408) ## Booting kernel from Legacy Image at 00800000 ... Image Name: ARM OpenWrt Linux-4.14.171 Created: 2020-02-27 21:05:12 UTC Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 2079191 Bytes = 2 MiB Load Address: 00008000 Entry Point: 00008000 Verifying Checksum ... OK Starting kernel ...
# Make sure to delete the old entry for the device from your # ~/.ssh/known_hosts file, or else you will get a big scary warning # about the host key having changed $ ssh root@192.168.100.25 The authenticity of host '192.168.100.25 (192.168.100.25)' can't be established. RSA key fingerprint is SHA256:yAqh277tA08JMFh5GSbZkka/gcfpIMcoIsP3HMK8Gmg. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.100.25' (RSA) to the list of known hosts. BusyBox v1.30.1 () built-in shell (ash) _______ ________ __ | |.-----.-----.-----.| | | |.----.| |_ | - || _ | -__| || | | || _|| _| |_______|| __|_____|__|__||________||__| |____| |__| W I R E L E S S F R E E D O M ----------------------------------------------------- OpenWrt 19.07.2, r10947-65030d81f3 ----------------------------------------------------- === WARNING! ===================================== There is no root password defined on this device! Use the "passwd" command to set up a new password in order to prevent unauthorized SSH logins. -------------------------------------------------- root@OpenWrt:~# # *Now* this system is installed! root@OpenWrt:~# cat /etc/fw_env.config /dev/mtd1 0x0 0x20000 0x20000 # We need to set up fw_env.config again, because # the first time around it was just a file in RAM root@OpenWrt:~# echo /dev/mtd0 0xc0000 0x20000 0x20000 >/etc/fw_env.config # Check the MTD partitions again root@OpenWrt:~# cat /proc/mtd dev: size erasesize name mtd0: 00200000 00020000 "u-boot" mtd1: 07e00000 00020000 "ubi" # (That's a 126 MB partition for OpenWRT, by the way) # Now, point your Web browser to port 80 and start configuring!