diff --git a/src/.config b/src/.config index 1b2a837e9..e1a732a2d 100644 --- a/src/.config +++ b/src/.config @@ -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 +# 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 + diff --git a/src/00_prepare.sh b/src/00_prepare.sh old mode 100644 new mode 100755 diff --git a/src/01_get_kernel.sh b/src/01_get_kernel.sh old mode 100644 new mode 100755 diff --git a/src/02_build_kernel.sh b/src/02_build_kernel.sh old mode 100644 new mode 100755 diff --git a/src/03_get_glibc.sh b/src/03_get_glibc.sh old mode 100644 new mode 100755 diff --git a/src/04_build_glibc.sh b/src/04_build_glibc.sh old mode 100644 new mode 100755 diff --git a/src/05_prepare_glibc.sh b/src/05_prepare_glibc.sh old mode 100644 new mode 100755 diff --git a/src/06_get_busybox.sh b/src/06_get_busybox.sh old mode 100644 new mode 100755 diff --git a/src/07_build_busybox.sh b/src/07_build_busybox.sh old mode 100644 new mode 100755 diff --git a/src/08_generate_rootfs.sh b/src/08_generate_rootfs.sh old mode 100644 new mode 100755 index 7164ce640..fd8c708fe --- a/src/08_generate_rootfs.sh +++ b/src/08_generate_rootfs.sh @@ -46,12 +46,15 @@ cd etc cat > bootscript.sh << EOF #!/bin/sh +echo "Welcome to \"Minimal Linbux Live\" (/sbin/init)" + dmesg -n 1 mount -t devtmpfs none /dev mount -t proc none /proc mount -t sysfs none /sys for DEVICE in /sys/class/net/* ; do + echo "Found network device \${DEVICE##*/}" ip link set \${DEVICE##*/} up [ \${DEVICE##*/} != lo ] && udhcpc -b -i \${DEVICE##*/} -s /etc/rc.dhcp done @@ -70,6 +73,13 @@ if [ "\$router" ]; then ip route add default via \$router dev \$interface fi +if [ "\$ip" ]; then + echo "DHCP configuration for device \$interface" + echo "ip: \$ip" + echo "mask: \$mask" + echo "router: \$router" +fi + EOF chmod +x rc.dhcp @@ -118,6 +128,8 @@ cd .. cat > init << EOF #!/bin/sh +echo "Welcome to \"Minimal Linbux Live\" (/init)" + exec /sbin/init EOF diff --git a/src/09_pack_rootfs.sh b/src/09_pack_rootfs.sh old mode 100644 new mode 100755 diff --git a/src/10_get_syslinux.sh b/src/10_get_syslinux.sh new file mode 100755 index 000000000..1d22c5dec --- /dev/null +++ b/src/10_get_syslinux.sh @@ -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 .. + diff --git a/src/10_generate_iso.sh b/src/11_generate_iso.sh old mode 100644 new mode 100755 similarity index 76% rename from src/10_generate_iso.sh rename to src/11_generate_iso.sh index 42a83eaa9..bebe36154 --- a/src/10_generate_iso.sh +++ b/src/11_generate_iso.sh @@ -6,6 +6,12 @@ cd $(ls -d *) WORK_KERNEL_DIR=$(pwd) 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. rm -f minimal_linux_live.iso @@ -16,17 +22,9 @@ rm -rf work/isoimage mkdir work/isoimage cd work/isoimage -# Search and copy the files 'isolinux.bin' and 'ldlinux.c32' -for i in lib lib64 share end ; do - if [ -f /usr/$i/syslinux/isolinux.bin ]; then - 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 +# Copy the precompiled files 'isolinux.bin' and 'ldlinux.c32' in the ISO image root folder. +cp $WORK_SYSLINUX_DIR/bios/core/isolinux.bin . +cp $WORK_SYSLINUX_DIR/bios/com32/elflink/ldlinux/ldlinux.c32 . # Now we copy the kernel. cp $WORK_KERNEL_DIR/arch/x86/boot/bzImage ./kernel.bz diff --git a/src/build_minimal_linux_live.sh b/src/build_minimal_linux_live.sh index dff5db4c4..547b95e90 100755 --- a/src/build_minimal_linux_live.sh +++ b/src/build_minimal_linux_live.sh @@ -10,5 +10,6 @@ sh 06_get_busybox.sh sh 07_build_busybox.sh sh 08_generate_rootfs.sh sh 09_pack_rootfs.sh -sh 10_generate_iso.sh +sh 10_get_syslinux.sh +sh 11_generate_iso.sh