21-usersetup: check for existing /bin/zsh inside the chroot
authorMichael Prokop <mika@grml.org>
Fri, 20 Jun 2014 09:20:39 +0000 (11:20 +0200)
committerMichael Prokop <mika@grml.org>
Fri, 20 Jun 2014 09:22:52 +0000 (11:22 +0200)
/bin/zsh usually points to /etc/alternatives/zsh, but if
/etc/alternatives/zsh doesn't exist on the *build* system,
the test for existing /bin/zsh fails, so we need to verify
the existence of /bin/zsh *inside* the chroot.

Thanks: Krisztian VASAS <iron@ironiq.hu> for reporting the problem
Acked-by: Alexander Wirt <formorer@grml.org>
etc/grml/fai/config/scripts/GRMLBASE/21-usersetup

index 123e39c..a83224f 100755 (executable)
@@ -55,7 +55,7 @@ add_user_to_group voice
 sed -i 's/^root::/root:*:/'            $target/etc/shadow
 sed -i "s/^$USERNAME:!:/$USERNAME:*:/" $target/etc/shadow
 
-if [ -r $target/bin/zsh ] ; then
+if $ROOTCMD [ -r /bin/zsh ] ; then
    $ROOTCMD chsh -s /bin/zsh root
    $ROOTCMD chsh -s /bin/zsh $USERNAME
 fi