about summary refs log tree commit diff
path: root/dracut
diff options
context:
space:
mode:
authorJuan RP <xtraeme@gmail.com>2014-05-23 15:05:31 +0200
committerJuan RP <xtraeme@gmail.com>2014-05-23 15:05:31 +0200
commit07ce345ba6c6331b0d4edb9133509d43bfe51aad (patch)
treeae25f82a5a33b6412e87147212f4283ff162ad13 /dracut
parent3b5b9cba6a69b191faccae4d8c798b5fc84dc704 (diff)
downloadhrmpf-07ce345ba6c6331b0d4edb9133509d43bfe51aad.tar.gz
hrmpf-07ce345ba6c6331b0d4edb9133509d43bfe51aad.tar.xz
hrmpf-07ce345ba6c6331b0d4edb9133509d43bfe51aad.zip
mklive: misc tweaks to generate a proper image with runit.
Diffstat (limited to 'dracut')
-rw-r--r--dracut/adduser.sh16
-rw-r--r--dracut/locale.sh2
2 files changed, 14 insertions, 4 deletions
diff --git a/dracut/adduser.sh b/dracut/adduser.sh
index 246b20d..4b7acb3 100644
--- a/dracut/adduser.sh
+++ b/dracut/adduser.sh
@@ -4,6 +4,8 @@
 
 type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 
+echo void-live > ${NEWROOT}/etc/hostname
+
 USERNAME=$(getarg live.user)
 [ -z "$USERNAME" ] && USERNAME=anon
 
@@ -12,16 +14,24 @@ echo "USERNAME=$USERNAME" >> ${NEWROOT}/etc/default/live.conf
 chmod 644 ${NEWROOT}/etc/default/live.conf
 
 # Create new user and remove password. We'll use autologin by default.
-chroot ${NEWROOT} useradd -c $USERNAME -m $USERNAME -G \
-    systemd-journal,wheel -s /bin/bash
+chroot ${NEWROOT} useradd -c $USERNAME -m $USERNAME -G systemd-journal,wheel -s /bin/bash
 chroot ${NEWROOT} passwd -d $USERNAME >/dev/null 2>&1
 
+# Setup default root password (voidlinux).
+chroot ${NEWROOT} sh -c 'echo "root:voidlinux" | chpasswd -c SHA512'
+
 # Enable sudo permission by default.
 if [ -f ${NEWROOT}/etc/sudoers ]; then
     echo "${USERNAME}  ALL=(ALL) NOPASSWD: ALL" >> ${NEWROOT}/etc/sudoers
 fi
 
-# Enable autologin for agetty(8).
+# Enable autologin for agetty(8) on tty1 and disable pam_systemd.
+if [ -d ${NEWROOT}/etc/runit ]; then
+    sed -e "s|\-8|& -a $USERNAME|g" -i ${NEWROOT}/etc/sv/agetty-tty1/run
+    sed -e '/systemd/d' -i ${NEWROOT}/etc/pam.d/*
+fi
+
+# Enable autologin for agetty(8) on tty1 with systemd.
 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" \
diff --git a/dracut/locale.sh b/dracut/locale.sh
index d7f5190..4ba1dd2 100644
--- a/dracut/locale.sh
+++ b/dracut/locale.sh
@@ -18,5 +18,5 @@ KEYMAP=$(getarg vconsole.keymap)
 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
+    sed -e "s,^#KEYMAP=.*,KEYMAP=$KEYMAP," -i $NEWROOT/etc/rc.conf
 fi