• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

ivandavidov/minimal-linux-script: One script which generates live Linux ISO imag ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

ivandavidov/minimal-linux-script

开源软件地址(OpenSource Url):

https://github.com/ivandavidov/minimal-linux-script

开源编程语言(OpenSource Language):

Shell 100.0%

开源软件介绍(OpenSource Introduction):

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 with some improvements taken from the next releases. All empty lines and comments have been removed and the script has been modified to reduce the overall length.

The script below uses Linux kernel 4.19.12, BusyBox 1.29.3 and Syslinux 6.03. The source bundles are downloaded and compiled automatically. If you are using Ubuntu or Linux Mint, you should be able to resolve all build dependencies by executing the following command:

sudo apt install wget make gawk gcc bc bison flex xorriso libelf-dev libssl-dev

After that simply run the below script. It doesn't require root privileges. In the end you should have a bootable ISO image named minimal_linux_live.iso in the same directory where you executed the script.

wget http://kernel.org/pub/linux/kernel/v4.x/linux-4.19.12.tar.xz
wget http://busybox.net/downloads/busybox-1.29.3.tar.bz2
wget http://kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.03.tar.xz
mkdir isoimage
tar -xvf linux-4.19.12.tar.xz
tar -xvf busybox-1.29.3.tar.bz2
tar -xvf syslinux-6.03.tar.xz
cd busybox-1.29.3
make distclean defconfig
sed -i "s|.*CONFIG_STATIC.*|CONFIG_STATIC=y|" .config
make busybox install
cd _install
rm -f linuxrc
mkdir dev proc sys
echo '#!/bin/sh' > init
echo 'dmesg -n 1' >> init
echo 'mount -t devtmpfs none /dev' >> init
echo 'mount -t proc none /proc' >> init
echo 'mount -t sysfs none /sys' >> init
echo 'setsid cttyhack /bin/sh' >> init
chmod +x init
find . | cpio -R root:root -H newc -o | gzip > ../../isoimage/rootfs.gz
cd ../../linux-4.19.12
make mrproper defconfig bzImage
cp arch/x86/boot/bzImage ../isoimage/kernel.gz
cd ../isoimage
cp ../syslinux-6.03/bios/core/isolinux.bin .
cp ../syslinux-6.03/bios/com32/elflink/ldlinux/ldlinux.c32 .
echo 'default kernel.gz initrd=rootfs.gz' > ./isolinux.cfg
xorriso \
    -as mkisofs \
    -o ../minimal_linux_live.iso \
    -b isolinux.bin \
    -c boot.cat \
    -no-emul-boot \
    -boot-load-size 4 \
    -boot-info-table \
    ./
cd ..

Note that this script produces very small live Linux OS with working shell only and no network support. The network functionality has been implemented properly in the Minimal Linux Live project which is extensively documented and more feature rich, yet still produces very small live Linux ISO image.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
archlinux/archweb: Arch Linux website code发布时间:2022-08-15
下一篇:
foxlet/bootra1n: Just enough Linux for checkra1n.发布时间:2022-08-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap