blob: bb9789fd79bda8c8ebade0dd314493a617c1f65c (
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
#!/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/
# -----------------------------------------------------------------------------
#
# Mini-Linux Toolkit
#
# -----------------------------------------------------------------------------
SELF=$(readlink -f $0)
ROOT_DIR=$(dirname ${SELF})
banner () {
echo -e "\t __ __ __ "
echo -e "\t.--------.| | | |_| |--."
echo -e "\t| || |_| _| < "
echo -e "\t|__|__|__||____|____|__|__|"
echo -e "\t "
echo -e "\t ** OpenSLX Project // 2011 **"
echo -e "\t http://lab.openslx.org/"
echo -e ""
}
print_usage() {
echo "Toolkit for creating preboot mini-linux for OpenSLX NG (mltk)"
echo "Usage: $(basename ${SELF}) MODULE [OPTION]"
echo " MODULE:"
echo -e " core \t minimal initramfs (stage 3.1) to mount the system-container (stage 3.2)."
echo -e " tools \t minimal systemd-based rootfs including basic tools."
echo -e " OPTION:"
echo -e " build \t builds [MODULE]"
echo -e " clean \t clean build files for [MODULE]"
echo -e ""
echo -e " Module specific option:"
echo -e " tools \t build [TOOL]"
echo -e " TOOL can be: \t base, busybox, dbus, udev, systemd, plymouth"
}
banner
if [ "x$1" = "x" ]; then
print_usage
exit 0
elif [ "x$(whoami)" != "xroot" ]; then
echo "ERROR: You need to have root rights to install packages."
exit 1
fi
# read setup-tools and build_core
BUILD_CORE=${ROOT_DIR}/server/build_core
SETUP_TOOLS=${ROOT_DIR}/remote/setup_tools
if [ "x$1" = "xcore" ]; then
[ -e ${BUILD_CORE} ] && . ${BUILD_CORE}
shift
if [ "x$1" = "xbuild" ]; then
generate_stage31
elif [ "x$1" = "xclean" ]; then
clean_core
else
print_usage
exit 1
fi
elif [ "x$1" = "xtools" ]; then
[ -e ${SETUP_TOOLS} ] && . $SETUP_TOOLS
shift
if [ "x$1" = "xbuild" ]; then
# shift away first 2 parameters
shift
echo "[tools] Building $@"
generate_stage32 $@
elif [ "x$1" = "xclean" ]; then
shift
echo "[tools] Cleaning $@"
clean_tools $@
else
print_usage
exit 1
fi
else
echo "Module $1 not known."
print_usage
exit 1
fi
|