Difference between revisions of "USB Boot"
From ArmadeusWiki
(creation) |
|||
| (8 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| − | {{ | + | {{Note|Only possible if your docking board has an USB Host controller ;-)}} |
| − | + | ===Prepare your key=== | |
| − | + | * create a partition on your USB key (supposing it is recognized as /dev/sdb) | |
| − | * create a partition on your USB key | + | <pre class="host"> |
| + | $ sudo fdisk /dev/sdb | ||
| + | n | ||
| + | p | ||
| + | 1 | ||
| + | <ENTER> | ||
| + | <ENTER> | ||
| + | w | ||
| + | </pre> | ||
* format it as ext2: | * format it as ext2: | ||
| + | <pre class="host"> | ||
$ sudo mkfs.ext2 /dev/sdb1 | $ sudo mkfs.ext2 /dev/sdb1 | ||
| + | </pre> | ||
* mount it: | * mount it: | ||
| + | <pre class="host"> | ||
$ sudo mount /dev/sdb1 /media/disk/ | $ sudo mount /dev/sdb1 /media/disk/ | ||
| + | </pre> | ||
* copy rootfs on it: | * copy rootfs on it: | ||
| − | $ sudo tar xvf | + | <pre class="host"> |
| + | $ make shell_env | ||
| + | $ source armadeus_env.sh | ||
| + | $ sudo tar xvf $ARMADEUS_ROOTFS_TAR -C /media/disk/ | ||
$ sudo umount /media/disk/ | $ sudo umount /media/disk/ | ||
| + | </pre> | ||
| − | + | ===Prepare your kernel=== | |
| + | * Linux should be compiled with USB Host driver as static ('''done by default in current Armadeus configuration'''). For example on the APF9328: | ||
| + | <pre class="host"> | ||
$ make linux-menuconfig | $ make linux-menuconfig | ||
| − | Device Drivers ---> Armadeus specific drivers ---> <*> isp1761 USB 2.0 Host controller | + | </pre> |
| − | + | <pre class="config"> | |
| + | Device Drivers ---> | ||
| + | Armadeus specific drivers ---> | ||
| + | <*> isp1761 USB 2.0 Host controller | ||
| + | </pre> | ||
| + | |||
| + | ===Set environment variables in U-Boot=== | ||
| + | <pre class="apf"> | ||
| + | BIOS> setenv usbroot /dev/sda1 | ||
| + | BIOS> setenv usbrootfstype ext2 | ||
| + | BIOS> setenv addusbargs setenv bootargs \${bootargs} root=\${usbroot} rootfstype=\${usbrootfstype} rootwait | ||
| + | BIOS> setenv usbboot setenv bootargs \${console}\;run addusbargs addipargs\; bootm \${kernel_addr} | ||
| + | ... | ||
| + | BIOS> saveenv | ||
| + | </pre> | ||
| + | |||
| + | ===Let's go=== | ||
| + | <pre class="apf"> | ||
| + | BIOS> run usbboot | ||
| + | </pre> | ||
Latest revision as of 17:49, 6 August 2018
Prepare your key
- create a partition on your USB key (supposing it is recognized as /dev/sdb)
$ sudo fdisk /dev/sdb n p 1 <ENTER> <ENTER> w
- format it as ext2:
$ sudo mkfs.ext2 /dev/sdb1
- mount it:
$ sudo mount /dev/sdb1 /media/disk/
- copy rootfs on it:
$ make shell_env $ source armadeus_env.sh $ sudo tar xvf $ARMADEUS_ROOTFS_TAR -C /media/disk/ $ sudo umount /media/disk/
Prepare your kernel
- Linux should be compiled with USB Host driver as static (done by default in current Armadeus configuration). For example on the APF9328:
$ make linux-menuconfig
Device Drivers --->
Armadeus specific drivers --->
<*> isp1761 USB 2.0 Host controller
Set environment variables in U-Boot
BIOS> setenv usbroot /dev/sda1
BIOS> setenv usbrootfstype ext2
BIOS> setenv addusbargs setenv bootargs \${bootargs} root=\${usbroot} rootfstype=\${usbrootfstype} rootwait
BIOS> setenv usbboot setenv bootargs \${console}\;run addusbargs addipargs\; bootm \${kernel_addr}
...
BIOS> saveenv
Let's go
BIOS> run usbboot