aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpost_chroot.sh41
1 files changed, 20 insertions, 21 deletions
diff --git a/post_chroot.sh b/post_chroot.sh
index de5ec2a..2f0d9ec 100755
--- a/post_chroot.sh
+++ b/post_chroot.sh
@@ -52,7 +52,26 @@ else
exit 1
fi
-useradd -m -g users -G wheel,storage,power -s /bin/bash $_username
+# use dash as sh
+pacman -Sy dash
+ln -sfT dash /usr/bin/sh
+mkdir -p /etc/pacman.d/hooks
+cat <<EOL >> /etc/pacman.d/hooks/bash.hook
+[Trigger]
+Type = Package
+Operation = Install
+Operation = Upgrade
+Target = bash
+
+[Action]
+Description = Re-pointing /bin/sh symlink to dash...
+When = PostTransaction
+Exec = /usr/bin/ln -sfT dash /usr/bin/sh
+Depends = dash
+EOL
+
+pacman -Sy zsh
+useradd -m -g users -G wheel,storage,power -s /bin/zsh $_username
echo root:$_rootpasswd | chpasswd
echo $_username:$_userpasswd | chpasswd
@@ -79,24 +98,4 @@ if [ "$_kernelflag" -eq 1 ]; then
grub-mkconfig -o /boot/grub/grub.cfg
fi
-# use dash as sh
-pacman -Sy dash zsh
-ln -sfT dash /usr/bin/sh
-mkdir -p /etc/pacman.d/hooks
-cat <<EOL >> /etc/pacman.d/hooks/bash.hook
-[Trigger]
-Type = Package
-Operation = Install
-Operation = Upgrade
-Target = bash
-
-[Action]
-Description = Re-pointing /bin/sh symlink to dash...
-When = PostTransaction
-Exec = /usr/bin/ln -sfT dash /usr/bin/sh
-Depends = dash
-EOL
-
-chsh -s /bin/zsh $_username
-
rm /post_chroot.sh