From 296213448dae45def41f14de9b46b3d694316841 Mon Sep 17 00:00:00 2001 From: Nulo Date: Sat, 2 Jul 2022 15:34:46 -0300 Subject: [PATCH] Correr mkinitfs manualmente con zstd sin -19 --- modules/kernel.lua | 21 +++++++++++++++++---- setup.lua | 2 ++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/modules/kernel.lua b/modules/kernel.lua index a0c74cb..828a90b 100644 --- a/modules/kernel.lua +++ b/modules/kernel.lua @@ -1,6 +1,17 @@ -modules.kernel = {} +local t = require("../utils/templater") -add_packages({ "linux-virt" }) +modules.kernel = { + flavor = "virt", + mkinitfs = function(rootfs_path) + local status = os.execute(t("sudo sed -i 's/^esac/esac;comp=zstd/' '{{rootfs_path}}'/sbin/mkinitfs && sudo chroot '{{rootfs_path}}' mkinitfs -o /boot/initramfs-{{flavor}} $(cat '{{rootfs_path}}'/usr/share/kernel/'{{flavor}}'/kernel.release)", { + rootfs_path = rootfs_path, + flavor = modules.kernel.flavor, + })) + if not (status == 0) then return status end + end, +} + +add_packages({ "linux-" .. modules.kernel.flavor, "zstd" }) add_file("/etc/update-extlinux.conf", [[# configuration for extlinux config builder # Overwrite current /boot/extlinux.conf. @@ -26,5 +37,7 @@ timeout=3 default=lts ]]) -add_file("/etc/mkinitfs/mkinitfs.conf", - 'features="squashfs ata base cdrom ext4 keymap kms mmc nvme scsi usb virtio"') +add_file("/etc/mkinitfs/mkinitfs.conf", [[ +features="squashfs ata base cdrom ext4 keymap kms mmc nvme scsi usb virtio" +disable_trigger=yes +]]) diff --git a/setup.lua b/setup.lua index 4da73cf..ccdf6df 100644 --- a/setup.lua +++ b/setup.lua @@ -51,6 +51,8 @@ module "nginx" print("=> Installing and upgrading packages...") utils.expect_nil(alpine.make_world(root, packages)) +print("=> Generating initramfs...") +utils.expect_nil(modules.kernel.mkinitfs(root)) print("=> Setting password...") utils.expect_nil(alpine.set_password(root, "root", "1")) print("=> Moving boot...") -- 2.45.2