mirror of
https://gitlab.com/prism7/archery.git
synced 2026-04-28 17:37:36 +02:00
Change: Partition naming has been changed under LUKS encryption.
Change: Prompts have been edited for better aesthetics.
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Amelia Installer
|
# Amelia Installer
|
||||||
# Source: https://gitlab.com/prism7/archery
|
# Source: https://gitlab.com/prism7/archery
|
||||||
# Version: 1.0.10
|
# Version: 1.0.11
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
@@ -220,9 +220,13 @@ stage_ok() {
|
|||||||
stage_fail() {
|
stage_fail() {
|
||||||
sleep 0.2
|
sleep 0.2
|
||||||
RED "
|
RED "
|
||||||
|
|
||||||
>> ${bwhite}${stage_prompt} ${nc}${red}FAILED${cyan}
|
>> ${bwhite}${stage_prompt} ${nc}${red}FAILED${cyan}
|
||||||
|
|
||||||
>> ${nc}Check ${yellowl}Amelia.log ${nc}for errors "
|
|
||||||
|
>> ${nc}Check ${yellowl}Amelia.log ${nc}for errors
|
||||||
|
|
||||||
|
"
|
||||||
failure
|
failure
|
||||||
}
|
}
|
||||||
completion_err() {
|
completion_err() {
|
||||||
@@ -3993,12 +3997,6 @@ Enter a disk number: "
|
|||||||
###################################################################################################
|
###################################################################################################
|
||||||
sanity_check() {
|
sanity_check() {
|
||||||
|
|
||||||
sleep 0.2
|
|
||||||
NC "
|
|
||||||
|
|
||||||
${magenta}###${nc}--------------------------------------${magenta}[ ${bwhite}Sanity Check${nc} ${magenta}]${nc}--------------------------------------${magenta}###
|
|
||||||
|
|
||||||
"
|
|
||||||
rootcount="$(fdisk -l "${instl_drive}" | grep -E -c 'root' | awk "{print \$1}")"
|
rootcount="$(fdisk -l "${instl_drive}" | grep -E -c 'root' | awk "{print \$1}")"
|
||||||
root_dev="$(fdisk -l "${instl_drive}" | grep -E 'root' | awk "{print \$1}")"
|
root_dev="$(fdisk -l "${instl_drive}" | grep -E 'root' | awk "{print \$1}")"
|
||||||
multi_root="$(fdisk -l "${instl_drive}" | grep -E 'root' | awk "{print \$1}" | cat --number)"
|
multi_root="$(fdisk -l "${instl_drive}" | grep -E 'root' | awk "{print \$1}" | cat --number)"
|
||||||
@@ -4024,6 +4022,12 @@ ${magenta}###${nc}--------------------------------------${magenta}[ ${bwhite}San
|
|||||||
xbootprt=""
|
xbootprt=""
|
||||||
homeprt=""
|
homeprt=""
|
||||||
swapprt=""
|
swapprt=""
|
||||||
|
sleep 0.2
|
||||||
|
NC "
|
||||||
|
|
||||||
|
${magenta}###${nc}--------------------------------------${magenta}[ ${bwhite}Sanity Check${nc} ${magenta}]${nc}--------------------------------------${magenta}###
|
||||||
|
"
|
||||||
|
[[ "${rootcount}" == "1" || "${espcount}" == "1" || "${xbootcount}" == "1" || "${homecount}" == "1" || "${swapcount}" == "1" ]] && echo
|
||||||
|
|
||||||
if [[ "${rootcount}" -gt "1" ]]; then
|
if [[ "${rootcount}" -gt "1" ]]; then
|
||||||
local stage_prompt="Selecting Partition"
|
local stage_prompt="Selecting Partition"
|
||||||
@@ -4049,11 +4053,11 @@ ${multi_root}
|
|||||||
"
|
"
|
||||||
YELLOW "
|
YELLOW "
|
||||||
|
|
||||||
### Only the 1st Linux x86-64 /Root partition on a selected disk can be auto-assigned as a valid /Root partition
|
### Only the ${nc}1st Linux x86-64 /Root ${yellow}partition on a selected disk can be ${nc}auto-assigned ${yellow}as a valid /Root partition${cyan}
|
||||||
|
|
||||||
|
|
||||||
> Partition ${nc}${root_comply} ${yellow}is auto-assigned as such and will be ${red}[!] ${nc}FORMATTED ${red}[!]
|
>> ${nc}Partition ${yellowl}${root_comply} ${nc}is auto-assigned as such and will be ${red}[!] ${nc}FORMATTED ${red}[!]
|
||||||
"
|
"
|
||||||
BLUE "
|
BLUE "
|
||||||
|
|
||||||
|
|
||||||
@@ -4100,15 +4104,15 @@ ${multi_esp}
|
|||||||
"
|
"
|
||||||
YELLOW "
|
YELLOW "
|
||||||
|
|
||||||
### Only the 1st EFI partition on a selected disk can be auto-assigned as a valid EFI partition
|
### Only the ${nc}1st EFI partition${yellow} on a selected disk can be ${nc}auto-assigned ${yellow}as a valid EFI partition
|
||||||
"
|
"
|
||||||
if [[ "${multibooting}" == "n" ]]; then
|
if [[ "${multibooting}" == "n" ]]; then
|
||||||
YELLOW "
|
CYAN "
|
||||||
> Partition ${nc}${esp_comply} ${yellow}is auto-assigned as such and will be ${red}[!] ${nc}FORMATTED ${red}[!]
|
>> ${nc}Partition ${yellowl}${esp_comply} ${nc}is auto-assigned as such and will be ${red}[!] ${nc}FORMATTED ${red}[!]
|
||||||
"
|
"
|
||||||
elif [[ "${multibooting}" == "y" ]]; then
|
elif [[ "${multibooting}" == "y" ]]; then
|
||||||
YELLOW "
|
CYAN "
|
||||||
> Partition ${nc}${esp_comply} ${yellow}is auto-assigned as such and will be used
|
>> ${nc}Partition ${yellowl}${esp_comply} ${nc}is auto-assigned as such and will be used in the installation
|
||||||
"
|
"
|
||||||
fi
|
fi
|
||||||
BLUE "
|
BLUE "
|
||||||
@@ -4156,11 +4160,11 @@ ${multi_xboot}
|
|||||||
"
|
"
|
||||||
YELLOW "
|
YELLOW "
|
||||||
|
|
||||||
### Only the 1st Linux Extended Boot partition on a selected disk can be auto-assigned as a valid XBOOTLDR partition
|
### Only the ${nc}1st Linux Extended Boot ${yellow}partition on a selected disk can be ${nc}auto-assigned ${yellow}as a valid /XBOOTLDR partition${cyan}
|
||||||
|
|
||||||
|
|
||||||
> Partition ${nc}${xboot_comply} ${yellow}is auto-assigned as such and will be ${red}[!] ${nc}FORMATTED ${red}[!]
|
>> ${nc}Partition ${yellowl}${xboot_comply} ${nc}is auto-assigned as such and will be ${red}[!] ${nc}FORMATTED ${red}[!]
|
||||||
"
|
"
|
||||||
BLUE "
|
BLUE "
|
||||||
|
|
||||||
|
|
||||||
@@ -4206,10 +4210,10 @@ ${multi_home}
|
|||||||
"
|
"
|
||||||
YELLOW "
|
YELLOW "
|
||||||
|
|
||||||
### Only the 1st Linux /Home partition on a selected disk can be auto-assigned as a valid /Home partition
|
### Only the ${nc}1st Linux /Home ${yellow}partition on a selected disk can be ${nc}auto-assigned ${yellow}as a valid /Home partition${cyan}
|
||||||
|
|
||||||
|
|
||||||
> Partition ${nc}${home_comply} ${yellow}is auto-assigned as such and will be used
|
>> ${nc}Partition ${yellowl}${home_comply} ${nc}is auto-assigned as such and will be used in the installation
|
||||||
"
|
"
|
||||||
BLUE "
|
BLUE "
|
||||||
|
|
||||||
@@ -4248,19 +4252,19 @@ ${multi_home}
|
|||||||
|
|
||||||
###${nc}-----------------------------------------------------------------------------------------------------------------${cyan}### "
|
###${nc}-----------------------------------------------------------------------------------------------------------------${cyan}### "
|
||||||
NC "
|
NC "
|
||||||
${yellowl}Linux /Swap Partitions:${nc}
|
${yellowl}Linux /Swap Partitions:${nc}
|
||||||
|
|
||||||
------------------------
|
-----------------------
|
||||||
${multi_swap}
|
${multi_swap}
|
||||||
------------------------
|
-----------------------
|
||||||
"
|
"
|
||||||
YELLOW "
|
YELLOW "
|
||||||
|
|
||||||
### Only the 1st Linux /Swap partition on a selected disk can be auto-assigned as a valid /Swap partition
|
### Only the ${nc}1st Linux /Swap ${yellow}partition on a selected disk can be ${nc}auto-assigned ${yellow}as a valid /Swap partition${cyan}
|
||||||
|
|
||||||
|
|
||||||
> Partition ${nc}${swap_comply} ${yellow}is auto-assigned as such and will be ${red}[!] ${nc}FORMATTED ${red}[!]
|
>> ${nc}Partition ${yellowl}${swap_comply} ${nc}is auto-assigned as such and will be ${red}[!] ${nc}FORMATTED ${red}[!]
|
||||||
"
|
"
|
||||||
BLUE "
|
BLUE "
|
||||||
|
|
||||||
|
|
||||||
@@ -4891,6 +4895,9 @@ instl() {
|
|||||||
###################################################################################################
|
###################################################################################################
|
||||||
swappart() {
|
swappart() {
|
||||||
|
|
||||||
|
if [[ "${encrypt}" == "yes" ]]; then
|
||||||
|
line2
|
||||||
|
fi
|
||||||
local prompt="Swap Partition Creation"
|
local prompt="Swap Partition Creation"
|
||||||
local stage_prompt="Swap Partition Creation"
|
local stage_prompt="Swap Partition Creation"
|
||||||
sleep 0.2
|
sleep 0.2
|
||||||
@@ -5923,20 +5930,21 @@ ${magenta}###${nc}-------------------------------------${magenta}[ ${bwhite}LUKS
|
|||||||
BLUE "
|
BLUE "
|
||||||
|
|
||||||
|
|
||||||
> Encrypting your ${yellowl}${LuksParts}:
|
> Encrypting your ${yellowl}${LuksParts}${blue}:
|
||||||
|
|
||||||
|
|
||||||
"
|
"
|
||||||
if echo -n "${CRYPTPASS}" | cryptsetup luksFormat --label CRYPTROOT "${root_dev}" > "${void}"; then
|
if echo -n "${CRYPTPASS}" | cryptsetup luksFormat --label CRYPTROOT "${root_dev}" > "${void}"; then
|
||||||
if [[ "${rota}" == "0" ]]; then
|
if [[ "${rota}" == "0" ]]; then
|
||||||
echo -n "${CRYPTPASS}" | cryptsetup --perf-no_read_workqueue --perf-no_write_workqueue --persistent luksOpen "${root_dev}" CryptArch || err_abort
|
echo -n "${CRYPTPASS}" | cryptsetup --perf-no_read_workqueue --perf-no_write_workqueue --persistent luksOpen "${root_dev}" CryptRoot || err_abort
|
||||||
else
|
else
|
||||||
echo -n "${CRYPTPASS}" | cryptsetup luksOpen "${root_dev}" CryptArch || err_abort
|
echo -n "${CRYPTPASS}" | cryptsetup luksOpen "${root_dev}" CryptRoot || err_abort
|
||||||
fi
|
fi
|
||||||
#------------------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------------------
|
||||||
if [[ "${fs}" == "1" ]]; then
|
if [[ "${fs}" == "1" ]]; then
|
||||||
mkfs.ext4 -F -L Root /dev/mapper/CryptArch > "${void}" 2> "${log}" || err_abort
|
mkfs.ext4 -F -L CryptRoot /dev/mapper/CryptRoot > "${void}" 2> "${log}" || err_abort
|
||||||
tune2fs -O fast_commit /dev/mapper/CryptArch > "${void}" 2> "${log}" || err_abort
|
tune2fs -O fast_commit /dev/mapper/CryptRoot > "${void}" 2> "${log}" || err_abort
|
||||||
mount /dev/mapper/CryptArch /mnt > "${void}" 2> "${log}" || err_abort
|
mount /dev/mapper/CryptRoot /mnt > "${void}" 2> "${log}" || err_abort
|
||||||
sleep 0.2
|
sleep 0.2
|
||||||
NC "
|
NC "
|
||||||
==> [${green}Encrypted /Root OK${nc}]
|
==> [${green}Encrypted /Root OK${nc}]
|
||||||
@@ -5944,8 +5952,8 @@ ${magenta}###${nc}-------------------------------------${magenta}[ ${bwhite}LUKS
|
|||||||
luks_root="ok"
|
luks_root="ok"
|
||||||
#------------------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------------------
|
||||||
elif [[ "${fs}" == "2" ]]; then
|
elif [[ "${fs}" == "2" ]]; then
|
||||||
mkfs.btrfs -f -L Root /dev/mapper/CryptArch > "${void}" 2> "${log}" || err_abort
|
mkfs.btrfs -f -L CryptRoot /dev/mapper/CryptRoot > "${void}" 2> "${log}" || err_abort
|
||||||
mount /dev/mapper/CryptArch /mnt > "${void}" 2> "${log}" || err_abort
|
mount /dev/mapper/CryptRoot /mnt > "${void}" 2> "${log}" || err_abort
|
||||||
btrfs subvolume create /mnt/@ > "${void}" 2> "${log}" || err_abort
|
btrfs subvolume create /mnt/@ > "${void}" 2> "${log}" || err_abort
|
||||||
btrfs subvolume create /mnt/@home > "${void}" 2> "${log}" || err_abort
|
btrfs subvolume create /mnt/@home > "${void}" 2> "${log}" || err_abort
|
||||||
btrfs subvolume create /mnt/@cache > "${void}" 2> "${log}" || err_abort
|
btrfs subvolume create /mnt/@cache > "${void}" 2> "${log}" || err_abort
|
||||||
@@ -5956,14 +5964,14 @@ ${magenta}###${nc}-------------------------------------${magenta}[ ${bwhite}LUKS
|
|||||||
btrfs subvolume create /mnt/@swap > "${void}" 2> "${log}" || err_abort
|
btrfs subvolume create /mnt/@swap > "${void}" 2> "${log}" || err_abort
|
||||||
fi
|
fi
|
||||||
umount /mnt > "${void}" 2> "${log}" || err_abort
|
umount /mnt > "${void}" 2> "${log}" || err_abort
|
||||||
mount -o "${sbvl_mnt_opts}",subvol=@ /dev/mapper/CryptArch /mnt > "${void}" 2> "${log}" || err_abort
|
mount -o "${sbvl_mnt_opts}",subvol=@ /dev/mapper/CryptRoot /mnt > "${void}" 2> "${log}" || err_abort
|
||||||
mount --mkdir -o "${sbvl_mnt_opts}",subvol=@home /dev/mapper/CryptArch /mnt/home > "${void}" 2> "${log}" || err_abort
|
mount --mkdir -o "${sbvl_mnt_opts}",subvol=@home /dev/mapper/CryptRoot /mnt/home > "${void}" 2> "${log}" || err_abort
|
||||||
mount --mkdir -o "${sbvl_mnt_opts}",subvol=@cache /dev/mapper/CryptArch /mnt/var/cache > "${void}" 2> "${log}" || err_abort
|
mount --mkdir -o "${sbvl_mnt_opts}",subvol=@cache /dev/mapper/CryptRoot /mnt/var/cache > "${void}" 2> "${log}" || err_abort
|
||||||
mount --mkdir -o "${sbvl_mnt_opts}",subvol=@log /dev/mapper/CryptArch /mnt/var/log > "${void}" 2> "${log}" || err_abort
|
mount --mkdir -o "${sbvl_mnt_opts}",subvol=@log /dev/mapper/CryptRoot /mnt/var/log > "${void}" 2> "${log}" || err_abort
|
||||||
mount --mkdir -o "${sbvl_mnt_opts}",subvol=@tmp /dev/mapper/CryptArch /mnt/var/tmp > "${void}" 2> "${log}" || err_abort
|
mount --mkdir -o "${sbvl_mnt_opts}",subvol=@tmp /dev/mapper/CryptRoot /mnt/var/tmp > "${void}" 2> "${log}" || err_abort
|
||||||
mount --mkdir -o "${sbvl_mnt_opts}",subvol=@snapshots /dev/mapper/CryptArch /mnt/"${snapname}" > "${void}" 2> "${log}" || err_abort
|
mount --mkdir -o "${sbvl_mnt_opts}",subvol=@snapshots /dev/mapper/CryptRoot /mnt/"${snapname}" > "${void}" 2> "${log}" || err_abort
|
||||||
if [[ "${swapmode}" == "2" ]]; then
|
if [[ "${swapmode}" == "2" ]]; then
|
||||||
mount --mkdir -o "${sbvl_mnt_opts}",subvol=@swap /dev/mapper/CryptArch /mnt/swap > "${void}" 2> "${log}" || err_abort
|
mount --mkdir -o "${sbvl_mnt_opts}",subvol=@swap /dev/mapper/CryptRoot /mnt/swap > "${void}" 2> "${log}" || err_abort
|
||||||
fi
|
fi
|
||||||
sleep 0.2
|
sleep 0.2
|
||||||
NC "
|
NC "
|
||||||
@@ -5982,11 +5990,11 @@ ${magenta}###${nc}-------------------------------------${magenta}[ ${bwhite}LUKS
|
|||||||
line2
|
line2
|
||||||
if echo -n "${CRYPTPASS}" | cryptsetup luksFormat --label CRYPTSWAP "${swap_dev}" > "${void}"; then
|
if echo -n "${CRYPTPASS}" | cryptsetup luksFormat --label CRYPTSWAP "${swap_dev}" > "${void}"; then
|
||||||
if [[ "${rota}" == "0" ]]; then
|
if [[ "${rota}" == "0" ]]; then
|
||||||
echo -n "${CRYPTPASS}" | cryptsetup --perf-no_read_workqueue --perf-no_write_workqueue --persistent luksOpen "${swap_dev}" swap || err_abort
|
echo -n "${CRYPTPASS}" | cryptsetup --perf-no_read_workqueue --perf-no_write_workqueue --persistent luksOpen "${swap_dev}" CryptSwap || err_abort
|
||||||
else
|
else
|
||||||
echo -n "${CRYPTPASS}" | cryptsetup luksOpen "${swap_dev}" swap || err_abort
|
echo -n "${CRYPTPASS}" | cryptsetup luksOpen "${swap_dev}" CryptSwap || err_abort
|
||||||
fi
|
fi
|
||||||
mkswap /dev/mapper/swap > "${void}" 2> "${log}" || err_abort
|
mkswap /dev/mapper/CryptSwap > "${void}" 2> "${log}" || err_abort
|
||||||
sleep 0.2
|
sleep 0.2
|
||||||
NC "
|
NC "
|
||||||
==> [${green}Encrypted /Swap OK${nc}]
|
==> [${green}Encrypted /Swap OK${nc}]
|
||||||
@@ -7183,9 +7191,9 @@ set_vars() {
|
|||||||
if [[ "${encrypt}" == "yes" ]]; then
|
if [[ "${encrypt}" == "yes" ]]; then
|
||||||
|
|
||||||
# Encrypted Root Device
|
# Encrypted Root Device
|
||||||
encr_root_dev="/dev/mapper/CryptArch"
|
encr_root_dev="/dev/mapper/CryptRoot"
|
||||||
# Encrypted Root Options
|
# Encrypted Root Options
|
||||||
encr_root_opts="rd.luks.name=$(blkid -s UUID -o value "${root_dev}")=CryptArch"
|
encr_root_opts="rd.luks.name=$(blkid -s UUID -o value "${root_dev}")=CryptRoot"
|
||||||
|
|
||||||
|
|
||||||
# ATTENTION LUKS ROOT KERNEL CMDLINE
|
# ATTENTION LUKS ROOT KERNEL CMDLINE
|
||||||
@@ -7197,10 +7205,10 @@ set_vars() {
|
|||||||
# Encrypted Swap Partition
|
# Encrypted Swap Partition
|
||||||
if [[ "${swapmode}" == "1" ]]; then
|
if [[ "${swapmode}" == "1" ]]; then
|
||||||
# Encrypted Swap Partition Options
|
# Encrypted Swap Partition Options
|
||||||
encr_swap_opts="rd.luks.name=$(blkid -s UUID -o value "${swap_dev}")=swap"
|
encr_swap_opts="rd.luks.name=$(blkid -s UUID -o value "${swap_dev}")=CryptSwap"
|
||||||
|
|
||||||
# ATTENTION LUKS SWAP PARTITION KERNEL CMDLINE
|
# ATTENTION LUKS SWAP PARTITION KERNEL CMDLINE
|
||||||
encr_swap_bootopts="resume=/dev/mapper/swap ${encr_swap_opts}"
|
encr_swap_bootopts="resume=/dev/mapper/CryptSwap ${encr_swap_opts}"
|
||||||
|
|
||||||
# Encrypted Swapfile
|
# Encrypted Swapfile
|
||||||
elif [[ "${swapmode}" == "2" ]]; then
|
elif [[ "${swapmode}" == "2" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user