stevleibelt / arch-linux-live-cd-iso-with-zfs

archiso with zfs embedded
GNU General Public License v3.0
57 stars 15 forks source link

Handle linux/zfs-linux dependency issues #12

Closed gardar closed 1 year ago

gardar commented 2 years ago

I see that the scheduled iso build has failed due to the fact that the zfs-linux package is a version behind the linux package.

warning: cannot resolve "linux=5.19.12.arch1-1", a dependency of "zfs-linux"
:: The following package cannot be upgraded due to unresolvable dependencies:
error: failed to prepare transaction (could not satisfy dependencies)
      zfs-linux

This is a problem that I suspect everyone that has used the archzfs packages is familiar with.

I wonder if we can somehow fix this issue in the script, I see a few possible options:

  1. Run the schedule more often.
  2. Run the schedule automatically again in one day or 12 hours or something if the scheduled run fails.
  3. Take a look at what kernel version zfs-linux requires and if it's older than what's current then fetch it from https://archive.archlinux.org
  4. Use the zfs dkms package.

Options 1 and 2 are probably the easiest ones to implement, but are also the least ideal imho since it doesn't really fix the issue and only applies to running the script here on github. I'm not sure if the dkms package can be used for generating a iso but if it works then I think that might be the best option. Option 3 feels a bit hackish and I think we should only consider it if dkms doesn't work.

What are your thoughts? Do you see any other possibilities?

stevleibelt commented 2 years ago

Hello @gardar

I've just tried to build an arch iso with an zfs-dkms and it was not possible. What have I done? I've opened the build.sh and replaced the line zfs-utils (and above) with zfs-dkms. The build was running fine but when I've booted the iso, no zfs module was available.

While figuring out how to do this, I would like to debate with you about general questions when thinking about this topic.

1.) Why not build always against zfs-dkms as default? 2.) Should I implement a first run using regular zfs-linux package and if this build fails, retry it with zfs-dkms?

Else, I like your approach listed in 1. and 2.

Best regards, Stev

gardar commented 2 years ago

Did you add linux-headers too? It seems that the zfs-dkms package doesn't depend on linux-headers yet the wiki reccommends it:

If you include any DKMS packages, make sure you also include headers for any kernels you are including in the ISO (linux-headers for the default kernel). https://wiki.archlinux.org/title/ZFS#Using_self-built_ZFS_packages_from_the_AUR

1.) Why not build always against zfs-dkms as default? People seem to have different opinions on dkms, some prefer it while others try to avoid it, I remember reading some arguments against dkms but I don't remember what they were., only downside I can think of is increased build time.

2.) Should I implement a first run using regular zfs-linux package and if this build fails, retry it with zfs-dkms? I think zfs-dkms should be enough, since I don't think the increased build time of dkms is going to matter. I's not like the iso is being built every hour.

stevleibelt commented 2 years ago

@gardar I've done another build by using "zfs-dkms" and "linux-headers" and I was able to create an archiso with a working zfs environment.

I've quickly added a new flag -u|--use-dkms in this commit. This is currently a draft since we've decided to switch to "dkms as default".

We are on the right way :-). Have a great day.

stevleibelt commented 1 year ago

@gardar Times have passed and I am running multiple machines with zfs and dkms without any issues. Furthermore, building archiso with dkms has become my defacto standard.

From my side, it looks like this issue is solved. Do you agree or did I missed something?

Cheers, Stev

update

I am using this installer script to unify my setup.

gardar commented 1 year ago

I haven't built the iso myself for a long time, but I'll take your word for it. Although I noticed that the workflow for building the iso is currently broken, proposed a fix in #17

stevleibelt commented 1 year ago

I will close this issue since things are working fine right now.