Difference between revisions of "Talk:Mkinitcpio"

From ArchWiki
Jump to: navigation, search
m (systemd hook ?: rm closed discussion)
(Talking about LUKS/LVM with sd-encrypt example: re)
 
(43 intermediate revisions by 16 users not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:Talk:mkinitcpio}}
 
{{DISPLAYTITLE:Talk:mkinitcpio}}
== keymap v. consolefont ==
+
== Talking about other hooks and a more generic view of the early userspace ==
Using the consolefont hook seems to work as advertised in /lib/initcpio/hooks/consolefont and {{ic|mkinitcpio -H consolefont}} i.e. I get my font in the early stages of the boot process, while using keymap only sets the font a bit later and mangles Polish accented characters if I'm using {{ic|1=DAEMON_LOCALE="yes"}}. I think we need to add consolefont to the HOOKS list and fix keymap hook description. -- [[User:Karol|Karol]] 11:10, 21 January 2012 (EST)
+
I am the current maintainer of the the {{AUR|dropbear_initrd_encrypt}}, and, I've also developed some other mkinitcpio hooks, such as: {{AUR|mkinitcpio-ppp}} and {{AUR|mkinitcpio-ddns}}. I will write some wiki pages describing them, but I would also like to talk more about the early userspace. So, my question is, should I make an early userspace page, should I write a page just for the hooks? Should I write it and make it related to the mkinitcpio page? Thanks in advance.
 +
 
 +
[[User:Grazzolini|Grazzolini]] ([[User talk:Grazzolini|talk]]) 01:03, 11 February 2015 (UTC)
 +
 
 +
