[arch-releng] [PATCH] Add optional command line parameter: archisobasedir

Thomas Bächler thomas at archlinux.org
Fri Jun 4 16:42:59 EDT 2010


When remastering the image onto a USB volume, you might want to reuse
an existing partition without filling the root with lots of archiso
files. The archisobasedir parameter allows to specify a new root
directory, isomounts and all images will be searched in this directory.
---
What do you think of this? I am planning to include scripts on
the ISO to easily put the image onto an existing vfat partition
on USB without entirely deleting it. This will help to
put it into a subdirectory instead of the root.

 archiso/hooks/archiso |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso
index e1ad81a..d979ef4 100644
--- a/archiso/hooks/archiso
+++ b/archiso/hooks/archiso
@@ -54,10 +54,14 @@ run_hook () {
         tmpfs_sqfs_size="75%"
     fi
 
+    if [ "x${archisobasedir}" != "x" ]; then
+        archisobasedir=""
+    fi
+
     if [ "x${isomounts}" != "x" ]; then
         isomounts="/bootmnt/${isomounts}"
     else
-        isomounts="/bootmnt/isomounts"
+        isomounts="/bootmnt/${archisobasedir}/isomounts"
     fi
 
     if [ "x${archisodevice}" = "x" ]; then
@@ -128,12 +132,12 @@ archiso_mount_handler() {
 
         [ "$imgarch" != "$arch" ] && continue
 
-        [ ! -r "/bootmnt/${img}" ] && continue
+        [ ! -r "/bootmnt/${archisobasedir}/${img}" ] && continue
 
         if [ "${type}" = "bind" ]; then
-            _mnt_bind "/bootmnt/${img}" "${newroot}${mountpoint}"
+            _mnt_bind "/bootmnt/${archisobasedir}/${img}" "${newroot}${mountpoint}"
         elif [ "${type}" = "squashfs" ]; then
-            _mnt_squashfs "/bootmnt/${img}" "${newroot}${mountpoint}"
+            _mnt_squashfs "/bootmnt/${archisobasedir}/${img}" "${newroot}${mountpoint}"
         fi
     done < "${isomounts}"
 
-- 
1.7.1



More information about the arch-releng mailing list