about summary refs log tree commit diff
path: root/dracut
diff options
context:
space:
mode:
authorJuan RP <xtraeme@gmail.com>2014-05-23 11:30:24 +0200
committerJuan RP <xtraeme@gmail.com>2014-05-23 11:30:24 +0200
commit3b5b9cba6a69b191faccae4d8c798b5fc84dc704 (patch)
tree4e1478ff392a4917a2f9f81a6e41a7f369579ede /dracut
parent11e39d0fbc5de4c9ada783c34f9d02bee74d21d0 (diff)
downloadhrmpf-3b5b9cba6a69b191faccae4d8c798b5fc84dc704.tar.gz
hrmpf-3b5b9cba6a69b191faccae4d8c798b5fc84dc704.tar.xz
hrmpf-3b5b9cba6a69b191faccae4d8c798b5fc84dc704.zip
mklive: do not assume glibc and/or systemd (might use musl and runit instead :-).
Diffstat (limited to 'dracut')
-rw-r--r--dracut/adduser.sh14
-rw-r--r--dracut/locale.sh7
2 files changed, 14 insertions, 7 deletions
diff --git a/dracut/adduser.sh b/dracut/adduser.sh
index aaee9f3..246b20d 100644
--- a/dracut/adduser.sh
+++ b/dracut/adduser.sh
@@ -22,12 +22,14 @@ if [ -f ${NEWROOT}/etc/sudoers ]; then
 fi
 
 # Enable autologin for agetty(8).
-rm -f "${NEWROOT}/etc/systemd/system/getty.target.wants/getty@tty1.service"
-sed -e "s|/sbin/agetty --noclear|& -a ${USERNAME}|g" \
-    "${NEWROOT}/usr/lib/systemd/system/getty@.service" > \
-    "${NEWROOT}/etc/systemd/system/getty@.service"
-ln -sf /etc/systemd/system/getty@.service \
-    "${NEWROOT}/etc/systemd/system/getty.target.wants/getty@tty1.service"
+if [ -d ${NEWROOT}/etc/systemd/system ]; then
+    rm -f "${NEWROOT}/etc/systemd/system/getty.target.wants/getty@tty1.service"
+    sed -e "s|/sbin/agetty --noclear|& -a ${USERNAME}|g" \
+        "${NEWROOT}/usr/lib/systemd/system/getty@.service" > \
+        "${NEWROOT}/etc/systemd/system/getty@.service"
+    ln -sf /etc/systemd/system/getty@.service \
+        "${NEWROOT}/etc/systemd/system/getty.target.wants/getty@tty1.service"
+fi
 
 if [ -d ${NEWROOT}/etc/polkit-1 ]; then
     # If polkit is installed allow users in the wheel group to run anything.
diff --git a/dracut/locale.sh b/dracut/locale.sh
index bad138b..d7f5190 100644
--- a/dracut/locale.sh
+++ b/dracut/locale.sh
@@ -14,4 +14,9 @@ echo "LC_COLLATE=C" >> $NEWROOT/etc/locale.conf
 # set keymap too.
 KEYMAP=$(getarg vconsole.keymap)
 [ -z "$KEYMAP" ] && KEYMAP="us"
-sed -e "s,^KEYMAP=.*,KEYMAP=$KEYMAP," -i $NEWROOT/etc/vconsole.conf
+
+if [ -f ${NEWROOT}/etc/vconsole.conf ]; then
+    sed -e "s,^KEYMAP=.*,KEYMAP=$KEYMAP," -i $NEWROOT/etc/vconsole.conf
+elif [ -f ${NEWROOT}/etc/rc.conf ]; then
+    sed -e "s,^KEYMAP=.*,KEYMAP=$KEYMAP," -i $NEWROOT/etc/rc.conf.conf
+fi