Improve refind support

merge-requests/273/head
Chrysostomus 7 years ago
parent d47d84a72e
commit f401e21c95

@ -445,6 +445,6 @@ _EnterChroot="Enter your installation
#Refind
_InstRefindTitle="Install refind"
_InstRefindBody="This installs refind and configures it to automatically detect your kernels.\nNo support for intel microcode. Use manual boot stanzas for that.\nDo not use shared /boot partition with other systems when using this option."
_InstRefindBody="This installs refind and configures it to automatically detect your kernels.\nNo support for encrypted /boot or intel microcode.\nThese require manual boot stanzas or using different bootloader."
_RefindReady="Refind was succesfully installed"
_bootloaderInfo="Refind can be used as standalone or in conjunction with other bootloaders as a bootmenu.\nGrub can boot iso files from harddrive and have automatic boot entries for btrfs snapshots."
_bootloaderInfo="Refind can be used as standalone or in conjunction with other bootloaders as a bootmenu.\nGrub can boot iso files from harddrive and have automatic boot entries for btrfs snapshots."

@ -444,6 +444,6 @@ _EnterChroot="Enter your installation
#Refind
_InstRefindTitle="Install refind"
_InstRefindBody="This installs refind and configures it to automatically detect your kernels.\nNo support for intel microcode. Use manual boot stanzas for that.\nDo not use shared /boot partition with other systems when using this option."
_InstRefindBody="This installs refind and configures it to automatically detect your kernels.\nNo support for encrypted /boot or intel microcode.\nThese require manual boot stanzas or using different bootloader."
_RefindReady="Refind was succesfully installed"
_bootloaderInfo="Refind can be used as standalone or in conjunction with other bootloaders as a bootmenu.\nGrub can boot iso files from harddrive and have automatic boot entries for btrfs snapshots."
_bootloaderInfo="Refind can be used as standalone or in conjunction with other bootloaders as a bootmenu.\nGrub can boot iso files from harddrive and have automatic boot entries for btrfs snapshots."

@ -444,6 +444,6 @@ _EnterChroot="Enter your installation"
#Refind
_InstRefindTitle="Install refind"
_InstRefindBody="This installs refind and configures it to automatically detect your kernels.\nNo support for intel microcode. Use manual boot stanzas for that.\nDo not use shared /boot partition with other systems when using this option."
_InstRefindBody="This installs refind and configures it to automatically detect your kernels.\nNo support for encrypted /boot or intel microcode.\nThese require manual boot stanzas or using different bootloader."
_RefindReady="Refind was succesfully installed"
_bootloaderInfo="Refind can be used as standalone or in conjunction with other bootloaders as a bootmenu.\nGrub can boot iso files from harddrive and have automatic boot entries for btrfs snapshots."
_bootloaderInfo="Refind can be used as standalone or in conjunction with other bootloaders as a bootmenu.\nGrub can boot iso files from harddrive and have automatic boot entries for btrfs snapshots."

@ -445,6 +445,6 @@ _EnterChroot="Enter your installation
#Refind
_InstRefindTitle="Install refind"
_InstRefindBody="This installs refind and configures it to automatically detect your kernels.\nNo support for intel microcode. Use manual boot stanzas for that.\nDo not use shared /boot partition with other systems when using this option."
_InstRefindBody="This installs refind and configures it to automatically detect your kernels.\nNo support for encrypted /boot or intel microcode.\nThese require manual boot stanzas or using different bootloader."
_RefindReady="Refind was succesfully installed"
_bootloaderInfo="Refind can be used as standalone or in conjunction with other bootloaders as a bootmenu.\nGrub can boot iso files from harddrive and have automatic boot entries for btrfs snapshots."
_bootloaderInfo="Refind can be used as standalone or in conjunction with other bootloaders as a bootmenu.\nGrub can boot iso files from harddrive and have automatic boot entries for btrfs snapshots."

