summary refs log tree commit diff
path: root/lib/make-iso9660-image.sh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2009-06-09 12:01:31 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2009-06-09 12:01:31 +0000
commit37edcf4fae23e1e3862ccbad063f91e712d13206 (patch)
treeb92048d94d1f97fb0022b7bd11dbaa2528b89b31 /lib/make-iso9660-image.sh
parentca061eb628db7c0f824dfe9220acbe56fd8bda0e (diff)
downloadnixpkgs-37edcf4fae23e1e3862ccbad063f91e712d13206.tar
nixpkgs-37edcf4fae23e1e3862ccbad063f91e712d13206.tar.gz
nixpkgs-37edcf4fae23e1e3862ccbad063f91e712d13206.tar.bz2
nixpkgs-37edcf4fae23e1e3862ccbad063f91e712d13206.tar.lz
nixpkgs-37edcf4fae23e1e3862ccbad063f91e712d13206.tar.xz
nixpkgs-37edcf4fae23e1e3862ccbad063f91e712d13206.tar.zst
nixpkgs-37edcf4fae23e1e3862ccbad063f91e712d13206.zip
* Provide an option to add more files to the ISO image.
svn path=/nixos/branches/modular-nixos/; revision=15903
Diffstat (limited to 'lib/make-iso9660-image.sh')
-rw-r--r--lib/make-iso9660-image.sh19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/make-iso9660-image.sh b/lib/make-iso9660-image.sh
index 5ba133b6890..a1d7f62f35c 100644
--- a/lib/make-iso9660-image.sh
+++ b/lib/make-iso9660-image.sh
@@ -6,13 +6,24 @@ targets_=($targets)
 objects=($objects)
 symlinks=($symlinks)
 
+
+# Remove the initial slash from a path, since genisofs likes it that way.
+stripSlash() {
+    res="$1"
+    if test "${res:0:1}" = /; then res=${res:1}; fi
+}
+
+stripSlash "$bootImage"; bootImage="$res"
+
+
 if test -n "$bootable"; then
 
     # 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
+        stripSlash "${targets_[$i]}"
+        if test "$res" = "$bootImage"; then
             echo "copying the boot image ${sources_[$i]}"
             cp "${sources_[$i]}" boot.img
             chmod u+w boot.img
@@ -23,11 +34,14 @@ if test -n "$bootable"; then
     bootFlags="-b $bootImage -c .boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table"
 fi
 
+
 touch pathlist
 
+
 # Add the individual files.
 for ((i = 0; i < ${#targets_[@]}; i++)); do
-    echo "${targets_[$i]}=$(readlink -f ${sources_[$i]})" >> pathlist
+    stripSlash "${targets_[$i]}"
+    echo "$res=$(readlink -f ${sources_[$i]})" >> pathlist
 done
 
 
@@ -54,6 +68,7 @@ for ((n = 0; n < ${#objects[*]}; n++)); do
     fi
 done
 
+# !!! what does this do?
 cat pathlist | sed -e 's/=\(.*\)=\(.*\)=/\\=\1=\2\\=/' | tee pathlist.safer