7-add-legacy-bios-support #8

Merged
hygienic-books merged 12 commits from 7-add-legacy-bios-support into main 2023-10-24 00:25:35 +00:00
Showing only changes of commit d685431684 - Show all commits

View File

@ -44,8 +44,45 @@ function we_are_changerooted () {
fi fi
} }
function uefi_or_bios () { function no_kernel_update_in_iso () {
#1.1 #1.1
sed -ri -e 's'$'\x1''#(IgnorePkg)[^\r\n\f]+'$'\x1''\1 = linux linux-headers'$'\x1''g' /etc/pacman.conf
}
function set_ntp () {
#1.2
timedatectl set-ntp true
}
function resize_cow_space () {
#1.3
mount -o remount,size='50%' /run/archiso/cowspace
}
function update_pacman_db () {
#1.4
printf -- '%s\n' 'Refreshing mirror list ...'
systemctl start reflector
# In an ISO and for the minimal number of packages we need we do not
# care about partial upgrades
pacman -Syyuu --noconfirm
}
function install_pkgs () {
#1.5
printf -- '%s\n' 'Installing packages ...'
pacman -S --needed --noconfirm "${@}"
}
function install_zfs () {
#1.6
declare reset_colors='\033[0m'
curl -s 'https://raw.githubusercontent.com/eoli3n/archiso-zfs/master/init' | bash
printf -- "${reset_colors}"
}
function uefi_or_bios () {
#1.7
local part_count_linux part_count_efi local part_count_linux part_count_efi
# Select disks with at least one partition. Among them count how many # Select disks with at least one partition. Among them count how many
# with the given partition type code we have. # with the given partition type code we have.
@ -72,43 +109,6 @@ function uefi_or_bios () {
fi fi
} }
function no_kernel_update_in_iso () {
#1.2
sed -ri -e 's'$'\x1''#(IgnorePkg)[^\r\n\f]+'$'\x1''\1 = linux linux-headers'$'\x1''g' /etc/pacman.conf
}
function set_ntp () {
#1.3
timedatectl set-ntp true
}
function resize_cow_space () {
#1.4
mount -o remount,size='50%' /run/archiso/cowspace
}
function update_pacman_db () {
#1.5
printf -- '%s\n' 'Refreshing mirror list ...'
systemctl start reflector
# In an ISO and for the minimal number of packages we need we do not
# care about partial upgrades
pacman -Syyuu --noconfirm
}
function install_pkgs () {
#1.6
printf -- '%s\n' 'Installing packages ...'
pacman -S --needed --noconfirm "${@}"
}
function install_zfs () {
#1.7
declare reset_colors='\033[0m'
curl -s 'https://raw.githubusercontent.com/eoli3n/archiso-zfs/master/init' | bash
printf -- "${reset_colors}"
}
function get_partitions () { function get_partitions () {
declare partitions_json declare partitions_json
partitions_json="$(lsblk --output PATH,PARTTYPE --json --tree)" || return 1 partitions_json="$(lsblk --output PATH,PARTTYPE --json --tree)" || return 1
@ -873,13 +873,13 @@ function main () {
if we_are_changerooted; then if we_are_changerooted; then
install_os_in_chroot #2.2 install_os_in_chroot #2.2
else else
uefi_or_bios #1.1 no_kernel_update_in_iso #1.1
no_kernel_update_in_iso #1.2 set_ntp #1.2
set_ntp #1.3 resize_cow_space #1.3
resize_cow_space #1.4 update_pacman_db #1.4
update_pacman_db #1.5 install_pkgs 'jq' #1.5
install_pkgs 'jq' #1.6 install_zfs #1.6
install_zfs #1.7 uefi_or_bios #1.7
setup_zpool #1.8 setup_zpool #1.8
mount_system #1.9 mount_system #1.9
copy_zpool_cache #1.10 copy_zpool_cache #1.10