@ -443,6 +443,6 @@ _EnterChroot="Enter your installation
#Refind
_InstRefindTitle="Install refind"
_InstRefindBody="This installs refind and configures it to automatically detect your kernels.\nNo support for intel microcode. Use manual boot stanzas for that.\nDo not use shared /boot partition with other systems when using this option."
_InstRefindBody="This installs refind and configures it to automatically detect your kernels.\nNo support for encrypted /boot or intel microcode.\nThese require manual boot stanzas or using different bootloader."
_RefindReady="Refind was succesfully installed"
_bootloaderInfo="Refind can be used as standalone or in conjunction with other bootloaders as a bootmenu.\nGrub can boot iso files from harddrive and have automatic boot entries for btrfs snapshots."
_bootloaderInfo="Refind can be used as standalone or in conjunction with other bootloaders as a bootmenu.\nGrub can boot iso files from harddrive and have automatic boot entries for btrfs snapshots."

@ -440,6 +440,6 @@ _EnterChroot="Enter your installation
#Refind
_InstRefindTitle="Install refind"
_InstRefindBody="This installs refind and configures it to automatically detect your kernels.\nNo support for intel microcode. Use manual boot stanzas for that.\nDo not use shared /boot partition with other systems when using this option."
_InstRefindBody="This installs refind and configures it to automatically detect your kernels.\nNo support for encrypted /boot or intel microcode.\nThese require manual boot stanzas or using different bootloader."
_RefindReady="Refind was succesfully installed"
_bootloaderInfo="Refind can be used as standalone or in conjunction with other bootloaders as a bootmenu.\nGrub can boot iso files from harddrive and have automatic boot entries for btrfs snapshots."
_bootloaderInfo="Refind can be used as standalone or in conjunction with other bootloaders as a bootmenu.\nGrub can boot iso files from harddrive and have automatic boot entries for btrfs snapshots."

@ -444,6 +444,6 @@ _EnterChroot="Enter your installation
#Refind
_InstRefindTitle="Install refind"
_InstRefindBody="This installs refind and configures it to automatically detect your kernels.\nNo support for intel microcode. Use manual boot stanzas for that.\nDo not use shared /boot partition with other systems when using this option."
_InstRefindBody="This installs refind and configures it to automatically detect your kernels.\nNo support for encrypted /boot or intel microcode.\nThese require manual boot stanzas or using different bootloader."
_RefindReady="Refind was succesfully installed"
_bootloaderInfo="Refind can be used as standalone or in conjunction with other bootloaders as a bootmenu.\nGrub can boot iso files from harddrive and have automatic boot entries for btrfs snapshots."
_bootloaderInfo="Refind can be used as standalone or in conjunction with other bootloaders as a bootmenu.\nGrub can boot iso files from harddrive and have automatic boot entries for btrfs snapshots."

@ -444,6 +444,6 @@ _EnterChroot="Enter your installation
#Refind
_InstRefindTitle="Install refind"
_InstRefindBody="This installs refind and configures it to automatically detect your kernels.\nNo support for intel microcode. Use manual boot stanzas for that.\nDo not use shared /boot partition with other systems when using this option."
_InstRefindBody="This installs refind and configures it to automatically detect your kernels.\nNo support for encrypted /boot or intel microcode.\nThese require manual boot stanzas or using different bootloader."
_RefindReady="Refind was succesfully installed"
_bootloaderInfo="Refind can be used as standalone or in conjunction with other bootloaders as a bootmenu.\nGrub can boot iso files from harddrive and have automatic boot entries for btrfs snapshots."
_bootloaderInfo="Refind can be used as standalone or in conjunction with other bootloaders as a bootmenu.\nGrub can boot iso files from harddrive and have automatic boot entries for btrfs snapshots."

