module Getch module FileSystem module Zfs module Encrypt class Deps < Getch::FileSystem::Zfs::Encrypt::Device def make unstable_zfs install_deps zfs_mountpoint auto_module_rebuild hostid options_make Getch::Make.new("genkernel --kernel-config=/usr/src/linux/.config all").run! end private def unstable_zfs conf = "#{MOUNTPOINT}/etc/portage/package.accept_keywords/zfs" data = [ "sys-fs/zfs-kmod", "sys-fs/zfs" ] File.write(conf, data.join("\n"), mode: "w") end def install_deps Getch::Bask.new('-a zfs').run! Getch::Make.new("make modules_prepare").run! Getch::Make.new("make -j$(nproc)").run! Getch::Emerge.new('genkernel sys-fs/zfs').pkg! end # See: https://wiki.archlinux.org/index.php/ZFS#Using_zfs-mount-generator def zfs_mountpoint Helpers::mkdir("#{MOUNTPOINT}/etc/zfs/zfs-list.cache") Helpers::touch("#{MOUNTPOINT}/etc/zfs/zfs-list.cache/#{@boot_pool_name}") if @dev_boot Helpers::touch("#{MOUNTPOINT}/etc/zfs/zfs-list.cache/#{@pool_name}") exec("ln -fs /usr/libexec/zfs/zed.d/history_event-zfs-list-cacher.sh /etc/zfs/zed.d/") exec("systemctl start zfs-zed.service") Helpers::sys("sed -Ei \"s|/mnt/?|/|\" #{MOUNTPOINT}/etc/zfs/zfs-list.cache/*") exec("systemctl enable zfs-zed.service") exec("systemctl enable zfs.target") end def auto_module_rebuild g_dir="#{MOUNTPOINT}/etc/portage/env/sys-kernel" Helpers::mkdir(g_dir) # See https://wiki.gentoo.org/wiki/Kernel/Upgrade#Automated_build_and_installation content=<