m (→Building an Emdebian (Embedded Debian) root filesystem for armel) |
(Added prerequisites) |
||
(6 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
== Building an Emdebian (Embedded Debian) root filesystem for GuruPlug/armel == | == Building an Emdebian (Embedded Debian) root filesystem for GuruPlug/armel == | ||
+ | |||
+ | Many of the distros are dropping support for ARMv5 and when you do find one, today's 'minimal' root filesystem is typically a couple hundred of megabytes. | ||
+ | |||
+ | Emdebian (Embedded Debian) has the advantage that not only still supporting ARMv5, but it has a multistrap tool that gives the ability to customise the root filesystem on the host and only include the packages you need. | ||
+ | |||
+ | Debian is now my choice for a root filesystem on the GuruPlug. | ||
+ | |||
+ | === Prerequisites === | ||
+ | |||
+ | Install the following prerequisites | ||
<PRE> | <PRE> | ||
− | + | apt-get install multistrap | |
− | + | apt-get install qemu | |
+ | apt-get install qemu-user-static | ||
+ | apt-get install binfmt-support | ||
+ | apt-get install dpkg-cross | ||
</PRE> | </PRE> | ||
− | + | === Building your Debian rootfs === | |
+ | |||
+ | To build your root filesystem, create a multistrap configuration file called GuruPlugRootFS.conf and add the following: | ||
<PRE> | <PRE> | ||
[General] | [General] | ||
arch=armel | arch=armel | ||
− | directory= | + | directory=guruplug-rootfs |
cleanup=true | cleanup=true | ||
noauth=true | noauth=true | ||
Line 27: | Line 42: | ||
[Net] | [Net] | ||
#Basic packages to enable the networking | #Basic packages to enable the networking | ||
− | packages=netbase net-tools ethtool udev iproute iputils-ping ifupdown isc-dhcp-client ssh | + | packages=netbase net-tools ethtool udev iproute iputils-ping iptables ifupdown isc-dhcp-client ssh |
source=http://www.emdebian.org/grip | source=http://www.emdebian.org/grip | ||
Line 45: | Line 60: | ||
<PRE> | <PRE> | ||
− | # cp /usr/bin/qemu-arm-static | + | # cp /usr/bin/qemu-arm-static guruplug-rootfs/usr/bin |
− | # LC_ALL=C LANGUAGE=C LANG=C chroot | + | # LC_ALL=C LANGUAGE=C LANG=C chroot guruplug-rootfs dpkg --configure -a |
</PRE> | </PRE> | ||
+ | |||
+ | === Root Password === | ||
Set your root password: | Set your root password: | ||
<PRE> | <PRE> | ||
− | # sudo chroot | + | # sudo chroot guruplug-rootfs passwd |
</PRE> | </PRE> | ||
+ | |||
+ | === Other Miscellaneous Configurations === | ||
Set your hostname: | Set your hostname: | ||
<PRE> | <PRE> | ||
− | # echo guruplug >> | + | # echo guruplug >> guruplug-rootfs/etc/hostname |
</PRE> | </PRE> | ||
Line 64: | Line 83: | ||
<PRE> | <PRE> | ||
− | # echo proc /proc proc defaults 0 0 >> | + | # echo proc /proc proc defaults 0 0 >> guruplug-rootfs/etc/fstab |
</PRE> | </PRE> | ||
+ | |||
+ | === Set-up Terminal on Serial Console === | ||
If you desire to have a terminal available on the serial/console port, you will need to edit /etc/inittab and modify/uncomment: | If you desire to have a terminal available on the serial/console port, you will need to edit /etc/inittab and modify/uncomment: | ||
Line 80: | Line 101: | ||
<PRE> | <PRE> | ||
T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100 | T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100 | ||
+ | </PRE> | ||
+ | |||
+ | === UBI/MTD Utilities === | ||
+ | |||
+ | If you are planning on making an [[GuruPlug_Building_RootFS|UBI filesystem]] it may be advantageous to add your UBI MTD utilities at this stage. We have [[Cross_Compiling_MTD_Utils_for_ARM|instructions to build them here]], or you can use some with prepared earlier: | ||
+ | |||
+ | <PRE> | ||
+ | wget http://wiki.beyondlogic.org/prebuilt/mtdutils-1.5.0-arm-linux-gnueabi.tar.bz2 | ||
+ | tar -xjf mtdutils-1.5.0-arm-linux-gnueabi.tar.bz2 -C guruplug-rootfs | ||
+ | </PRE> | ||
+ | |||
+ | === Kernel Modules === | ||
+ | |||
+ | Your root filesystem needs to be populated with any kernel modules corresponding to the Linux kernel version you are using. | ||
+ | |||
+ | Jump to the folder containing your kernel and execute: | ||
+ | |||
+ | <PRE> | ||
+ | # make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules | ||
+ | # make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=<path of your guruplug-rootfs> modules_install | ||
</PRE> | </PRE> |
Many of the distros are dropping support for ARMv5 and when you do find one, today's 'minimal' root filesystem is typically a couple hundred of megabytes.
Emdebian (Embedded Debian) has the advantage that not only still supporting ARMv5, but it has a multistrap tool that gives the ability to customise the root filesystem on the host and only include the packages you need.
Debian is now my choice for a root filesystem on the GuruPlug.
Install the following prerequisites
apt-get install multistrap apt-get install qemu apt-get install qemu-user-static apt-get install binfmt-support apt-get install dpkg-cross
To build your root filesystem, create a multistrap configuration file called GuruPlugRootFS.conf and add the following:
[General] arch=armel directory=guruplug-rootfs cleanup=true noauth=true unpack=true debootstrap=Emdebian Net Utils aptsources=Emdebian [Emdebian] packages=apt source=http://www.emdebian.org/grip keyring=emdebian-archive-keyring suite=wheezy-grip [Net] #Basic packages to enable the networking packages=netbase net-tools ethtool udev iproute iputils-ping iptables ifupdown isc-dhcp-client ssh source=http://www.emdebian.org/grip [Utils] #General purpose utilities packages=locales adduser nano less wget vim rsyslog dialog source=http://www.emdebian.org/grip
Save and run the multistrap tool:
# multistrap -f GuruPlugRootFS.conf
Now configure the Emdebian packages with the QEMU emulator. This will configure various packages, set your shell and time zone.
# cp /usr/bin/qemu-arm-static guruplug-rootfs/usr/bin # LC_ALL=C LANGUAGE=C LANG=C chroot guruplug-rootfs dpkg --configure -a
Set your root password:
# sudo chroot guruplug-rootfs passwd
Set your hostname:
# echo guruplug >> guruplug-rootfs/etc/hostname
Initialise your fstab:
# echo proc /proc proc defaults 0 0 >> guruplug-rootfs/etc/fstab
If you desire to have a terminal available on the serial/console port, you will need to edit /etc/inittab and modify/uncomment:
# Example how to put a getty on a serial line (for a terminal) # #T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100 #T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100
I use
T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100
If you are planning on making an UBI filesystem it may be advantageous to add your UBI MTD utilities at this stage. We have instructions to build them here, or you can use some with prepared earlier:
wget http://wiki.beyondlogic.org/prebuilt/mtdutils-1.5.0-arm-linux-gnueabi.tar.bz2 tar -xjf mtdutils-1.5.0-arm-linux-gnueabi.tar.bz2 -C guruplug-rootfs
Your root filesystem needs to be populated with any kernel modules corresponding to the Linux kernel version you are using.
Jump to the folder containing your kernel and execute:
# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules # make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=<path of your guruplug-rootfs> modules_install