@ -443,6 +443,6 @@ _EnterChroot="Enter your installation
#Refind
_InstRefindTitle="Install refind"
_InstRefindBody="This installs refind and configures it to automatically detect your kernels.\nNo support for intel microcode. Use manual boot stanzas for that.\nDo not use shared /boot partition with other systems when using this option."
_InstRefindBody="This installs refind and configures it to automatically detect your kernels.\nNo support for encrypted /boot or intel microcode.\nThese require manual boot stanzas or using different bootloader."
_RefindReady="Refind was succesfully installed"
_bootloaderInfo="Refind can be used as standalone or in conjunction with other bootloaders as a bootmenu.\nGrub can boot iso files from harddrive and have automatic boot entries for btrfs snapshots."
_bootloaderInfo="Refind can be used as standalone or in conjunction with other bootloaders as a bootmenu.\nGrub can boot iso files from harddrive and have automatic boot entries for btrfs snapshots."

@ -444,6 +444,6 @@ _EnterChroot="Enter your installation
#Refind
_InstRefindTitle="Install refind"
_InstRefindBody="This installs refind and configures it to automatically detect your kernels.\nNo support for intel microcode. Use manual boot stanzas for that.\nDo not use shared /boot partition with other systems when using this option."
_InstRefindBody="This installs refind and configures it to automatically detect your kernels.\nNo support for encrypted /boot or intel microcode.\nThese require manual boot stanzas or using different bootloader."
_RefindReady="Refind was succesfully installed"
_bootloaderInfo="Refind can be used as standalone or in conjunction with other bootloaders as a bootmenu.\nGrub can boot iso files from harddrive and have automatic boot entries for btrfs snapshots."
_bootloaderInfo="Refind can be used as standalone or in conjunction with other bootloaders as a bootmenu.\nGrub can boot iso files from harddrive and have automatic boot entries for btrfs snapshots."

@ -444,6 +444,6 @@ _EnterChroot="Enter your installation
#Refind
_InstRefindTitle="Install refind"
_InstRefindBody="This installs refind and configures it to automatically detect your kernels.\nNo support for intel microcode. Use manual boot stanzas for that.\nDo not use shared /boot partition with other systems when using this option."
_InstRefindBody="This installs refind and configures it to automatically detect your kernels.\nNo support for encrypted /boot or intel microcode.\nThese require manual boot stanzas or using different bootloader."
_RefindReady="Refind was succesfully installed"
_bootloaderInfo="Refind can be used as standalone or in conjunction with other bootloaders as a bootmenu.\nGrub can boot iso files from harddrive and have automatic boot entries for btrfs snapshots."
_bootloaderInfo="Refind can be used as standalone or in conjunction with other bootloaders as a bootmenu.\nGrub can boot iso files from harddrive and have automatic boot entries for btrfs snapshots."

@ -443,6 +443,6 @@ _EnterChroot="Enter your installation
#Refind
_InstRefindTitle="Install refind"
_InstRefindBody="This installs refind and configures it to automatically detect your kernels.\nNo support for intel microcode. Use manual boot stanzas for that.\nDo not use shared /boot partition with other systems when using this option."
_InstRefindBody="This installs refind and configures it to automatically detect your kernels.\nNo support for encrypted /boot or intel microcode.\nThese require manual boot stanzas or using different bootloader."
_RefindReady="Refind was succesfully installed"
_bootloaderInfo="Refind can be used as standalone or in conjunction with other bootloaders as a bootmenu.\nGrub can boot iso files from harddrive and have automatic boot entries for btrfs snapshots."
_bootloaderInfo="Refind can be used as standalone or in conjunction with other bootloaders as a bootmenu.\nGrub can boot iso files from harddrive and have automatic boot entries for btrfs snapshots."

