Installer: Separate boot filesystem from root

This commit is contained in:
Adam Jafarov 2022-05-29 23:27:35 +03:00 committed by GitHub
parent d7fc769dad
commit f151dc5c71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,24 +75,38 @@ base_os_install() {
# released after May 20.
if [ "$(awk '/'${DRIVEDEVICE}'/ {print $3; exit}' /proc/partitions)" -lt 64000000 ] || [[ "${DEVICE}" =~ mmcblk0 ]]; then
parted ${DEVICE} mkpart primary btrfs 256M 100%
else
parted ${DEVICE} mkpart primary btrfs 256M 24G
parted ${DEVICE} mkpart primary ext4 24G 100%
fi
root_partition="${INSTALLDEVICE}2"
mkfs -t vfat ${INSTALLDEVICE}1
fatlabel ${INSTALLDEVICE}1 HOLOEFI
mkfs -t btrfs -f ${root_partition}
mkfs -t ext4 ${INSTALLDEVICE}3
home_partition="${INSTALLDEVICE}3"
btrfs filesystem label ${root_partition} holo-root
e2label "${INSTALLDEVICE}3" holo-home
CMD_MOUNT_HOME=(echo "Skipping home creation...")
CMD_MOUNT_BOOT=(echo "Skipping separate boot creation...")
else
parted ${DEVICE} mkpart primary ext4 256M 2G
parted ${DEVICE} mkpart primary btrfs 2G 24G
parted ${DEVICE} mkpart primary ext4 24G 100%
boot_partition="${INSTALLDEVICE}2"
root_partition="${INSTALLDEVICE}3"
mkfs -t vfat ${INSTALLDEVICE}1
fatlabel ${INSTALLDEVICE}1 HOLOEFI
mkfs -t btrfs -f ${root_partition}
mkfs -t ext4 boot_partition
mkfs -t ext4 ${INSTALLDEVICE}4
home_partition="${INSTALLDEVICE}4"
btrfs filesystem label ${root_partition} holo-root
e2label "${INSTALLDEVICE}4" holo-home
e2label "${INSTALLDEVICE}2" holo-bootfs
CMD_MOUNT_BOOT=(mkdir ${HOLO_INSTALL_DIR}/boot && mount -t ext4 ${boot_partition} ${HOLO_INSTALL_DIR}/boot)
CMD_MOUNT_HOME=(mount -t ext4 ${home_partition} ${HOLO_INSTALL_DIR}/home)
fi
echo "\nPartitioning complete, mounting and pacstrapping..."
echo "${UCODE_INSTALL_MSG}"
mount -t btrfs -o subvol=/,compress-force=zstd:1,discard,noatime,nodiratime ${root_partition} ${HOLO_INSTALL_DIR}
${CMD_MOUNT_BOOT}
pacstrap -i ${HOLO_INSTALL_DIR} base base-devel ${UCODE_INSTALL} core/linux core/linux-headers linux-neptune-dri linux-neptune-dri-headers linux-firmware
mount -t ext4 ${home_partition} ${HOLO_INSTALL_DIR}/home
${CMD_MOUNT_HOME}
echo "\nBase system installation done, generating fstab..."
genfstab -U -p /mnt >> /mnt/etc/fstab