From 5e1246d638d9eeb505431aa1d2a18c7ba49b255b Mon Sep 17 00:00:00 2001 From: udeved Date: Fri, 13 May 2016 21:24:47 +0200 Subject: [PATCH] buildiso: allow to specify the user's login shell --- README.md | 3 +++ bin/buildiso.in | 1 + data/manjaro-tools.conf | 3 +++ docbook/manjaro-tools.conf.xml | 8 ++++++++ lib/util-iso-image.sh | 4 ++-- lib/util.sh | 2 ++ 6 files changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a94b14d..517144d 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,9 @@ overriding # requires minimum 4.0 kernel on the build host and on iso in profile.conf # use_overlayfs="true" +# the login shell +# login_shell=/bin/bash + ################ deployiso ################ # the server url diff --git a/bin/buildiso.in b/bin/buildiso.in index 0365425..8ee8c22 100755 --- a/bin/buildiso.in +++ b/bin/buildiso.in @@ -94,6 +94,7 @@ display_settings(){ msg2 "iso_compression: %s" "${iso_compression}" msg2 "iso_checksum: %s" "${iso_checksum}" msg2 "use_overlayfs: %s" "${use_overlayfs}" + msg2 "login_shell: %s" "${login_shell}" ${verbose} && msg2 "iso_fs: %s" "${iso_fs}" msg "BUILD QUEUE:" diff --git a/data/manjaro-tools.conf b/data/manjaro-tools.conf index 524945c..7c1d7f2 100644 --- a/data/manjaro-tools.conf +++ b/data/manjaro-tools.conf @@ -78,6 +78,9 @@ # requires minimum 4.0 kernel on the build host and on iso in profile.conf # use_overlayfs="false" +# the login shell +# login_shell=/bin/bash + ################ deployiso ################ # the server url diff --git a/docbook/manjaro-tools.conf.xml b/docbook/manjaro-tools.conf.xml index cc34807..3df423a 100644 --- a/docbook/manjaro-tools.conf.xml +++ b/docbook/manjaro-tools.conf.xml @@ -272,6 +272,14 @@ + + login_shell= + + Accepts any login shell for the user, eg. /bin/zsh. + login_shell defaults to /bin/bash + + + diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index b38dea0..6247a4b 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -32,9 +32,9 @@ configure_user(){ # set up user and password msg2 "Creating user ..." if [[ -n ${password} ]];then - chroot $1 useradd -m -G ${addgroups} -p $(gen_pw) ${username} + chroot $1 useradd -m -G ${addgroups} -p $(gen_pw) -s ${login_shell} ${username} else - chroot $1 useradd -m -G ${addgroups} ${username} + chroot $1 useradd -m -G ${addgroups} -s ${login_shell} ${username} fi } diff --git a/lib/util.sh b/lib/util.sh index c689444..56ce7ac 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -283,6 +283,8 @@ init_buildiso(){ [[ -z ${use_overlayfs} ]] && use_overlayfs='true' [[ -z ${profile_repo} ]] && profile_repo='manjaro-tools-iso-profiles' + + [[ -z ${login_shell} ]] && login_shell='/bin/bash' } init_deployiso(){