@ -441,13 +441,24 @@ install_refind()
rootflag="rootflags=$(mount | awk '$3 == "/mnt" {print $6}' | sed 's/^.*subvol=/subvol=/' | sed -e 's/,.*$/,/p' | sed 's/)//g')"
sed -i "s|\"$|\ $rootflag\"|g" /mnt/boot/refind_linux.conf
fi
# Set the root parameter if encrypted or on LVM
#ROOT_PART="/dev/$(lsblk -lno NAME,MOUNTPOINT | grep "/mnt$" | awk '{print $1}')"
if [[ $(echo $ROOT_PART | grep "/dev/mapper/") != "" ]]; then
bl_root="PARTUUID=$(blkid -s PARTUUID ${ROOT_PART} | sed 's/.*=//g' | sed 's/"//g')"
sed -i "s/root=.* /root=$bl_root /g" /mnt/boot/refind_linux.conf
# LUKS
if [[ $LUKS == 1 ]]; then
root_name=$(mount | awk '/\/mnt / {print $1}' | sed s~/dev/mapper/~~g)
mapper_name="$(mount | awk '/\/mnt / {print $1}')"
ROOTY_PARTY="/dev/$(lsblk -lno NAME,MOUNTPOINT,TYPE | grep -B1 "${root_name}" | grep "part" | awk '{print $1}')"
bl_root="PARTUUID=$(blkid -s PARTUUID ${ROOTY_PARTY} | sed 's/.*=//g' | sed 's/"//g')"
sed -i "s|root=.* |cryptdevice=$bl_root:$root_name root=$mapper_name |g" /mnt/boot/refind_linux.conf
sed -i '/Boot with minimal options/d' /mnt/boot/refind_linux.conf
fi
# Set the root parameter if encrypted or on LVM
# ROOTY_PARTY="/dev/$(lsblk -lno NAME,MOUNTPOINT | grep "/mnt$" | awk '{print $1}')"
#if [[ $(echo $ROOTY_PARTY | grep "/dev/mapper/") != "" ]]; then
# bl_root="PARTUUID=$(blkid -s PARTUUID ${ROOTY_PARTY} | sed 's/.*=//g' | sed 's/"//g')"
# sed -i "s/root=.* /root=$bl_root /g" /mnt/boot/refind_linux.conf
# sed -i '/Boot with minimal options/d' /mnt/boot/refind_linux.conf
#fi
DIALOG " $_InstUefiBtTitle " --infobox "\n$_RefindReady\n " 0 0
sleep 2
}

