aboutsummaryrefslogtreecommitdiffstats
path: root/preseed.sh
diff options
context:
space:
mode:
Diffstat (limited to 'preseed.sh')
-rwxr-xr-xpreseed.sh19
1 files changed, 9 insertions, 10 deletions
diff --git a/preseed.sh b/preseed.sh
index 86a8c65..c1226d1 100755
--- a/preseed.sh
+++ b/preseed.sh
@@ -47,14 +47,14 @@ rmdir "$mountdir"
cp preseed.cfg "$isoeditdir/"
md5sum ./preseed.cfg >> "$isoeditdir/md5sum.txt"
-cfg="$isoeditdir/isolinux/*.cfg $isoeditdir/isolinux/*/*.cfg"
+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@& file=/cdrom/preseed.cfg@' $cfg
+sed -ri 's@^\s+(append|linux)\s(.*\s)?auto=true\s(.*\s)?priority=critical\b@& preseed/file=/cdrom/preseed.cfg@' $cfg
# ^ no need to update isolinux' checksum, as it's not in './md5sum.txt'.
mkdir "$isoeditdir/include"
rsync -aL ./include/ "$isoeditdir/include"/
-find ./include \( \! -name '.*' -a -type f \) -print0 | \
+find -L ./include \( \! -name '.*' -a -type f \) -print0 | \
xargs -r0 md5sum >> "$isoeditdir/md5sum.txt"
# non-free firmwares:
@@ -63,10 +63,9 @@ find ./include \( \! -name '.*' -a -type f \) -print0 | \
#find ./firmware \( \! -name '.*' -a -type f \) -print0 | \
# xargs -r0 md5sum >> "$isoeditdir/md5sum.txt"
-# XXX: that's ugly
-dist=$(for x in "$isoeditdir"/dists/*; do [ -h "$x" ] && continue; [ -d "$x" ] && echo ${x##*/} && break; done)
-arch=$(for x in "$isoeditdir/dists/$dist/main"/binary-*; do test -d "$x" && echo ${x##*/binary-} && break; done)
-packages="dists/$dist/main/debian-installer/binary-$arch/Packages"
+dist=$(readlink "$isoeditdir/dists/stable")
+packages="dists/$dist/main/debian-installer/binary-$DEB_ARCH/Packages"
+gunzip "$isoeditdir/$packages.gz"
while [ $# -gt 0 ]; do
cd "${1%%_*}-udeb"; shift
name="$(sed -n 's/Package:\s\s*//p' ./debian/control)"
@@ -87,17 +86,17 @@ while [ $# -gt 0 ]; do
cd "$pwd"
done
-cd "$isoeditdir"
-gzip -fk ./"$packages"
+gzip "$isoeditdir/$packages"
md5sums=$(mktemp)
+cd "$isoeditdir"
while read sum file; do
if [ "$file" = "./${packages}" -o \
"$file" = "./${packages}.gz" -o \
"$file" = "./boot/grub/grub.cfg" ]; then
md5sum "$file"
else
- echo "$sum $file"
+ echo "$sum $file"
fi
done < ./md5sum.txt > "$md5sums"
mv "$md5sums" "$isoeditdir/md5sum.txt"