##Build Linux and BusyBox > Environment:RedHat Enterprise Linux 10.2 > Installed:make gcc g++ ncurses-devel syslinux bison flex elfutils-libelf-devel glibc-static(Need enable codeReady repos 'sudo subscription-manager repos --enable codeready-builder-for-rhel-10-x86_64-rpms') 1.Download Kernel SRC and unzip >tar xvf linux-x.xx.xx.tar.xz 2.make tiny configuration > make tinyconfig > make menuconfig 2.a.Modify the configuration Enable 64-bit Kernel [General setup/] Enable Initial RAM filesystem and RAM disk(initramfs/initrd) support Disable Support initial .... using gzip Support initial .... using bzip2 Support initial .... using LZMA Support initial .... using XZ Support initial .... using LZO Support initial .... using LZ4 Support initial .... using ZSTD [General setup/Enable Configure standard Kernel features(expert user)/] Enable support for pintk [Device Drivers/Character devices/] Enable TTY [Executable file formats/] Enable Kernel support for ELF binaries 3.Make Kernel > make -j8 (Compile using 8 threads) (The bzImage is located in arch/x86_64/boot) 4.Download Busybox SRC and unzip > tar -xjf busybox-x.xx.x.tar.bz2 5.Modify the configuration > make defconfig > make menuconfig [Settings/Build Options] Enable Build static binary(no shared libs) [Networking Utilities/] Disable tc 6.Make Busybox > make -j8 7.Create an independent root file system >mkdir -p ~/linux-rootfs >cd ~/linux-rootfs >mkdir -p bin sbin usr/bin usr/sbin >mkdir -p dev proc sys run tmp >mkdir -p etc/init.d >mkdir -p root home mnt >mkdir -p var/log >make CONFIG_PREFIX=$HOME/linux-rootfs install (In the busybox directory!) >cd ~/linux-rootfs >sudo mknod -m 600 dev/console c 5 1 >sudo mknod -m 666 dev/null c 1 3 >sudo mknod -m 666 dev/zero c 1 5 >sudo mknod -m 666 dev/tty c 5 0 >cat > etc/inittab <<'EOF' ::sysinit:/etc/init.d/rcS ::respawn:-/bin/sh ::ctrlaltdel:/sbin/reboot ::shutdown:/bin/umount -a -r EOF >cat > etc/init.d/rcS <<'EOF' #!/bin/sh mount -t devtmpfs devtmpfs /dev mount -t proc proc /proc mount -t sysfs sysfs /sys mkdir -p /run /tmp mount -t tmpfs tmpfs /run mount -t tmpfs tmpfs /tmp echo Hi Linux. EOF >chmod +x etc/init.d/rcS Check List: >cd ~/linux-rootfs >ls -l bin/busybox >ls -l bin/sh >ls -l sbin/init *If /sbin/init does not exist, create it manually.->'sudo ln -sf ../bin/busybox sbin/init' >cd ~/linux-rootfs >sudo chown -R root:root . >sudo ln -sf bin/busybox init >find . -print0 | sudo cpio --null -o --format=newc | gzip -9 > ~/initramfs.cpio.gz 8.Test via QEMU qemu-system-x86_64 \ -machine pc \ -accel tcg \ -cpu max \ -m 1024 \ -smp 1 \ -kernel bzImage \ -initrd initramfs.cpio.gz \ -append "console=ttyS0 rdinit=/init" \ -nographic \ -no-reboot