@ -56,10 +56,10 @@ edit_configs() {
options+=( $i "refind_linux.conf" )
functions+=( "nano ${MOUNTPOINT}/boot/refind_linux.conf" )
fi
if [[ -e ${MOUNTPOINT}/boot/efi/EFI/refind/refind_linux.conf ]]; then
if [[ -e ${MOUNTPOINT}${UEFI_MOUNT}/EFI/refind/refind_linux.conf ]]; then
((i++))
options+=( $i "refind.conf" )
functions+=( "nano ${MOUNTPOINT}/boot/efi/EFI/refind/refind_linux.conf" )
functions+=( "nano ${MOUNTPOINT}${UEFI_MOUNT}/EFI/refind/refind_linux.conf" )
fi
if [[ -e ${MOUNTPOINT}/etc/hostname ]]; then
((i++))

@ -876,7 +876,8 @@ mount_partitions() {
DIALOG " $_PrepMntPart " --menu "\n$_SelRootBody\n " 0 0 12 ${PARTITIONS} 2>${ANSWER} || return 0
PARTITION=$(cat ${ANSWER})
ROOT_PART=${PARTITION}
echo ${ROOT_PART} > /tmp/.root_partitioni
echo ${ROOT_PART} > /tmp/.root_partition
# Format with FS (or skip) -> # Make the directory and mount. Also identify LUKS and/or LVM
select_filesystem && mount_current_partition || return 0
@ -971,9 +972,9 @@ btrfs_subvolumes()
{
#1) save mount options and name of the root partition
mount | grep "on /mnt " | grep -Po '(?<=\().*(?=\))' > /tmp/.root_mount_options
lsblk -lno MOUNTPOINT,NAME | awk '/^\/mnt / {print $2}' > /tmp/.root_partition
#lsblk -lno MOUNTPOINT,NAME | awk '/^\/mnt / {print $2}' > /tmp/.root_partition
#2) choose automatic or manual mode
DIALOG " Choose mode " --menu "\n$_Note\nAutomatic mode is deigned to\nallow integration with snapper,\nnon-recursive snapshots,\nseparating system and user data\nand restoring snapshots without losing data. " 0 0 2 \
DIALOG " Choose mode " --menu "\n$_Note\nAutomatic mode is designed to\nallow integration with snapper,\nnon-recursive snapshots,\nseparating system and user data\nand restoring snapshots without losing data. " 0 0 2 \
"1" "automatic" \
"2" "manual" 2>/tmp/.subvol_mode
@ -996,7 +997,7 @@ btrfs_subvolumes()
for sub in $(cat /tmp/.subvols); do
DIALOG "Mount subvolume $sub" --inputbox "\nInput mountpoint of the subvolume $sub\nas it would appear in installed system\n(without prepending /mnt)\n." 0 0 "/home" 2>/tmp/.mountp || return 0
mkdir -p /mnt/"$(cat /tmp/.mountp)"
mount -o $(cat ${MOUNT_OPTS}),subvol="$sub" /dev/"$(cat /tmp/.root_partition)" /mnt"$(cat /tmp/.mountp)"
mount -o $(cat ${MOUNT_OPTS}),subvol="$sub" "$(cat /tmp/.root_partition)" /mnt"$(cat /tmp/.mountp)"
done
else
DIALOG " Automatic btrfs subvolumes" --yesno "\nThis creates subvolumes @ for /,@home for /home, @cache for /var/cache and subvolume @snapshots. \n " 0 0 || return 0
@ -1009,11 +1010,11 @@ btrfs_subvolumes()
cd
# Mount subvolumes
umount /mnt
mount -o $(cat ${MOUNT_OPTS}),subvol=@ /dev/"$(cat /tmp/.root_partition)" /mnt
mount -o $(cat ${MOUNT_OPTS}),subvol=@ "$(cat /tmp/.root_partition)" /mnt
mkdir -p /mnt/home
mkdir -p /mnt/var/cache
mount -o $(cat ${MOUNT_OPTS}),subvol=@home /dev/"$(cat /tmp/.root_partition)" /mnt/home
mount -o $(cat ${MOUNT_OPTS}),subvol=@cache /dev/"$(cat /tmp/.root_partition)" /mnt/var/cache
mount -o $(cat ${MOUNT_OPTS}),subvol=@home "$(cat /tmp/.root_partition)" /mnt/home
mount -o $(cat ${MOUNT_OPTS}),subvol=@cache "$(cat /tmp/.root_partition)" /mnt/var/cache
fi
else
return 0

@ -534,9 +534,8 @@ final_check() {
# Check if bootloader is installed
if [[ $SYSTEM == "BIOS" ]]; then
arch_chroot "pacman -Qq grub" &> /dev/null || echo "- $_BootlCheck" >> ${CHECKLIST}
else
[[ -e /mnt/boot/efi/EFI/manjaro_grub/grubx64.efi ]] || [[ -e /mnt/boot/EFI/manjaro_grub/grubx64.efi ]] || echo "- $_BootlCheck" >> ${CHECKLIST}
[[ -e /mnt/boot/efi/EFI/manjaro_grub/grubx64.efi ]] || [[ -e /mnt/boot/EFI/refind/refind_x64.efi ]] || echo "- $_BootlCheck" >> ${CHECKLIST}
else ! [[ -e /mnt/boot/efi/EFI/manjaro_grub/grubx64.efi ]] || [[ -e /mnt/boot/EFI/manjaro_grub/grubx64.efi ]] || [[ -e /mnt/boot/efi/EFI/manjaro_grub/grubx64.efi ]] || ! [[ -e /mnt/boot/EFI/refind/refind_x64.efi ]]
echo "- $_BootlCheck" >> ${CHECKLIST}
fi
# Check if fstab is generated

Loading…
Cancel
Save