diff options
author | Juan RP <xtraeme@gmail.com> | 2014-09-20 11:48:49 +0200 |
---|---|---|
committer | Juan RP <xtraeme@gmail.com> | 2014-09-20 11:48:49 +0200 |
commit | 14381901e4c9fc1000fd6b4f6095cf4aa8ae1a1b (patch) | |
tree | 422ee53016fe1f0acbf53de18b6281f071e6559d /dracut | |
parent | 6711fb5182c8963c0df63b494bbac8e30c7ee79f (diff) | |
download | hrmpf-14381901e4c9fc1000fd6b4f6095cf4aa8ae1a1b.tar.gz hrmpf-14381901e4c9fc1000fd6b4f6095cf4aa8ae1a1b.tar.xz hrmpf-14381901e4c9fc1000fd6b4f6095cf4aa8ae1a1b.zip |
mklive: accept live.shell kernel cmdline to switch user shell; from pancake.
Diffstat (limited to 'dracut')
-rw-r--r-- | dracut/adduser.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/dracut/adduser.sh b/dracut/adduser.sh index 9dd7ddc..8269730 100644 --- a/dracut/adduser.sh +++ b/dracut/adduser.sh @@ -7,14 +7,20 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh echo void-live > ${NEWROOT}/etc/hostname USERNAME=$(getarg live.user) +USERSHELL=$(getarg live.shell) [ -z "$USERNAME" ] && USERNAME=anon +[ -z "$USERSHELL" ] && USERSHELL=/bin/sh # Create /etc/default/live.conf to store USER. echo "USERNAME=$USERNAME" >> ${NEWROOT}/etc/default/live.conf chmod 644 ${NEWROOT}/etc/default/live.conf +if ! grep -q ${USERSHELL} ${NEWROOT}/etc/shells ; then + echo ${USERSHELL} >> ${NEWROOT}/etc/shells +fi + # Create new user and remove password. We'll use autologin by default. -chroot ${NEWROOT} useradd -c $USERNAME -m $USERNAME -G wheel -s /bin/sh +chroot ${NEWROOT} useradd -c $USERNAME -m $USERNAME -G wheel -s $USERSHELL chroot ${NEWROOT} passwd -d $USERNAME >/dev/null 2>&1 # Setup default root password (voidlinux). |