[arch-dev-public] Mkinitcpio replacement with Dracut
Hi All, Recently, Dave announced his intention to step down as mkinitcpio maintainer. I have been handling a few things on it, made some small changes to our mkinitcpio-busybox [0], closed a few old bugs, while also made sure some of the other bug reports are still valid. [1] I have been testing a few patches to mkinitcpio for a while to fix those bugs, but last week Dave and I had a discussion on IRC and we agreed that we could spend better time contributing somewhere else than keeping working with mkinitcpio. Currently mkinitcpio cannot boot from NFS properly, mknitcpio-nfs-utils [2] uses very old code. Even though ipconfig works, it has several drawbacks compared to using more modern tools. Not to mention that we have two use cases for mkinitcpio, which are base and systemd enabled initramfs. Even though we use by default our base enabled initramfs, we have to support systemd related issues and we have to keep developing our systemd hooks. I have been looking into dracut for some time now, I copied some stuff from them on a few of my own scripts and they also have an actual test suite, that we currently can't use on Arch, but I plan to change that. With this in mind, I have packaged dracut for Arch and put it on Extra [3]. I have been using a dracut initramfs for a while now to boot my encrypted partition. Surprisingly, I only had to create a small patch to one of the dm-crypt module scripts [4] In this initial phase I want to ask as many of you to test this as a replacement to mkinitcpio in your setups, as many as possible, and in as many scenarios as possible. We will probably have to keep both packages on our repos for a long time, but once we are confident it's a good fit, we can replace mkinitcpio on our iso and base, so new installs get dracut by default. Please, drop in your comments as well. Regards, Giancarlo Razzolini [0] https://git.archlinux.org/svntogit/packages.git/commit/trunk/PKGBUILD?h=packages/mkinitcpio-busybox&id=489fbd6f2ed1defd1c7f1b57e7d6edd25185e6d8 [1] https://bugs.archlinux.org/index.php?string=mkinitcpio&project=0 [2] https://git.archlinux.org/mkinitcpio-nfs-utils.git/ [3] https://www.archlinux.org/packages/extra/x86_64/dracut/ [4] https://git.archlinux.org/svntogit/packages.git/tree/trunk/0001-90crypt-Chan...
On 21/05/2019 04:41, Giancarlo Razzolini via arch-dev-public wrote:
Hi All,
Recently, Dave announced his intention to step down as mkinitcpio maintainer. I have been handling a few things on it, made some small changes to our mkinitcpio-busybox [0], closed a few old bugs, while also made sure some of the other bug reports are still valid. [1]
I have been testing a few patches to mkinitcpio for a while to fix those bugs, but last week Dave and I had a discussion on IRC and we agreed that we could spend better time contributing somewhere else than keeping working with mkinitcpio.
Currently mkinitcpio cannot boot from NFS properly, mknitcpio-nfs-utils [2] uses very old code. Even though ipconfig works, it has several drawbacks compared to using more modern tools. Not to mention that we have two use cases for mkinitcpio, which are base and systemd enabled initramfs. Even though we use by default our base enabled initramfs, we have to support systemd related issues and we have to keep developing our systemd hooks.
I have been looking into dracut for some time now, I copied some stuff from them on a few of my own scripts and they also have an actual test suite, that we currently can't use on Arch, but I plan to change that.
With this in mind, I have packaged dracut for Arch and put it on Extra [3]. I have been using a dracut initramfs for a while now to boot my encrypted partition. Surprisingly, I only had to create a small patch to one of the dm-crypt module scripts [4]
In this initial phase I want to ask as many of you to test this as a replacement to mkinitcpio in your setups, as many as possible, and in as many scenarios as possible. We will probably have to keep both packages on our repos for a long time, but once we are confident it's a good fit, we can replace mkinitcpio on our iso and base, so new installs get dracut by default.
Please, drop in your comments as well.
Regards, Giancarlo Razzolini
[1] https://bugs.archlinux.org/index.php?string=mkinitcpio&project=0 [2] https://git.archlinux.org/mkinitcpio-nfs-utils.git/ [3] https://www.archlinux.org/packages/extra/x86_64/dracut/ [4] https://git.archlinux.org/svntogit/packages.git/tree/trunk/0001-90crypt-Chan...
Without looking at dracut yet, I have a few questions: - Is there a description how to move from mkinitcpio to dracut? - Does dracut support what mkinitcpio has? all the hooks and stuff - did you already add pacman hooks for dracut as we need for mkinitcpio, or is that not needed? When I have some time to spare I certainly will try it out.
Em maio 21, 2019 2:24 Ike Devolder via arch-dev-public escreveu:
Without looking at dracut yet, I have a few questions: - Is there a description how to move from mkinitcpio to dracut?
No, not yet. But it is as simple as running dracut -H -f /boot/initramfs-linux.img, for trying it out. I'll work later this week on a wiki page, but the good thing is, it has plenty documentation available.
- Does dracut support what mkinitcpio has? all the hooks and stuff
It does support even more than we do currently. It can boot from pretty much anything, including NFS and NBD.
- did you already add pacman hooks for dracut as we need for mkinitcpio, or is that not needed?
We will certainly need a hook to trigger the rebuild, but I didn't add it as a part of the dracut package yet, because I need to write them, but I want first to see if dracut is a good fit for Arch or not.
When I have some time to spare I certainly will try it out.
Please do. And make sure you have your fallback image working when you do. Regards, Giancarlo Razzolini
On Tue, 21 May 2019 13:51:43 -0300 Giancarlo Razzolini via arch-dev-public <arch-dev-public@archlinux.org> wrote:
Em maio 21, 2019 2:24 Ike Devolder via arch-dev-public escreveu:
Without looking at dracut yet, I have a few questions: - Is there a description how to move from mkinitcpio to dracut?
No, not yet. But it is as simple as running dracut -H -f /boot/initramfs-linux.img, for trying it out. I'll work later this week on a wiki page, but the good thing is, it has plenty documentation available.
- Does dracut support what mkinitcpio has? all the hooks and stuff
It does support even more than we do currently. It can boot from pretty much anything, including NFS and NBD.
- did you already add pacman hooks for dracut as we need for mkinitcpio, or is that not needed?
We will certainly need a hook to trigger the rebuild, but I didn't add it as a part of the dracut package yet, because I need to write them, but I want first to see if dracut is a good fit for Arch or not.
A hook would be good, but might need to be in the kernel packages like the current hooks are. Kernel versions are hard-coded in the hook. It would also be nice to rename the initramfs so that we've got both available, I just put -dracut in it for testing this.
When I have some time to spare I certainly will try it out.
Please do. And make sure you have your fallback image working when you do.
Regards, Giancarlo Razzolini
Em maio 21, 2019 14:08 Doug Newgard via arch-dev-public escreveu:
A hook would be good, but might need to be in the kernel packages like the current hooks are. Kernel versions are hard-coded in the hook. It would also be nice to rename the initramfs so that we've got both available, I just put -dracut in it for testing this.
Yes the hook could be versioned, but dracut has --kver and some other stuff we can use to rebuild the image when you update the kernel and the kernel on disk is different than the booted one. You can use the -dracut nomenclature for now, or you can replace the default initramfs. Your choice really. As long as you have the fallback working, shouldn't be a problem. I also cannot emphasize this more, people testing dracut should probably have an arch iso handy in case something goes wrong. Other than that, please lets test everything possible. Regards, Giancarlo Razzolini
On Mon, 2019-05-20 at 23:41 -0300, Giancarlo Razzolini via arch-dev- public wrote:
Hi All,
Recently, Dave announced his intention to step down as mkinitcpio maintainer. I have been handling a few things on it, made some small changes to our mkinitcpio-busybox [0], closed a few old bugs, while also made sure some of the other bug reports are still valid. [1]
I have been testing a few patches to mkinitcpio for a while to fix those bugs, but last week Dave and I had a discussion on IRC and we agreed that we could spend better time contributing somewhere else than keeping working with mkinitcpio.
Currently mkinitcpio cannot boot from NFS properly, mknitcpio-nfs- utils [2] uses very old code. Even though ipconfig works, it has several drawbacks compared to using more modern tools. Not to mention that we have two use cases for mkinitcpio, which are base and systemd enabled initramfs. Even though we use by default our base enabled initramfs, we have to support systemd related issues and we have to keep developing our systemd hooks.
I have been looking into dracut for some time now, I copied some stuff from them on a few of my own scripts and they also have an actual test suite, that we currently can't use on Arch, but I plan to change that.
With this in mind, I have packaged dracut for Arch and put it on Extra [3]. I have been using a dracut initramfs for a while now to boot my encrypted partition. Surprisingly, I only had to create a small patch to one of the dm-crypt module scripts [4]
In this initial phase I want to ask as many of you to test this as a replacement to mkinitcpio in your setups, as many as possible, and in as many scenarios as possible. We will probably have to keep both packages on our repos for a long time, but once we are confident it's a good fit, we can replace mkinitcpio on our iso and base, so new installs get dracut by default.
Please, drop in your comments as well.
Regards, Giancarlo Razzolini
[0] https://git.archlinux.org/svntogit/packages.git/commit/trunk/PKGBUILD?h=packages/mkinitcpio-busybox&id=489fbd6f2ed1defd1c7f1b57e7d6edd25185e6d8 [1] https://bugs.archlinux.org/index.php?string=mkinitcpio&project=0 [2] https://git.archlinux.org/mkinitcpio-nfs-utils.git/ [3] https://www.archlinux.org/packages/extra/x86_64/dracut/ [4] https://git.archlinux.org/svntogit/packages.git/tree/trunk/0001-90crypt-Chan...
Hi Giancarlo, Did some initial testing on my system, I was almost able to get a working initrd after a few tweaks [0] and a little patching [1] to use fs-lib with bash and without systemd. However I can't use my usb keyboard and mouse when greeted by gdm. I'll keep looking into it unless you have some pointers at the ready. Using the following command to generate the initrd: mkinitrd --xz /boot/initramfs-5.1.3-zen1-1-zen.img And the resulting lsinitrd [2]. Cheers, -- Maxime [0] https://paste.xinu.at/07qqfyuQljNvR1Kh/ [1] https://raw.githubusercontent.com/void-linux/void-packages/fdeed0979a8f63e38... [2] https://paste.xinu.at/AhXYJjuCtUR2vY4O/
Em maio 21, 2019 12:29 Maxime Gauduin via arch-dev-public escreveu:
Hi Giancarlo,
Did some initial testing on my system, I was almost able to get a working initrd after a few tweaks [0] and a little patching [1] to use fs-lib with bash and without systemd. However I can't use my usb keyboard and mouse when greeted by gdm. I'll keep looking into it unless you have some pointers at the ready.
Using the following command to generate the initrd:
mkinitrd --xz /boot/initramfs-5.1.3-zen1-1-zen.img
And the resulting lsinitrd [2].
Thanks. This is precisely the kind of testing we need. Including different kernels. I tried only on linux and linux-lts so far. It's weird your keyboard is not running when hitting gdm, because, at that point the initramfs shouldn't have any interference. Also, any reason to use xz? I know that not everyone has a big boot partition and images created by dracut (even with -H) are larger than mkinitcpio's. By jelle's suggestion, can we concentrate the bug reports on the bugtracker? I think it will be better. Thanks again. Regards, Giancarlo Razzolini
Hi All, I'm revisiting this thread to clarify the current situation Arch is in, regarding the initramfs. When this was suggested, mkinitcpio was without a maintainer, and dracut was the obvious choice for replacement. In the almost two years this has been proposed though, I have maintained mkinitcpio, it has gained features and had bug fixes over this time, as well as it has seen a lot of activity from the community on github (issues and PR's). In this meantime, dracut as well got a number of releases and the dracut package is maintained, but dracut doesn't have alpm hooks to install the kernels to /boot and re-generate the images, mainly because there's no mkinitcpio profile equivalent Also, Anatol has created booster, which is extremely fast and creates very small images. Currently, you can have all 3 of them, mkinitcpio, dracut and booster installed on your system at the same time. booster does come with alpm hooks and it's currently doubling the work mkinitcpio hooks do, so the kernel gets copied to /boot twice. I plan to separate the mkinitcpio hooks and have all 3 initramfs generators to use the same hook, that way we can avoid them competing with each other, while also allowing them all to be installed at the same time. Having said all that, there are no plans at this time to change the status quo, so mkinitcpio remains the default, but users now have 3 options, which is always good. Regards, Giancarlo Razzolini
participants (4)
-
Doug Newgard
-
Giancarlo Razzolini
-
Ike Devolder
-
Maxime Gauduin