]> git.sur5r.net Git - bacula/rescue/blobdiff - rescue/linux/cdrom/makeinitrd
Update
[bacula/rescue] / rescue / linux / cdrom / makeinitrd
index e7ca4c5ee4cc25276e6db3e41e3ac872a93d3f92..2474cf9e0e55f573d5979ab150f7672c7dee2184 100755 (executable)
@@ -2,8 +2,9 @@
 
 TOPDIR=`pwd`
 
-mkdir -p /mnt/loop1 /mnt/loop2
+mkdir -p /mnt/loop1 /mnt/loop2
 
+#
 # we need to set aside a few loop devices. I chose (in reverse order of their appearance)
 # -- loop1 for the boot image
 # -- loop2 for the RAM disk image
@@ -29,39 +30,39 @@ echo "Initial RAM disk contents will be $ISIZE KB"
 # delete the existing RAM disk image, if there is one
 rm -f root
 
-dd if=/dev/zero of=$TOPDIR/root bs=1k count=$ISIZE
+dd if=/dev/zero of=$TOPDIR/root bs=1k count=$ISIZE
 
-umount /mnt/loop2  2>/dev/null >/dev/null
-losetup -d /dev/loop2 2>/dev/null >/dev/null
+umount /mnt/loop2  2>/dev/null >/dev/null
+losetup -d /dev/loop2 2>/dev/null >/dev/null
 
-# associate it with /dev/loop2
-losetup /dev/loop2 $TOPDIR/root
+# associate it with /dev/loop2
+losetup /dev/loop2 $TOPDIR/root
 
-# make an ext2 filesystem on it. Set reserve to 0
-mke2fs -q -m 0 /dev/loop2 $ISIZE
-if [ $? != 0 ] ; then
-  echo "Build failed."
-  exit 1
-fi
+# make an ext2 filesystem on it. Set reserve to 0
+mke2fs -q -m 0 /dev/loop2 $ISIZE
+if [ $? != 0 ] ; then
+  echo "Build failed."
+  exit 1
+fi
 
-# we mount it...
-mount /dev/loop2 /mnt/loop2 
+# we mount it...
+mount /dev/loop2 /mnt/loop2 
 
-# ... and delete the lost+found directory 
-rm -rf /mnt/loop2/lost+found 
+# ... and delete the lost+found directory 
+rm -rf /mnt/loop2/lost+found 
 
-# then we copy the contents of our roottree to this filesystem
-cp -dpR roottree/* /mnt/loop2/
-if [ $? != 0 ] ; then
-  echo "RAM disk build failed."
-  exit 1
-fi
+# then we copy the contents of our roottree to this filesystem
+cp -dpR roottree/* /mnt/loop2/
+if [ $? != 0 ] ; then
+  echo "RAM disk build failed."
+  exit 1
+fi
 
-# and unmount and divorce /dev/loop2
-umount /mnt/loop2
-losetup -d /dev/loop2 
+# and unmount and divorce /dev/loop2
+umount /mnt/loop2
+losetup -d /dev/loop2 
 
-(cd roottree; find . | cpio --quiet -c -o) >root
+(cd roottree; find . | cpio --quiet -c -o) >root
 
 echo "Building initial RAM disk done"
 
@@ -74,8 +75,7 @@ echo "Compressing the RAM disk image.... "
 rm -f cdtree/boot/isolinux/initrd.img
 
 # and gzip our RAM disk image and put it in the right place.
-# gzip -9 -c root >cdtree/boot/isolinux/initrd.img
-gzip -9 < root >cdtree/boot/isolinux/initrd.img
+gzip -9 -c root >cdtree/boot/isolinux/initrd.img
 if [ $? != 0 ] ; then
   echo "Build failed"
   exit 1