From 7fb0c618916e24a050481d5a15c58fdfc6dfa9f5 Mon Sep 17 00:00:00 2001 From: awy Date: Wed, 21 Aug 2024 14:06:14 +0300 Subject: tidy --- post_chroot.sh | 41 ++++++++++++++++++++--------------------- 1 file 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 <> /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 <> /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 -- cgit v1.2.3