Only set PARTITION=1 if target is a block device.
[grml-debootstrap.git] / grml-debootstrap
index 2544c85..0409092 100755 (executable)
@@ -104,10 +104,10 @@ fi
 
 # cmdline handling {{{
 # source external command line parameter-processing script
-if [ -r /usr/share/grml-debootstrap/functions/cmdlineopts.clp ] ; then
-   . /usr/share/grml-debootstrap/functions/cmdlineopts.clp
-elif [ -r ./cmdlineopts.clp ] ; then
+if [ -r ./cmdlineopts.clp ] ; then
    . ./cmdlineopts.clp
+elif [ -r /usr/share/grml-debootstrap/functions/cmdlineopts.clp ] ; then
+   . /usr/share/grml-debootstrap/functions/cmdlineopts.clp
 else
    echo "Error: cmdline function file not found, exiting.">&2
    exit 1
@@ -576,13 +576,11 @@ set_target_directory(){
     GRUB=''
 }
 
-case $TARGET in
-  /dev/shm/*) set_target_directory ;;
-  /dev/*)
+if [ -b "$TARGET" ] ; then
     PARTITION=1
-    ;;
-  *) set_target_directory ;;
-esac
+else
+    set_target_directory
+fi
 # }}}
 
 # architecture setup {{{