2
This commit is contained in:
parent
b2c5477a43
commit
9d0a5edf57
1 changed files with 13 additions and 16 deletions
29
z.sh
29
z.sh
|
|
@ -1,41 +1,38 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# read user input to give btrfs seed, sprout and efi device
|
||||
|
||||
read -r seed sprout efi
|
||||
seed_device=$seed
|
||||
sprout_device=$sprout
|
||||
efi_device=$efi
|
||||
# display the setup and ask if continue (y,N)
|
||||
echo "Seed device: /dev/$seed_device"
|
||||
echo "Sprout device: /dev/$sprout_device"
|
||||
echo "EFI device: /dev/$efi_device"
|
||||
# defaults to N
|
||||
read -r -p "Are you sure? (y,N): " response
|
||||
if [[ "$response" != "y" && "$response" != "Y" ]]; then
|
||||
echo "Aborting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkfs.btrfs -f -L SEED /dev/$seed_device
|
||||
mkfs.btrfs -f -L SPRUT /dev/$sprout_device
|
||||
mkfs.fat -F 32 -n EFI /dev/$efi_device
|
||||
echo "Filesystems created successfully."
|
||||
|
||||
mount -o subvol=/ /dev/vda1 /mnt
|
||||
|
||||
btrfs su cr /mnt/@
|
||||
|
||||
umount -R /mnt
|
||||
|
||||
mount -o subvol=/@ /dev/vda1 /mnt
|
||||
|
||||
pacstrap -K /mnt base linux dracut btrfs-progs linux-firmware sudo nano networkmanager
|
||||
|
||||
# ask user to input packages to install
|
||||
read -r -p "Enter packages to install (space-separated): " packages_input
|
||||
packages=($packages_input)
|
||||
# ask user for package installation confirmation
|
||||
echo "The following packages will be installed: ${packages[@]}"
|
||||
# ask user for confirmation before proceeding
|
||||
read -r -p "Continue with installation? (y,N): " response
|
||||
if [[ "$response" != "y" && "$response" != "Y" ]]; then
|
||||
echo "Installation aborted."
|
||||
exit 1
|
||||
fi
|
||||
pacstrap -K /mnt ${packages[@]}
|
||||
mount -m /dev/vda3 /mnt/efi
|
||||
|
||||
genfstab -U /mnt > /mnt/etc/fstab
|
||||
|
||||
arch-chroot /mnt /bin/bash /root/z2.sh
|
||||
arch-chroot /mnt
|
||||
Loading…
Reference in a new issue