From 3b5b9cba6a69b191faccae4d8c798b5fc84dc704 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 23 May 2014 11:30:24 +0200 Subject: mklive: do not assume glibc and/or systemd (might use musl and runit instead :-). --- dracut/adduser.sh | 14 ++++++++------ dracut/locale.sh | 7 ++++++- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'dracut') 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 -- cgit 1.4.1