RootFS


Hier eine kurze Anleitung, wie man ein eigenes Debian RootFS baut, vorausgesetzt die Pakete qemu-user-static und debootstrap sind installiert.

Ich habe mich für ein Debian Stretch entschieden.

Erst, einpaar Einstellungen im Bash:

export DIST=testing
export ARCH=arm
export ROOTPATH=/usr/src/rootfs

Nun das eigentliche Bauen:

debootstrap –arch=$ARCH –foreign $DIST $ROOTPATH
cp /usr/bin/qemu-arm-static $ROOTPATH/usr/bin/
chroot $ROOTPATH /usr/bin/qemu-arm-static /bin/sh -i

/debootstrap/debootstrap –second-stage

cat < etc/apt/sources.list
deb http://http.debian.net/debian $DIST main contrib non-free
deb-src http://http.debian.net/debian $DIST main contrib non-free
deb http://http.debian.net/debian $DIST-updates main contrib non-free
deb-src http://http.debian.net/debian $DIST-updates main contrib non-free
deb http://security.debian.org/debian-security $DIST/updates main contrib non-free
deb-src http://security.debian.org/debian-security $DIST/updates main contrib non-free
EOT

cat <> etc/fstab
none /tmp tmpfs defaults,noatime,mode=1777 0 0
# if you have a separate boot partition
/dev/mmcblk0p1 /boot vfat defaults 0 0
EOT

exit

cp /etc/resolv.conf $ROOTPATH/etc
chroot $ROOTPATH
export LANG=C
apt-get update
cat < /etc/apt/apt.conf.d/71-no-recommends
APT::Install-Recommends „0“;
APT::Install-Suggests „0“;
END
apt-get install locales
dpkg-reconfigure locales
export LANG=en_US.UTF-8
apt-get install nvi ; apt-get remove nano
passwd
exit

rm $ROOTPATH/usr/bin/qemu-aarch64-static $ROOTPATH/etc/resolv.conf
echo rock64 >> $ROOTPATH/etc/hostname
echo T0:2345:respawn:/sbin/getty -L ttyS0 115200 vt100 >> $ROOTPATH/etc/inittab