supporting directories and direct blockdevices as source for the iso
authorMichael Gebetsroither <michael.geb@gmx.at>
Tue, 3 Apr 2007 21:35:42 +0000 (23:35 +0200)
committerMichael Gebetsroither <michael.geb@gmx.at>
Tue, 3 Apr 2007 21:35:42 +0000 (23:35 +0200)
debian/changelog
grml2usb
grml2usb.8

index 132a770..3e244b9 100644 (file)
@@ -1,3 +1,9 @@
+grml2usb (0.7.5) unstable; urgency=low
+
+  * supporting directories and direct blockdevices as source for the iso. 
+
+ -- Michael Gebetsroither <gebi@grml.org>  Tue, 03 Apr 2007 23:28:19 +0200
+
 grml2usb (0.7.4) unstable; urgency=low
 
   * Get rid of bashism, thanks for reporting - Paul Weaver!
 grml2usb (0.7.4) unstable; urgency=low
 
   * Get rid of bashism, thanks for reporting - Paul Weaver!
index 27cbddf..44de706 100755 (executable)
--- a/grml2usb
+++ b/grml2usb
@@ -82,6 +82,9 @@ Usage:
 Usage example - install grml-small to usb-device on /mnt/external1:
   $PROGRAMNAME grml_small_0.2.iso /mnt/external1
 
 Usage example - install grml-small to usb-device on /mnt/external1:
   $PROGRAMNAME grml_small_0.2.iso /mnt/external1
 
+Usage example - using grml2usb on a live grml system:
+  $PROGRAMNAME /cdrom /mnt/external1
+
 Usage example - delete grml-installation from /mnt/external1:
   $PROGRAMNAME uninstall /mnt/external1
 
 Usage example - delete grml-installation from /mnt/external1:
   $PROGRAMNAME uninstall /mnt/external1
 
@@ -134,8 +137,14 @@ mount_device(){
 
 mount_iso(){
   echo -n "Mounting ${ISO} to ${TMPMNT}: "
 
 mount_iso(){
   echo -n "Mounting ${ISO} to ${TMPMNT}: "
-  debugit "debug: mount -o loop ${ISO} ${TMPMNT}"
-  if mount -o loop "${ISO}" ${TMPMNT} ; then
+  local mount_opts_="-o loop"
+  if [ -d $ISO ]; then
+      mount_opts_="--bind"
+  elif [ -b $ISO ]; then
+      mount_opts_=""
+  fi
+  debugit "debug: mount $mount_opts_ ${ISO} ${TMPMNT}"
+  if mount $mount_opts_ "${ISO}" ${TMPMNT} ; then
     echo "${WHITE}done${NORMAL}"
   else
     echo 1>&2 "${RED}Problem? You got an error saying 'mount: could not find any free loop device'?
     echo "${WHITE}done${NORMAL}"
   else
     echo 1>&2 "${RED}Problem? You got an error saying 'mount: could not find any free loop device'?
index b6609ee..f3f0fbb 100644 (file)
@@ -21,6 +21,8 @@ grml2usb requires and supports exactly two options:
 .B <path-to-the-iso-file>
 The path where the iso you want to use for installation is available.
 That's something like for example /home/mika/grml_0.9.iso.
 .B <path-to-the-iso-file>
 The path where the iso you want to use for installation is available.
 That's something like for example /home/mika/grml_0.9.iso.
+The path could als be a block device or a plain directory (which contains all
+files of the iso).
 .TP
 .B <path-to-the-mountpoint>
 This option specifies the mountpoint for your usb device, using the setup in
 .TP
 .B <path-to-the-mountpoint>
 This option specifies the mountpoint for your usb device, using the setup in