]> gitweb.fluxo.info Git - hydra.git/commitdiff
Misc fixes
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 5 Oct 2011 17:32:32 +0000 (14:32 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 5 Oct 2011 17:32:32 +0000 (14:32 -0300)
share/hydra/bootless

index a1fa76e0f5e41ab393f09e468a42adff91f9d433..5bf6ed4830d91160985e3761b973d79a9b136c09 100755 (executable)
@@ -18,6 +18,7 @@
 source $APP_BASE/lib/hydra/functions || exit 1
 hydra_config_load
 
+# Set bootless folder
 function hydra_bootless_folder {
   # Check for a bootless repository
   if [ -e "$HYDRA_FOLDER/bootless" ]; then
@@ -30,6 +31,7 @@ function hydra_bootless_folder {
   fi
 }
 
+# Make a boot device
 function hydra_bootless_make {
   # Set folder
   hydra_bootless_folder
@@ -51,6 +53,7 @@ partition and make the device bootable.
 
 Press any key to continue, or ^C to abort.
 EOF
+
   read tmp
   
   # Git repo consistency check
@@ -87,6 +90,7 @@ EOF
 If you continue, all data in device "${device}" will be destroyed!
 
 EOF
+
   echo -n "Are you sure you want to continue? Type uppercase \"YES\": "
   read go
   
@@ -149,21 +153,23 @@ function hydra_bootless_init {
   if [ ! -z "$1" ]; then
     # Clone from url
     git clone $1 $HYDRA_FOLDER/bootless
+    exit $?
+  fi
+
+  # Create a fresh repository
+  mkdir -p $HYDRA_FOLDER/bootless/{default,custom,grub}
+  mkdir -p $HYDRA_FOLDER/bootless/default/{debian,memtest,ubuntu}
+  ( cd $HYDRA_FOLDER/bootless && ln -s . boot)
+
+  if [ -f "/boot/memtest86+.bin" ]; then
+    cp /boot/memtest86+.bin $HYDRA_FOLDER/bootless/default/memtest
   else
-    # Create a fresh repository
-    mkdir -p $HYDRA_FOLDER/bootless/{default,custom,grub}
-    mkdir -p $HYDRA_FOLDER/bootless/default/{debian,memtest,ubuntu}
-    ( cd $HYDRA_FOLDER/bootless && ln -s . boot)
-
-    if [ -f "/boot/memtest86+.bin" ]; then
-      cp /boot/memtest86+.bin $HYDRA_FOLDER/bootless/default/memtest
-    else
-      echo "No memtest image found. Please install memtest86+ package"
-      echo "and manually copy /boot/memtest86+.bin if you want memtest support"
-    fi
-
-    # Grub configuration
-    cat > $HYDRA_FOLDER/bootless/grub/grub.cfg <<-EOF    
+    echo "No memtest image found. Please install memtest86+ package"
+    echo "and manually copy /boot/memtest86+.bin if you want memtest support"
+  fi
+
+  # Grub configuration
+  cat > $HYDRA_FOLDER/bootless/grub/grub.cfg <<-EOF    
 # This is grub.cfg for use with Bootless Management System
 
 ### BEGIN header ###
@@ -198,16 +204,15 @@ set menu_color_highlight=yellow/red
 ### END debian_theme ###
 EOF
 
-    # Initialize git repository
-    (
-    cd $HYDRA_FOLDER/bootless
-    git init
-    git add .
-    git commit -a -m "Initial import"
-    )
+  # Initialize git repository
+  (
+  cd $HYDRA_FOLDER/bootless
+  git init
+  git add .
+  git commit -a -m "Initial import"
+  )
 
-    echo "Now add your boot images and edit $HYDRA_FOLDER/bootless/grub/grub.cfg to suit your needs."
-  fi
+  echo "Now add your boot images and edit $HYDRA_FOLDER/bootless/grub/grub.cfg to suit your needs."
 }
 
 # Git wrapper