# tl;dr to co w http://clfs.org/view/clfs-embedded/arm/ ale z toybox zamiast busybox # oraz ze zautomatyzowanym budowaniem toolchaina export WORKDIR=`pwd` # 1) przygotowanie toolchaina # 1.1) pobranie kernela (dla headerków) i generatora toolchaina git clone https://github.com/richfelker/musl-cross-make.git wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.6.5.tar.xz tar xf linux-5.6.5.tar.xz ln -s `pwd`/linux-5.6.5 musl-cross-make/linux-5.6.5 # 1.2) zbudowanie tymczasowego toolchaina dla hosta cd musl-cross-make/ cat >config.mak config.mak ${WORKDIR}/targetfs/etc/passwd << "EOF" root::0:0:root:/root:/bin/ash EOF cat > ${WORKDIR}/targetfs/etc/group << "EOF" root:x:0: bin:x:1: sys:x:2: kmem:x:3: tty:x:4: tape:x:5: daemon:x:6: floppy:x:7: disk:x:8: lp:x:9: dialout:x:10: audio:x:11: video:x:12: utmp:x:13: usb:x:14: cdrom:x:15: EOF touch ${WORKDIR}/targetfs/var/log/lastlog chmod -v 664 ${WORKDIR}/targetfs/var/log/lastlog # 3) Zbudowanie kernela sudo apt install bc curl gcc git libssl-dev libncurses5-dev lzop make u-boot-tools flex bison cd linux-5.6.4/ make mrproper make sunxi_defconfig make menuconfig time make -j4 make INSTALL_MOD_PATH=${WORKDIR}/targetfs modules_install make INSTALL_PATH=${WORKDIR}/targetfs/boot install make INSTALL_PATH=${WORKDIR}/targetfs/boot dtbs_install # 4) Podstawowe libki # libc cd .. cd musl-1.2.0 ./configure --prefix=/ --disable-static --target=arm-linux-musleabihf make DESTDIR=${WORKDIR}/targetfs make install-libs # libgcc_s cd ${WORKDIR}/arm-cortexa7-linux-musleabihf/arm-linux-musleabihf/lib/ cp libgcc_s.so.1 ${WORKDIR}/targetfs/lib/ 5) Toybox cd ${WORKDIR} wget https://github.com/landley/toybox/archive/0.8.2.tar.gz tar xf 0.8.2.tar.gz cd toybox-0.8.2 LD_FLAGS="--static" make defconfig toybox PREFIX=${WORKDIR}/targetfs make install 6) fstab cat > ${WORKDIR}/targetfs/etc/fstab << "EOF" # file-system mount-point type options dump fsck EOF # kontynuować od http://clfs.org/view/clfs-embedded/arm/bootable/bootloaders.html