Skip to content

Instantly share code, notes, and snippets.

@saii9
Last active May 19, 2018 19:53
Show Gist options
  • Save saii9/fea47b98c6f4c95d0dee5b99e6bb923d to your computer and use it in GitHub Desktop.
Save saii9/fea47b98c6f4c95d0dee5b99e6bb923d to your computer and use it in GitHub Desktop.
busybox compilation for self ref. Not to be run as a shell script
sudo apt-get install libncurses5-dev libncursesw5-dev unzip lzop u-boot-tools
#in a clean working directory donwload busybox
wget https://busybox.net/downloads/busybox-1.28.3.tar.bz2
tar xvjf busybox-1.28.3.tar.bz2
#downlaod linaro toolchain
wget https://releases.linaro.org/components/toolchain/binaries/latest/arm-linux-gnueabihf/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz
tar xvf gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz
#downlaod linux kernel source
wget https://github.com/beagleboard/linux/archive/4.4.zip
unzip 4.4.zip
wget ftp://ftp.denx.de/pub/u-boot/u-boot-2018.05.tar.bz2
tar xvjf u-boot-2018.05.tar.bz2
#add toolchain binaries to path
PATH=$PATH:`pwd`/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/bin/
pushd u-boot-2018.05.tar.bz2
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x_boneblack_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4
popd
pushd busybox-1.28.3
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- defconfig
# to change to static in menuconfig: busybox settings -> build busy box as static binary
#make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- CONFIG_PREFIX=`pwd`/build -j8 install
popd
pushd linux-4.4
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bb.org_defconfig
#make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage dtbs LOADADDR=0x80008000 -j4
# uImage - make kernel uboot image
# dtbs - include device tree blob
# LOADADDR - address header for uboot to load zimage in to ram
# j4 - build on 4 threads
# uImage will be in arch/arm/boot/uImage
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules -j4
# builds all the loadable kernel modules marked as M in defconfig. with a file ext .ko
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=<path_to_rfs> modules_install
# install all modules in the root file system
popd
apt install nfs-kernel-server
echo "/home/sai/BeagleBone/netfs 192.168.7.2(rw,sync,no_root_squash,no_subtree_check)" >> /etc/exports
exportfs -a
exportfs -rv
service nfs-kernel-server restart
#add this is /etc/network/interfaces in order to set a static Ip over beaglebone ethernet connection
auto enp1s0
iface enp1s0 inet static
address 192.168.7.1
netmask 255.255.255.0
network 192.168.7.0
gateway 192.253.7.1
dns-nameservers 8.8.8.8
sudo service networking restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment