installed lvm closed #4
This commit is contained in:
parent
c5c50b8d1d
commit
253db53f72
|
|
@ -82,6 +82,7 @@ do_format() {
|
||||||
}
|
}
|
||||||
|
|
||||||
do_lvm() {
|
do_lvm() {
|
||||||
|
install_pkg lvm2
|
||||||
i=0
|
i=0
|
||||||
while [[ "$i" -le "${#LVM_PART_NUM[@]}" ]]; do
|
while [[ "$i" -le "${#LVM_PART_NUM[@]}" ]]; do
|
||||||
if [[ "${#LVM_PART_NUM[@]}" -eq 1 ]]; then
|
if [[ "${#LVM_PART_NUM[@]}" -eq 1 ]]; then
|
||||||
|
|
@ -93,7 +94,7 @@ do_lvm() {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
lvm_mount() {
|
mount_lvm() {
|
||||||
vgchange -ay &>/dev/null
|
vgchange -ay &>/dev/null
|
||||||
i=0
|
i=0
|
||||||
while [[ "$i" -le "${#LVM_PART_NUM[@]}" ]]; do
|
while [[ "$i" -le "${#LVM_PART_NUM[@]}" ]]; do
|
||||||
|
|
@ -108,18 +109,17 @@ lvm_mount() {
|
||||||
mount -t "$FS" /dev/"$LVM_VG"/"$x" "$MOUNTPOINT"/"$x"
|
mount -t "$FS" /dev/"$LVM_VG"/"$x" "$MOUNTPOINT"/"$x"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
prep_disk() {
|
||||||
|
wipefs -a -f "$DISK" # wipe any file system
|
||||||
|
sgdisk -Z "$DISK" # zap all on disk
|
||||||
|
sgdisk -a 2048 -o "$DISK" # new gpt disk 2048 alignment
|
||||||
|
}
|
||||||
do_partition() {
|
do_partition() {
|
||||||
|
prep_disk
|
||||||
if [[ "$UEFI" -eq 1 ]]; then
|
if [[ "$UEFI" -eq 1 ]]; then
|
||||||
wipefs -a "$DISK" # wipe any file system
|
|
||||||
sgdisk -Z "$DISK" # zap all on disk
|
|
||||||
sgdisk -a 2048 -o "$DISK" # new gpt disk 2048 alignment
|
|
||||||
sgdisk -n 1::+300M --typecode=1:ef00 --change-name=1:"$BOOT" "$DISK" # partition 1 (UEFI Boot Partition)
|
sgdisk -n 1::+300M --typecode=1:ef00 --change-name=1:"$BOOT" "$DISK" # partition 1 (UEFI Boot Partition)
|
||||||
sgdisk -n 2::-0 --typecode=2:8300 --change-name=2:"$ROOT" "$DISK" # partition 2 (Root), default start, remaining
|
sgdisk -n 2::-0 --typecode=2:8300 --change-name=2:"$ROOT" "$DISK" # partition 2 (Root), default start, remaining
|
||||||
else
|
else
|
||||||
wipefs -a "$DISK"
|
|
||||||
sgdisk -Z "$DISK"
|
|
||||||
sgdisk -a 2048 -o "$DISK"
|
|
||||||
sgdisk -n 1::+1M --typecode=1:ef02 --change-name=1:"BIOSBOOT" "$DISK"
|
sgdisk -n 1::+1M --typecode=1:ef02 --change-name=1:"BIOSBOOT" "$DISK"
|
||||||
sgdisk -n 2::-0 --typecode=2:8300 --change-name=2:"$ROOT" "$DISK"
|
sgdisk -n 2::-0 --typecode=2:8300 --change-name=2:"$ROOT" "$DISK"
|
||||||
|
|
||||||
|
|
@ -173,7 +173,7 @@ elif [[ "$LVM" -eq 1 ]]; then
|
||||||
pvcreate "$PART2"
|
pvcreate "$PART2"
|
||||||
vgcreate "$LVM_VG" "$PART2"
|
vgcreate "$LVM_VG" "$PART2"
|
||||||
do_lvm
|
do_lvm
|
||||||
lvm_mount
|
mount_lvm
|
||||||
mount_boot
|
mount_boot
|
||||||
set_option "HOOKS" "(lvm2 filesystems)"
|
set_option "HOOKS" "(lvm2 filesystems)"
|
||||||
|
|
||||||
|
|
@ -186,7 +186,7 @@ elif [[ "$LUKS" -eq 1 ]]; then
|
||||||
pvcreate "$LUKS_PATH"
|
pvcreate "$LUKS_PATH"
|
||||||
vgcreate "$LVM_VG" "$LUKS_PATH"
|
vgcreate "$LVM_VG" "$LUKS_PATH"
|
||||||
do_lvm
|
do_lvm
|
||||||
lvm_mount
|
mount_lvm
|
||||||
mount_boot
|
mount_boot
|
||||||
# set_option "ENCRYP_PART" "$_PART_UUID"
|
# set_option "ENCRYP_PART" "$_PART_UUID"
|
||||||
# HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)
|
# HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)
|
||||||
|
|
@ -240,7 +240,7 @@ if [[ $TOTALMEM -lt 8000000 ]]; then
|
||||||
mkswap "$MOUNTPOINT"/opt/swap/swapfile
|
mkswap "$MOUNTPOINT"/opt/swap/swapfile
|
||||||
swapon "$MOUNTPOINT"/opt/swap/swapfile
|
swapon "$MOUNTPOINT"/opt/swap/swapfile
|
||||||
# The line below is written to /mnt/ but doesn't contain /mnt/, since it's just / for the system itself.
|
# The line below is written to /mnt/ but doesn't contain /mnt/, since it's just / for the system itself.
|
||||||
echo "/opt/swap/swapfile none swap sw 0 0" >>"$MOUNTPOINT"/etc/fstab # Add swap to fstab, so it KEEPS working after installation.
|
echo -e "/opt/swap/swapfile\tnone \tswap \tsw\t0 0" >>"$MOUNTPOINT"/etc/fstab # Add swap to fstab, so it KEEPS working after installation.
|
||||||
fi
|
fi
|
||||||
|
|
||||||
title "System ready for 1-setup.sh"
|
title "System ready for 1-setup.sh"
|
||||||
|
|
|
||||||
11
1-setup.sh
11
1-setup.sh
|
|
@ -183,11 +183,11 @@ systemd)
|
||||||
echo "Installing systemd-boot"
|
echo "Installing systemd-boot"
|
||||||
bootctl --path=/boot install
|
bootctl --path=/boot install
|
||||||
if [[ $LUKS -eq 1 ]]; then
|
if [[ $LUKS -eq 1 ]]; then
|
||||||
echo -e "title\tArchTitus\nlinux\t/vmlinuz-linux\ninitrd\t/initramfs-linux.img\noptions\tcryptdevice=UUID=$ENCRYPT_UUID:luks root=/dev/$LVM_VG/${LVM_NAMES[0]} rw" >/boot/loader/entries/arch.conf
|
echo -e "title\tArchTitus\nlinux\t/vmlinuz-linux\ninitrd\t/initramfs-linux.img\ninitrd\t/$IMG\noptions\tcryptdevice=UUID=$ENCRYPT_UUID:luks root=/dev/$LVM_VG/${LVM_NAMES[0]} rw" >/boot/loader/entries/arch.conf
|
||||||
elif [[ $LVM -eq 1 ]]; then
|
elif [[ $LVM -eq 1 ]]; then
|
||||||
echo -e "title\tArchTitus\nlinux\t/vmlinuz-linux\ninitrd\t/initramfs-linux.img\noptions\troot=/dev/$LVM_VG/${LVM_NAMES[0]} rw" >/boot/loader/entries/arch.conf
|
echo -e "title\tArchTitus\nlinux\t/vmlinuz-linux\ninitrd\t/initramfs-linux.img\ninitrd\t/$IMG\noptions\troot=/dev/$LVM_VG/${LVM_NAMES[0]} rw" >/boot/loader/entries/arch.conf
|
||||||
else
|
else
|
||||||
echo -e "title\tArchTitus\nlinux\t/vmlinuz-linux\ninitrd\t/initramfs-linux.img\noptions\troot=PARTUUID=$PART_UUID rw" >/boot/loader/entries/arch.conf
|
echo -e "title\tArchTitus\nlinux\t/vmlinuz-linux\ninitrd\t/initramfs-linux.img\ninitrd\t/$IMG\noptions\troot=PARTUUID=$PART_UUID rw" >/boot/loader/entries/arch.conf
|
||||||
fi
|
fi
|
||||||
echo -e "default arch\ntimeout 5" >/boot/loader/loader.conf
|
echo -e "default arch\ntimeout 5" >/boot/loader/loader.conf
|
||||||
else
|
else
|
||||||
|
|
@ -199,10 +199,7 @@ uefi)
|
||||||
if [[ "$UEFI" -eq 1 ]]; then
|
if [[ "$UEFI" -eq 1 ]]; then
|
||||||
echo "Installing efistub"
|
echo "Installing efistub"
|
||||||
install_pkg efibootmgr
|
install_pkg efibootmgr
|
||||||
if [[ "$LUKS" -eq 1 && "$FS" =~ "btrfs" ]]; then
|
if [[ "$LUKS" -eq 1 ]]; then
|
||||||
efibootmgr --disk "$DISK" --part 1 --create --label "ArchTitus" --loader "/vmlinuz-linux" --unicode "cryptdevice=PARTUUID=$PART_UUID:luks:allow-discards root=/dev/$LVM_VG/${LVM_NAMES[0]} rw rootflags=subvol=@ initrd=\\$IMG initrd=\initramfs-linux.img"
|
|
||||||
efibootmgr --disk "$DISK" --part 1 --create --label "ArchTitus-Fallback" --loader "/vmlinuz-linux" --unicode "cryptdevice=PARTUUID=$PART_UUID:luks:allow-discards root=/dev/$LVM_VG/${LVM_NAMES[0]} rw rootflags=subvol=@ initrd=\\$IMG initrd=\initramfs-linux-fallback.img"
|
|
||||||
elif [[ "$LUKS" -eq 1 ]]; then
|
|
||||||
efibootmgr --disk "$DISK" --part 1 --create --label "ArchTitus" --loader "/vmlinuz-linux" --unicode "cryptdevice=PARTUUID=$PART_UUID:luks:allow-discards root=/dev/$LVM_VG/${LVM_NAMES[0]} rw initrd=\\$IMG initrd=\initramfs-linux.img"
|
efibootmgr --disk "$DISK" --part 1 --create --label "ArchTitus" --loader "/vmlinuz-linux" --unicode "cryptdevice=PARTUUID=$PART_UUID:luks:allow-discards root=/dev/$LVM_VG/${LVM_NAMES[0]} rw initrd=\\$IMG initrd=\initramfs-linux.img"
|
||||||
efibootmgr --disk "$DISK" --part 1 --create --label "ArchTitus-Fallback" --loader "/vmlinuz-linux" --unicode "cryptdevice=PARTUUID=$PART_UUID:luks:allow-discards root=/dev/$LVM_VG/${LVM_NAMES[0]} rw initrd=\\$IMG initrd=\initramfs-linux-fallback.img"
|
efibootmgr --disk "$DISK" --part 1 --create --label "ArchTitus-Fallback" --loader "/vmlinuz-linux" --unicode "cryptdevice=PARTUUID=$PART_UUID:luks:allow-discards root=/dev/$LVM_VG/${LVM_NAMES[0]} rw initrd=\\$IMG initrd=\initramfs-linux-fallback.img"
|
||||||
elif [[ "$LVM" -eq 1 ]]; then
|
elif [[ "$LVM" -eq 1 ]]; then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue