summaryrefslogtreecommitdiffstats
path: root/core/modules/safe-mode
diff options
context:
space:
mode:
authorSebastian2016-04-25 12:01:08 +0200
committerSebastian2016-04-25 12:01:08 +0200
commit5acda3eaeabae9045609539303a8c12c4ce401f1 (patch)
tree7e71975f8570b05aafe2ea6ec0e242a8912387bb /core/modules/safe-mode
parentinitial commit (diff)
downloadmltk-5acda3eaeabae9045609539303a8c12c4ce401f1.tar.gz
mltk-5acda3eaeabae9045609539303a8c12c4ce401f1.tar.xz
mltk-5acda3eaeabae9045609539303a8c12c4ce401f1.zip
merge with latest dev version
Diffstat (limited to 'core/modules/safe-mode')
-rw-r--r--core/modules/safe-mode/data/etc/systemd/system/exam.service7
-rwxr-xr-xcore/modules/safe-mode/data/opt/openslx/scripts/systemd-safe_mode24
-rw-r--r--core/modules/safe-mode/module.build12
-rw-r--r--core/modules/safe-mode/module.conf3
4 files changed, 46 insertions, 0 deletions
diff --git a/core/modules/safe-mode/data/etc/systemd/system/exam.service b/core/modules/safe-mode/data/etc/systemd/system/exam.service
new file mode 100644
index 00000000..be0809b4
--- /dev/null
+++ b/core/modules/safe-mode/data/etc/systemd/system/exam.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Sets up safe mode (no magic keys, no tty switch, no openbox menu)
+DefaultDependencies=no
+
+[Service]
+Type=oneshot
+ExecStart=/opt/openslx/scripts/systemd-safe_mode
diff --git a/core/modules/safe-mode/data/opt/openslx/scripts/systemd-safe_mode b/core/modules/safe-mode/data/opt/openslx/scripts/systemd-safe_mode
new file mode 100755
index 00000000..ebcee099
--- /dev/null
+++ b/core/modules/safe-mode/data/opt/openslx/scripts/systemd-safe_mode
@@ -0,0 +1,24 @@
+#!/bin/ash
+
+disable_tty_switch() {
+ cat <<EOF > /etc/X11/xorg.conf.d/50-no-tty.conf
+Section "ServerFlags"
+ Option "DontVTSwitch" "true"
+EndSection
+EOF
+}
+
+disable_openbox_menu() {
+ [ ! -e "/etc/xdg/openbox/rc.xml.safe" ] && \
+ echo "No rc.xml.safe template found." && return 1
+ cp "/etc/xdg/openbox/rc.xml" "/root/rc.xml.unsafe"
+ cp "/etc/xdg/openbox/rc.xml.safe" "/etc/xdg/openbox/rc.xml"
+}
+
+disable_magic_keys() {
+ echo 0 > /proc/sys/kernel/sysrq
+}
+
+disable_tty_switch
+disable_openbox_menu
+disable_magic_keys
diff --git a/core/modules/safe-mode/module.build b/core/modules/safe-mode/module.build
new file mode 100644
index 00000000..86b1fd00
--- /dev/null
+++ b/core/modules/safe-mode/module.build
@@ -0,0 +1,12 @@
+# fake module simply copying its data/ files
+fetch_source() {
+ :
+}
+
+build() {
+ :
+}
+
+post_copy() {
+ :
+}
diff --git a/core/modules/safe-mode/module.conf b/core/modules/safe-mode/module.conf
new file mode 100644
index 00000000..0cd03752
--- /dev/null
+++ b/core/modules/safe-mode/module.conf
@@ -0,0 +1,3 @@
+REQUIRED_BINARIES=""
+REQUIRED_LIBRARIES=""
+REQUIRED_DIRECTORIES=""