summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--remote/modules/busybox/openslx-busybox-config2
-rwxr-xr-xremote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats2
-rwxr-xr-xremote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script13
-rwxr-xr-xremote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action77
-rwxr-xr-xremote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_poweroff6
-rwxr-xr-xremote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_reboot6
-rw-r--r--remote/modules/kdm-theme-bwlp/data/etc/kde4/kdm/kdmrc4
-rw-r--r--remote/modules/kdm/data/etc/kde4/kdm/kdmrc4
-rwxr-xr-xremote/modules/run-virt/data/opt/openslx/scripts/systemd-mount_vm_store2
-rwxr-xr-xremote/modules/vmchooser2/data/opt/openslx/bin/vmchooser14
-rw-r--r--remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc10
-rw-r--r--remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware.inc66
-rw-r--r--remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware_legacy.inc1
-rw-r--r--remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include36
-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
34 files changed, 184 insertions, 169 deletions
diff --git a/remote/modules/busybox/openslx-busybox-config b/remote/modules/busybox/openslx-busybox-config
index ee5e99ee..00a008d7 100644
--- a/remote/modules/busybox/openslx-busybox-config
+++ b/remote/modules/busybox/openslx-busybox-config
@@ -39,7 +39,7 @@ CONFIG_LAST_SUPPORTED_WCHAR=767
CONFIG_LONG_OPTS=y
CONFIG_FEATURE_DEVPTS=y
# CONFIG_FEATURE_CLEAN_UP is not set
-# CONFIG_FEATURE_UTMP is not set
+CONFIG_FEATURE_UTMP=y
# CONFIG_FEATURE_WTMP is not set
CONFIG_FEATURE_PIDFILE=y
CONFIG_PID_FILE_PATH="/var/run"
diff --git a/remote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats b/remote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats
index 6c0b667b..ce910a2b 100755
--- a/remote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats
+++ b/remote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats
@@ -198,6 +198,8 @@ for DELAY in 1 1 0; do
${START}-59/5 * * * * root /opt/openslx/scripts/cron-system_usage_update
EOF
+ touch "/etc/cron.d" # Sometimes, aufs doesn't update the mtime of dirs when creating files,
+ # so cron would not rescan the cron directory
exit 0
fi
sleep "$DELAY"
diff --git a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script b/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script
index 9a9bdf1c..b7617940 100755
--- a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script
+++ b/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script
@@ -29,7 +29,7 @@ if [ -n "${SLX_LOGOUT_TIMEOUT}" ] && [ "${SLX_LOGOUT_TIMEOUT}" -gt 0 ]; then
if [ -n "$DISPLAY" ]; then
# Seems to be x11
IDLE=
- export XAUTHORITY=$(ps a | grep -v grep | grep -o -- '-auth.*$' | awk '{print $2}')
+ export XAUTHORITY=$(ps a | grep " $DISPLAY " | grep -o -- '-auth.*$' | grep -m1 -v grep | awk '{print $2}')
[ -n "$XAUTHORITY" ] && [ -f "$XAUTHORITY" ] && IDLE=$(xprintidle)
# Now that we have DISPLAY and XAUTHORITY set, xprintidle should work
if [ -z "$IDLE" ]; then
@@ -95,7 +95,7 @@ if [ -n "${SLX_SHUTDOWN_TIMEOUT}" ] && [ "${SLX_SHUTDOWN_TIMEOUT}" -gt 0 ] && [
[ "$IDLE" -gt "$NOW" ] && IDLE="$NOW"
IDLE=$(( $NOW - $IDLE ))
if [ "$IDLE" -gt "$SLX_SHUTDOWN_TIMEOUT" ]; then
- poweroff -nf # TODO: Do proper shutdown once it works reliably
+ poweroff
fi
fi
@@ -122,7 +122,7 @@ if [ -n "$SLX_SHUTDOWN_SCHEDULE" -o -n "$SLX_REBOOT_SCHEDULE" ] && [ ! -e "$CRON
[ -z "$HOUR$MINUTE" ] && invalid_time && continue
[ "$HOUR" -lt 0 -o "$HOUR" -gt 23 ] && invalid_time && continue
[ "$MINUTE" -lt 0 -o "$MINUTE" -gt 59 ] && invalid_time && continue
- echo "$MINUTE $HOUR * * * root /opt/openslx/scripts/idleaction-scheduled_poweroff" >> "$CRONFILE"
+ echo "$MINUTE $HOUR * * * root /opt/openslx/scripts/idleaction-scheduled_action poweroff" >> "$CRONFILE"
done
# do it again for SLX_REBOOT_SCHEDULE
for time in $SLX_REBOOT_SCHEDULE; do
@@ -131,11 +131,8 @@ if [ -n "$SLX_SHUTDOWN_SCHEDULE" -o -n "$SLX_REBOOT_SCHEDULE" ] && [ ! -e "$CRON
[ -z "$HOUR$MINUTE" ] && invalid_time && continue
[ "$HOUR" -lt 0 -o "$HOUR" -gt 23 ] && invalid_time && continue
[ "$MINUTE" -lt 0 -o "$MINUTE" -gt 59 ] && invalid_time && continue
- echo "$MINUTE $HOUR * * * root /opt/openslx/scripts/idleaction-scheduled_reboot" >> "$CRONFILE"
+ echo "$MINUTE $HOUR * * * root /opt/openslx/scripts/idleaction-scheduled_action reboot" >> "$CRONFILE"
done
- (
- sleep 20
- systemctl restart cron
- ) &
+ touch "/etc/cron.d" # Aufs bug where it won't update dir mtime when creating the file within
fi
diff --git a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action b/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action
new file mode 100755
index 00000000..6ef6969c
--- /dev/null
+++ b/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action
@@ -0,0 +1,77 @@
+#!/bin/ash
+
+if [ "$(whoami)" != "root" ]; then
+ echo "Only root can call this"
+ exit 1
+fi
+
+if [ $# -ne 1 ]; then
+ echo "$0 <reboot|poweroff>"
+ exit 1
+fi
+
+MODE=$1
+
+if [ "$MODE" != "reboot" ] && [ "$MODE" != "poweroff" ]; then
+ slxlog "idleaction-failed-call" "Invalid call to idleaction-scheduled_action. Mode '$MODE' unknown."
+ exit 1
+fi
+
+NUM=$(who | wc -l)
+[ "$NUM" = "0" ] && $MODE # Easy way out - machine is idle
+
+# Someone logged in
+for MINUTES in 5 X X X X X X X 3 X X X 2 X X X 1 X X X; do
+ NUM=$(who | wc -l)
+ [ "$NUM" = "0" ] && break
+ if [ "$MINUTES" != "X" ]; then
+ USERS=0
+ if [ "$MODE" = "reboot" ]; then
+ MESSAGE="Das System wird in $MINUTES Minute(n) neugestartet, bitte beenden Sie Ihre Sitzung.
+The system will reboot in $MINUTES minute(s). Please save your work and end the session."
+ else
+ MESSAGE="Dieser Rechner wird in $MINUTES Minute(n) abgeschaltet, bitte beenden Sie Ihre Sitzung.
+The system will power off in $MINUTES minute(s). Please save your work and end the session."
+ fi
+ for d in $(who | awk '{print $2}' | sort -u); do
+ if [ "${d:0:1}" = ":" ]; then
+ # X11
+ export DISPLAY=$d
+ export XAUTHORITY=$(ps a | grep " $DISPLAY " | grep -o -- '-auth.*$' | grep -m1 -v grep | awk '{print $2}')
+ # TODO: Don't look... We need to pick a proper util for this
+ /opt/openslx/cups/printergui --error "$MESSAGE" &
+ unset DISPLAY XAUTHORITY
+ USERS=$(( $USERS + 1 ))
+ elif [ "${d:0:3}" = "tty" ]; then
+ # Regular tty
+ cat > "/dev/$d" <<-EOF
+ *
+ ***************************
+ $MESSAGE
+ ***************************
+ *
+ EOF
+ USERS=$(( $USERS + 1 ))
+ elif [ "${d:0:3}" = "pts" ]; then
+ # pts - xterm or ssh session
+ cat > "/dev/pts/${d:3}" <<-EOF
+ *
+ ***************************
+ $MESSAGE
+ ***************************
+ *
+ EOF
+ USERS=$(( $USERS + 1 ))
+ fi
+ done
+ FILE=$(mktemp)
+ who > "$FILE"
+ slxlog "idleaction-busy" "Postponed $MODE ($MINUTES minutes max.) - $USERS user(s) still active"
+ sleep 1
+ rm -- "$FILE"
+ fi
+ sleep 15
+done
+
+$MODE
+
diff --git a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_poweroff b/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_poweroff
deleted file mode 100755
index 5b5acda2..00000000
--- a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_poweroff
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/ash
-
-# TODO: Warn user, wait 5 minutes, etc...
-
-poweroff -nf
-
diff --git a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_reboot b/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_reboot
deleted file mode 100755
index fa3adf65..00000000
--- a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_reboot
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/ash
-
-# TODO: Warn user, wait 5 minutes, etc...
-
-echo 'b' > /proc/sysrq-trigger
-
diff --git a/remote/modules/kdm-theme-bwlp/data/etc/kde4/kdm/kdmrc b/remote/modules/kdm-theme-bwlp/data/etc/kde4/kdm/kdmrc
index 0b283d2a..e1f9f357 100644
--- a/remote/modules/kdm-theme-bwlp/data/etc/kde4/kdm/kdmrc
+++ b/remote/modules/kdm-theme-bwlp/data/etc/kde4/kdm/kdmrc
@@ -46,8 +46,8 @@ Startup=/etc/X11/Xstartup
[Shutdown]
AllowFifo=false
-HaltCmd=/usr/bin/systemctl -ff poweroff
-RebootCmd=/usr/bin/systemctl -ff reboot
+HaltCmd=/usr/bin/systemctl poweroff
+RebootCmd=/usr/bin/systemctl reboot
[Xdmcp]
Enable=false
diff --git a/remote/modules/kdm/data/etc/kde4/kdm/kdmrc b/remote/modules/kdm/data/etc/kde4/kdm/kdmrc
index f7e7be86..5f9f9e39 100644
--- a/remote/modules/kdm/data/etc/kde4/kdm/kdmrc
+++ b/remote/modules/kdm/data/etc/kde4/kdm/kdmrc
@@ -44,8 +44,8 @@ Startup=/etc/X11/Xstartup
[Shutdown]
AllowFifo=false
-HaltCmd=/usr/bin/systemctl -ff poweroff
-RebootCmd=/usr/bin/systemctl -ff reboot
+HaltCmd=/usr/bin/systemctl poweroff
+RebootCmd=/usr/bin/systemctl reboot
[Xdmcp]
Enable=false
diff --git a/remote/modules/run-virt/data/opt/openslx/scripts/systemd-mount_vm_store b/remote/modules/run-virt/data/opt/openslx/scripts/systemd-mount_vm_store
index 4559e1e3..9d478918 100755
--- a/remote/modules/run-virt/data/opt/openslx/scripts/systemd-mount_vm_store
+++ b/remote/modules/run-virt/data/opt/openslx/scripts/systemd-mount_vm_store
@@ -2,7 +2,7 @@
. /opt/openslx/config || exit 1
-[ -z "$SLX_VM_NFS" ] && slxlog "mount-vmstore-missing" "No SLX_VM_NFS given in /opt/openslx/config!" && exit 1
+[ -z "$SLX_VM_NFS" ] && exit 0
# create target directory
mkdir -p /mnt/vmstore
diff --git a/remote/modules/vmchooser2/data/opt/openslx/bin/vmchooser b/remote/modules/vmchooser2/data/opt/openslx/bin/vmchooser
index 4f30f447..a99207ff 100755
--- a/remote/modules/vmchooser2/data/opt/openslx/bin/vmchooser
+++ b/remote/modules/vmchooser2/data/opt/openslx/bin/vmchooser
@@ -16,7 +16,7 @@ else
fi
MEM=$(grep -m1 '^MemTotal:' /proc/meminfo | awk '{print $2}')
-if [ -n "$SLX_VMCHOOSER_TAB" ] && [ "$SLX_VMCHOOSER_TAB" -ge 0 -a "$SLX_VMCHOOSER_TAB" -le 2 ]; then
+if [ -n "$SLX_VMCHOOSER_TAB" ] && [ "$SLX_VMCHOOSER_TAB" -ge 0 -a "$SLX_VMCHOOSER_TAB" -le 2 ] 2>/dev/null; then
TAB="$SLX_VMCHOOSER_TAB"
elif [ "$MEM" -lt 3000000 ]; then # Check RAM size; if it's not that much, default to the native linux sessions
TAB=0
@@ -24,9 +24,13 @@ else
TAB=2
fi
-if [ -n "$SLX_VM_POOL_FILTER" ]; then
- exec vmchooser.real "$@" --url "$URL" --pool "$SLX_VM_POOL_FILTER" --fullscreen --tab "$TAB"
-else
- exec vmchooser.real "$@" --url "$URL" --fullscreen --tab "$TAB"
+EXTRA=
+[ -n "$SLX_VMCHOOSER_TEMPLATES" ] && EXTRA="$EXTRA --template-mode $SLX_VMCHOOSER_TEMPLATES"
+[ -n "$SLX_VMCHOOSER_FORLOCATION" ] && EXTRA="$EXTRA --location-mode $SLX_VMCHOOSER_FORLOCATION"
+
+if [ -z "$SLX_LOCATIONS" ]; then
+ exec vmchooser.real "$@" --url "$URL" --fullscreen --tab "$TAB" $EXTRA
fi
+exec vmchooser.real "$@" --url "$URL" --fullscreen --tab "$TAB" --locations "$SLX_LOCATIONS" $EXTRA
+
diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc
index f8f43ad3..092abce5 100644
--- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc
+++ b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc
@@ -99,11 +99,15 @@ HEREEND
# Serial, parallel: Empty, nothing is being currently set. TODO later.
-# Graphics, GPU: 3D will be activated if FORCE3D is set.
-# Force3D is set in set_hardware.inc if SLX_VMWARE_3D is set in config.
-if [ -n "$FORCE3D" ]; then
+# Graphics, GPU: 3D will be enabled (even if vmware doesn't support the chip) if we whitelisted it.
+if [ -n "$SLX_VMWARE_3D" ]; then
writelog "FORCE3D set - overriding 3D in vmx file."
echo 'mks.gl.allowBlacklistedDrivers = "TRUE"' >> "$TMPDIR/$IMGUUID"
+ # We override... play safe and cap the hwVersion to 10, since some i915 chips goofed up with 12
+ # Investigate if we might have to do this in other cases where we don't override
+ if grep -qi '^mks.enable3d.*true' "$TMPDIR/$IMGUUID"; then
+ vmw_cap_hw_version "10"
+ fi
else
writelog "FORCE3D not set - 3D will only work if GPU/driver is whitelisted by vmware."
fi
diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware.inc b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware.inc
deleted file mode 100644
index a94f5b26..00000000
--- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware.inc
+++ /dev/null
@@ -1,66 +0,0 @@
-#########################################
-# Include: Hardware checks and settings #
-#########################################
-
-# check for 3D configuration setting
-case "$enable3d" in
- true|yes)
- enable3d="TRUE"
- ;;
- *)
- enable3d="FALSE"
- ;;
-esac
-
-# set standard sound card, overwrite depending on OS (options sb16, es1371, hdaudio)
-sound="es1371"
-
-# set sound card explicitly if there is more than one card in the host system
-sound_fileName='sound.fileName = "-1"
-sound.autodetect = "TRUE"'
-
-# check for whitelisted HW-3D
-source /opt/openslx/config
-FORCE3D=""
-if [ -n "$SLX_VMWARE_3D" ]; then
- FORCE3D='mks.gl.allowBlacklistedDrivers = "TRUE"'
-fi
-
-# read only the first 30 lines to be sure
-imghead=$(head -n 30 "${diskfile}")
-hwver=$(echo "${imghead}" | grep -m1 -ia "ddb.virtualHWVersion" | awk -F '"' '{print $2}')
-
-
-if [ -z "$override_hddtype" ]; then
- hddrv=$(echo "${imghead}" | grep -m1 -ia "ddb.adapterType" | awk -F '"' '{print $2}')
-else
- hddrv=$override_hddtype
-fi
-
-PCIE=
-case "${hddrv}" in
- ide)
- ide="TRUE"
- scsi="FALSE"
- ;;
- lsisas*)
- ide="FALSE"
- scsi="TRUE"
- PCIE='pciBridge4.present = "TRUE"
- pciBridge4.virtualDev = "pcieRootPort"
- pciBridge4.functions = "8"'
- ;;
- lsilogic|buslogic)
- ide="FALSE"
- scsi="TRUE"
- ;;
- scsi)
- ide="FALSE"
- scsi="TRUE"
- hddrv="lsilogic"
- ;;
- *)
- slxlog "virt-vmware-hdd" "vmware: Unknown HDD adapter type $hddrv"
- ;;
-esac
-
diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware_legacy.inc b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware_legacy.inc
index 899f5aea..22718839 100644
--- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware_legacy.inc
+++ b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware_legacy.inc
@@ -43,7 +43,6 @@ case "$enable3d" in
esac
# check for whitelisted HW-3D
-source /opt/openslx/config
FORCE3D=""
if [ -n "$SLX_VMWARE_3D" ]; then
FORCE3D='mks.gl.allowBlacklistedDrivers = "TRUE"'
diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include
index f63092bd..5c76a180 100644
--- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include
+++ b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include
@@ -22,43 +22,41 @@
VMWAREINCLUDEDIR=/opt/openslx/vmchooser/vmware/includes
vmostype=$(rv_clean_string "$vmostype")
+# declaration of default variables for vmware
+source "${VMWAREINCLUDEDIR}/set_vmware_include_variables.inc" && set_vmware_include_variables
+# General global openslx config
+source /opt/openslx/config
+
+# TODO: Where to put global helper functions that could be used in several units below?
+vmw_cap_hw_version() {
+ [ -z "$1" ] && writelog "cap_hw_version called without parameter!" && return 1
+ [ "$1" -lt "$maxhardwareversion" ] && maxhardwareversion="$1"
+}
+
if [ "$LEGACY" ]; then
- # declaration of default variables for vmware
- source "${VMWAREINCLUDEDIR}/set_vmware_include_variables.inc" && set_vmware_include_variables
# hardware checks
- # sources /opt/openslx/config to check for whitelisted HW-3D
source "${VMWAREINCLUDEDIR}/set_hardware_legacy.inc" && set_hardware_legacy
# write configuration files
# write_config_files calls:
# set_vmhome_preferences_header
# set_vmware_startup_file
source "${VMWAREINCLUDEDIR}/write_config_files_legacy.inc" && write_config_files_legacy
- # logging and stdout
- # needs writelog() from vmchooser-run_virt
- source "${VMWAREINCLUDEDIR}/logging.inc" && logging
else
- # declaration of default variables for vmware
- source "${VMWAREINCLUDEDIR}/set_vmware_include_variables.inc" && set_vmware_include_variables
-
- # hardware checks: sources /opt/openslx/config to check for whitelisted HW-3D
- source "${VMWAREINCLUDEDIR}/set_hardware.inc"
-
# write configuration files
source "${VMWAREINCLUDEDIR}/write_config_files.inc"
# parse the given vmx file
source "${VMWAREINCLUDEDIR}/parse_vmx.inc"
+fi
- # logging and stdout
- # needs writelog() from vmchooser-run_virt
- source "${VMWAREINCLUDEDIR}/logging.inc" && logging
-
-fi
-
-# $maxhardwareversion
+# logging and stdout
+# needs writelog() from vmchooser-run_virt
+source "${VMWAREINCLUDEDIR}/logging.inc" && logging
+# Apply $maxhardwareversion to final VMX
HWVER=$(grep -i '^virtualHW.version *= *' "$conffile" | head -n 1 | awk -F '=' '{print $2}' | sed -r 's/[^0-9]//g')
if [ -n "$HWVER" ] && [ "$HWVER" -gt "$maxhardwareversion" ]; then
+ writelog "Hardware version capped to $maxhardwareversion (was $HWVER)"
sed -i 's/^virtualHW\.version.*$/virtualHW.version = "'$maxhardwareversion'"/I' "$conffile"
fi
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
"