fix(os): Shorten initramfs build list (#1)

This commit is contained in:
hygienic-books 2023-02-20 04:14:44 +01:00
parent 11b43e6fd0
commit cddcce4ff3

View File

@ -258,6 +258,16 @@ function add_zfs_hook_to_initramfs () {
'/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 () {
for zfs_file in '/etc/hostid' '/etc/zfs/zpool.cache' '/etc/zfs/zpool.key'; do
rsync -av --itemize-changes {'','/mnt'}"${zfs_file}"
@ -510,6 +520,7 @@ function main () {
set_hostname
set_locale
add_zfs_hook_to_initramfs
set_initramfs_build_list
add_zfs_files_to_new_os
enter_chroot
# We're done in chroot