InBetweenNames / gentooLTO

A Gentoo Portage configuration for building with -O3, Graphite, and LTO optimizations
GNU General Public License v2.0
569 stars 96 forks source link

sys-fs/zfs and initramfs #91

Open gcs-github opened 6 years ago

gcs-github commented 6 years ago

Looking into this repository, I've seen an exception being made for packages which can end up being included inside an initramfs. (#31)

I'm not sure why the exception was necessary (I couldn't find the reason why genkernel was failing), but, assuming it's for good reasons, one should probably add sys-fs/zfs to the exception list for ZFS-based systems as well.

InBetweenNames commented 6 years ago

@preney can you comment on this? I think you were the one who suggested initramfs LTO workarounds. I don't have a non-empty initramfs myself so I'm not sure about the details on this one.

Thunderbottom commented 6 years ago

I'll try this tonight, I have once failed to boot and now I think it might've been -flto. I'll try disabling flto for zfs and building new initramfs.

InBetweenNames commented 6 years ago

Thanks -- I wonder what it is about the initramfs that doesn't play nice with LTO. Worth some investigating for sure.

Thunderbottom commented 6 years ago

yes, although it will take me around 12 hours to recompile everything I have with these optimizations. I'll skip zfs this time around.

preney commented 6 years ago

Yes, I have my filesystems encrypted and use initramfs boot in a small unencrypted mount. I use genkernel to avoid manually having to build all of the tools + the kernel and if the LTO settings are not suppressed, this has caused my kernel+initramfs builds to fail. So I did a pull request for those packages --until someone figures out what can be done with respect to this.

@Thunderbottom Please let us know your results, i.e., it isn't just my configurations where one encounters such. If you experience the same, then it makes sense we add ZFS to the list. (I am not using ZFS.)

Thunderbottom commented 6 years ago

I have been using dracut instead of genkernel, the initramfs built fine for me the last time around but didnt boot. Let me tell you I had a working system before that, and the exact same config. I think it might be the -flto flag and so I'll take another chance here and compile without it.

Thunderbottom commented 6 years ago

works fine for me with -flto enabled. hm.. weird..

Thunderbottom commented 6 years ago

i use dracut though. Since zfs on. genkernel is buggy and adds 30+ seconds to boot time

preney commented 6 years ago

Perhaps dracut is something I try then? If it means those packages can be LTO then would be interesting.

preney commented 6 years ago

Has anyone else here used dracut with LVM and an encrypted root (i.e., LUKS)?

Thunderbottom commented 6 years ago

yes you just add lvm as a dracut module and include crypttab and crypto_key if you have one in dracut using install_items+="/etc/crypttab <keyfile>"

preney commented 6 years ago

I am not using systemd so I don't have a crypttab file. I will figure out the settings (not in the near future though).

Thunderbottom commented 6 years ago

it is not necessary to be on systemd to use crypttab.

preney commented 6 years ago

Sure, but, whenever I have tried to have tools make use of crypttab, it has been overall an exercise in non-success --so I've not used it and simply pass those details to the boot command line.

InBetweenNames commented 6 years ago

Until we can find out what the real problem is, I agree we should accept the zfs workaround as suggested. However, I see no technical reason why LTO should not work with an initramfs. Perhaps I'll make a simple one this week to see if I can nail down what's going on here.

javashin commented 5 years ago

????