summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorSebastian Schmelzer2012-06-26 19:13:45 +0200
committerSebastian Schmelzer2012-06-26 19:13:45 +0200
commit8c5112e5c97181fec92227333909613b7159cea5 (patch)
tree5329ff2e2e86355ca1aa6c9642f35ac7ce6c3559 /bin
parentadd patch for systemd path fixes (diff)
downloadosib-8c5112e5c97181fec92227333909613b7159cea5.tar.gz
osib-8c5112e5c97181fec92227333909613b7159cea5.tar.xz
osib-8c5112e5c97181fec92227333909613b7159cea5.zip
remove udev stuff from patch, add osib main script
Diffstat (limited to 'bin')
-rwxr-xr-x[-rw-r--r--]bin/osib84
1 files changed, 76 insertions, 8 deletions
diff --git a/bin/osib b/bin/osib
index 28d8e50..89d954f 100644..100755
--- a/bin/osib
+++ b/bin/osib
@@ -3,14 +3,82 @@
ROOT_DIR=$(readlink -f $(dirname $(readlink -f $0))/..)
SELF=$(readlink -f $0)
-print_module_usage() {
+print_usage() {
echo "Toolkit for creating systemd based initramfs images (osid)"
- echo "Usage: $(basename $SELF) MODULE [OPTIONS]"
- echo "Modules:"
- echo -e " env \t fetch, update, recreate kernel/initramfs"
- echo -e " iso \t create preboot isos"
- echo -e " usb \t create preboot usb sticks"
- echo -e " installer \t create self-extracting installers"
- echo "For more help run: $(basename $SELF) MODULE --help"
+ echo "Usage: $(basename $SELF) [OPTIONS] CMD"
+ echo "Options:"
+ echo -e " --rebuild-all, -r \t force recreation of build env"
+ echo -e " --rebuild-cpio \t force recreation of cpio base"
+ echo -e " --rebuild-sqfs \t force recreation of sqfs base"
+ echo -e " --help, -h \t print help"
+ echo "Commands (CMD):"
+ echo -e " clean \t clean build dir"
+ echo -e " initramfs \t create only initramfs"
+ echo -e " iso \t create iso"
}
+
+rebuild_cpio=0
+rebuild_sqfs=0
+build_initramfs=0
+build_iso=0
+clean=0
+
+if [ "x$1" = "x" ]; then
+ print_usage
+ exit 0
+elif [ "x$(whoami)" != "xroot" ]; then
+ echo "ERROR: You need root rights to run $SELF."
+ echo " (required for creating dev files)"
+ exit 1
+fi
+
+while [ "x$1" != "x" ]; do
+ arg=$1
+ if [ "x$arg" = "x--rebuild-all" -o "x$arg" = "x-r" ]; then
+ rebuild_cpio=1
+ rebuild_sqfs=1
+ elif [ "x$arg" = "x--rebuild-cpio" ]; then
+ rebuild_cpio=1
+ elif [ "x$arg" = "x--rebuild-sqfs" -o "x$arg" = "x-s" ]; then
+ rebuild_sqfs=1
+ elif [ "x$arg" = "x--help" -o "x$arg" = "x-h" ]; then
+ print_usage
+ exit 0
+ elif [ "x$arg" = "xiso" ]; then
+ build_initramfs=1
+ build_iso=1
+ elif [ "x$arg" = "xinitramfs" ]; then
+ build_initramfs=1
+ elif [ "x$arg" = "xclean" ]; then
+ clean=1
+ else
+ echo "ERROR: Unkown argument ($arg)."
+ print_usage
+ exit 1
+ fi
+ shift
+done
+
+if [ $rebuild_cpio -eq 1 ]; then
+ rm -rf ${ROOT_DIR}/build/cpio-base
+fi
+
+if [ $rebuild_sqfs -eq 1 ]; then
+ rm -rf ${ROOT_DIR}/build/sqfs-base
+fi
+
+if [ $clean -eq 1 ]; then
+ rm -rf ${ROOT_DIR}/build
+fi
+
+
+if [ $build_initramfs -eq 1 ]; then
+ ${ROOT_DIR}/inc/build.initramfs.sh && exit 0
+fi
+
+if [ $build_iso -eq 1 ]; then
+ ${ROOT_DIR}/inc/build.iso.sh
+fi
+
+exit 0