Skip to content

Commit

Permalink
Reapply "feat(dracut)!: improve size by zstd and --aggressive-strip"
Browse files Browse the repository at this point in the history
This reverts commit d56f945.
  • Loading branch information
madonuko committed Sep 23, 2024
1 parent 31b7508 commit 33c4866
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ pub struct IsoBuilder {

const DR_MODS: &str = "livenet dmsquash-live dmsquash-live-ntfs convertfs pollcdrom qemu qemu-net";
const DR_OMIT: &str = "";
const DR_ARGS: &str = "--xz --no-early-microcode";
const DR_ARGS: &str = "--xz --no-early-microcode --strip --aggressive-strip";

impl IsoBuilder {
fn dracut(&self, root: &Path) -> Result<()> {
Expand Down Expand Up @@ -603,6 +603,9 @@ impl IsoBuilder {
dr_args.push(&dr_omit);
}

if std::env::var("INITRD_COMPRESS").is_err() {
std::env::set_var("INITRD_COMPRESS", "zstd --ultra -22 -q -T0");
}
crate::chroot_run_cmd!(root,
unshare -R $root env - DRACUT_SYSTEMD=0 dracut $[dr_args]
/boot/initramfs-$kver.img --kver $kver 2>&1;
Expand Down

0 comments on commit 33c4866

Please sign in to comment.