:It depends a lot on how much content you're actually going to write. I suggest starting by expanding on the early userspace in [[Arch boot process]]; then, if what you write gets too long, we can always consider splitting the page. About custom/additional hooks you might create a section below [[Mkinitcpio#Common hooks]], following the same principle: if the content gets too long/detailed to stay in the page, we can split it later. In any case, it's very important that you try your best to avoid duplicating existing information in other articles, and instead either add links to them, or move that information to your new content, if it fits best there, and add links to the new location from the articles where the info was removed. — [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 4:32, 12 February 2015 (UTC)
 +
 
 +
::Thank you for your information [[User:Kynikos|Kynikos]]. I'll be contributing these changes very soon. [[User:Grazzolini|Grazzolini]] ([[User talk:Grazzolini|talk]]) 12:54, 12 February 2015 (UTC)
 +
 
 +
== Mark /usr with a passno of {{ic|2}}, not {{ic|0}} ==
 +
 
 +
[[mkinitcpio#/usr as a separate partition]] firmly suggests to mark {{ic|/usr}} with a {{ic|passno}} of {{ic|0}} in {{ic|/etc/fstab}}. The way I understand {{ic|man fstab}}, {{ic|2}} is the correct number for the task. Am I wrong? [[User:Regid|Regid]] ([[User talk:Regid|talk]]) 19:09, 6 April 2017 (UTC)
 +
: It also suggests adding the {{ic|fsck}} hook to your config. Seeing as the regular fsck binaries reside on the {{ic|/usr}} partition, this is needed to actually make it possible to fsck it at startup. The entry in {{ic|/etc/fstab}} should thus be {{ic|0}}. [[User:Koneu|Koneu]] ([[User talk:Koneu|talk]]) 07:27, 7 April 2017 (UTC)
 +
::I see your point about the binaries residing on /usr. Still, with a passno of {{ic|0}} you set no automatic fsck at all, don't you? Would you set passno for / to {{ic|0}} when usr is an integral part of /?
 +
::Indeed the fsck hook copies fsck binaries to the initramfs, and possibly ignores passno for / and /usr at runtime. As an aside, its help text should mention usr, not just /.
 +
::[[User:Regid|Regid]] ([[User talk:Regid|talk]]) 10:12, 7 April 2017 (UTC)
 +
 
 +
== Talking about LUKS/LVM with sd-encrypt example ==
 +
Formerly there was a [https://wiki.archlinux.org/index.php?title=Mkinitcpio&diff=493888&oldid=492088 link to the forum] that was ambiguous about where the UUID were generated from. [[User:enckse|enckse]] documented clearly the same use case within this page, which was reverted by [[User:Lahwaacz|Lahwaacz]] in [https://wiki.archlinux.org/index.php?title=Mkinitcpio&diff=493938&oldid=493934 this change]. The [https://wiki.archlinux.org/index.php?title=Mkinitcpio&oldid=493938 current edit] of the page removes a reference to the forum post entirely. Where should the writeup from [[User:enckse|enckse]] be placed? - [[User:storrgie|storrgie]] 22:05, 23 October 2017 (UTC)
 +
: In the previous form, ie., as a tutorial, it would belong in someone's namespace. If you just want to capture the bit about determining UUIDs, then that is already documented on the [https://wiki.archlinux.org/index.php/Persistent_block_device_naming#by-uuid relevant page]. [[User:Jasonwryan|Jasonwryan]] ([[User talk:Jasonwryan|talk]]) 22:19, 23 October 2017 (UTC)
 +
:: If you review the forum post mentioned it isn't that I'm saying users don't know how to capture UUID. I'm saying that in the case of LUKS/LVM the rd.luks.uuid requires the block device UUID and the root=UUID= requires the UUID of the root volume group. This is what is ambiguous in the original forum post. Let's be clear, this is a commonly followed install pathway (LUKS/LVM), so why let users be confused when we've got a documented use case? - [[User:storrgie|storrgie]] 22:25, 23 October 2017 (UTC)
 +
::: Then that relevant factoid belongs on the [https://wiki.archlinux.org/index.php/Dm-crypt/System_configuration dm-crypt page] page. [[User:Jasonwryan|Jasonwryan]] ([[User talk:Jasonwryan|talk]]) 22:39, 23 October 2017 (UTC)
 +
:::: I've tried to place it in an [https://wiki.archlinux.org/index.php?title=Dm-crypt/System_configuration&diff=493944&oldid=488939 appropriate place on that page], please advise. - [[User:storrgie|storrgie]] 22:50, 23 October 2017 (UTC)
 +
:::::I said *not* the entire tutorial, just the relevant snippet about locating the correct uuids. [[User:Jasonwryan|Jasonwryan]] ([[User talk:Jasonwryan|talk]]) 23:20, 23 October 2017 (UTC)
 +
:::::: It'd be nice to have a proposed modification rather than just slapping the revert button. - [[User:storrgie|storrgie]] 23:41, 23 October 2017 (UTC)
 +
:::::::[[user:enckse|enckse]]'s writeup is really no better than the forum post, it just describes how to do one specific thing without explaining the steps. That's not the wiki way, the wiki should explain the steps in some organized way and let users combine them as they want.
 +
:::::::That said, I think that everything discussed here is already on the [[dm-crypt/System configuration]] page:
 +
:::::::* mkinitcpio hooks: [[dm-crypt/System_configuration#mkinitcpio]] (two variants, base and systemd)
 +
:::::::* bootloader config: [[dm-crypt/System_configuration#Using_encrypt_hook]] (for the base hook) and [[dm-crypt/System_configuration#Using_sd-encrypt_hook]] (for the systemd hook) - the second section ''explains'' what the {{ic|rd.luks.*}} parameters actually do, this cannot be found in the forum post
 +
:::::::* If you don't know how to get the UUIDs, read the [[Persistent block device naming]] page - it is linked multiple times from [[dm-crypt/System configuration]]. There is no point to include a full example of {{ic|lsblk -f}} everywhere.
 +
:::::::Though I must admit, that I can't find the {{ic|rd.lvm.lv}} kernel parameter anywhere on the wiki. I have no idea what it's for and the forum post does not explain it either. Is it necessary for resume? Or for LVM? Or the LUKS/LVM combo? If you find out, feel free to explain it here so we can find an appropriate place on the wiki for it.
 +
:::::::-- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 07:25, 24 October 2017 (UTC)
 +
:::::::: {{ic|rd.lvm.lv}} seems to be a [https://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html#_lvm dracut] specific thing. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 13:26, 29 October 2017 (UTC)
 +
:::::::: [https://wiki.archlinux.org/index.php?title=Mkinitcpio&diff=494191&oldid=493938] confuses me. Is {{ic|/etc/crypttab}} meant to be {{ic|/etc/crypttab}} on real root or {{ic|/etc/crypttab}} in initramfs (i.e. {{ic|/etc/crypttab.initramfs}} on real root)? -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 13:39, 29 October 2017 (UTC)
 +
:::::::::Since the snippet is from the {{man|8|systemd-cryptsetup-generator}} man page, I'd say it's the root where ''systemd-cryptsetup-generator'' is run. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 13:56, 29 October 2017 (UTC)
 +
::::::::::[[mkinitcpio#Non-root drives are not decrypted by sd-lvm2 hook]] doesn't make the distinction, which makes the whole section nonsense. Why would you expect sd-lvm2 to have access to block devices that are decrypted after boot (those listed in {{ic|/etc/crypttab}} on real root)? Using  {{ic|/etc/crypttab.initramfs}} is far simpler than messing around with all those {{ic|rd.luks.}} and {{ic|luks.}} parameters. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 14:06, 29 October 2017 (UTC)
 +
:::::::::::I have no idea, I just moved the section from [[systemd-boot]]. See also [[Talk:Systemd-boot#Move_section_.22Non-root_drives_are_not_decrypted_by_sd-lvm2_mkinitcpio_hook.22]]. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 14:31, 29 October 2017 (UTC)

Latest revision as of 14:31, 29 October 2017

Talking about other hooks and a more generic view of the early userspace

I am the current maintainer of the the dropbear_initrd_encryptAUR, and, I've also developed some other mkinitcpio hooks, such as: mkinitcpio-pppAUR and mkinitcpio-ddnsAUR. I will write some wiki pages describing them, but I would also like to talk more about the early userspace. So, my question is, should I make an early userspace page, should I write a page just for the hooks? Should I write it and make it related to the mkinitcpio page? Thanks in advance.

Grazzolini (talk) 01:03, 11 February 2015 (UTC)

It depends a lot on how much content you're actually going to write. I suggest starting by expanding on the early userspace in Arch boot process; then, if what you write gets too long, we can always consider splitting the page. About custom/additional hooks you might create a section below Mkinitcpio#Common hooks, following the same principle: if the content gets too long/detailed to stay in the page, we can split it later. In any case, it's very important that you try your best to avoid duplicating existing information in other articles, and instead either add links to them, or move that information to your new content, if it fits best there, and add links to the new location from the articles where the info was removed. — Kynikos (talk) 4:32, 12 February 2015 (UTC)
Thank you for your information Kynikos. I'll be contributing these changes very soon. Grazzolini (talk) 12:54, 12 February 2015 (UTC)

Mark /usr with a passno of 2, not 0

mkinitcpio#/usr as a separate partition firmly suggests to mark /usr with a passno of 0 in /etc/fstab. The way I understand man fstab, 2 is the correct number for the task. Am I wrong? Regid (talk) 19:09, 6 April 2017 (UTC)

It also suggests adding the fsck hook to your config. Seeing as the regular fsck binaries reside on the /usr partition, this is needed to actually make it possible to fsck it at startup. The entry in /etc/fstab should thus be 0. Koneu (talk) 07:27, 7 April 2017 (UTC)
I see your point about the binaries residing on /usr. Still, with a passno of 0 you set no automatic fsck at all, don't you? Would you set passno for / to 0 when usr is an integral part of /?
Indeed the fsck hook copies fsck binaries to the initramfs, and possibly ignores passno for / and /usr at runtime. As an aside, its help text should mention usr, not just /.
Regid (talk) 10:12, 7 April 2017 (UTC)

Talking about LUKS/LVM with sd-encrypt example

Formerly there was a link to the forum that was ambiguous about where the UUID were generated from. enckse documented clearly the same use case within this page, which was reverted by Lahwaacz in this change. The current edit of the page removes a reference to the forum post entirely. Where should the writeup from enckse be placed? - storrgie 22:05, 23 October 2017 (UTC)

In the previous form, ie., as a tutorial, it would belong in someone's namespace. If you just want to capture the bit about determining UUIDs, then that is already documented on the relevant page. Jasonwryan (talk) 22:19, 23 October 2017 (UTC)
If you review the forum post mentioned it isn't that I'm saying users don't know how to capture UUID. I'm saying that in the case of LUKS/LVM the rd.luks.uuid requires the block device UUID and the root=UUID= requires the UUID of the root volume group. This is what is ambiguous in the original forum post. Let's be clear, this is a commonly followed install pathway (LUKS/LVM), so why let users be confused when we've got a documented use case? - storrgie 22:25, 23 October 2017 (UTC)
Then that relevant factoid belongs on the dm-crypt page page. Jasonwryan (talk) 22:39, 23 October 2017 (UTC)
I've tried to place it in an appropriate place on that page, please advise. - storrgie 22:50, 23 October 2017 (UTC)
I said *not* the entire tutorial, just the relevant snippet about locating the correct uuids. Jasonwryan (talk) 23:20, 23 October 2017 (UTC)
It'd be nice to have a proposed modification rather than just slapping the revert button. - storrgie 23:41, 23 October 2017 (UTC)
enckse's writeup is really no better than the forum post, it just describes how to do one specific thing without explaining the steps. That's not the wiki way, the wiki should explain the steps in some organized way and let users combine them as they want.
That said, I think that everything discussed here is already on the dm-crypt/System configuration page:
Though I must admit, that I can't find the rd.lvm.lv kernel parameter anywhere on the wiki. I have no idea what it's for and the forum post does not explain it either. Is it necessary for resume? Or for LVM? Or the LUKS/LVM combo? If you find out, feel free to explain it here so we can find an appropriate place on the wiki for it.
-- Lahwaacz (talk) 07:25, 24 October 2017 (UTC)
rd.lvm.lv seems to be a dracut specific thing. -- nl6720 (talk) 13:26, 29 October 2017 (UTC)
[1] confuses me. Is /etc/crypttab meant to be /etc/crypttab on real root or /etc/crypttab in initramfs (i.e. /etc/crypttab.initramfs on real root)? -- nl6720 (talk) 13:39, 29 October 2017 (UTC)
Since the snippet is from the systemd-cryptsetup-generator(8) man page, I'd say it's the root where systemd-cryptsetup-generator is run. -- Lahwaacz (talk) 13:56, 29 October 2017 (UTC)
mkinitcpio#Non-root drives are not decrypted by sd-lvm2 hook doesn't make the distinction, which makes the whole section nonsense. Why would you expect sd-lvm2 to have access to block devices that are decrypted after boot (those listed in /etc/crypttab on real root)? Using /etc/crypttab.initramfs is far simpler than messing around with all those rd.luks. and luks. parameters. -- nl6720 (talk) 14:06, 29 October 2017 (UTC)
I have no idea, I just moved the section from systemd-boot. See also Talk:Systemd-boot#Move_section_.22Non-root_drives_are_not_decrypted_by_sd-lvm2_mkinitcpio_hook.22. -- Lahwaacz (talk) 14:31, 29 October 2017 (UTC)