From 6c529fac777dc2880aead3a1d325532dcc89c879 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 7 Feb 2007 15:23:19 +0000 Subject: [PATCH] * Very naughty of me not to use -boot-info-table. Now I know better. svn path=/nixos/trunk/; revision=7875 --- helpers/make-iso9660-image.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/helpers/make-iso9660-image.sh b/helpers/make-iso9660-image.sh index 910417cde47b..942e782dbad3 100644 --- a/helpers/make-iso9660-image.sh +++ b/helpers/make-iso9660-image.sh @@ -8,7 +8,20 @@ symlinks=($symlinks) if test -n "$bootable"; then - bootFlags="-b $bootImage -c boot.cat -no-emul-boot -boot-load-size 4" + + # The -boot-info-table option modifies the $bootImage file, so + # find it in `contents' and make a copy of it (since the original + # is read-only in the Nix store...). + for ((i = 0; i < ${#targets_[@]}; i++)); do + if test "${targets_[$i]}" = "$bootImage"; then + echo "copying the boot image ${sources_[$i]}" + cp "${sources_[$i]}" boot.img + chmod u+w boot.img + sources_[$i]=boot.img + fi + done + + bootFlags="-b $bootImage -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table" fi