summaryrefslogtreecommitdiffstats
path: root/remote
diff options
context:
space:
mode:
authorSimon Rettberg2014-02-24 19:05:15 +0100
committerSimon Rettberg2014-02-24 19:05:15 +0100
commit5bf2753b66b10658d00eee47a453ba839956f8f9 (patch)
treee6e8fcb5b4f386749187bfbcdebd9db8deab69d5 /remote
parentMerge branch 'master' of simonslx:openslx-ng/tm-scripts (diff)
downloadtm-scripts-5bf2753b66b10658d00eee47a453ba839956f8f9.tar.gz
tm-scripts-5bf2753b66b10658d00eee47a453ba839956f8f9.tar.xz
tm-scripts-5bf2753b66b10658d00eee47a453ba839956f8f9.zip
Integrate prop nvidia drivers into system
If we detect nvidia.ko was loaded in stage31, download nvidia libs via our slx-addon system. It is also ensured that kdm will not start before the nvidia libs have been downloaded and integrated into the running system. For that matter, it was ensured that slx addons are only downloaded when setup-partitions finished running, and a proper /tmp dir is available.
Diffstat (limited to 'remote')
-rw-r--r--remote/modules/kdm/data/etc/systemd/system/kdm.service2
-rwxr-xr-xremote/modules/nvidia_libs/data/addon-init12
l---------remote/rootfs/rootfs-stage32/data/etc/systemd/system/getty.target.wants/killsplash.service1
l---------remote/rootfs/rootfs-stage32/data/etc/systemd/system/graphical.target.wants/killsplash.service1
-rw-r--r--remote/rootfs/rootfs-stage32/data/etc/systemd/system/killsplash.service10
-rw-r--r--remote/rootfs/rootfs-stage32/data/etc/systemd/system/setup-slx-addon@.service2
-rw-r--r--remote/rootfs/rootfs-stage32/data/etc/systemd/system/tmp.target5
-rwxr-xr-xremote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-load_gfx_driver6
-rwxr-xr-xremote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons2
l---------remote/targets/nvidia_libs/nvidia_libs1
10 files changed, 40 insertions, 2 deletions
diff --git a/remote/modules/kdm/data/etc/systemd/system/kdm.service b/remote/modules/kdm/data/etc/systemd/system/kdm.service
index 93bc2dd8..e07ae6fc 100644
--- a/remote/modules/kdm/data/etc/systemd/system/kdm.service
+++ b/remote/modules/kdm/data/etc/systemd/system/kdm.service
@@ -1,7 +1,7 @@
[Unit]
Description=KDM Display Manager
Conflicts=getty@tty7.service
-After=systemd-user-sessions.service getty@tty7.service
+After=systemd-user-sessions.service getty@tty7.service setup-slx-addon@nvidia_libs.service
[Service]
ExecStart=/usr/bin/kdm -nodaemon
diff --git a/remote/modules/nvidia_libs/data/addon-init b/remote/modules/nvidia_libs/data/addon-init
new file mode 100755
index 00000000..7e263976
--- /dev/null
+++ b/remote/modules/nvidia_libs/data/addon-init
@@ -0,0 +1,12 @@
+#!/bin/ash
+
+[ -e "/opt/openslx/etc/nvidia.whiteout" ] || exit 66
+
+while read line; do
+ rm -f -- "$line"
+done < "/opt/openslx/etc/nvidia.whiteout"
+
+ldconfig || ldconfig.real
+
+exit 0
+
diff --git a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/getty.target.wants/killsplash.service b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/getty.target.wants/killsplash.service
new file mode 120000
index 00000000..40a962d5
--- /dev/null
+++ b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/getty.target.wants/killsplash.service
@@ -0,0 +1 @@
+../killsplash.service \ No newline at end of file
diff --git a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/graphical.target.wants/killsplash.service b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/graphical.target.wants/killsplash.service
new file mode 120000
index 00000000..40a962d5
--- /dev/null
+++ b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/graphical.target.wants/killsplash.service
@@ -0,0 +1 @@
+../killsplash.service \ No newline at end of file
diff --git a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/killsplash.service b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/killsplash.service
new file mode 100644
index 00000000..c3e088c8
--- /dev/null
+++ b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/killsplash.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Stop splash screen
+Before=getty.target graphical.target
+DefaultDependencies=no
+
+[Service]
+Type=oneshot
+ExecStart=-/opt/openslx/usr/bin/killall fbsplash
+ExecStart=/opt/openslx/bin/true
+RemainAfterExit=no
diff --git a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/setup-slx-addon@.service b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/setup-slx-addon@.service
index d7ec53c2..88f38dbb 100644
--- a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/setup-slx-addon@.service
+++ b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/setup-slx-addon@.service
@@ -1,6 +1,8 @@
[Unit]
Description=Setup SLX addon %i
DefaultDependencies=no
+Wants=tmp.target
+After=tmp.target
[Service]
Type=oneshot
diff --git a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/tmp.target b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/tmp.target
new file mode 100644
index 00000000..a8c3eab2
--- /dev/null
+++ b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/tmp.target
@@ -0,0 +1,5 @@
+[Unit]
+Description=/tmp has been mounted
+Wants=setup-partitions.service
+After=setup-partitions.service
+
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 04fbea6e..5f3a52fe 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
@@ -12,5 +12,11 @@ if grep -E ' 8086:0152( |$)' "$PCIFILE" > /dev/null; then
echo -e "# Written by load-gfx-driver\nSLX_VMWARE_3D=yes" >> "/opt/openslx/config"
fi
+if lsmod | grep -q '^nvidia\s'; then
+ # nvidia kernel module was loaded in stage31 - download libs
+ systemctl start setup-slx-addon@nvidia_libs &
+ echo -e "# Written by load-gfx-driver\nSLX_VMWARE_3D=yes" >> "/opt/openslx/config"
+fi
+
exit 0
diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons
index e4ecf9e7..e66e2e2c 100755
--- a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons
+++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons
@@ -71,7 +71,7 @@ if [ $# -eq 1 ]; then
# now append it to /
echo "Appending ${ADDON_MOUNT_POINT} to /"
- if ! mount -o "remount,ins:2:${ADDON_MOUNT_POINT}=rr" / ; then # ins:2 makes sure the addon is after tmpfs and stage32, but before stage4
+ if ! mount -o "remount,ins:1:${ADDON_MOUNT_POINT}=rr" / ; then # ins:2 makes sure the addon is after tmpfs and stage32, but before stage4
slxlog --echo "addon-aufs" "Failed to append ${ADDON_MOUNT_POINT} to the aufs. Cleaning up..."
umount -l ${ADDON_MOUNT_POINT} || echo "Could not unmount ${ADDON_MOUNT_POINT}!"
exit 1
diff --git a/remote/targets/nvidia_libs/nvidia_libs b/remote/targets/nvidia_libs/nvidia_libs
new file mode 120000
index 00000000..27f398eb
--- /dev/null
+++ b/remote/targets/nvidia_libs/nvidia_libs
@@ -0,0 +1 @@
+../../modules/nvidia_libs \ No newline at end of file