19-define-os-ip #24

Merged
hygienic-books merged 23 commits from 19-define-os-ip into main 2023-11-12 03:26:37 +00:00
Showing only changes of commit 47321313a9 - Show all commits

View File

@ -1409,6 +1409,7 @@ EOF
} }
function configure_sshd () { function configure_sshd () {
#3.4
local pub_key_line local pub_key_line
cat >> '/mnt/etc/ssh/sshd_config.d/40-defaults.conf' <<"EOF" cat >> '/mnt/etc/ssh/sshd_config.d/40-defaults.conf' <<"EOF"
@ -1424,7 +1425,7 @@ EOF
} }
function configure_dns () { function configure_dns () {
#3.4 #3.5
rm '/mnt/etc/resolv.conf' rm '/mnt/etc/resolv.conf'
ln -s '/run/systemd/resolve/stub-resolv.conf' '/mnt/etc/resolv.conf' ln -s '/run/systemd/resolve/stub-resolv.conf' '/mnt/etc/resolv.conf'
@ -1435,21 +1436,22 @@ function configure_dns () {
} }
function configure_ntp () { function configure_ntp () {
#3.6
systemctl enable 'systemd-timesyncd.service' --root='/mnt' systemctl enable 'systemd-timesyncd.service' --root='/mnt'
} }
function configure_reflector () { function configure_reflector () {
#3.5 #3.7
systemctl enable 'reflector.service' 'reflector.timer' --root='/mnt' systemctl enable 'reflector.service' 'reflector.timer' --root='/mnt'
} }
function configure_zfs () { function configure_zfs () {
#3.6 #3.8
systemctl enable 'zfs-import-cache.service' 'zfs-mount.service' 'zfs-import.target' 'zfs.target' --root='/mnt' systemctl enable 'zfs-import-cache.service' 'zfs-mount.service' 'zfs-import.target' 'zfs.target' --root='/mnt'
} }
function configure_zfs_mount_gen () { function configure_zfs_mount_gen () {
#3.7 #3.9
mkdir -p '/mnt/etc/zfs/zfs-list.cache' mkdir -p '/mnt/etc/zfs/zfs-list.cache'
touch '/mnt/etc/zfs/zfs-list.cache/'"${zpool_name}" touch '/mnt/etc/zfs/zfs-list.cache/'"${zpool_name}"
zfs list -H -o name,mountpoint,canmount,atime,relatime,devices,exec,readonly,setuid,nbmand | sed 's/\/mnt//' > '/mnt/etc/zfs/zfs-list.cache/'"${zpool_name}" zfs list -H -o name,mountpoint,canmount,atime,relatime,devices,exec,readonly,setuid,nbmand | sed 's/\/mnt//' > '/mnt/etc/zfs/zfs-list.cache/'"${zpool_name}"
@ -1457,7 +1459,7 @@ function configure_zfs_mount_gen () {
} }
function set_new_uefi_boot_entries () { function set_new_uefi_boot_entries () {
#3.8 #3.10
declare -a uefi_images declare -a uefi_images
mapfile -t uefi_images < \ mapfile -t uefi_images < \
<(find '/mnt/efi/EFI/ZBM' -type f -iname '*.efi' -print0 | \ <(find '/mnt/efi/EFI/ZBM' -type f -iname '*.efi' -print0 | \
@ -1500,7 +1502,7 @@ function set_new_uefi_boot_entries () {
} }
function umount_all () { function umount_all () {
#3.9 #3.11
if [[ "${part_schema}" = 'mbr' ]]; then if [[ "${part_schema}" = 'mbr' ]]; then
umount '/mnt/boot/syslinux' umount '/mnt/boot/syslinux'
else else
@ -1515,17 +1517,17 @@ function finalize_os_setup () {
set_root_pw #3.2 set_root_pw #3.2
configure_networking #3.3 configure_networking #3.3
if [[ "${ARCHZBM_OS_SSH_AUTH_KEYS}" ]]; then if [[ "${ARCHZBM_OS_SSH_AUTH_KEYS}" ]]; then
configure_sshd configure_sshd #3.4
fi fi
configure_dns #3.4 configure_dns #3.5
configure_ntp configure_ntp #3.6
configure_reflector #3.5 configure_reflector #3.7
configure_zfs #3.6 configure_zfs #3.8
configure_zfs_mount_gen #3.7 configure_zfs_mount_gen #3.9
if [[ "${part_schema}" = 'gpt' ]]; then if [[ "${part_schema}" = 'gpt' ]]; then
set_new_uefi_boot_entries #3.8 set_new_uefi_boot_entries #3.10
fi fi
umount_all #3.9 umount_all #3.11
} }
function main () { function main () {