Syslinux is now automatically downloaded and ISO image generation process uses precompiled Syslinux binaries. The initramfs logging has been improved and more details are displayed during boot.

This commit is contained in:
Ivan Davidov 2016-04-07 00:22:20 +03:00
parent 5acf2b46f8
commit 44ee04c758
14 changed files with 55 additions and 12 deletions

View File

@ -16,3 +16,11 @@ GLIBC_SOURCE_URL=http://ftp.gnu.org/gnu/glibc/glibc-2.23.tar.bz2
# #
BUSYBOX_SOURCE_URL=http://busybox.net/downloads/busybox-1.24.2.tar.bz2 BUSYBOX_SOURCE_URL=http://busybox.net/downloads/busybox-1.24.2.tar.bz2
# You can find the latest Syslinux source bundles here:
#
# http://syslinux.org (official website)
#
# http://kernel.org/pub/linux/utils/boot/syslinux
#
SYSLINUX_SOURCE_URL=https://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.03.tar.xz

0
src/00_prepare.sh Normal file → Executable file
View File

0
src/01_get_kernel.sh Normal file → Executable file
View File

0
src/02_build_kernel.sh Normal file → Executable file
View File

0
src/03_get_glibc.sh Normal file → Executable file
View File

0
src/04_build_glibc.sh Normal file → Executable file
View File

0
src/05_prepare_glibc.sh Normal file → Executable file
View File

0
src/06_get_busybox.sh Normal file → Executable file
View File

0
src/07_build_busybox.sh Normal file → Executable file
View File

12
src/08_generate_rootfs.sh Normal file → Executable file
View File

@ -46,12 +46,15 @@ cd etc
cat > bootscript.sh << EOF cat > bootscript.sh << EOF
#!/bin/sh #!/bin/sh
echo "Welcome to \"Minimal Linbux Live\" (/sbin/init)"
dmesg -n 1 dmesg -n 1
mount -t devtmpfs none /dev mount -t devtmpfs none /dev
mount -t proc none /proc mount -t proc none /proc
mount -t sysfs none /sys mount -t sysfs none /sys
for DEVICE in /sys/class/net/* ; do for DEVICE in /sys/class/net/* ; do
echo "Found network device \${DEVICE##*/}"
ip link set \${DEVICE##*/} up ip link set \${DEVICE##*/} up
[ \${DEVICE##*/} != lo ] && udhcpc -b -i \${DEVICE##*/} -s /etc/rc.dhcp [ \${DEVICE##*/} != lo ] && udhcpc -b -i \${DEVICE##*/} -s /etc/rc.dhcp
done done
@ -70,6 +73,13 @@ if [ "\$router" ]; then
ip route add default via \$router dev \$interface ip route add default via \$router dev \$interface
fi fi
if [ "\$ip" ]; then
echo "DHCP configuration for device \$interface"
echo "ip: \$ip"
echo "mask: \$mask"
echo "router: \$router"
fi
EOF EOF
chmod +x rc.dhcp chmod +x rc.dhcp
@ -118,6 +128,8 @@ cd ..
cat > init << EOF cat > init << EOF
#!/bin/sh #!/bin/sh
echo "Welcome to \"Minimal Linbux Live\" (/init)"
exec /sbin/init exec /sbin/init
EOF EOF

0
src/09_pack_rootfs.sh Normal file → Executable file
View File

24
src/10_get_syslinux.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
# Grab everything after the '=' character.
DOWNLOAD_URL=$(grep -i SYSLINUX_SOURCE_URL .config | cut -f2 -d'=')
# Grab everything after the last '/' character.
ARCHIVE_FILE=${DOWNLOAD_URL##*/}
cd source
# Downloading Syslinux file.
# -c option allows the download to resume.
wget -c $DOWNLOAD_URL
# Delete folder with previously extracted Syslinux.
rm -rf ../work/syslinux
mkdir ../work/syslinux
# Extract Syslinux to folder 'work/syslinux'.
# Full path will be something like 'work/syslinux/syslinux-6.03'.
tar -xvf $ARCHIVE_FILE -C ../work/syslinux
cd ..

20
src/10_generate_iso.sh → src/11_generate_iso.sh Normal file → Executable file
View File

@ -6,6 +6,12 @@ cd $(ls -d *)
WORK_KERNEL_DIR=$(pwd) WORK_KERNEL_DIR=$(pwd)
cd ../../.. cd ../../..
# Find the Syslinux build directory.
cd work/syslinux
cd $(ls -d *)
WORK_SYSLINUX_DIR=$(pwd)
cd ../../..
# Remove the old ISO file if it exists. # Remove the old ISO file if it exists.
rm -f minimal_linux_live.iso rm -f minimal_linux_live.iso
@ -16,17 +22,9 @@ rm -rf work/isoimage
mkdir work/isoimage mkdir work/isoimage
cd work/isoimage cd work/isoimage
# Search and copy the files 'isolinux.bin' and 'ldlinux.c32' # Copy the precompiled files 'isolinux.bin' and 'ldlinux.c32' in the ISO image root folder.
for i in lib lib64 share end ; do cp $WORK_SYSLINUX_DIR/bios/core/isolinux.bin .
if [ -f /usr/$i/syslinux/isolinux.bin ]; then cp $WORK_SYSLINUX_DIR/bios/com32/elflink/ldlinux/ldlinux.c32 .
cp /usr/$i/syslinux/isolinux.bin .
if [ -f /usr/$i/syslinux/ldlinux.c32 ]; then
cp /usr/$i/syslinux/ldlinux.c32 .
fi;
break;
fi;
if [ $i = end ]; then exit 1; fi;
done
# Now we copy the kernel. # Now we copy the kernel.
cp $WORK_KERNEL_DIR/arch/x86/boot/bzImage ./kernel.bz cp $WORK_KERNEL_DIR/arch/x86/boot/bzImage ./kernel.bz

View File

@ -10,5 +10,6 @@ sh 06_get_busybox.sh
sh 07_build_busybox.sh sh 07_build_busybox.sh
sh 08_generate_rootfs.sh sh 08_generate_rootfs.sh
sh 09_pack_rootfs.sh sh 09_pack_rootfs.sh
sh 10_generate_iso.sh sh 10_get_syslinux.sh
sh 11_generate_iso.sh