You are not logged in.
Hi everyone.
Please forgive my English, (not my native language) and also forgive my scripting ignorance. (i have no coding experience or knowledge whatsoever)
That being said, i'd greatly appreciate some help on the following:
I created my own Arch install bash scripts.
The way i'm doing this, is like so :
1. Boot from the Arch iso
2. Connect to the internet and install "git" (on the live media)
3. Clone my gitlab repo and cd into it
4. Run my script_1, which takes care of all steps up to chrooting into my system :
(format drive, create partitions, format partitions, mount partitions, pacstrap and install "base, git, linux" packages, generate fstab and lastly chroot into my installation)
5. Then, i clone my gitlab repo once again (while in chroot) to run my script_2, which takes care of the rest of the installation.
The (childish) script format is like this:
script_1.sh :
#!/bin/zsh
command 1 &&
command 2 &&
command 'n' &&
arch-chroot /mnt &&
umount -R /mnt &&
poweroff
script_2.sh
#!/bin/bash
command 1 &&
command 2 &&
command 'n' &&
last command
As soon as i'm done with the 2nd script, and exit, script_1 completes, auto-exits and i'm done.
I'm wondering if there's a way to combine the 2 scripts, so i don't have to clone my repo twice, or is this far too advanced for my (zero) knowledge level?
Thank you for your time, in advance !
Last edited by Dante777 (2021-11-29 20:59:52)
Offline
Offline
Thank you @Head_on_a_Stick !
Greatly appreciated.
Offline
I'm facing a new issue now.
My bash script fails when i run it from the arch live iso, chroots into my installation and tries to execute a command that needs human interaction. (e.g. pacman -S base-devel)
Example script:
#!/bin/zsh
command 1 &&
command 2 &&
arch-chroot /mnt /bin/bash <<END
command 1 &&
command 2 &&
pacman -S base-devel
END
command "n" &&
last command
How could i get around this issue?
Already tried
yes | pacman -S base-devel
to no avail.
Any ideas?
EDIT: correction
Last edited by Dante777 (2021-11-28 10:15:31)
Offline
pacman has a --noconfirm option that will automatically pick the normally highlighted option
Offline
pacman has a --noconfirm option that will automatically pick the normally highlighted option
Thank you! Will give it a try asap.
Offline
Alternitavely just add base-devel to the list of packages initially installed when running pacstrap.
Offline
Alternitavely just add base-devel to the list of packages initially installed when running pacstrap.
Both ways (pacman --noconfirm option while in chroot, or just pacstrapping the desired packages), work equally good.
I prefer the pacstrap -i option, since it provides interaction, and lets me refine my choices.
Plus, it's already (a step) in my script, so i see no reason why should i duplicate it in the first place.
Thank you all !
Offline