Skip to content

Latest commit

 

History

History
59 lines (43 loc) · 1.36 KB

README.md

File metadata and controls

59 lines (43 loc) · 1.36 KB

Tiny Linux

Script and configuration for building tiny Linux

  1. Prepare source codes and tools.

Download tarballs for Linux kernel and busybox. Then extract.

tiny-linux$ tar xf archive/linux-5.6.14.tar
tiny-linux$ tar jxf archive/busybox-1.31.1.tar.bz2 

Apply pathes if any. For exmaple:

tiny-linux$ cd busybox-1.31.1
busybox-1.31.1$ patch -p 1 -i ../patch/busybox-1.31.1-patch-stime

Set PATH for cross-compile tool and QEMU. For example:

tiny-linux$ export PATH=$PATH:/opt/riscv/bin/
tiny-linux$ export PATH=$PATH:/opt/qemu/bin/
  1. Build all using script/build.sh

Check out the versions of linux kernel and busybox in build.sh. For example:

BUSYBOX_VER=1.31.1 
LINUX_VER=5.6.14

Run build.sh

tiny-linux$ ./script/build.sh
  1. Run tiny Linux in QEMU
tiny-linux$ ./script/run-qemu.sh
  1. Upgrade Linux kernel

From linux 5.13.0 to 5.18.1 for example:

tiny-linux$ cd linux-5.18.1
linux-5.18.1$ cp ../config/config-linux-5.13.0-riscv-initramfs-dts ./.config
linux-5.18.1$ make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- oldconfig # Check out each new configuration
linux-5.18.1$ cp .config ../config/config-linux-5.18.1-riscv-initramfs-d06011648
linux-5.18.1$ cd -
tiny-linux$ vim ./script/build.sh # Define new $LINUX_VER and $LINUX_CONFIG
tiny-linux$ ./script/build.sh linux