]> git.sur5r.net Git - bacula/rescue/blobdiff - rescue/linux/oldusb/remaster/pack_initrd
Move usb to oldusb
[bacula/rescue] / rescue / linux / oldusb / remaster / pack_initrd
diff --git a/rescue/linux/oldusb/remaster/pack_initrd b/rescue/linux/oldusb/remaster/pack_initrd
new file mode 100755 (executable)
index 0000000..bd5677f
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+#
+if [ ! -d initrd ] ; then
+  echo "Cannot find initrd directory."
+  exit 1
+fi
+cd initrd
+echo "Packing initrd to initrd.gz ..."
+find . | cpio -o -H newc | gzip -9 > ../initrd.gz
+if [ "x$SUID_UID" != "x" ] ; then
+  if [ "x$SUID_GID" = "x" ] ; then
+    chown $SUID_UID ../initrd.gz
+  else
+    chown $SUID_UID:$SUID_GID ../initrd.gz
+  fi  
+fi