aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xpreseed.sh16
1 files changed, 13 insertions, 3 deletions
diff --git a/preseed.sh b/preseed.sh
index c1226d1..0ab9513 100755
--- a/preseed.sh
+++ b/preseed.sh
@@ -47,11 +47,21 @@ rmdir "$mountdir"
cp preseed.cfg "$isoeditdir/"
md5sum ./preseed.cfg >> "$isoeditdir/md5sum.txt"
-cfg="$isoeditdir/isolinux/*.cfg"
-[ -f $isoeditdir/boot/grub/grub.cfg ] && cfg="$cfg $isoeditdir/boot/grub/grub.cfg"
-sed -ri 's@^\s+(append|linux)\s(.*\s)?auto=true\s(.*\s)?priority=critical\b@& preseed/file=/cdrom/preseed.cfg@' $cfg
+kernel="$(sed -rn '/^\s+kernel\s+/ {s///p; q}' $isoeditdir/isolinux/txt.cfg)"
+initrd="$(sed -rn '/^\s+append\s(.*\s)?initrd=(\S+)(\s.*)?$/ {s//\2/p;q}' $isoeditdir/isolinux/txt.cfg)"
+cat >$isoeditdir/isolinux/isolinux.cfg <<-EOF
+ default install
+ label install
+ kernel $kernel
+ append initrd=$initrd preseed/file=/cdrom/preseed.cfg auto=true --- fb=false
+EOF
# ^ no need to update isolinux' checksum, as it's not in './md5sum.txt'.
+if [ -f $isoeditdir/boot/grub/grub.cfg ]; then
+ sed -ri 's@^\s+linux\s(.*\s)?auto=true\s(.*\s)?priority=critical\b@& preseed/file=/cdrom/preseed.cfg@' \
+ "$isoeditdir/boot/grub/grub.cfg"
+fi
+
mkdir "$isoeditdir/include"
rsync -aL ./include/ "$isoeditdir/include"/
find -L ./include \( \! -name '.*' -a -type f \) -print0 | \