From 7d2de5053bd2b8881581e0ef114a0ce438a7a87d Mon Sep 17 00:00:00 2001 From: bauen1 Date: Sat, 2 Dec 2017 09:52:07 +0100 Subject: [PATCH 1/4] Allow the user to enter a custom boot string for syslinux --- src/13_prepare_iso.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/13_prepare_iso.sh b/src/13_prepare_iso.sh index bb4bb0df1..de8b6b7e2 100755 --- a/src/13_prepare_iso.sh +++ b/src/13_prepare_iso.sh @@ -47,7 +47,26 @@ cp $WORK_SYSLINUX_DIR/bios/core/isolinux.bin . cp $WORK_SYSLINUX_DIR/bios/com32/elflink/ldlinux/ldlinux.c32 . # Create the ISOLINUX configuration file. -echo 'default kernel.xz initrd=rootfs.xz vga=ask' > ./syslinux.cfg +cat << CEOF > ./syslinux.cfg +PROMPT 1 +TIMEOUT 50 +DEFAULT mll + +SAY Press enter to boot minimal linux or wait 5 seconds +SAY Press tab to view available boot entries or enter syslinux commands directly + +LABEL mll + SAY Now booting minimal linux + LINUX kernel.xz + APPEND vga=ask + INITRD rootfs.xz + +LABEL mll_nomodeset + SAY Now booting minimal linux with 'nomodeset' + LINUX kernel.xz + APPEND vga=ask nomodeset + INITRD rootfs.xz +CEOF # Create UEFI start script. mkdir -p efi/boot From 58ccaa6ab112326bbb986823784f2d155b6f29b5 Mon Sep 17 00:00:00 2001 From: bauen1 Date: Sat, 2 Dec 2017 10:08:02 +0100 Subject: [PATCH 2/4] Cleaned up sysroot creation Removed all traces of sysroot.spec Copy kernel headers instead of symlinking theam (~6.7MB more space) --- src/05_prepare_sysroot.sh | 48 ++++------------------------------- src/minimal_overlay/common.sh | 14 ---------- 2 files changed, 5 insertions(+), 57 deletions(-) diff --git a/src/05_prepare_sysroot.sh b/src/05_prepare_sysroot.sh index e8e4c5c96..b1731dca4 100755 --- a/src/05_prepare_sysroot.sh +++ b/src/05_prepare_sysroot.sh @@ -8,52 +8,14 @@ cd work echo "Cleaning existing sysroot. This may take a while." rm -rf sysroot -rm -rf sysroot.specs echo "Preparing glibc. This may take a while." -cp -r glibc/glibc_installed sysroot -cd sysroot +mkdir -p sysroot/usr +ln -s ../include sysroot/usr/include +ln -s ../lib sysroot/usr/lib -# Create custom 'usr' area and link it with some of the kernel header directories. -# BusyBox compilation process uses these linked directories. The following -# directories are affected: -# -# usr (glibc) -# | -# +--include (glibc) -# | | -# | +--asm (kernel) -# | | -# | +--asm-generic (kernel) -# | | -# | +--linux (kernel) -# | | -# | +--mtd (kernel) -# | -# +--lib (glibc) - -mkdir -p usr - -ln -s ../include usr/include -ln -s ../lib usr/lib - -ln -s ../../kernel/kernel_installed/include/linux include/linux -ln -s ../../kernel/kernel_installed/include/asm include/asm -ln -s ../../kernel/kernel_installed/include/asm-generic include/asm-generic -ln -s ../../kernel/kernel_installed/include/mtd include/mtd - -cd .. - -echo "generating sysroot.specs" -SYSROOT="$PWD/sysroot" - -# gcc has a "internal" path that needs to be added to find the static versions of libgcc_* -GCC_INTERNAL_PATH=$(dirname $(gcc -print-libgcc-file-name)) - -cat << CEOF > sysroot.specs -*link_libgcc: --L$SYSROOT/lib -L$SYSROOT/lib64 -L$SYSROOT/usr/lib -L$SYSROOT/usr/lib64 -L$SYSROOT/usr/local/lib -L$SYSROOT/usr/local/lib64 -L$GCC_INTERNAL_PATH -CEOF +cp -r kernel/kernel_installed/include sysroot +cp -r glibc/glibc_installed/* sysroot cd $SRC_DIR diff --git a/src/minimal_overlay/common.sh b/src/minimal_overlay/common.sh index e7eae9d98..f66061c4d 100755 --- a/src/minimal_overlay/common.sh +++ b/src/minimal_overlay/common.sh @@ -13,7 +13,6 @@ export BUNDLE_NAME=`basename $SRC_DIR` export DEST_DIR=$WORK_DIR/overlay/$BUNDLE_NAME/${BUNDLE_NAME}_installed export CONFIG=$MAIN_SRC_DIR/.config export SYSROOT=$WORK_DIR/sysroot -#export SYSROOT_SPECS=$WORK_DIR/sysroot.specs # Read the 'JOB_FACTOR' property from $CONFIG export JOB_FACTOR="$(grep -i ^JOB_FACTOR $CONFIG | cut -f2 -d'=')" @@ -29,16 +28,3 @@ export NUM_JOBS=$((NUM_CORES * JOB_FACTOR)) # Ideally we would export MAKE at this point with -j etc to allow programs to just run $(MAKE) and not worry about extra flags that need to be passed # export MAKE="${MAKE-make} -j $NUM_JOBS" - -# sysroot flags for the compiler - -#-Wl,-nostdlib is required to make ld / gcc ignore the host's /usr/lib and /lib -#ld_flags="-Wl,-nostdlib $(grep -- \"-L\" $SYSROOT_SPECS)" -#-static-libgcc is neeeded since we don't have the gcc-libs in our sysroot -#gcc_flags="-specs=$SYSROOT_SPECS -static-libgcc" - -# $ld_flags is passed 2 times because sometimes bundles ignore one of the variables -#export CC="${CC-gcc} $gcc_flags $ld_flags" -#export CFLAGS="$CFLAGS" -#export LDFLAGS="$LDFLAGS $ld_flags" - From fbf7cd37d8964c94b2a09310e21118d99d324fe7 Mon Sep 17 00:00:00 2001 From: bauen1 Date: Sat, 2 Dec 2017 10:24:50 +0100 Subject: [PATCH 3/4] Renamed all .gitignore to .keep .gitignore's shouldn't be removed as they (might) serve a purpose for bundles --- src/09_generate_rootfs.sh | 4 ++-- src/minimal_overlay/bundles/mll_source/bundle.sh | 4 ++-- src/minimal_rootfs/dev/{.gitignore => .keep} | 0 src/minimal_rootfs/lib/{.gitignore => .keep} | 0 src/minimal_rootfs/mnt/{.gitignore => .keep} | 0 src/minimal_rootfs/proc/{.gitignore => .keep} | 0 src/minimal_rootfs/root/{.gitignore => .keep} | 0 src/minimal_rootfs/sys/{.gitignore => .keep} | 0 src/minimal_rootfs/tmp/{.gitignore => .keep} | 0 9 files changed, 4 insertions(+), 4 deletions(-) rename src/minimal_rootfs/dev/{.gitignore => .keep} (100%) rename src/minimal_rootfs/lib/{.gitignore => .keep} (100%) rename src/minimal_rootfs/mnt/{.gitignore => .keep} (100%) rename src/minimal_rootfs/proc/{.gitignore => .keep} (100%) rename src/minimal_rootfs/root/{.gitignore => .keep} (100%) rename src/minimal_rootfs/sys/{.gitignore => .keep} (100%) rename src/minimal_rootfs/tmp/{.gitignore => .keep} (100%) diff --git a/src/09_generate_rootfs.sh b/src/09_generate_rootfs.sh index 6458ef57d..1d0160276 100755 --- a/src/09_generate_rootfs.sh +++ b/src/09_generate_rootfs.sh @@ -24,9 +24,9 @@ cp -r ../minimal_rootfs/* rootfs cd rootfs -# Delete the '.gitignore' files which we use in order to keep track of otherwise +# Delete the '.keep' files which we use in order to keep track of otherwise # empty folders. -find * -type f -name '.gitignore' -exec rm {} + +find * -type f -name '.keep' -exec rm {} + # Remove 'linuxrc' which is used when we boot in 'RAM disk' mode. rm -f linuxrc diff --git a/src/minimal_overlay/bundles/mll_source/bundle.sh b/src/minimal_overlay/bundles/mll_source/bundle.sh index 442855a22..ed3a40def 100755 --- a/src/minimal_overlay/bundles/mll_source/bundle.sh +++ b/src/minimal_overlay/bundles/mll_source/bundle.sh @@ -22,9 +22,9 @@ cp -r $MAIN_SRC_DIR/minimal_config $DEST_DIR/usr/src cd $DEST_DIR/usr/src -# Delete the '.gitignore' files which we use in order to keep track of otherwise +# Delete the '.keep' files which we use in order to keep track of otherwise # empty folders. -find * -type f -name '.gitignore' -exec rm {} + +find * -type f -name '.keep' -exec rm {} + # With '--remove-destination' all possibly existing soft links in # '$OVERLAY_ROOTFS' will be overwritten correctly. diff --git a/src/minimal_rootfs/dev/.gitignore b/src/minimal_rootfs/dev/.keep similarity index 100% rename from src/minimal_rootfs/dev/.gitignore rename to src/minimal_rootfs/dev/.keep diff --git a/src/minimal_rootfs/lib/.gitignore b/src/minimal_rootfs/lib/.keep similarity index 100% rename from src/minimal_rootfs/lib/.gitignore rename to src/minimal_rootfs/lib/.keep diff --git a/src/minimal_rootfs/mnt/.gitignore b/src/minimal_rootfs/mnt/.keep similarity index 100% rename from src/minimal_rootfs/mnt/.gitignore rename to src/minimal_rootfs/mnt/.keep diff --git a/src/minimal_rootfs/proc/.gitignore b/src/minimal_rootfs/proc/.keep similarity index 100% rename from src/minimal_rootfs/proc/.gitignore rename to src/minimal_rootfs/proc/.keep diff --git a/src/minimal_rootfs/root/.gitignore b/src/minimal_rootfs/root/.keep similarity index 100% rename from src/minimal_rootfs/root/.gitignore rename to src/minimal_rootfs/root/.keep diff --git a/src/minimal_rootfs/sys/.gitignore b/src/minimal_rootfs/sys/.keep similarity index 100% rename from src/minimal_rootfs/sys/.gitignore rename to src/minimal_rootfs/sys/.keep diff --git a/src/minimal_rootfs/tmp/.gitignore b/src/minimal_rootfs/tmp/.keep similarity index 100% rename from src/minimal_rootfs/tmp/.gitignore rename to src/minimal_rootfs/tmp/.keep From a44d44b9876c4e57e7d5004dec07d1b13c824993 Mon Sep 17 00:00:00 2001 From: bauen1 Date: Tue, 5 Dec 2017 18:27:59 +0100 Subject: [PATCH 4/4] Fixed the boot menu --- src/13_prepare_iso.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/13_prepare_iso.sh b/src/13_prepare_iso.sh index de8b6b7e2..a5532b10b 100755 --- a/src/13_prepare_iso.sh +++ b/src/13_prepare_iso.sh @@ -56,13 +56,11 @@ SAY Press enter to boot minimal linux or wait 5 seconds SAY Press tab to view available boot entries or enter syslinux commands directly LABEL mll - SAY Now booting minimal linux LINUX kernel.xz APPEND vga=ask INITRD rootfs.xz LABEL mll_nomodeset - SAY Now booting minimal linux with 'nomodeset' LINUX kernel.xz APPEND vga=ask nomodeset INITRD rootfs.xz