diff options
author | Simon Rettberg | 2020-08-03 18:04:59 +0200 |
---|---|---|
committer | Your Name | 2020-08-03 18:04:59 +0200 |
commit | a069ecafe76710cdc758f5c79a7c000bfe3a7e76 (patch) | |
tree | bc8de78515c7b5d0c24ffc3e7e216e5d846082bb /core/modules/systemd-distro | |
parent | [rfs-stage31] Fix hostname lookup for newer busybox nslookup (diff) | |
download | mltk-a069ecafe76710cdc758f5c79a7c000bfe3a7e76.tar.gz mltk-a069ecafe76710cdc758f5c79a7c000bfe3a7e76.tar.xz mltk-a069ecafe76710cdc758f5c79a7c000bfe3a7e76.zip |
[systemd-distro] Get this module into working state, switch
Diffstat (limited to 'core/modules/systemd-distro')
9 files changed, 128 insertions, 2 deletions
diff --git a/core/modules/systemd-distro/data/etc/systemd/system/debug-shell.service b/core/modules/systemd-distro/data/etc/systemd/system/debug-shell.service new file mode 100644 index 00000000..4220d7c2 --- /dev/null +++ b/core/modules/systemd-distro/data/etc/systemd/system/debug-shell.service @@ -0,0 +1,33 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Early root shell on /dev/tty9 FOR DEBUGGING ONLY +Documentation=man:sushell(8) +DefaultDependencies=no +IgnoreOnIsolate=yes + +[Service] +Environment=TERM=linux +ExecStart=/bin/ash +Restart=always +RestartSec=0 +StandardInput=tty +TTYPath=/dev/tty9 +TTYReset=yes +TTYVHangup=yes +KillMode=process +IgnoreSIGPIPE=no +# bash ignores SIGTERM +KillSignal=SIGHUP + +# Unset locale for the console getty since the console has problems +# displaying some internationalized messages. +Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION= + +[Install] +WantedBy=sysinit.target diff --git a/core/modules/systemd-distro/data/etc/systemd/system/getty.target.wants/getty@tty1.service b/core/modules/systemd-distro/data/etc/systemd/system/getty.target.wants/getty@tty1.service new file mode 120000 index 00000000..e231dae8 --- /dev/null +++ b/core/modules/systemd-distro/data/etc/systemd/system/getty.target.wants/getty@tty1.service @@ -0,0 +1 @@ +../getty@tty1.service
\ No newline at end of file diff --git a/core/modules/systemd-distro/data/etc/systemd/system/getty@.service b/core/modules/systemd-distro/data/etc/systemd/system/getty@.service new file mode 100644 index 00000000..5c1d1666 --- /dev/null +++ b/core/modules/systemd-distro/data/etc/systemd/system/getty@.service @@ -0,0 +1,50 @@ +# This file is part of systemd. +# Patched for OpenSLX +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Getty on %I +Documentation=man:agetty(8) man:systemd-getty-generator(8) +Documentation=http://0pointer.de/blog/projects/serial-console.html +After=systemd-user-sessions.service +After=rc-local.service + +# If additional gettys are spawned during boot then we should make +# sure that this is synchronized before getty.target, even though +# getty.target didn't actually pull it in. +Before=getty.target +IgnoreOnIsolate=yes + +# On systems without virtual consoles, don't start any getty. (Note +# that serial gettys are covered by serial-getty@.service, not this +# unit +ConditionPathExists=/dev/tty0 + +[Service] +ExecStartPre=-/opt/openslx/bin/killall fbsplash +ExecStartPre=-/opt/openslx/scripts/tty-init %I +# the VT is cleared by TTYVTDisallocate +ExecStart=-/sbin/agetty %I 38400 linux +Type=idle +Restart=always +RestartSec=0 +UtmpIdentifier=%I +TTYPath=/dev/%I +TTYReset=yes +TTYVHangup=yes +TTYVTDisallocate=no +KillMode=process +IgnoreSIGPIPE=no + +# Unset locale for the console getty since the console has problems +# displaying some internationalized messages. +Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION= + +# Some login implementations ignore SIGTERM, so we send SIGHUP +# instead, to ensure that login terminates cleanly. +KillSignal=SIGHUP + diff --git a/core/modules/systemd-distro/data/etc/systemd/system/network-interface@.service b/core/modules/systemd-distro/data/etc/systemd/system/network-interface@.service new file mode 100644 index 00000000..c566eda1 --- /dev/null +++ b/core/modules/systemd-distro/data/etc/systemd/system/network-interface@.service @@ -0,0 +1,9 @@ +[Unit] +Description=Brings interface %i up +Wants=dhcpc@%i.service +Before=dhcpc@%i.service + +[Service] +Type=oneshot +ExecStart=/opt/openslx/sbin/ip link set dev %i up + diff --git a/core/modules/systemd-distro/data/etc/udev/rules.d/99-openslx-net.rules b/core/modules/systemd-distro/data/etc/udev/rules.d/99-openslx-net.rules new file mode 100644 index 00000000..07a4fbd5 --- /dev/null +++ b/core/modules/systemd-distro/data/etc/udev/rules.d/99-openslx-net.rules @@ -0,0 +1 @@ +ACTION=="add", TAG!="openslxignore", SUBSYSTEM=="net", KERNEL=="br0|eth*", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/sys/subsystem/net/devices/$name", ENV{SYSTEMD_WANTS}="network-interface@$name.service" diff --git a/core/modules/systemd-distro/data/opt/openslx/scripts/tty-init b/core/modules/systemd-distro/data/opt/openslx/scripts/tty-init new file mode 100755 index 00000000..a157854d --- /dev/null +++ b/core/modules/systemd-distro/data/opt/openslx/scripts/tty-init @@ -0,0 +1,23 @@ +#!/bin/ash + +[ -c "/dev/$1" ] || exit 0 + +exec > "/dev/$1" +echo -en "\e]P0232323" #black +echo -en "\e]P82B2B2B" #darkgrey +echo -en "\e]P1D75F5F" #darkred +echo -en "\e]P9E33636" #red +echo -en "\e]P287AF5F" #darkgreen +echo -en "\e]PA98E34D" #green +echo -en "\e]P3D7AF87" #brown +echo -en "\e]PBFFD75F" #yellow +echo -en "\e]P48787AF" #darkblue +echo -en "\e]PC7373C9" #blue +echo -en "\e]P5BD53A5" #darkmagenta +echo -en "\e]PDD633B2" #magenta +echo -en "\e]P65FAFAF" #darkcyan +echo -en "\e]PE44C9C9" #cyan +echo -en "\e]P7E5E5E5" #lightgrey +echo -en "\e]PFFFFFFF" #white +echo -en '\033c' #clear + diff --git a/core/modules/systemd-distro/module.build b/core/modules/systemd-distro/module.build index 0745ad3c..5c2dd958 100644 --- a/core/modules/systemd-distro/module.build +++ b/core/modules/systemd-distro/module.build @@ -15,6 +15,9 @@ build () { } post_copy() { - : + [ -d "${TARGET_BUILD_DIR}/usr/lib/systemd/system" ] \ + && ! [ -L "${TARGET_BUILD_DIR}/usr/lib/systemd/system" ] \ + && perror "/usr/lib/systemd/system must not exist in target build dir" + ln -nfs "../../../lib/systemd/system" "${TARGET_BUILD_DIR}/usr/lib/systemd/system" } diff --git a/core/modules/systemd-distro/module.conf.centos b/core/modules/systemd-distro/module.conf.centos index fad96b29..68fc6209 100644 --- a/core/modules/systemd-distro/module.conf.centos +++ b/core/modules/systemd-distro/module.conf.centos @@ -4,5 +4,5 @@ REQUIRED_CONTENT_PACKAGES=" systemd-libs " REQUIRED_SYSTEM_FILES+=" - /usr/lib/systemd/system + /lib/systemd/system " diff --git a/core/modules/systemd-distro/module.conf.ubuntu b/core/modules/systemd-distro/module.conf.ubuntu index 04752c0b..2dbd4e5f 100644 --- a/core/modules/systemd-distro/module.conf.ubuntu +++ b/core/modules/systemd-distro/module.conf.ubuntu @@ -11,3 +11,9 @@ REQUIRED_INSTALLED_PACKAGES=" libacl1-dev libpam-dev " + +REQUIRED_CONTENT_PACKAGES=" + systemd + libpam-systemd + udev +" |