Mounthome: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
K (1 Version importiert: Import von michigreat.a.wiki-site.com) |
(SystemD hinzugefügt) |
||
Zeile 5: | Zeile 5: | ||
if [ -e /home/info.txt ] | if [ -e /home/info.txt ] | ||
then | then | ||
echo " | echo "Verschlüsselte Partition ist bereits eingebunden." | ||
sleep 1 | sleep 1 | ||
else | else | ||
Zeile 11: | Zeile 11: | ||
/bin/mount /dev/mapper/encimg /home | /bin/mount /dev/mapper/encimg /home | ||
/bin/df -h | grep "home" | /bin/df -h | grep "home" | ||
echo "Eingabetaste | echo "Eingabetaste drücken..." | ||
read | read | ||
fi | fi | ||
Zeile 17: | Zeile 17: | ||
chmod +x /usr/local/bin/mounthome | chmod +x /usr/local/bin/mounthome | ||
== XFCE in Xubuntu == | |||
Skript wird gestartet, wenn der Anmeldebildschirm erscheint. | |||
In /etc/lightdm/lightdm.conf.d/10-xubuntu.conf: | In /etc/lightdm/lightdm.conf.d/10-xubuntu.conf: | ||
greeter-setup-script=xterm -u8 -e /usr/local/bin/mounthome | greeter-setup-script=xterm -u8 -e /usr/local/bin/mounthome | ||
== SystemD beim Start == | |||
In /etc/systemd/system/mounthome.service: | |||
[Unit] | |||
Description=Mount LUKS encrypted home partition | |||
After=network.target | |||
Before=systemd-logind.service getty@tty1.service | |||
[Service] | |||
Type=oneshot | |||
TTYPath=/dev/tty13 | |||
ExecStartPre=/usr/bin/chvt 13 | |||
ExecStart=/usr/local/bin/mounthome | |||
ExecStartPost=/usr/bin/chvt 1 | |||
TimeoutStartSec=0 | |||
StandardInput=tty | |||
TTYVHangup=yes | |||
TTYVTDisallocate=yes | |||
[Install] | |||
WantedBy=default.target | |||
RequiredBy=systemd-logind.service getty@tty1.service | |||
Danach | |||
systemctl enable mounthome | |||
[https://www.golinuxcloud.com/read-user-input-during-boot-stage-linux/ Credits] |
Aktuelle Version vom 3. Oktober 2023, 05:45 Uhr
In /usr/local/bin/mounthome:
#!/bin/bash if [ -e /home/info.txt ] then echo "Verschlüsselte Partition ist bereits eingebunden." sleep 1 else /sbin/cryptsetup luksOpen /media/daten/images/eeehome encimg /bin/mount /dev/mapper/encimg /home /bin/df -h | grep "home" echo "Eingabetaste drücken..." read fi
chmod +x /usr/local/bin/mounthome
XFCE in Xubuntu
Skript wird gestartet, wenn der Anmeldebildschirm erscheint.
In /etc/lightdm/lightdm.conf.d/10-xubuntu.conf:
greeter-setup-script=xterm -u8 -e /usr/local/bin/mounthome
SystemD beim Start
In /etc/systemd/system/mounthome.service:
[Unit] Description=Mount LUKS encrypted home partition After=network.target Before=systemd-logind.service getty@tty1.service [Service] Type=oneshot TTYPath=/dev/tty13 ExecStartPre=/usr/bin/chvt 13 ExecStart=/usr/local/bin/mounthome ExecStartPost=/usr/bin/chvt 1 TimeoutStartSec=0 StandardInput=tty TTYVHangup=yes TTYVTDisallocate=yes [Install] WantedBy=default.target RequiredBy=systemd-logind.service getty@tty1.service
Danach
systemctl enable mounthome