Try to run commands from chroot

This commit is contained in:
Santiago Lo Coco 2021-12-22 16:53:50 -03:00
parent 6322ae07ca
commit 036ea20867
1 changed files with 23 additions and 16 deletions

View File

@ -30,10 +30,10 @@ showDisks() {
partDisks() { partDisks() {
showDisks showDisks
clear
result=$(whiptail --yesno "Do you want me to automatically partition and format the disk for you?" 0 0 3>&1 1>&2 2>&3) result=$(whiptail --yesno "Do you want me to automatically partition and format the disk for you?" 0 0 3>&1 1>&2 2>&3)
if [ $? -eq 1 ]; then if [ $? -eq 1 ]; then
gdisk $disk gdisk $disk
# TODO: ask user for the partitions and do formatPart and mountPart
return return
fi fi
@ -97,8 +97,8 @@ setPassword() {
} }
installMorePackages() { installMorePackages() {
pacman -S grub efibootmgr networkmanager network-manager-applet dialog reflector base-devel linux-headers xdg-user-dirs xdg-utils alsa-utils pipewire pipewire-alsa pipewire-pulse openssh reflector qemu qemu-arch-extra ttf-fira-code pacman -Sy grub efibootmgr networkmanager network-manager-applet dialog reflector base-devel linux-headers xdg-user-dirs xdg-utils alsa-utils pipewire pipewire-alsa pipewire-pulse openssh reflector qemu qemu-arch-extra ttf-fira-code
pacman -S --noconfirm nvidia nvidia-utils nvidia-settings pacman -Sy --noconfirm nvidia nvidia-utils nvidia-settings
systemctl enable NetworkManager systemctl enable NetworkManager
systemctl enable fstrim.timer systemctl enable fstrim.timer
@ -120,24 +120,31 @@ userSetUp() {
usermod -aG wheel slococo usermod -aG wheel slococo
} }
runInChroot() {
chroot /mnt /bin/bash << END
"${1}"
END
}
runScript() { runScript() {
whiptail --title "CocoASAIS" --msgbox "Welcome to CocoASAIS!" 0 0 whiptail --title "CocoASAIS" --msgbox "Welcome to CocoASAIS!" 0 0
checkUefi # checkUefi
updateSystemClock # updateSystemClock
partDisks # partDisks
# installPackages # installPackages
# generateFstab generateFstab
# arch-chroot /mnt arch-chroot /mnt
# setTimeZone setTimeZone
# setLocale setLocale
# networkConf networkConf
# setPassword setPassword
# installMorePackages installMorePackages
# grubSetUp grubSetUp
# userSetUp userSetUp
# exit # exit
# umount -R /mnt # umount -R /mnt
# reboot # reboot
} }
runScript # runScript
runInChroot "ls -al"