summaryrefslogtreecommitdiffstats
path: root/remote/rootfs
diff options
context:
space:
mode:
authorJonathan Bauer2016-01-22 17:35:14 +0100
committerJonathan Bauer2016-01-22 17:35:14 +0100
commitf595907fa79e5eabd4e18766c87a094acd4e4ee4 (patch)
treeb6787af2c28da63e8990ea005bbd93e106fd7f3c /remote/rootfs
parent[pvs] remove hardcoded name to pvs session. Instead check for the name in the... (diff)
parent[vmchooser2] Add support for new location related parameters (diff)
downloadtm-scripts-f595907fa79e5eabd4e18766c87a094acd4e4ee4.tar.gz
tm-scripts-f595907fa79e5eabd4e18766c87a094acd4e4ee4.tar.xz
tm-scripts-f595907fa79e5eabd4e18766c87a094acd4e4ee4.zip
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
Diffstat (limited to 'remote/rootfs')
-rw-r--r--remote/rootfs/rootfs-stage31/data/inc/activate_sysconfig13
-rwxr-xr-xremote/rootfs/rootfs-stage31/data/inc/ntp_sync26
-rw-r--r--remote/rootfs/rootfs-stage31/data/inc/parse_kcl4
-rwxr-xr-xremote/rootfs/rootfs-stage31/data/init6
-rw-r--r--remote/rootfs/rootfs-stage31/module.build2
-rw-r--r--remote/rootfs/rootfs-stage31/module.conf4
-rw-r--r--remote/rootfs/rootfs-stage31/module.conf.centos3
-rw-r--r--remote/rootfs/rootfs-stage31/module.conf.debian3
-rw-r--r--remote/rootfs/rootfs-stage31/module.conf.fedora3
-rw-r--r--remote/rootfs/rootfs-stage31/module.conf.ubuntu3
l---------remote/rootfs/rootfs-stage32/data/etc/systemd/system/network.target.wants/ntpdate.service1
-rw-r--r--remote/rootfs/rootfs-stage32/data/etc/systemd/system/ntpdate.service9
-rwxr-xr-xremote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-load_gfx_driver2
-rwxr-xr-xremote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_network_time24
-rw-r--r--remote/rootfs/rootfs-stage32/module.conf1
-rw-r--r--remote/rootfs/rootfs-stage32/module.conf.centos1
-rw-r--r--remote/rootfs/rootfs-stage32/module.conf.debian1
-rw-r--r--remote/rootfs/rootfs-stage32/module.conf.fedora1
-rw-r--r--remote/rootfs/rootfs-stage32/module.conf.opensuse2
-rw-r--r--remote/rootfs/rootfs-stage32/module.conf.ubuntu1
20 files changed, 61 insertions, 49 deletions
diff --git a/remote/rootfs/rootfs-stage31/data/inc/activate_sysconfig b/remote/rootfs/rootfs-stage31/data/inc/activate_sysconfig
index e245371f..9837f150 100644
--- a/remote/rootfs/rootfs-stage31/data/inc/activate_sysconfig
+++ b/remote/rootfs/rootfs-stage31/data/inc/activate_sysconfig
@@ -24,9 +24,9 @@ fetch_sysconfig() {
# This function downloads the config.tgz and unpacks it to $TARGET_PATH <-- no it doesn't!
#
fetch_config_files() {
- [ -e "${CONFIG}.tgz" ] && echo "config.tgz already downloaded." && exit 0
+ [ -e "${CONFIG}.tgz" ] && echo "config.tgz already downloaded." && return 0
- download "${SLX_BASE_PATH}/config.tgz" "${CONFIG}.tgz" || return 1
+ download "${SLX_BASE_PATH}/config.tgz" "${CONFIG}.tgz"
}
@@ -81,6 +81,7 @@ HEREEND
[ $DEBUG -eq 0 ] && rm -f -- "${CONFIG}.tgz"
# Display branding logo if splash screen is shown
[ "x${MUTED_OUTPUT}" = "x1" ] && [ -e "${FUTURE_ROOT}/etc/branding.ppm" ] && fbsplash -s "${FUTURE_ROOT}/etc/branding.ppm" &
+ return 0
}
@@ -89,9 +90,9 @@ HEREEND
# MAIN PART
#
-fetch_sysconfig
-. "${CONFIG}-remote"
-fetch_config_files
-update_sysconfig
+fetch_sysconfig || drop_shell "Could not download remote config"
+. "${CONFIG}-remote" || drop_shell "Could not source remote config"
+fetch_config_files || drop_shell "Could not download config.tgz"
+update_sysconfig || drop_shell "Could not update sysconfig"
true
diff --git a/remote/rootfs/rootfs-stage31/data/inc/ntp_sync b/remote/rootfs/rootfs-stage31/data/inc/ntp_sync
new file mode 100755
index 00000000..940af366
--- /dev/null
+++ b/remote/rootfs/rootfs-stage31/data/inc/ntp_sync
@@ -0,0 +1,26 @@
+# Sync time via network
+
+func_sync_net_time() {
+ local SERVER
+ if [ -n "$SLX_NTP_SERVER" ]; then
+ for SERVER in $SLX_NTP_SERVER; do
+ if ntpdate -u -p 2 "$SERVER"; then
+ echo "Successfully queried $SERVER for time."
+ if [ "x$SLX_BIOS_CLOCK" = "xlocal" ]; then
+ usleep 100000
+ hwclock -l -w || echo "... but could not set BIOS clock to localtime"
+ elif [ "x$SLX_BIOS_CLOCK" = "xutc" ]; then
+ usleep 100000
+ hwclock -u -w || echo "... but could not set BIOS clock to UTC"
+ fi
+ break
+ fi
+ echo "Error querying $SERVER for current time."
+ done
+ fi
+}
+
+func_sync_net_time &
+
+true
+
diff --git a/remote/rootfs/rootfs-stage31/data/inc/parse_kcl b/remote/rootfs/rootfs-stage31/data/inc/parse_kcl
index 13f9c467..4a69ac25 100644
--- a/remote/rootfs/rootfs-stage31/data/inc/parse_kcl
+++ b/remote/rootfs/rootfs-stage31/data/inc/parse_kcl
@@ -22,7 +22,9 @@ read KCL < "/proc/cmdline"
for opts in ${KCL}; do
case "${opts}" in
debug=*)
- DEBUG=${opts#debug=} ;;
+ DEBUG=${opts#debug=}
+ DEBUG_SHELL=set
+ ;;
ip=*)
# process IP info
parse_ip ${opts#ip=} ;;
diff --git a/remote/rootfs/rootfs-stage31/data/init b/remote/rootfs/rootfs-stage31/data/init
index d881ad50..1537e012 100755
--- a/remote/rootfs/rootfs-stage31/data/init
+++ b/remote/rootfs/rootfs-stage31/data/init
@@ -80,6 +80,9 @@ bench_event "NETWORK" "Network up and running"
bench_event "CONFIG" "Downloaded config"
# From here on, we have all the vars from /opt/openslx/config
+# Sync time via NTP
+. "/inc/ntp_sync"
+
[ $DEBUG -ge 2 ] && drop_shell "Requested Debug Shell: after configuration/before stage32."
. "/inc/setup_stage32" || drop_shell "Problem setting up stage3.2"
@@ -103,6 +106,9 @@ fi
# one last debug shell if activated
[ $DEBUG -ge 1 ] && drop_shell "Requested Debug Shell: before switch_root."
+# Activate debug shell after switchroot?
+[ -n "$DEBUG_SHELL" ] && ln -s "../debug-shell.service" "${FUTURE_ROOT}/usr/lib/systemd/system/sysinit.target.wants/debug-shell.service"
+
# need /proc for this ;)
bench_event "PRESWITCH" "Switching to stage 3.2"
diff --git a/remote/rootfs/rootfs-stage31/module.build b/remote/rootfs/rootfs-stage31/module.build
index ad2eedca..cda5788a 100644
--- a/remote/rootfs/rootfs-stage31/module.build
+++ b/remote/rootfs/rootfs-stage31/module.build
@@ -14,7 +14,7 @@ build() {
done
mkdir -p "$MODULE_BUILD_DIR/lib"
- find /lib /lib64 /usr/lib /usr/lib64 \( -name "libnss_dns*" -o -name "libresolv*" \) >> "$COPYLIST"
+ find /lib /lib64 /usr/lib /usr/lib64 \( -name "libnss_dns*" -o -name "libresolv*" -o -name "libnss_files*" \) >> "$COPYLIST"
tarcopy "$(cat "$COPYLIST" | sort -u)" "$MODULE_BUILD_DIR"
diff --git a/remote/rootfs/rootfs-stage31/module.conf b/remote/rootfs/rootfs-stage31/module.conf
index 40a7bee6..b41b1f10 100644
--- a/remote/rootfs/rootfs-stage31/module.conf
+++ b/remote/rootfs/rootfs-stage31/module.conf
@@ -1,3 +1,6 @@
+REQUIRED_BINARIES="
+ ntpdate
+"
REQUIRED_MODULES="
busybox
kernel
@@ -56,6 +59,7 @@ REQUIRED_FIRMWARE="
intel/
"
REQUIRED_LIBRARIES="
+ libnss_files
libnss_dns
libresolv
"
diff --git a/remote/rootfs/rootfs-stage31/module.conf.centos b/remote/rootfs/rootfs-stage31/module.conf.centos
new file mode 100644
index 00000000..35c9927b
--- /dev/null
+++ b/remote/rootfs/rootfs-stage31/module.conf.centos
@@ -0,0 +1,3 @@
+REQUIRED_INSTALLED_PACKAGES="
+ ntpdate
+"
diff --git a/remote/rootfs/rootfs-stage31/module.conf.debian b/remote/rootfs/rootfs-stage31/module.conf.debian
new file mode 100644
index 00000000..35c9927b
--- /dev/null
+++ b/remote/rootfs/rootfs-stage31/module.conf.debian
@@ -0,0 +1,3 @@
+REQUIRED_INSTALLED_PACKAGES="
+ ntpdate
+"
diff --git a/remote/rootfs/rootfs-stage31/module.conf.fedora b/remote/rootfs/rootfs-stage31/module.conf.fedora
new file mode 100644
index 00000000..35c9927b
--- /dev/null
+++ b/remote/rootfs/rootfs-stage31/module.conf.fedora
@@ -0,0 +1,3 @@
+REQUIRED_INSTALLED_PACKAGES="
+ ntpdate
+"
diff --git a/remote/rootfs/rootfs-stage31/module.conf.ubuntu b/remote/rootfs/rootfs-stage31/module.conf.ubuntu
new file mode 100644
index 00000000..35c9927b
--- /dev/null
+++ b/remote/rootfs/rootfs-stage31/module.conf.ubuntu
@@ -0,0 +1,3 @@
+REQUIRED_INSTALLED_PACKAGES="
+ ntpdate
+"
diff --git a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/network.target.wants/ntpdate.service b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/network.target.wants/ntpdate.service
deleted file mode 120000
index f4b5e3f8..00000000
--- a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/network.target.wants/ntpdate.service
+++ /dev/null
@@ -1 +0,0 @@
-../ntpdate.service \ No newline at end of file
diff --git a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/ntpdate.service b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/ntpdate.service
deleted file mode 100644
index ebaa9afb..00000000
--- a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/ntpdate.service
+++ /dev/null
@@ -1,9 +0,0 @@
-[Unit]
-Description=Update date from local time server
-After=network.target
-Requires=network.target
-
-[Service]
-Type=oneshot
-RemainAfterExit=yes
-ExecStart=/opt/openslx/scripts/systemd-setup_network_time
diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-load_gfx_driver b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-load_gfx_driver
index 64955884..8cdf21fa 100755
--- a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-load_gfx_driver
+++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-load_gfx_driver
@@ -7,7 +7,7 @@ if ! lspci -n > "$PCIFILE"; then
exit 1
fi
-if grep -E ' (8086:0152|1002:6779)( |$)' "$PCIFILE" > /dev/null; then
+if grep -E ' (8086:0152|8086:0412|8086:0416|1002:6779)( |$)' "$PCIFILE" > /dev/null; then
echo "i915 - enable 3D"
echo -e "# Written by load-gfx-driver\nSLX_VMWARE_3D=yes" >> "/opt/openslx/config"
fi
diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_network_time b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_network_time
deleted file mode 100755
index 3ae84af5..00000000
--- a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_network_time
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/ash
-
-. /opt/openslx/config || { echo "Could not source config!"; exit 1; }
-
-[ -z "$SLX_NTP_SERVER" ] && exit 0
-
-for SERVER in $SLX_NTP_SERVER; do
- if ntpdate -u -p 2 "$SERVER"; then
- echo "Successfully queried $SERVER for time."
- if [ "x$SLX_BIOS_CLOCK" = "xlocal" ]; then
- usleep 100000
- /opt/openslx/sbin/hwclock -l -w || echo "... but could not set BIOS clock to localtime"
- elif [ "x$SLX_BIOS_CLOCK" = "xutc" ]; then
- usleep 100000
- /opt/openslx/sbin/hwclock -u -w || echo "... but could not set BIOS clock to UTC"
- fi
- exit 0
- fi
- echo "Error querying $SERVER for current time."
-done
-
-[ ! -z "$SLX_NTP_SERVER" ] && slxlog "ntpdate" "No NTP server was reachable. Please check SLX_NTP_SERVER in your config file." >&2
-exit 1
-
diff --git a/remote/rootfs/rootfs-stage32/module.conf b/remote/rootfs/rootfs-stage32/module.conf
index 3a671883..4bb758a7 100644
--- a/remote/rootfs/rootfs-stage32/module.conf
+++ b/remote/rootfs/rootfs-stage32/module.conf
@@ -29,7 +29,6 @@ REQUIRED_BINARIES="
dirname
mkdosfs
iptables
- ntpdate
rdns
find
rpcbind
diff --git a/remote/rootfs/rootfs-stage32/module.conf.centos b/remote/rootfs/rootfs-stage32/module.conf.centos
index da290670..b48da75e 100644
--- a/remote/rootfs/rootfs-stage32/module.conf.centos
+++ b/remote/rootfs/rootfs-stage32/module.conf.centos
@@ -1,5 +1,4 @@
REQUIRED_INSTALLED_PACKAGES="
- ntpdate
nfs-utils
xfsprogs
squashfs-tools
diff --git a/remote/rootfs/rootfs-stage32/module.conf.debian b/remote/rootfs/rootfs-stage32/module.conf.debian
index 900cd6e1..fbf489e7 100644
--- a/remote/rootfs/rootfs-stage32/module.conf.debian
+++ b/remote/rootfs/rootfs-stage32/module.conf.debian
@@ -3,7 +3,6 @@ REQUIRED_INSTALLED_PACKAGES="
squashfs-tools
whois
xfsprogs
- ntpdate
firmware-linux-free
curl
jfsutils
diff --git a/remote/rootfs/rootfs-stage32/module.conf.fedora b/remote/rootfs/rootfs-stage32/module.conf.fedora
index da290670..b48da75e 100644
--- a/remote/rootfs/rootfs-stage32/module.conf.fedora
+++ b/remote/rootfs/rootfs-stage32/module.conf.fedora
@@ -1,5 +1,4 @@
REQUIRED_INSTALLED_PACKAGES="
- ntpdate
nfs-utils
xfsprogs
squashfs-tools
diff --git a/remote/rootfs/rootfs-stage32/module.conf.opensuse b/remote/rootfs/rootfs-stage32/module.conf.opensuse
index 4b11529b..a9601b88 100644
--- a/remote/rootfs/rootfs-stage32/module.conf.opensuse
+++ b/remote/rootfs/rootfs-stage32/module.conf.opensuse
@@ -7,7 +7,7 @@ REQUIRED_INSTALLED_PACKAGES="
jfsutils
curl
"
-REQUIRED_CONTENT_PACKAGES="
+REQUIRED_CONTENT_PACKAGES="
timezone
libcap2
"
diff --git a/remote/rootfs/rootfs-stage32/module.conf.ubuntu b/remote/rootfs/rootfs-stage32/module.conf.ubuntu
index 1ba422d3..77c68cef 100644
--- a/remote/rootfs/rootfs-stage32/module.conf.ubuntu
+++ b/remote/rootfs/rootfs-stage32/module.conf.ubuntu
@@ -3,7 +3,6 @@ REQUIRED_INSTALLED_PACKAGES="
squashfs-tools
whois
xfsprogs
- ntpdate
curl
openssl
"