U-Boot - Booting process in multiple drives configuration January 04, 2015 11:24PM |
Admin Registered: 12 years ago Posts: 17,697 |
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_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
fw_setenv devices 'usb ide mmc' fw_setenv device '0:1' fw_setenv disks '0 1 2 3' fw_setenv bootdev usb
fw_setenv 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 ext2load $dev $disknum:1 0x800000 /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'
fw_setenv bootcmd 'run scan_disk; run set_bootargs_xxx; run bootcmd_xxx, reset'
fw_setenv bootcmd 'run bootcmd_uenv; sleep 2; run scan_disk; run set_bootargs_xxx; run bootcmd_xxx, reset'
tune2fs -L rootfs /dev/sda1
fw_setenv usb_root 'LABEL=rootfs'
fw_setenv usb_init "usb start; setenv usb_root LABEL=rootfs"
Re: U-Boot - Booting process with partition label in multiple drives configuration January 05, 2015 06:34PM |
Registered: 9 years ago Posts: 55 |
Re: U-Boot - Booting process with partition label in multiple drives configuration January 06, 2015 02:20AM |
Admin Registered: 12 years ago Posts: 17,697 |
nc -l -u -p 6666 & nc -u 192.168.1.100 6666You can combine them into one:
nc -lup 6666 192.168.1.100 6666
Re: U-Boot - Booting process with partition label in multiple drives configuration January 06, 2015 07:06AM |
Registered: 9 years ago Posts: 55 |
root@debian:~# fw_printenv ethact=egiga0 bootdelay=3 baudrate=115200 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_set_bootargs=setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts $rescue_custom_params 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_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:26:39:3A arcNumber=3089 rescue_installed=1 rescue_bootcmd=if test $rescue_installed -eq 1; then run rescue_set_bootargs; nand read.e 0x500000 0x100000 0x400000; bootm 0x500000; else run pogo_bootcmd; fi setenv=usb_root LABEL=rootfs usb_init=usb start; setenv usb_root LABEL=rootfs
Re: U-Boot - Booting process with partition label in multiple drives configuration January 06, 2015 11:24AM |
Admin Registered: 12 years ago Posts: 17,697 |
Re: U-Boot - Booting process with partition label in multiple drives configuration January 06, 2015 01:46PM |
Registered: 9 years ago Posts: 55 |
Re: U-Boot - Booting process with partition label in multiple drives configuration January 06, 2015 11:26PM |
Admin Registered: 12 years ago Posts: 17,697 |
Re: U-Boot - Booting process with partition label in multiple drives configuration January 31, 2015 03:30PM |
Registered: 8 years ago Posts: 26 |
fw_setenv setenv usb_root 'LABEL=rootfs'
fw_setenv usb_root 'LABEL=rootfs'
Re: U-Boot - Booting process with partition label in multiple drives configuration February 01, 2015 01:19AM |
Admin Registered: 12 years ago Posts: 17,697 |
> fw_setenv setenv usb_root 'LABEL=rootfs' >>
> fw_setenv usb_root 'LABEL=rootfs' >>
Re: U-Boot - Booting process with partition label in multiple drives configuration February 07, 2015 07:26PM |
Registered: 8 years ago Posts: 26 |
tune2fs -L ROOTFS /dev/sda1
fw_setenv usb_root 'LABEL=ROOTFS'
fw_setenv usb_init "run usb_scan; setenv usb_root LABEL=ROOTFS"
fw_setenv usb_bootcmd 'setenv usb_root LABEL=ROOTFS; run usb_init; run usb_set_bootargs; run usb_boot'
pacman -Sy uboot-mkimage
mkinitcpio -v -g /boot/kernel.img
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs -d /boot/kernel.img /boot/uInitrd
arcNumber=3542 baudrate=115200 bootcmd=usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run rescue_bootcmd; run pogo_bootcmd; reset bootdelay=4 console=ttyS0,115200 ethact=egiga0 ethaddr=00:11:22:33:44:55 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 led_error=orange blinking led_exit=green off led_init=green blinking machid=dd6 mainlineLinux=yes mtdids=nand0=orion_nand mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data) 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_set_bootargs=setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts $rescue_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 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_rootdelay=10 usb_rootfstype=ext3 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 rescue_installed=1 bootcmd_rescue=run set_bootargs_rescue; nand read.e 0x800000 0x100000 0x400000; bootm 0x800000 bootcmd_pogo=run bootcmd_rescue force_rescue=0 ipaddr=192.168.0.176 serverip=192.168.0.159 usb_device=0:1 usb_root=/dev/sda1 usb_bootcmd=setenv usb_root LABEL=ROOTFS; run usb_init; run usb_set_bootargs; run usb_boot usb_init=run usb_scan; setenv usb_root LABEL=ROOTFS
Re: U-Boot - Booting process with partition label in multiple drives configuration February 08, 2015 02:30AM |
Admin Registered: 12 years ago Posts: 17,697 |
Re: U-Boot - Booting process in multiple drives configuration March 15, 2015 02:43PM |
Admin Registered: 12 years ago Posts: 17,697 |
Re: U-Boot - Booting process in multiple drives configuration March 22, 2015 04:53PM |
Admin Registered: 12 years ago Posts: 17,697 |
setenv bootcmd 'run bootcmd_uenv; run scan_disk; run set_bootargs_xxx; run bootcmd_xxx, reset'
setenv bootcmd 'run bootcmd_uenv; sleep 2; run scan_disk; run set_bootargs_xxx; run bootcmd_xxx, reset'
Re: U-Boot - Booting process in multiple drives configuration April 25, 2015 03:49AM |
Registered: 8 years ago Posts: 25 |
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data) baudrate=115200 bootcmd_sata=run sata_init; run set_bootargs_sata; run sata_boot; bootcmd_usb=run usb_init; run set_bootargs_usb; run usb_boot; bootdelay=10 console=ttyS0,115200 device=0:1 ethact=egiga0 if_netconsole=ping $serverip led_error=orange blinking led_exit=green off led_init=green blinking mainlineLinux=yes mtdids=nand0=orion_nand partition=nand0,2 preboot_nc=run if_netconsole start_netconsole rootdelay=10 rootfstype=ext3 sata_init=ide reset set_bootargs_sata=setenv bootargs console=$console root=$sata_root rootdelay=$rootdelay rootfstype=$rootfstype $mtdparts set_bootargs_usb=setenv bootargs console=$console root=$usb_root rootdelay=$rootdelay rootfstype=$rootfstype $mtdparts start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version; stderr=serial stdin=serial stdout=serial usb_init=usb start bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi uenv_import=echo importing envs ...; env import -t 0x810000 uenv_load=usb start; mmc rescan; ide reset; setenv uenv_loaded 0; for devtype in usb mmc ide; 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 0x810000 /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 arcNumber=4495 ethaddr=5C:F4:AB:2F:F9:95 ipaddr=192.168.0.3 preboot=run preboot_nc load_dtb=ext2load usb 0:1 0x1c00000 /boot/dts/kirkwood-nsa325.dtb load_initrd=ext2load usb 0:1 0x1100000 /boot/uInitrd load_uimage=ext2load usb 0:1 0x800000 /boot/uImage usb_boot=run load_dtb; run load_uimage; if run load_initrd; then bootm 0x800000 0x1100000 0x1c00000; else bootm 0x800000 - 0x1c00000; fi serverip=192.168.0.10 usb_root=LABEL=rootfs sata_boot=run load_dtb_sata; run load_uimage_sata; if run load_initrd_sata; then bootm 0x800000 0x1100000 0x1c00000; else bootm 0x800000 - 0x1c00000; fi load_dtb_sata=ext2load ide 0:2 0x1c00000 /boot/dts/kirkwood-nsa325.dtb load_initrd_sata=ext2load ide 0:2 0x1100000 /boot/uInitrd load_uimage_sata=ext2load ide 0:2 0x800000 /boot/uImage bootcmd=run bootcmd_uenv; run bootcmd_usb; run bootcmd_sata; reset sata_root=LABEL=rootfs
root@debian:~# fdisk -l Disk /dev/sda: 931,5 GiB, 1000204886016 bytes, 1953525168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: dos Disk identifier: 0x0004983a Device Boot Start End Sectors Size Id Type /dev/sda1 63 1890613247 1890613185 901,5G 83 Linux /dev/sda2 * 1890613248 1949331455 58718208 28G 83 Linux /dev/sda3 1949331456 1953523711 4192256 2G 82 Linux swap / Solaris Partition 2 does not start on physical sector boundary. Disk /dev/sdb: 14,9 GiB, 15955132416 bytes, 31162368 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x00009485 Device Boot Start End Sectors Size Id Type /dev/sdb1 * 2048 31162367 31160320 14,9G 83 Linux
Re: U-Boot - Booting process in multiple drives configuration April 25, 2015 03:59AM |
Admin Registered: 12 years ago Posts: 17,697 |
A.2. New scanning script to scan all types of device looking for uImage in 1st partition.
Re: U-Boot - Booting process in multiple drives configuration January 07, 2016 12:56AM |
Registered: 7 years ago Posts: 9 |
Re: U-Boot - Booting process in multiple drives configuration January 07, 2016 01:07AM |
Admin Registered: 12 years ago Posts: 17,697 |
Re: U-Boot - Booting process in multiple drives configuration May 11, 2017 10:28AM |
Registered: 10 years ago Posts: 18 |
Re: U-Boot - Booting process in multiple drives configuration May 11, 2017 10:47AM |
Admin Registered: 12 years ago Posts: 17,697 |