summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Schmelzer2011-05-06 18:49:41 +0200
committerSebastian Schmelzer2011-05-06 18:49:41 +0200
commit1c172a3df203ff8143067bc6fb52c83e53c7ba49 (patch)
tree7a08a2047213a4cf1efbe38dd9fdda9a7997539d
parentpbmtk v1 (diff)
downloadusb-boot-stick-1c172a3df203ff8143067bc6fb52c83e53c7ba49.tar.gz
usb-boot-stick-1c172a3df203ff8143067bc6fb52c83e53c7ba49.tar.xz
usb-boot-stick-1c172a3df203ff8143067bc6fb52c83e53c7ba49.zip
add env module .. not finished ..
-rw-r--r--.gitignore1
-rw-r--r--inc/functions.env.sh114
-rwxr-xr-xpbmtk2
3 files changed, 117 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 8bf6c80..a041558 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,5 +9,6 @@ installer/*.bz2
installer/*installer
contrib/syslinux/sys*
.project
+.buildpath
*.ISO
*.iso
diff --git a/inc/functions.env.sh b/inc/functions.env.sh
new file mode 100644
index 0000000..56cc49c
--- /dev/null
+++ b/inc/functions.env.sh
@@ -0,0 +1,114 @@
+SHORT_OPTS=":vbcfdh"
+LONG_OPTS="version,build,clean,force,debug,help"
+
+KERNEL="kernel-preboot-latest"
+INITRAMFS="initramfs-default"
+
+LOG_DIR="/tmp/pbmtk"
+
+run_module_checks () {
+
+ if [ ! -z $1 ]; then
+ perror "Too many parameters. \n"
+ print_usage
+ exit 1
+ fi
+
+ if [ -z $(which make) ]; then
+ perror "buildutils are missing (if you are on a debian/ubuntu system: apt-get install ..)"
+ exit 1
+ fi
+}
+
+init_params () {
+ FORCE=0
+ DEBUG=0
+ TARGET_KERNEL=0
+ TARGET_INIT=0
+ CLEAN=0
+ BUILD=0
+}
+
+print_usage() {
+ unset_quiet
+ echo "Usage: $(basename $SELF) env [OPTIONS] TARGET"
+ echo -e " -b --build \t build"
+ echo -e " -c --clean \t remove all temporary stuff"
+ echo -e " -d --debug \t give more debug output"
+ echo -e " -f --force \t don't ask questions"
+ echo -e " -h --help \t print help"
+ echo -e " -v --version \t print version information"
+ echo -e "TARGET can be kernel, initramfs or all"
+}
+
+read_params() {
+ getopt_start $@
+
+ eval set -- "$GETOPT_TEMP"
+
+ while true ; do
+ case "$1" in
+ -v|--version)
+ echo "OpenSLX PreBoot .. ($VERSION - $VDATE)."
+ exit 0
+ ;;
+ -h|--help)
+ print_usage
+ exit 0
+ ;;
+ -f|--force) pinfo "Disable user-interaction."; FORCE=1; shift ;;
+ -b|--build)
+ BUILD=1
+ shift
+ ;;
+ -c|--clean) pinfo "Clean setup."; CLEAN=1; shift ;;
+ -d|--debug) pinfo "Enabled debugmode."; DEBUG=1; unset_quiet; shift ;;
+ --) shift ; break ;;
+ *) perror "Internal error!" ; exit 1 ;;
+ esac
+ done
+
+
+ TARGET=$1
+ shift
+ case "$TARGET" in
+ kernel)
+ TARGET_KERNEL=1
+ msg="kernel"
+ ;;
+ initramfs)
+ TARGET_INIT=1
+ msg="initramfs"
+ ;;
+ all)
+ TARGET_INIT=1
+ TARGET_KERNEL=1
+ msg="kernel, initramfs"
+ ;;
+ *)
+ perror "Missing valid TARGET for build.\n"
+ print_usage
+ exit 1
+ ;;
+ esac
+
+ if [ -z $TARGET ]; then
+ perror "Missing valid TARGET for build.\n"
+ print_usage
+ exit 1
+ fi
+}
+
+
+run () {
+ set_quiet
+
+ pre_start_cleanup
+ setup_dir_structure
+ copy_files
+ create_iso
+
+ unset_quiet
+
+ pinfo "FINISHED: ISO can be found here: $ROOT_DIR/openslx.iso!"
+} \ No newline at end of file
diff --git a/pbmtk b/pbmtk
index 2d40ca1..a7a6631 100755
--- a/pbmtk
+++ b/pbmtk
@@ -36,6 +36,7 @@ banner
if [ "x$SUBMODULE" = "xenv" ]; then
echo -e "Module: ENV"
+ . $ROOT_DIR/inc/functions.env.sh
elif [ "x$SUBMODULE" = "xiso" ]; then
echo -e "Module: PreBoot-ISO Creator"
. $ROOT_DIR/inc/functions.iso.sh
@@ -50,6 +51,7 @@ elif [ "x$SUBMODULE" = "x--version" -o "x$SUBMODULE" = "x-v" ]; then
exit 1
else
print_module_usage
+ exit 1
fi
init_params