Nach den Versionen 1 (»Holler«-Ansatz mit USB-fähigem neueren uBoot in mtd3) und 2 (UBIFS-Root in mtd3, vom Dockstar-uBoot gestartet) möchte ich heute eine dritte Variante vorstellen, wie man seinen Dockstar »um Debian erweitern« kann.
Anstatt mit mtd3, dem freien Flashbereich der Dockstars, rumzuspielen, möchte ich heute, nachdem auch die JTAG-Belegung bekannt ist und das Risiko eines dauerhaften Bricks somit geringer, das »Übel« an der Wurzel anpacken: der kastrierte leistungsarme uBoot-Loader des Dockstars.
Jeff Doozan hat es dankenswerterweise verskriptet, sodaß es eigentlich nur der Dreisprung Dockstar auspacken, das ersten Mal booten und Jeffs uBoot installieren sein sollte …
-bash-3.2# cd /tmp -bash-3.2# wget http://jeff.doozan.com/debian/uboot/install_uboot_mtd0.sh Connecting to jeff.doozan.com (69.163.187.226:80) install_uboot_mtd0.s 100% |*******************************| 15859 00:00:00 ETA -bash-3.2# chmod +x install_uboot_mtd0.sh -bash-3.2# ./install_uboot_mtd0.sh !!!!!! DANGER DANGER DANGER DANGER DANGER DANGER !!!!!! If you lose power to your device while running this script, it could be left in an unusable state. This script will replace the bootloader on /dev/mtd0. This installer will only work on a Seagate Dockstar or Pogoplug Pink. Do not run this installer on any other device. By typing ok, you agree to assume all liabilities and risks associated with running this installer. If you agree, type 'ok' and press ENTER to continue: ok DISABLE POGOPLUG SERVICES The pogoplug service includes an auto-update feature which could be used to cripple or disable your device. It is recommended that you disable this service. NOTE: The pogoplug service is proprietary software created by Cloud Engines. It is not available for use in other distributions and will not be available in your new linux installation even if you choose not to disable it. Would you like to disable the pogoplug services? [Y/n] y Applying fixes to the pogoplug environment... Disabling the pogoplug service... Done fixing pogoplug environment. # checking for /uboot-original-mtd0.kwb... # Installing /uboot-original-mtd0.kwb... Connecting to jeff.doozan.com (69.163.187.226:80) uboot-original-mtd0. 100% |*******************************| 49 --:--:-- ETA Connecting to jeff.doozan.com (69.163.187.226:80) uboot-original-mtd0. 100% |*******************************| 512k 00:00:00 ETA # Successfully installed /uboot-original-mtd0.kwb. # checking for /usr/sbin/blparam... # Installing /usr/sbin/blparam... Connecting to jeff.doozan.com (69.163.187.226:80) blparam.md5 100% |*******************************| 42 --:--:-- ETA Connecting to jeff.doozan.com (69.163.187.226:80) blparam 100% |*******************************| 14168 --:--:-- ETA # Successfully installed /usr/sbin/blparam. # checking for /usr/sbin/nandwrite... # Installing /usr/sbin/nandwrite... Connecting to jeff.doozan.com (69.163.187.226:80) nandwrite.md5 100% |*******************************| 44 --:--:-- ETA Connecting to jeff.doozan.com (69.163.187.226:80) nandwrite 100% |*******************************| 11500 --:--:-- ETA # Successfully installed /usr/sbin/nandwrite. # checking for /usr/sbin/nanddump... # Installing /usr/sbin/nanddump... Connecting to jeff.doozan.com (69.163.187.226:80) nanddump.md5 100% |*******************************| 43 --:--:-- ETA Connecting to jeff.doozan.com (69.163.187.226:80) nanddump 100% |*******************************| 21286 00:00:00 ETA # Successfully installed /usr/sbin/nanddump. # checking for /usr/sbin/flash_erase... # Installing /usr/sbin/flash_erase... Connecting to jeff.doozan.com (69.163.187.226:80) flash_erase.md5 100% |*******************************| 46 --:--:-- ETA Connecting to jeff.doozan.com (69.163.187.226:80) flash_erase 100% |*******************************| 12819 00:00:00 ETA # Successfully installed /usr/sbin/flash_erase. # checking for /usr/sbin/fw_printenv... # Installing /usr/sbin/fw_printenv... Connecting to jeff.doozan.com (69.163.187.226:80) fw_printenv.md5 100% |*******************************| 46 --:--:-- ETA Connecting to jeff.doozan.com (69.163.187.226:80) fw_printenv 100% |*******************************| 652k 00:00:00 ETA # Successfully installed /usr/sbin/fw_printenv. # checking for /etc/fw_env.config... # Installing /etc/fw_env.config... Connecting to jeff.doozan.com (69.163.187.226:80) fw_env.config.md5 100% |*******************************| 48 --:--:-- ETA Connecting to jeff.doozan.com (69.163.187.226:80) fw_env.config 100% |*******************************| 329 --:--:-- ETA # Successfully installed /etc/fw_env.config. # Attempting to auto-detect your device...Dockstar detected # Installing uBoot Connecting to jeff.doozan.com (69.163.187.226:80) uboot.mtd0.kwb.md5 100% |*******************************| 49 --:--:-- ETA Connecting to jeff.doozan.com (69.163.187.226:80) uboot.mtd0.kwb 100% |*******************************| 512k 00:00:00 ETA Erase Total 4 Units Performing Flash Erase of length 131072 at offset 0x60000 done 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 Block size 131072, page size 2048, OOB size 64 Dumping data starting at 0x00000000 and ending at 0x00080000... ## Verifying new uBoot... Connecting to jeff.doozan.com (69.163.187.226:80) uboot.mtd0.kwb.md5 100% |*******************************| 49 --:--:-- ETA # Verified successfully! # Installing uBoot environment Warning: Bad CRC, using default environment ## Error: "ethaddr" not defined Warning: Bad CRC, using default environment ## Error: "rescue_installed" not defined Warning: Bad CRC, using default environment ## Error: "bootcmd_rescue" not defined Warning: Bad CRC, using default environment ## Error: "rescue_custom_params" not defined Warning: Bad CRC, using default environment ## Error: "usb_custom_params" not defined Warning: Bad CRC, using default environment ## Error: "ubifs_custom_params" not defined Connecting to jeff.doozan.com (69.163.187.226:80) uboot.environment.md 100% |*******************************| 52 --:--:-- ETA Connecting to jeff.doozan.com (69.163.187.226:80) uboot.environment 100% |*******************************| 128k 00:00:00 ETA Erase Total 1 Units Performing Flash Erase of length 131072 at offset 0xc0000 done Writing data to block 6 at offset 0xc0000 # Verifying uBoot environment ECC failed: 6 ECC corrected: 0 Number of bad blocks: 0 Number of bbt blocks: 0 Block size 131072, page size 2048, OOB size 64 Dumping data starting at 0x000c0000 and ending at 0x000e0000... Connecting to jeff.doozan.com (69.163.187.226:80) uboot.environment.md 100% |*******************************| 52 --:--:-- ETA # uBoot installation has completed successfully.
… wobei es erst einmal nach »Danger, Will Robinson!« aussieht. Aber die Warnungen sind wohl dem ersten Lauf und dem noch leeren Environment des neuen uBoot geschuldet, denn gesetzt wurde augenscheinlich alles:
-bash-3.2# /usr/sbin/fw_printenv ethact=egiga0 bootdelay=3 baudrate=115200 arcNumber=2097 mainlineLinux=yes console=ttyS0,115200 led_init=green blinking led_exit=green off led_error=orange blinking mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data) mtdids=nand0=orion_nand partition=nand0,2 stdin=serial stdout=serial stderr=serial rescue_installed=0 rescue_set_bootargs=setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts $rescue_custom_params 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 pogo_bootcmd=if fsload uboot-original-mtd0.kwb; then go 0x800200; fi 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 ubifs_mtd=3 ubifs_set_bootargs=setenv bootargs console=$console ubi.mtd=$ubifs_mtd root=ubi0:rootfs rootfstype=ubifs $mtdparts $ubifs_custom_params 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 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_list=1 2 3 4 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_init=run usb_scan usb_device=0:1 usb_root=/dev/sda1 usb_rootfstype=ext2 usb_rootdelay=10 usb_set_bootargs=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts $usb_custom_params usb_bootcmd=run usb_init; run usb_set_bootargs; run usb_boot 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 bootcmd=usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run rescue_bootcmd; run pogo_bootcmd; reset ethaddr=00:10:75:XX:XX:XX
Also, Mut zur Lücke und »halt« getippt. Nach ein paar Sekunden Dockstar stromlos machen, USB-Stick oder -Platte (mit /boot/uImage in Partition 1) angeschlossen und dem Affen Zucker, also dem Dockstar Energie, gegeben …
(Als Debian-Filesystem habe ich mein NFS-Root meiner besherigen Variante auf ‘nen Stick kopiert und dann meinen aktuellen 2.6.32.2er Kernel (mit den Hollerschen Dockstar-Patches) nach /boot/uImage sowie die passende Module nach /lib/modules/2.6.32.2 auf dem USB-Medium geschoben.)
… und in der Tat, der so behandelte Dockstar bootet klaglos /boot/uImage von einem ext3-formattierten USB-Stick (1 Partition) — und auch ein »shutdown -r now« wird klaglos ausgeführt, hier hing die uBoot-läd-uBoot-lädt-von-USB-Lösung ja leider. Kühl. Wenn es jetzt noch haltbare USB-Sticks gäbe …
