Update README.md
This commit is contained in:
parent
a3fa9d7e03
commit
3266786770
40
README.md
40
README.md
@ -1,7 +1,7 @@
|
|||||||
# Minimal Linux Script
|
# Minimal Linux Script
|
||||||
One script which generates fully functional live Linux ISO image with minimal effort. This is based on the first published version of [Minimal Linux Live](http://github.com/ivandavidov/minimal). All comments and empty lines have been removed and the original script code has been slightly altered to reduce the overall script length.
|
One script which generates fully functional live Linux ISO image with minimal effort. This is based on the first published version of [Minimal Linux Live](http://github.com/ivandavidov/minimal). All comments and empty lines have been removed and the original script code has been modified to reduce the overall script length.
|
||||||
|
|
||||||
The script below uses **Linux kernel 3.15.6** and **BusyBox 1.22.1**. The source bundles are downloaded and compiled automatically. If you are using [Ubuntu](http://ubuntu.com) or [Linux Mint](http://linuxmint.com), you should be able to resolve all build dependencies by executing the following command:
|
The script below uses **Linux kernel 4.6.2** and **BusyBox 1.24.2**. The source bundles are downloaded and compiled automatically. If you are using [Ubuntu](http://ubuntu.com) or [Linux Mint](http://linuxmint.com), you should be able to resolve all build dependencies by executing the following command:
|
||||||
|
|
||||||
sudo apt-get install wget bc build-essential gawk syslinux genisoimage
|
sudo apt-get install wget bc build-essential gawk syslinux genisoimage
|
||||||
|
|
||||||
@ -11,19 +11,19 @@ After that simply run the below script. It doesn't require root privileges. In t
|
|||||||
mkdir work
|
mkdir work
|
||||||
cd work
|
cd work
|
||||||
rm -f linux-3.15.6.tar.xz
|
rm -f linux-3.15.6.tar.xz
|
||||||
wget http://kernel.org/pub/linux/kernel/v3.x/linux-3.15.6.tar.xz
|
wget http://kernel.org/pub/linux/kernel/v4.x/linux-4.6.2.tar.xz
|
||||||
rm -rf kernel
|
rm -rf kernel
|
||||||
mkdir kernel
|
mkdir kernel
|
||||||
tar -xvf linux-3.15.6.tar.xz -C kernel
|
tar -xvf linux-4.6.2.tar.xz -C kernel
|
||||||
cd kernel/linux-3.15.6
|
cd kernel/linux-4.6.2
|
||||||
make clean defconfig vmlinux
|
make clean defconfig vmlinux
|
||||||
cd ../..
|
cd ../..
|
||||||
rm -f busybox-1.22.1.tar.bz2
|
rm -f busybox-1.24.2.tar.bz2
|
||||||
wget http://busybox.net/downloads/busybox-1.22.1.tar.bz2
|
wget http://busybox.net/downloads/busybox-1.24.2.tar.bz2
|
||||||
rm -rf busybox
|
rm -rf busybox
|
||||||
mkdir busybox
|
mkdir busybox
|
||||||
tar -xvf busybox-1.22.1.tar.bz2 -C busybox
|
tar -xvf busybox-1.24.2.tar.bz2 -C busybox
|
||||||
cd busybox/busybox-1.22.1
|
cd busybox/busybox-1.24.2
|
||||||
make clean defconfig
|
make clean defconfig
|
||||||
sed -i "s/.*CONFIG_STATIC.*/CONFIG_STATIC=y/" .config
|
sed -i "s/.*CONFIG_STATIC.*/CONFIG_STATIC=y/" .config
|
||||||
make busybox install
|
make busybox install
|
||||||
@ -31,35 +31,21 @@ After that simply run the below script. It doesn't require root privileges. In t
|
|||||||
cp -R _install ../../rootfs
|
cp -R _install ../../rootfs
|
||||||
cd ../../rootfs
|
cd ../../rootfs
|
||||||
rm -f linuxrc
|
rm -f linuxrc
|
||||||
mkdir dev etc proc sys tmp
|
mkdir dev proc sys
|
||||||
cd etc
|
|
||||||
echo > welcome.txt
|
|
||||||
echo ' #####################################' >> welcome.txt
|
|
||||||
echo ' # #' >> welcome.txt
|
|
||||||
echo ' # Welcome to "Minimal Linux Live" #' >> welcome.txt
|
|
||||||
echo ' # #' >> welcome.txt
|
|
||||||
echo ' #####################################' >> welcome.txt
|
|
||||||
echo >> welcome.txt
|
|
||||||
cd ..
|
|
||||||
echo '#!/bin/sh' > init
|
echo '#!/bin/sh' > init
|
||||||
echo 'dmesg -n 1' >> init
|
echo 'dmesg -n 1' >> init
|
||||||
echo 'mount -t devtmpfs none /dev' >> init
|
echo 'mount -t devtmpfs none /dev' >> init
|
||||||
echo 'mount -t proc none /proc' >> init
|
echo 'mount -t proc none /proc' >> init
|
||||||
echo 'mount -t sysfs none /sys' >> init
|
echo 'mount -t sysfs none /sys' >> init
|
||||||
echo 'cat /etc/welcome.txt' >> init
|
echo 'setsid cttyhack /bin/sh' >> init
|
||||||
echo 'while true' >> init
|
|
||||||
echo 'do' >> init
|
|
||||||
echo ' setsid cttyhack /bin/sh' >> init
|
|
||||||
echo 'done' >> init
|
|
||||||
echo >> init
|
|
||||||
chmod +x init
|
chmod +x init
|
||||||
rm -f ../rootfs.cpio.gz
|
rm -f ../rootfs.cpio.gz
|
||||||
cd ../rootfs
|
cd ../rootfs
|
||||||
find . | cpio -H newc -o | gzip > ../rootfs.cpio.gz
|
find . | cpio -H newc -o | gzip > ../rootfs.cpio.gz
|
||||||
rm -f ../../minimal_linux_live.iso
|
rm -f ../../minimal_linux_live.iso
|
||||||
cd ../kernel/linux-3.15.6
|
cd ../kernel/linux-4.6.2
|
||||||
make isoimage FDINITRD=../../rootfs.cpio.gz
|
make isoimage FDINITRD=../../rootfs.cpio.gz
|
||||||
cp arch/x86/boot/image.iso ../../../minimal_linux_live.iso
|
cp arch/x86/boot/image.iso ../../../minimal_linux_live.iso
|
||||||
cd ../../..
|
cd ../../..
|
||||||
|
|
||||||
Note that this produces very small live Linux OS with working shell and no proper network support. The network support has been implemented properly in the [Minimal Linux Live](http://github.com/ivandavidov/minimal) project which is extensively documented and more feature rich, yet still produces very small live Linux ISO image.
|
Note that this produces very small live Linux OS with working shell only. The network support has been implemented properly in the [Minimal Linux Live](http://github.com/ivandavidov/minimal) project which is extensively documented and more feature rich, yet still produces very small live Linux ISO image.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user