Add runInChrootWithInput() function
This commit is contained in:
parent
bdf8cc6ebd
commit
db65dd6d33
31
install.sh
31
install.sh
|
@ -93,7 +93,8 @@ networkConf() {
|
||||||
}
|
}
|
||||||
|
|
||||||
setPassword() {
|
setPassword() {
|
||||||
echo root:password | chpasswd
|
# echo root:password | chpasswd
|
||||||
|
runInChrootWithInput "passwd"
|
||||||
}
|
}
|
||||||
|
|
||||||
installMorePackages() {
|
installMorePackages() {
|
||||||
|
@ -110,20 +111,29 @@ grubSetUp() {
|
||||||
}
|
}
|
||||||
|
|
||||||
userSetUp() {
|
userSetUp() {
|
||||||
useradd -m slococo
|
runInChroot "useradd -m slococo"
|
||||||
echo slococo:password | chpasswd
|
# echo slococo:password | chpasswd
|
||||||
|
# echo "$(whiptail --passwordbox "Enter the root password" 0 0 1>&2)" | chpasswd
|
||||||
|
runInChrootWithInput "passwd slococo"
|
||||||
|
|
||||||
# echo "slococo ALL=(ALL) ALL" >> /etc/sudoers.d/slococo
|
# echo "slococo ALL=(ALL) ALL" >> /etc/sudoers.d/slococo
|
||||||
# Uncomment wheel line:
|
# Uncomment wheel line:
|
||||||
EDITOR=nvim visudo
|
runInChroot "EDITOR=nvim visudo"
|
||||||
|
|
||||||
usermod -aG wheel slococo
|
runInChroot "usermod -aG wheel slococo"
|
||||||
}
|
}
|
||||||
|
|
||||||
runInChroot() {
|
runInChroot() {
|
||||||
chroot /mnt /bin/bash << END
|
arch-chroot /mnt bash -c '${1}'
|
||||||
|
}
|
||||||
|
|
||||||
|
runInChrootWithInput() {
|
||||||
|
cat << EOF > /mnt/runme
|
||||||
${1}
|
${1}
|
||||||
END
|
EOF
|
||||||
|
chmod 755 /mnt/runme
|
||||||
|
arch-chroot /mnt /runme
|
||||||
|
rm /mnt/runme
|
||||||
}
|
}
|
||||||
|
|
||||||
runScript() {
|
runScript() {
|
||||||
|
@ -133,18 +143,15 @@ runScript() {
|
||||||
# partDisks
|
# partDisks
|
||||||
# installPackages
|
# installPackages
|
||||||
generateFstab
|
generateFstab
|
||||||
arch-chroot /mnt
|
|
||||||
setTimeZone
|
setTimeZone
|
||||||
setLocale
|
setLocale
|
||||||
networkConf
|
networkConf
|
||||||
# setPassword
|
setPassword
|
||||||
installMorePackages
|
installMorePackages
|
||||||
grubSetUp
|
grubSetUp
|
||||||
# userSetUp
|
userSetUp
|
||||||
# exit
|
|
||||||
# umount -R /mnt
|
# umount -R /mnt
|
||||||
# reboot
|
# reboot
|
||||||
}
|
}
|
||||||
|
|
||||||
runScript
|
runScript
|
||||||
# runInChroot "ls -al"
|
|
Loading…
Reference in New Issue