Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

ChenPi11/minimal-linux

Repository files navigation

DEPRECATED! DEPRECATED! DEPRECATED!

minimal-linux is merged into the MLinux project, https://github.com/mlinux-project/minimal is the latest repo.








MinimalLinux - Minimal Linux filesystem

Dependencies

For building binary

Install binary building dependencies on Debian

sudo apt-get update && sudo apt-get install gcc cpio xz-utils gawk grub2 make grep kpartx qemu-utils sed util-linux wget binutils libelf-dev libssl-dev bc flex bison -y

For building tarball

Install tarball building dependencies Debian

sudo apt-get update && sudo apt-get autoconf automake -y

For generating picture

Install picture-generating dependencies on Debian

sudo apt-get update && sudo apt-get install python3 python3-pillow -y

Or you can using pip to install Pillow.

pip install Pillow

For testing

Install testing dependencies on Debian

sudo apt-get update && sudo apt-get install tree qemu-system -y

Build source tarball

You need to install the dependencies first, and make sure you are in source directory.

make -f Makefile.devel dist

Build rootfs, linux kernel and disk image

./configure
make -j$(nproc)

The compressed rootfs will be name to rootfs.tar.xz. The compressed linux kernel will be name to vmlinuz.xz. The compressed disk image will be name to disk.img.

Configuration options

  • --with-busybox-version=X.X.X

    • Specify the version of Busybox.
    • Default is 1.36.1.
  • --with-linux-version=X.X.X

    • Specify the version of Linux kernel.
    • Default is 6.7.5.
  • --with-busybox-mirror=OFFICIAL | <URL>

    • Specify the mirror of Busybox. If you want to use the official mirror, set it to OFFICIAL. Otherwise, set it to the URL of the mirror.
    • Default is OFFICIAL.
  • --with-linux-mirror=OFFICIAL | CDN | TSINGHUA | ALIYUN | USTC | <URL>

    • Specify the mirror of Linux kernel. If you want to use the Tsinghua mirror, set it to TSINGHUA. Otherwise, set it to the URL of the mirror.
    • Default is OFFICIAL.

Like this:

./configure --with-busybox-version=1.36.1 --with-linux-version=6.7.5 --with-busybox-mirror=OFFICIAL --with-linux-mirror=TSINGHUA

Run

You should use origin binary file instead of XZ compressed one!!!

Using this command to run disk.img.

qemu-system-x86_64 -m 1024 -hda disk.img

Using this command to run vmlinuz.

qemu-system-x86_64 -m 1024 -kernel vmlinuz

This vmlinuz contians initramfs, so you can execute it directly using QEMU.

Copyright

The MinimalLinux is under GPL 2.0, see file LICENSE.

Download

https://github.com/ChenPi11/miminal-linux/releases

Homepage

https://github.com/ChenPi11/miminal-linux