summaryrefslogtreecommitdiffstats
path: root/pbmtk
blob: a7a66318a4cb573e4c65cfdc17f89c2834b6af96 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
# -----------------------------------------------------------------------------
# Copyright (c) 2011 - OpenSLX GmbH
#
# This program is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
#
# If you have any feedback please consult http://openslx.org/feedback and
# send your suggestions, praise, or complaints to feedback@openslx.org
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
# PreBoot Media ToolKit
# -----------------------------------------------------------------------------

ROOT_DIR=$(dirname $(readlink -f $0))
SELF=$(readlink -f $0)

SUBMODULE=$1
shift

. $ROOT_DIR/inc/functions.common.sh

print_module_usage() {
  echo "Toolkit for creating PreBoot Media for OpenSLX NG (pbmtk)"
  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"
}

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
elif [ "x$SUBMODULE" = "xusb" ]; then
	echo -e "Module: PreBoot-USB-Stick Creator"
	. $ROOT_DIR/inc/functions.usb.sh
elif [ "x$SUBMODULE" = "xinstaller" ]; then
	echo -e "Module: PreBoot-Media Installer Creator"
	. $ROOT_DIR/inc/functions.create-installer.sh
elif [ "x$SUBMODULE" = "x--version" -o "x$SUBMODULE" = "x-v"  ]; then
	echo -e "Module: Version"
	exit 1
else
	print_module_usage
	exit 1
fi

init_params

mkdir -p $LOG_DIR/

run_global_checks

read_params $@

run_module_checks

run