feat: copy chroot to /mnt/
This commit is contained in:
parent
2f3664acaa
commit
0a2b926e9d
16 changed files with 27 additions and 13 deletions
|
|
@ -1,34 +0,0 @@
|
|||
#!/bin/bash
|
||||
#shellcheck disable=SC2154
|
||||
|
||||
sgdisk -Z \
|
||||
-n '0:0:+512M' -t '0:ef00' -c '0:boot' \
|
||||
-n '0:0:0' -t '0:8300' -c '0:root' \
|
||||
"$disk"
|
||||
|
||||
boot=/dev/disk/by-partlabel/boot
|
||||
root=/dev/disk/by-partlabel/root
|
||||
|
||||
[ -n "$disk_passwd" ] && {
|
||||
echo -n "$disk_passwd" | cryptsetup luksFormat "$root" -
|
||||
cryptsetup open "$root" cryptroot - <<< "$disk_passwd"
|
||||
root=/dev/mapper/cryptroot
|
||||
}
|
||||
|
||||
sleep 2 # wait for /dev/disk/by-partlabel/ to be populated
|
||||
|
||||
mkfs.fat -F32 "$boot"
|
||||
mkfs.ext4 -F "$root"
|
||||
mount "$root" /mnt/
|
||||
mount -m -o fmask=0077,dmask=0077 /dev/disk/by-partlabel/boot /mnt/boot/
|
||||
|
||||
[ -n "$swapfile" ] && {
|
||||
dd if=/dev/zero of=/mnt/swapfile bs=1M count="$swapfile" status=progress
|
||||
chmod 600 /mnt/swapfile
|
||||
mkswap /mnt/swapfile
|
||||
swapon /mnt/swapfile
|
||||
}
|
||||
|
||||
cp -rfTv rootfs/ /mnt/
|
||||
genfstab -U /mnt/ >> /mnt/etc/fstab
|
||||
swapoff /mnt/swapfile
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
#!/bin/bash
|
||||
#shellcheck disable=SC2154
|
||||
|
||||
case "$(lscpu)" in
|
||||
*AMD*) pkg+=(amd-ucode) ;;
|
||||
*Intel*) pkg+=(intel-ucode) ;;
|
||||
*) ;;
|
||||
esac
|
||||
|
||||
[ -n "$flatpak" ] && pkg+=(flatpak xdg-desktop-portal-gtk)
|
||||
|
||||
[ -f /sys/class/power_supply/BAT0 ] && pkg+=(tlp)
|
||||
|
||||
pacstrap -C rootfs/etc/pacman.conf -K /mnt/ \
|
||||
base linux{,-lts,-firmware} "$shell" "${pkg[@]}"
|
||||
|
||||
find /mnt/etc -name '*.pacnew' -delete
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
#!/bin/bash
|
||||
#shellcheck disable=SC2154
|
||||
|
||||
BOLD=$'\e[1m'
|
||||
GREEN=$'\e[32m'
|
||||
NORMAL=$'\e[0m'
|
||||
|
||||
echo -e "${BOLD}${GREEN}DONE. Umount? [Y/n]${NORMAL} " && read -r ANS
|
||||
|
||||
case "$ANS" in
|
||||
[Yy]*) ;;
|
||||
*) exit ;;
|
||||
esac
|
||||
|
||||
awk '/mnt/ {print $1}' < /proc/swaps | xargs swapoff
|
||||
umount -R /mnt/
|
||||
Loading…
Add table
Add a link
Reference in a new issue