1-get-initial-setup-working #2

Merged
hygienic-books merged 92 commits from 1-get-initial-setup-working into main 2023-03-05 03:02:48 +00:00
Showing only changes of commit cddcce4ff3 - Show all commits

View File

@ -258,6 +258,16 @@ function add_zfs_hook_to_initramfs () {
'/mnt/etc/mkinitcpio.conf' '/mnt/etc/mkinitcpio.conf'
} }
function set_initramfs_build_list () {
# No need to build fallback initramfs, our new fallback is ZFS snapshots
sed -ri \
-e '/^#/d' \
-e '/^$/d' \
-e '/^fallback/d' \
-e 's'$'\x1''^(PRESETS=)[^\r\n\f]*'$'\x1''\1('"'"'default'"'"')'$'\x1''g' \
'/mnt/etc/mkinitcpio.d/linux.preset'
}
function add_zfs_files_to_new_os () { function add_zfs_files_to_new_os () {
for zfs_file in '/etc/hostid' '/etc/zfs/zpool.cache' '/etc/zfs/zpool.key'; do for zfs_file in '/etc/hostid' '/etc/zfs/zpool.cache' '/etc/zfs/zpool.key'; do
rsync -av --itemize-changes {'','/mnt'}"${zfs_file}" rsync -av --itemize-changes {'','/mnt'}"${zfs_file}"
@ -510,6 +520,7 @@ function main () {
set_hostname set_hostname
set_locale set_locale
add_zfs_hook_to_initramfs add_zfs_hook_to_initramfs
set_initramfs_build_list
add_zfs_files_to_new_os add_zfs_files_to_new_os
enter_chroot enter_chroot
# We're done in chroot # We're done in chroot