Install embedded rootfs on USB disk
USB disk preparation
Prepare a USB disk and format to EXT filesystem on host PC. Before formating/partitioning USB disk, you need to double check which /dev/sd? is detected. In my case, my host PC is using ubuntu 16.04 and inserted USB is detected on /dev/sda.
Rootfs generation
Use debootstrap to make a debian rootfs, check[1]. Another good reference is on github[2].
To be noticed that armel
should be general for arm platform and armhf
is advanced and also supported.
(but you need to check your target board with FPU. See debian website)
After you excute the script, rootfs will be put on build folder. Then, copy generated rootfs folder to USB disk. (In my case, it was on media/jt/xxxx/)
Generated a chroot script
Prepared a chroot
script (chrootfs.sh) and stored into USB disk.
Example as below:
Chroot on target board
Install USB disk on target board and execute chroot scripts
Install utility via apt package
Below is a case for example to use apt-get
and install python
.
To be noticed that you need to check your networking before using apt package.
The basic is to check your route gateway and ping 8.8.8.8 for testing.
Reference
[1] https://wiki.debian.org/EmDebian/CrossDebootstrap
[2] https://github.com/jubinson/debian-rootfs