Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 No Hi at the begin as it seems to be not common sense anymore to greet before answering. Am Do den 2. Jan 2014 um 13:46 schrieb Roger Leigh: This will prevent from using /usr via NFS or having a /usr md device or having /usr on LVM (Not sure about any of this issues, as I use initram only on systems with a NFS /usr.) And there is even more cases where the /usr mount needs to be done later in init stack. This patchset will continue to allow you to have /usr on NFS and/or MD/LVM. However, it will require you to use an initramfs to mount /usr as a separate filesystem. And that will break all systems that are well designed by having a separate /usr and have, for any well decided reason, no initram. And there are several reasons why you would not want to have it. And, in my case, that would break most of my systems as I usually avoid to use a initram. /usr on NFS is fairly pointless though--just have the whole rootfs (including /usr) on NFS and be done with it. Please don't tell people pointless (or stupid) if they do something you cannot imagine. There are use cases where a /usr on NFS is great thing. This patchset is unrelated to the init system; it will need minor changes to util-linux mount and sysvinit to avoid mounting /usr in mountall. /usr have to be mounted in mountall due the above I descripted. Regards Klaus - -- Klaus Ethgen http://www.ethgen.ch/ pub 4096R/4E20AF1C 2011-05-16 Klaus Ethgen kl...@ethgen.de Fingerprint: 85D4 CA42 952C 949B 1753 62B3 79D0 B06F 4E20 AF1C -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQGcBAEBCgAGBQJUI/raAAoJEKZ8CrGAGfasz2IL/389cg97tLsCTgfgMl7CC0mJ o2NTz9k3YgH7p08FEgVbH+QVn06kMK4RP+PuN5lobpk+cGyjG+5egHGPZq8FhbC6 tYDJI9JImoWf7+4rvePscvTvh+q83oUiYFGsF7f018k0vmmpfo/27KwMC566dxcw Xd1kbp0Yls2R0MZV6aju7/PBTZ3XO7htAwmVtTUECy96NqnvB8m2YolurFOEUFmz 18QcfCOJOgV6z1CMnRSQtsWCbEwnqpxSsRPJ2a4pc9WB+lwQALCs6ltsfbnZ6KSi 6HppcUWeTsMJ6S54lIa5xg92xIDmXMcfrXqXweBTxaOnTpymqzUqpTJ+H1yVNnLc biiEvTBXyIoO5JaO08hQCYD5Q9q1tdEJ9+bL5xgu05ZRjxtnpaGosaBBaQReRFCA oPIJAiBqknrZ5fmSkmIjT9nRea0j7EAmGU3MyszqSDmUrKPukk8e+guHW88i2cwc +wS4TZ2It9EUQFEal3/RMWuOLSMb4DVmflVXrOPeUg== =4et7 -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
On Thu, 2014-09-25 at 12:22 +0100, Klaus Ethgen wrote: No Hi at the begin as it seems to be not common sense anymore to greet before answering. Am Do den 2. Jan 2014 um 13:46 schrieb Roger Leigh: This will prevent from using /usr via NFS or having a /usr md device or having /usr on LVM (Not sure about any of this issues, as I use initram only on systems with a NFS /usr.) And there is even more cases where the /usr mount needs to be done later in init stack. This patchset will continue to allow you to have /usr on NFS and/or MD/LVM. However, it will require you to use an initramfs to mount /usr as a separate filesystem. And that will break all systems that are well designed by having a separate /usr That's not so much a design as a tradition arising from historical constraints: http://lists.busybox.net/pipermail/busybox/2010-December/074114.html. and have, for any well decided reason, no initram. And there are several reasons why you would not want to have it. And, in my case, that would break most of my systems as I usually avoid to use a initram. [...] Sorry, but you'll probably have to change them eventually. Ben. -- Ben Hutchings This sentence contradicts itself - no actually it doesn't. signature.asc Description: This is a digitally signed message part
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
On Sun, Aug 31, 2014 at 02:06:46AM +0200, Michael Prokop wrote: * Roger Leigh [Sat Aug 30, 2014 at 11:19:42PM +0100]: On Sun, Aug 31, 2014 at 12:13:29AM +0200, Michael Prokop wrote: * Michael Prokop [Thu Jul 31, 2014 at 05:30:53PM +0200]: I've rebased the patchset against current git master and a preliminary and *untested*(!) package is available at: https://people.debian.org/~mika/initramfs-tools/ [...] This sounds good to me, is there any chance that either you, Roger Leigh or someone else would be willing to provide the according patchset (without the /etc-mount feature) rebased against our current git master and possibly while at it also take care of https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652459#89 ? If so please ping me (either by mail, IRC or at DebConf), any help is really appreciated. I'm afraid I can't commit to any work at present. But regarding the mounting of /etc, that's just one or two commits at the end of the patchset. Just drop them to remove the feature. But do note that the feature is entirely harmless even if left in--it's not used by default. Thanks for additional information and the fast reply, then it would be even easier for me to integrate it since it's already there. If someone has objections please let me/us know NOW. yes scrap the /etc handling that was never acked, the rest had only codingstyle issues if i remember correctly. -- maks -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
Hi everyone, (if you don't want to get Cc-ed any longer please let me know, just trying to involve everyone and get some traction) * Michael Prokop [Thu Jul 31, 2014 at 05:30:53PM +0200]: * Matthew Gabeler-Lee [Thu Jul 31, 2014 at 10:29:18AM -0400]: Recent package upgrades have made it all but impossible for a Debian install supporting a graphical desktop environment not to use systemd. This quietly caused a system of mine to get switched from sysvinit to systemd, and thus no longer boot properly because of this issue (among others, but this isn't the place for that rant). Can we _pretty please_ get versions of the affected packages at least uploaded to experimental? I will add my voice to those volunteering to help test. I've rebased the patchset against current git master and a preliminary and *untested*(!) package is available at: https://people.debian.org/~mika/initramfs-tools/ Feedback definitely welcome and required. maks, are you willing to accept the patchset once https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652459#47 has been addressed? Maks, sadly still no reply from your side yet :( Is anyone else willing to help us in getting this issue resolved? If we want to see this issue resolved for jessie we need to get this forward soonish. So is there anyone else who has tested my package and can confirm that the issue is resolved by it? Michael Biebl, you also wrote: | Agreed. The actual patch to mount /usr is rather small. The one for | mounting /etc complicates things quite a bit. Please let's not | entangle the two and just upload the bits for mounting /usr. If | there is later demand for the /etc-mount feature, it can be added | then. This sounds good to me, is there any chance that either you, Roger Leigh or someone else would be willing to provide the according patchset (without the /etc-mount feature) rebased against our current git master and possibly while at it also take care of https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652459#89 ? If so please ping me (either by mail, IRC or at DebConf), any help is really appreciated. Thanks everyone regards, -mika- signature.asc Description: Digital signature
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
On Sun, Aug 31, 2014 at 12:13:29AM +0200, Michael Prokop wrote: Hi everyone, (if you don't want to get Cc-ed any longer please let me know, just trying to involve everyone and get some traction) * Michael Prokop [Thu Jul 31, 2014 at 05:30:53PM +0200]: * Matthew Gabeler-Lee [Thu Jul 31, 2014 at 10:29:18AM -0400]: Recent package upgrades have made it all but impossible for a Debian install supporting a graphical desktop environment not to use systemd. This quietly caused a system of mine to get switched from sysvinit to systemd, and thus no longer boot properly because of this issue (among others, but this isn't the place for that rant). Can we _pretty please_ get versions of the affected packages at least uploaded to experimental? I will add my voice to those volunteering to help test. I've rebased the patchset against current git master and a preliminary and *untested*(!) package is available at: https://people.debian.org/~mika/initramfs-tools/ Feedback definitely welcome and required. maks, are you willing to accept the patchset once https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652459#47 has been addressed? Maks, sadly still no reply from your side yet :( Is anyone else willing to help us in getting this issue resolved? If we want to see this issue resolved for jessie we need to get this forward soonish. So is there anyone else who has tested my package and can confirm that the issue is resolved by it? Michael Biebl, you also wrote: | Agreed. The actual patch to mount /usr is rather small. The one for | mounting /etc complicates things quite a bit. Please let's not | entangle the two and just upload the bits for mounting /usr. If | there is later demand for the /etc-mount feature, it can be added | then. This sounds good to me, is there any chance that either you, Roger Leigh or someone else would be willing to provide the according patchset (without the /etc-mount feature) rebased against our current git master and possibly while at it also take care of https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652459#89 ? If so please ping me (either by mail, IRC or at DebConf), any help is really appreciated. I'm afraid I can't commit to any work at present. But regarding the mounting of /etc, that's just one or two commits at the end of the patchset. Just drop them to remove the feature. But do note that the feature is entirely harmless even if left in--it's not used by default. Regards, Roger -- .''`. Roger Leigh : :' : Debian GNU/Linuxhttp://people.debian.org/~rleigh/ `. `' schroot and sbuild http://alioth.debian.org/projects/buildd-tools `-GPG Public Key F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800 -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
* Roger Leigh [Sat Aug 30, 2014 at 11:19:42PM +0100]: On Sun, Aug 31, 2014 at 12:13:29AM +0200, Michael Prokop wrote: * Michael Prokop [Thu Jul 31, 2014 at 05:30:53PM +0200]: I've rebased the patchset against current git master and a preliminary and *untested*(!) package is available at: https://people.debian.org/~mika/initramfs-tools/ [...] This sounds good to me, is there any chance that either you, Roger Leigh or someone else would be willing to provide the according patchset (without the /etc-mount feature) rebased against our current git master and possibly while at it also take care of https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652459#89 ? If so please ping me (either by mail, IRC or at DebConf), any help is really appreciated. I'm afraid I can't commit to any work at present. But regarding the mounting of /etc, that's just one or two commits at the end of the patchset. Just drop them to remove the feature. But do note that the feature is entirely harmless even if left in--it's not used by default. Thanks for additional information and the fast reply, then it would be even easier for me to integrate it since it's already there. If someone has objections please let me/us know NOW. regards, -mika- signature.asc Description: Digital signature
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
On Thu, 31 Jul 2014 at 21:45:56 -0400, Matthew Gabeler-Lee wrote: A clarification question: I see just the initramfs-tools package there. Past discussion on this ticket indicated that updates to sysvinit and util-linux were necessary too. A quick look suggests that's still the case. Are the previously linked patches still up to date? I have opened an initscripts (sysvinit) bug for that part, #757083. Roger Leigh does not appear to have updated that patch recently; it has conflicts when applied to current sysvinit. The patches for util-linux are #697002. Regards, S -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
Recent package upgrades have made it all but impossible for a Debian install supporting a graphical desktop environment not to use systemd. This quietly caused a system of mine to get switched from sysvinit to systemd, and thus no longer boot properly because of this issue (among others, but this isn't the place for that rant). Can we _pretty please_ get versions of the affected packages at least uploaded to experimental? I will add my voice to those volunteering to help test. -- -Matt Reality is that which, when you stop believing in it, doesn't go away. -- Philip K. Dick GPG pubkey fingerprint: A57F B354 FD30 A502 795B 9637 3EF1 3F22 A85E 2AD1 -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
[Cc-ing Roger as the author of the patchset and Marco who pinged me on IRC] * Matthew Gabeler-Lee [Thu Jul 31, 2014 at 10:29:18AM -0400]: Recent package upgrades have made it all but impossible for a Debian install supporting a graphical desktop environment not to use systemd. This quietly caused a system of mine to get switched from sysvinit to systemd, and thus no longer boot properly because of this issue (among others, but this isn't the place for that rant). Can we _pretty please_ get versions of the affected packages at least uploaded to experimental? I will add my voice to those volunteering to help test. I've rebased the patchset against current git master and a preliminary and *untested*(!) package is available at: https://people.debian.org/~mika/initramfs-tools/ Feedback definitely welcome and required. maks, are you willing to accept the patchset once https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652459#47 has been addressed? Is anyone else willing to help us in getting this issue resolved? regards, -mika- signature.asc Description: Digital signature
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
On Thu, 31 Jul 2014, Michael Prokop wrote: I've rebased the patchset against current git master and a preliminary and *untested*(!) package is available at: https://people.debian.org/~mika/initramfs-tools/ Feedback definitely welcome and required. Thank you :) I setup a VM today that approximately mirrors my server's disk setup, and while the install is too minimal to reproduce the problem so far, it can at least test the initramfs getting /usr on lvm on mdraid bit. If that works, I'll give it a go on the real hardware. A clarification question: I see just the initramfs-tools package there. Past discussion on this ticket indicated that updates to sysvinit and util-linux were necessary too. A quick look suggests that's still the case. Are the previously linked patches still up to date? -- -Matt Reality is that which, when you stop believing in it, doesn't go away. -- Philip K. Dick GPG pubkey fingerprint: A57F B354 FD30 A502 795B 9637 3EF1 3F22 A85E 2AD1 -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
Are there any news? Do you need help with this? -- ciao, Marco signature.asc Description: Digital signature
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
Where are we as far as releasing something in experimental or unstable to address this? Debian's decision to go with systemd in the upcoming release (jessie) should rightfully increase the sense of urgency a bit. I run on an Alpha PWS 433au, which means I run sid if I want to run anything current as far as software. Because the machine was originally configured back when dinosaurs roamed the earth, I have /usr on a separate partition. The upgrade to systemd has caused no small amount of pain (because of the requirement that /usr be available when systemd starts running), but a fix for #652459 will mitigate most of the issues I'm seeing. Yes, I'm willing to test patches for the specific case of /usr not being on the same file system as /. I'll be trying the already-submitted patches against the 0.115 initramfs-tools source in a few days. As always, thanks in advance. --Bob Tracy r...@frus.com -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
On Wed, Jan 01, 2014 at 11:19:26PM +0100, Klaus Ethgen wrote: Am Di den 23. Jul 2013 um 18:48 schrieb Michael Prokop: Does anyone have any objections against the current implementation of #652459 to support mounting of /usr in the initramfs? Yes, I have. Sorry about. This will prevent from using /usr via NFS or having a /usr md device or having /usr on LVM (Not sure about any of this issues, as I use initram only on systems with a NFS /usr.) And there is even more cases where the /usr mount needs to be done later in init stack. This patchset will continue to allow you to have /usr on NFS and/or MD/LVM. However, it will require you to use an initramfs to mount /usr as a separate filesystem. /usr on NFS is fairly pointless though--just have the whole rootfs (including /usr) on NFS and be done with it. If there are combinations of local/NFS which aren't catered for, e.g. local / and NFS /usr then we can look at fixing that. I think I tested all these combinations back when I wrote the patchset, but my memory isn't great. And I even fear about what to solve with this patch. I usually use a non-initram-kernel to boot my systems and have /usr on separate device. My fantasy tells me that the patch should solve some issues that was brought to debian by systemd. Just my fantasy. I hope, I am wrong with this. This patchset is unrelated to the init system; it will need minor changes to util-linux mount and sysvinit to avoid mounting /usr in mountall. Regards, Roger -- .''`. Roger Leigh : :' : Debian GNU/Linuxhttp://people.debian.org/~rleigh/ `. `' schroot and sbuild http://alioth.debian.org/projects/buildd-tools `-GPG Public Key F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800 -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hi, I just stumpled over this one. Am Di den 23. Jul 2013 um 18:48 schrieb Michael Prokop: Does anyone have any objections against the current implementation of #652459 to support mounting of /usr in the initramfs? Yes, I have. Sorry about. This will prevent from using /usr via NFS or having a /usr md device or having /usr on LVM (Not sure about any of this issues, as I use initram only on systems with a NFS /usr.) And there is even more cases where the /usr mount needs to be done later in init stack. And I even fear about what to solve with this patch. I usually use a non-initram-kernel to boot my systems and have /usr on separate device. My fantasy tells me that the patch should solve some issues that was brought to debian by systemd. Just my fantasy. I hope, I am wrong with this. Regards Klaus Ethgen - -- Klaus Ethgen http://www.ethgen.ch/ pub 4096R/4E20AF1C 2011-05-16 Klaus Ethgen kl...@ethgen.de Fingerprint: 85D4 CA42 952C 949B 1753 62B3 79D0 B06F 4E20 AF1C -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.15 (GNU/Linux) iQGcBAEBCgAGBQJSxJRtAAoJEKZ8CrGAGfaspEQL/R/s+vrCU9fR1KV//6Ufx3zr z26KjnYlvMHpAevb17fqbqBrMYm1nJRFtIW85bCIx/jkVgG5yXj4SViVkuWKK8oS 9ZMIqeOsuAeyEizxUZ6OUwQ9fWlbKtvd85mveZqDwvivoSwR30G2Pu7KWqqZHjli 9rCEgSaLoAGmpIvPN+wpQpYjVbDsI5MmyvKCgTu7OUkAP0xZKZEfVlKsl3l9mitw 8iO89kHjVYTI2f1LN8hzR/TbZYNXA4YRf6SZ6RqRzNHGip2j8D2AlMYVoa3L/RzL m8ql1Ok7VYsqe1aRPvxSIAUSjS9Auf458/wdODoEoZtyGWTG2GLWzmT+KZX1HUZ6 ERvWgg7F3EwC9TklPmti+cvN1rL46KH0pbtg6oIA6m4BKqi+74hdyBeDlnhbNPYc iEodPCf9ohWt9pmA6nLlPhveCT6AqmKh1i3nPlSXU0g88jpdUpVTISvenv4k+SNj Ct7xOLQ/qcPIGhbKsb3FeNNxXJabYhTjMu8qGUQzfw== =nPfm -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Jan 01, Klaus Ethgen kl...@ethgen.de wrote: What is being discussed in this bug is not if /usr should be mounted in the initramfs or not. This is a widely accepted design. The purpose of this bug is to implement it in the best way. This will prevent from using /usr via NFS or having a /usr md device or having /usr on LVM (Not sure about any of this issues, as I use initram only on systems with a NFS /usr.) Yes, you are wrong. And thanks to this patch in the future it will be possibile to mount all static OS data via NFS with an everything-in-/usr setup. And there is even more cases where the /usr mount needs to be done later in init stack. Care to show some of these use cases? And I even fear about what to solve with this patch. I usually use a non-initram-kernel to boot my systems and have /usr on separate device. This will not be a supported configuration anymore. - -- ciao, Marco -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.15 (GNU/Linux) iEYEARECAAYFAlLElo8ACgkQFGfw2OHuP7GD8gCdEw4y2PfU0T+BVKjnVf/PRF/E 8rcAn3A4J2RFFy7ac78otGTuGGi/mDPx =m3uZ -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
[Cc-ing everyone who was involved in discussing #652459] * Roger Leigh [Sun May 12, 2013 at 06:53:11PM +0100]: And one final patch to use panic rather than sulogin on fsck failure. Thanks for all your patches, I've applied them on top of current master (and edited debian/changelog on my own, being based on your patches). The result is currently sitting in branch mika/bug_652459 of initramfs-tools.git. Does anyone have any objections against the current implementation of #652459 to support mounting of /usr in the initramfs? If so, which objections do you have and what needs to be done to resolve this issue so all involved parties are happy? If there aren't any objections against the current implementation, are there any objections against uploading the current state to experimental? If someone wants to test Roger's implementation, my CI environment provides a Debian package of it: http://jenkins.grml.org/job/initramfs-tools-binaries/26/architecture=amd64/artifact/initramfs-tools_0.114~20130723074828.38_all.deb [md5sum: 7bbd3f70f6483d8506429fa9ace32a0d] regards, -mika- signature.asc Description: Digital signature
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
On 23/07/13 18:48, Michael Prokop wrote: [Cc-ing everyone who was involved in discussing #652459] (Also copying Adam Conrad and Steve Langasek.) * Roger Leigh [Sun May 12, 2013 at 06:53:11PM +0100]: And one final patch to use panic rather than sulogin on fsck failure. Thanks for all your patches, I've applied them on top of current master (and edited debian/changelog on my own, being based on your patches). The result is currently sitting in branch mika/bug_652459 of initramfs-tools.git. Does anyone have any objections against the current implementation of #652459 to support mounting of /usr in the initramfs? If so, which objections do you have and what needs to be done to resolve this issue so all involved parties are happy? If there aren't any objections against the current implementation, are there any objections against uploading the current state to experimental? Just a note for testers: This patchset does require patches for util-linux (fsck -R also ignores /usr as well as root) and initscripts (remount /usr r/w at the same time as the rootfs in checkroot.sh, and otherwise handle it the same as the rootfs). util-linux patch is in #697002. initscripts is this commit: http://anonscm.debian.org/gitweb/?p=users/rleigh/sysvinit.git;a=commitdiff;h=d406626ecad8988198542f270b663f3503f0b7ae For both of these I can put versions in experimental. initramfs-tools probably needs to have a Breaks: on versions prior to these patched versions, so it might be worth holding off uploading prior to these prerequisites being in place. Though if you don't have a separate /usr, this won't cause any problems. If you do, fsck will fail at boot when it tries to fsck a mounted /usr, and it will also leave /usr r/o. Lastly, there is a minor outstanding shortcoming in the ordering of progress messages with my patchset. I left the ordering as-is, but it probably wants tweaking so that there's a linear order rather than nesting messages. e.g. fsck prior to mounting rather than during etc. This is only cosmetic--it probably just needs the mount message moving further down; other third-party scripts might also need tweaking. Note that the patches for all three packages also included the logic for mounting /etc. If this is not wanted, we should probably drop that at this point. For initscripts and util-linux, these will be entirely harmless and will do nothing unless an fstab entry exists; and likewise for initramfs-tools unless you supply additional options on the kernel command-line. Regards, Roger -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
On Tue, Jul 23, 2013 at 10:09:38PM +0100, Roger Leigh wrote: On 23/07/13 18:48, Michael Prokop wrote: [Cc-ing everyone who was involved in discussing #652459] (Also copying Adam Conrad and Steve Langasek.) * Roger Leigh [Sun May 12, 2013 at 06:53:11PM +0100]: And one final patch to use panic rather than sulogin on fsck failure. Thanks for all your patches, I've applied them on top of current master (and edited debian/changelog on my own, being based on your patches). The result is currently sitting in branch mika/bug_652459 of initramfs-tools.git. Does anyone have any objections against the current implementation of #652459 to support mounting of /usr in the initramfs? If so, which objections do you have and what needs to be done to resolve this issue so all involved parties are happy? The shell parsing of /etc/fstab would run on any boot? nitpicking read_fstab_entry(): - useless loop, please just assign: + for file in ${rootmnt}/etc/fstab; do + if [ -f $file ]; then Please reverse logic and immediately return if no fstab + if [ $MNT_DIR = $1 ]; then similary please just unwrap that too. thanks. -- maks -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
On Sun, May 12, 2013 at 12:31:38AM +0100, Roger Leigh wrote: On Sat, May 11, 2013 at 08:02:36PM +0100, Roger Leigh wrote: With all the patches applied, /usr will be automatically mounted if it is present in the /etc/fstab on the rootfs. This works for both local and nfs. I've not tested LVM, but standard UUIDs work fine. You can also mount /etc so that this can be independently mounted; obviously this can't use the fstab, so it's done using an equivalent set of command-line options as for the rootfs. This is a separate patch so it can be easily dropped. Additional patch attached to canonicalise mount device names. This isn't just cosmetic--mount requires the device names to match when we try to mount all filesystems in fstab during boot (which we already fixed up for the tmpfs mounts). This does it for all local device paths. Additional patches to run fsck in the initramfs prior to mounting filesystems. It's not possible to do this during normal startup in checkroot due to e2fsck special casing fsck of mounted, read-only root, but not any other mounted fs such as /usr. -- .''`. Roger Leigh : :' : Debian GNU/Linux http://people.debian.org/~rleigh/ `. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/ `-GPG Public Key: 0x25BFB848 Please GPG sign your mail. From d54671242be20223a914aab293bb36066a132ba8 Mon Sep 17 00:00:00 2001 From: Roger Leigh Roger Leigh rle...@debian.org Date: Sun, 12 May 2013 17:05:51 +0100 Subject: [PATCH 14/16] debian: Document device name canonicalisation --- debian/changelog |4 1 file changed, 4 insertions(+) diff --git a/debian/changelog b/debian/changelog index df01f9d..44c79f6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -25,6 +25,10 @@ initramfs-tools (0.112+usrmount1) UNRELEASED; urgency=low - The local and nfs bottom scripts are run on demand if used; this does not interfere with alternative boot scripts being used, which will run first +- Canonicalise device names to match util-linux mount behaviour; + this ensures that mount -a in mountall does not try to mount + /usr a second time (which it will attempt if the mounted device + does not match the canonical device name). * Mount /usr if present in the /etc/fstab on the mounted rootfs (Closes: #652459) * Mount /etc if specified on the kernel command-line -- 1.7.10.4 From d65980e6c39632a8f702976a429ab0e18c3ef872 Mon Sep 17 00:00:00 2001 From: Roger Leigh Roger Leigh rle...@debian.org Date: Sun, 12 May 2013 17:05:09 +0100 Subject: [PATCH 15/16] Add support for running fsck - Add empty /etc/fstab and symlink /etc/mtab to /proc/mounts; not essential, but quell a number of fsck warnings - Copy fsck and needed fsck helpers, plus logsave - Add checkfs function, based on the initscripts checkroot script - local mount functions will call checkfs prior to mounting the filesystem --- hooks/fsck| 92 ++ init | 15 + mkinitramfs |4 +++ scripts/functions | 97 + scripts/local |6 5 files changed, 214 insertions(+) create mode 100755 hooks/fsck diff --git a/hooks/fsck b/hooks/fsck new file mode 100755 index 000..cd91fa9 --- /dev/null +++ b/hooks/fsck @@ -0,0 +1,92 @@ +#!/bin/sh + +PREREQ= + +prereqs() +{ + echo $PREREQ +} + +fstab_files() +{ +echo /etc/fstab +if [ -d /etc/fstab.d ]; then +ls -1 /etc/fstab.d | grep '\.fstab$' | sed -e 's;^;/etc/fstab.d/;' +fi +} + +# Find a specific fstab entry +# $1=mountpoint +# $2=fstype (optional) +_read_fstab_entry () { + # Not found by default. + echo MNT_FSNAME= + echo MNT_DIR= + echo MNT_TYPE= + + fstab_files | while read file; do + if [ -f $file ]; then + while read MNT_FSNAME MNT_DIR MNT_TYPE MNT_OPTS MNT_FREQ MNT_PASS MNT_JUNK; do +case $MNT_FSNAME in + |\#*) + continue; + ;; +esac +if [ $MNT_DIR = $1 ]; then + if [ -n $2 ]; then + [ $MNT_TYPE = $2 ] || continue; + fi + echo MNT_FSNAME=$MNT_FSNAME + echo MNT_DIR=$MNT_DIR + echo MNT_TYPE=$MNT_TYPE + break 2 +fi +MNT_DIR= + done $file + fi + done +} + +# Find a specific fstab entry and print its type (if found) +# $1=mountpoint +get_fstype () { + eval $(_read_fstab_entry $1) + + # Not found by default. + if [ $1 = $MNT_DIR ]; then + echo $MNT_TYPE + fi +} + +get_fstypes() { + get_fstype / + get_fstype /etc + get_fstype /usr +} + +case $1 in +prereqs) + prereqs + exit 0 + ;; +esac + +if [ ! -x /sbin/fsck ]; then + exit 0 +fi + +. /usr/share/initramfs-tools/hook-functions + + +copy_exec /sbin/fsck +copy_exec /sbin/logsave +for type in $(get_fstypes | sort | uniq); do + prog=/sbin/fsck.${type} + if [ -h $prog ]; then + link=$(readlink -f $prog) + copy_exec $link
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
On Sun, May 12, 2013 at 06:24:55PM +0100, Roger Leigh wrote: On Sun, May 12, 2013 at 12:31:38AM +0100, Roger Leigh wrote: On Sat, May 11, 2013 at 08:02:36PM +0100, Roger Leigh wrote: With all the patches applied, /usr will be automatically mounted if it is present in the /etc/fstab on the rootfs. This works for both local and nfs. I've not tested LVM, but standard UUIDs work fine. You can also mount /etc so that this can be independently mounted; obviously this can't use the fstab, so it's done using an equivalent set of command-line options as for the rootfs. This is a separate patch so it can be easily dropped. Additional patch attached to canonicalise mount device names. This isn't just cosmetic--mount requires the device names to match when we try to mount all filesystems in fstab during boot (which we already fixed up for the tmpfs mounts). This does it for all local device paths. Additional patches to run fsck in the initramfs prior to mounting filesystems. It's not possible to do this during normal startup in checkroot due to e2fsck special casing fsck of mounted, read-only root, but not any other mounted fs such as /usr. And one final patch to use panic rather than sulogin on fsck failure. -- .''`. Roger Leigh : :' : Debian GNU/Linux http://people.debian.org/~rleigh/ `. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/ `-GPG Public Key: 0x25BFB848 Please GPG sign your mail. From 58dc30c78bdecc8321023fb1e055944668053c45 Mon Sep 17 00:00:00 2001 From: Roger Leigh Roger Leigh rle...@debian.org Date: Sun, 12 May 2013 18:47:58 +0100 Subject: [PATCH 17/17] functions: checkfs calls panic rather than sulogin --- scripts/functions |7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scripts/functions b/scripts/functions index dea9e89..d6e8d75 100644 --- a/scripts/functions +++ b/scripts/functions @@ -571,12 +571,7 @@ A maintenance shell will now be started. After performing system maintenance, press CONTROL-D to terminate the maintenance shell and restart the system. # Start a single user shell on the console - if ! sulogin $CONSOLE - then - log_failure_msg Attempt to start maintenance shell failed. -Will restart in 5 seconds. - sleep 5 - fi + panic fsck of $NAME failed if [ ${verbose} = y ] ; then log_begin_msg Will now restart fi -- 1.7.10.4
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
On Sat, May 11, 2013 at 08:02:36PM +0100, Roger Leigh wrote: I have worked on improving my original patchset over the last couple of weeks. This completely generalises the boot logic so that you can now mount arbitrary filesystems in the initramfs. It's all split up into discrete logical changes so that you can see the intent of each and easily amend them or elide them as required. I forgot to mention that you can get all these changes directly from git://anonscm.debian.org/users/rleigh/initramfs-tools.git (branch: usrmount). It might be less tedious than applying all the patches with git am. I should also mention that this can't go into unstable until some prerequisite changes are made to util-linux and initscripts: - initscripts needs to fsck /usr (and /etc) in checkroot.sh since like the rootfs it's mounted read-only in the initramfs - initscripts needs to remount /usr (and /etc) read-write as for the rootfs - util-linux fsck needs to skip /usr (and /etc) when running fsck as it already does for the rootfs (#697002). None of these prevent testing, but they will need to go into unstable immediately prior to initramfs-tools being updated. experimental should be fine though. Regards, Roger -- .''`. Roger Leigh : :' : Debian GNU/Linux http://people.debian.org/~rleigh/ `. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/ `-GPG Public Key: 0x25BFB848 Please GPG sign your mail. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
On Wed, Dec 28, 2011 at 04:15:41PM +, Roger Leigh wrote: On Sun, Dec 18, 2011 at 03:38:20AM +0100, Marco d'Itri wrote: On Dec 17, Roger Leigh rle...@debian.org wrote: 1) Generation of /etc/fstab in the initramfs, including the rootfs and all the filesystems desired to be mounted This is highly suboptimal, because it suddenly makes the initramfs not generic anymore. The initramfs should: - mount / as usual - look at the rootfs fstab - mount /usr using the information from the rootfs fstab The attached patch does this. Note that the patch isn't complete; it won't mount an LVM VG because it lacks the LV activation performed for the root in scripts/local-top/lvm2. I haven't included this in the patch because I'm not sure of the best approach to take here. Maybe it would make sense to make the existing scripts a bit more generic, to permit setup of devices other than $ROOT? Maybe if the scripts were idempotent, they could be invoked multiple times (once per device)? I didn't want to do this without discussing it with you, so hope the patch is useful as a basis for a complete solution. Regarding mounting of /etc; I think this would be useful in a number of uncommon situations. I'll look at (separately) implementing an --etc/etc= option similar to the existing root options which would permit this to work, and keep the initramfs generic at the same time. As for /usr above, having the ability to generically activate devices other than $ROOT would also be useful here. I have worked on improving my original patchset over the last couple of weeks. This completely generalises the boot logic so that you can now mount arbitrary filesystems in the initramfs. It's all split up into discrete logical changes so that you can see the intent of each and easily amend them or elide them as required. With all the patches applied, /usr will be automatically mounted if it is present in the /etc/fstab on the rootfs. This works for both local and nfs. I've not tested LVM, but standard UUIDs work fine. You can also mount /etc so that this can be independently mounted; obviously this can't use the fstab, so it's done using an equivalent set of command-line options as for the rootfs. This is a separate patch so it can be easily dropped. If anything is unclear, please just ask. Changes which might need making: inclusion of modules in the initramfs needed to mount usr (or etc). I hope this is all reasonable. Regards, Roger -- .''`. Roger Leigh : :' : Debian GNU/Linux http://people.debian.org/~rleigh/ `. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/ `-GPG Public Key: 0x25BFB848 Please GPG sign your mail. From f1685f82df05215918ff6d7780991ee11fb2d307 Mon Sep 17 00:00:00 2001 From: Roger Leigh Roger Leigh rle...@debian.org Date: Wed, 8 May 2013 19:37:13 +0100 Subject: [PATCH 01/12] local: Add local_top, local_premount and local_bottom --- scripts/local | 41 ++--- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/scripts/local b/scripts/local index 521e69a..f79a335 100644 --- a/scripts/local +++ b/scripts/local @@ -1,11 +1,38 @@ # Local filesystem mounting -*- shell-script -*- -pre_mountroot() +local_top() { - [ $quiet != y ] log_begin_msg Running /scripts/local-top - run_scripts /scripts/local-top - [ $quiet != y ] log_end_msg + if [ ${local_top_used} != yes ]; then + [ $quiet != y ] log_begin_msg Running /scripts/local-top + run_scripts /scripts/local-top + [ $quiet != y ] log_end_msg + fi + local_top_used=yes +} + +local_premount() +{ + if [ ${local_premount_used} != yes ]; then + [ $quiet != y ] log_begin_msg Running /scripts/local-premount + run_scripts /scripts/local-premount + [ $quiet != y ] log_end_msg + fi + local_premount_used=yes +} +local_bottom() +{ + if [ ${local_premount_used} = yes ] || [ ${local_top_used} = yes ]; then + [ $quiet != y ] log_begin_msg Running /scripts/local-bottom + run_scripts /scripts/local-bottom + [ $quiet != y ] log_end_msg + fi + local_premount_used=no + local_top_used=no +} + +pre_mountroot() +{ wait_for_udev 10 # Load ubi with the correct MTD partition and return since fstype @@ -76,6 +103,8 @@ pre_mountroot() mountroot() { + local_top + pre_mountroot # Get the root filesystem type if not set @@ -85,9 +114,7 @@ mountroot() FSTYPE=${ROOTFSTYPE} fi - [ $quiet != y ] log_begin_msg Running /scripts/local-premount - run_scripts /scripts/local-premount - [ $quiet != y ] log_end_msg +local_premount if [ ${readonly} = y ]; then roflag=-r -- 1.7.10.4 From d5ce57e833cf415f32bc27fe84fba5703985cbd0 Mon Sep 17 00:00:00 2001 From: Roger Leigh Roger Leigh rle...@debian.org Date: Wed, 8 May 2013 19:40:08 +0100 Subject: [PATCH 02/12] nfs: Add nfs_top, nfs_premount and nfs_bottom --- scripts/nfs | 43 ++- 1 file changed, 34
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
On Sat, May 11, 2013 at 08:02:36PM +0100, Roger Leigh wrote: With all the patches applied, /usr will be automatically mounted if it is present in the /etc/fstab on the rootfs. This works for both local and nfs. I've not tested LVM, but standard UUIDs work fine. You can also mount /etc so that this can be independently mounted; obviously this can't use the fstab, so it's done using an equivalent set of command-line options as for the rootfs. This is a separate patch so it can be easily dropped. Additional patch attached to canonicalise mount device names. This isn't just cosmetic--mount requires the device names to match when we try to mount all filesystems in fstab during boot (which we already fixed up for the tmpfs mounts). This does it for all local device paths. Regards, Roger -- .''`. Roger Leigh : :' : Debian GNU/Linux http://people.debian.org/~rleigh/ `. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/ `-GPG Public Key: 0x25BFB848 Please GPG sign your mail. From 36b9ea47b06dc184404eef696e5457b750898ec9 Mon Sep 17 00:00:00 2001 From: Roger Leigh Roger Leigh rle...@debian.org Date: Sun, 12 May 2013 00:24:18 +0100 Subject: [PATCH 13/13] resolve_device: Canonicalise symbolic links to real device nodes Canonicalise device names to match util-linux mount behaviour. This ensures that mount -a in mountall does not try to mount /usr a second time (which it will attempt if the mounted device does not match the canonical device name). This also fixes a longstanding annoyance with the output of mount and df using long UUIDs rather than short device names. Note that resolve_device may be called more than one; it's done during options parsing for ROOT and ETC, and again immediately prior to mounting. This is because during options parsing the device node does not exist, but we still need to construct a path into /dev from the LABEL or UUID. --- scripts/functions |2 ++ scripts/local |6 ++ 2 files changed, 8 insertions(+) diff --git a/scripts/functions b/scripts/functions index 6354573..eeec778 100644 --- a/scripts/functions +++ b/scripts/functions @@ -492,6 +492,8 @@ resolve_device() { DEV=/dev/disk/by-uuid/${DEV#UUID=} ;; esac + # Only canonicalise if a valid file, in case $DEV isn't a filename + [ -e $DEV ] DEV=$(readlink -f $DEV) echo $DEV } diff --git a/scripts/local b/scripts/local index 3299232..55464a2 100644 --- a/scripts/local +++ b/scripts/local @@ -120,6 +120,8 @@ local_mount_root() local_premount + ROOT=$(resolve_device $ROOT) + if [ ${readonly} = y ]; then roflag=-r else @@ -151,6 +153,8 @@ local_mount_etc() local_premount + ETC=$(resolve_device $ETC) + if [ ${readonly} = y ]; then roflag=-r else @@ -178,6 +182,8 @@ local_mount_fs() local_premount + MNT_FSNAME=$(resolve_device $MNT_FSNAME) + if [ ${readonly} = y ]; then roflag=-r else -- 1.7.10.4
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
Hi maks, is there any progress on this issue? Seeing that you haven't replied so far makes me wonder if you generally reject this idea or if it is just lack of time. Would be nice if you can comment on this bug report so we can find a solution. Cheers, Michael -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth? signature.asc Description: OpenPGP digital signature
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
On Sun, Dec 18, 2011 at 03:38:20AM +0100, Marco d'Itri wrote: On Dec 17, Roger Leigh rle...@debian.org wrote: 1) Generation of /etc/fstab in the initramfs, including the rootfs and all the filesystems desired to be mounted This is highly suboptimal, because it suddenly makes the initramfs not generic anymore. The initramfs should: - mount / as usual - look at the rootfs fstab - mount /usr using the information from the rootfs fstab The attached patch does this. Note that the patch isn't complete; it won't mount an LVM VG because it lacks the LV activation performed for the root in scripts/local-top/lvm2. I haven't included this in the patch because I'm not sure of the best approach to take here. Maybe it would make sense to make the existing scripts a bit more generic, to permit setup of devices other than $ROOT? Maybe if the scripts were idempotent, they could be invoked multiple times (once per device)? I didn't want to do this without discussing it with you, so hope the patch is useful as a basis for a complete solution. Regarding mounting of /etc; I think this would be useful in a number of uncommon situations. I'll look at (separately) implementing an --etc/etc= option similar to the existing root options which would permit this to work, and keep the initramfs generic at the same time. As for /usr above, having the ability to generically activate devices other than $ROOT would also be useful here. Regards, Roger -- .''`. Roger Leigh : :' : Debian GNU/Linux http://people.debian.org/~rleigh/ `. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/ `-GPG Public Key: 0x25BFB848 Please GPG sign your mail. From 02574bd223ac21ad18e5c4fa801766e7eaa7c00a Mon Sep 17 00:00:00 2001 From: Roger Leigh Roger Leigh rle...@debian.org Date: Sat, 17 Dec 2011 11:47:59 + Subject: [PATCH] scripts/local: Add parse_initramfs_fstab function and mount /usr This parses /etc/fstab and /etc/fstab.d/*.fstab on the rootfs, in order to obtain the mount information for /usr (if available). If an entry for /usr exists, mount /usr immediately after mounting the rootfs. --- scripts/local | 51 +++ 1 files changed, 51 insertions(+), 0 deletions(-) diff --git a/scripts/local b/scripts/local index 521e69a..fc70c02 100644 --- a/scripts/local +++ b/scripts/local @@ -1,5 +1,54 @@ # Local filesystem mounting -*- shell-script -*- +# Find a specific fstab entry from the mounted rootfs +# $1=mountpoint +# $2=fstype (optional) +# returns 0 on success, 1 on failure (not found or no fstab) +parse_initramfs_fstab () { + local found + found=1 + for file in ${rootmnt}/etc/fstab ${rootmnt}/etc/fstab.d/*.fstab; do + if [ -f ${file} ]; then + while read MNT_FSNAME MNT_DIR MNT_TYPE MNT_OPTS MNT_FREQ MNT_PASS MNT_JUNK + do +case ${MNT_FSNAME} in +|\#*) + continue;; +esac + +if [ $MNT_DIR = $1 ]; then + if [ -n $2 ]; then + [ $MNT_TYPE = $2 ] || continue; + fi + found=0; + break 2 +fi + + done ${file} + fi + done + return $found +} + +# /usr mounting +mountusr() +{ + if parse_initramfs_fstab /usr; then + if [ ${readonly} = y ]; then + roflag=-r + else + roflag=-w + fi + + # FIXME This has no error checking + modprobe ${MNT_TYPE} + + # FIXME This has no error checking + # Mount /usr + mount ${roflag} -t ${MNT_TYPE} -o ${MNT_OPTS} ${MNT_FSNAME} ${rootmnt}${MNT_DIR} + fi +} + pre_mountroot() { [ $quiet != y ] log_begin_msg Running /scripts/local-top @@ -106,6 +155,8 @@ mountroot() mount ${roflag} ${ROOTFLAGS} ${ROOT} ${rootmnt} fi + mountusr + [ $quiet != y ] log_begin_msg Running /scripts/local-bottom run_scripts /scripts/local-bottom [ $quiet != y ] log_end_msg -- 1.7.7.3
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
Package: initramfs-tools Version: 0.99 Severity: normal Tags: patch Hi, In order to make the libraries and binaries in /usr available during early boot, it would be desirable to be able to mount /usr in addition to the rootfs inside the initramfs. This patch implements a generic solution into two parts 1) Generation of /etc/fstab in the initramfs, including the rootfs and all the filesystems desired to be mounted 2) In local mountroot(), rather than just mounting the rootfs, loop over all mountpoints in /etc/fstab and mount them. Note that this can replace the ROOT= option with the fstab entry alone, though if set, ROOT= supercedes the root entry. If the host /etc/fstab does not contain a root entry, a dummy one is generated to ensure that the rootfs is always the first entry in the initramfs fstab. This also means that the rootfs may be mounted with the options in /etc/fstab. This isn't intended to apply directly--it's more of a proof of concept. I've tested the fstab generator; I haven't yet tested local mountroot(). Not being totally familiar with the initramfs internals, it might also need: - inclusion of modules for the additional filesystems - ability to NFS mount filesystems other than the rootfs, i.e. it might need nfsmount for local (not that this is a useful use case) Also note that the initramfs mount option (patch sent upstream) is not yet in mount(8), and it would need to be before the option could be used. Regards, Roger From 77ff35762d8038a546c342e5c2fb46dca5977db1 Mon Sep 17 00:00:00 2001 From: Roger Leigh Roger Leigh rle...@debian.org Date: Sat, 17 Dec 2011 11:47:59 + Subject: [PATCH 1/2] Create /etc/fstab in the initramfs Known special mounts (/, /etc, /usr), and those marked with the initramfs option are added to /etc/fstab in the initramfs. This means that it becomes possible to mount filesystems in addition to root in the initramfs. The primary motivation for this change is to permit /usr to be mounted early, thus guaranteeing the presence of programs and libraries from /usr during early boot, solving a long-standing problem of needing to move an increasing number of libraries and other files to the root filesystem. It additionally permits mounting of /etc separately, thereby permitting it to be encrypted and/or writable while the root filesystem is unencrypted and/or read-only. Note that mount(8) breaks due to the new initramfs option being unrecognised. A patch to add this option has been submitted upstream. The option is filtered out in the generated fstab to avoid breaking mount in the initramfs. --- mkinitramfs |3 ++ scripts/functions | 78 + 2 files changed, 81 insertions(+), 0 deletions(-) diff --git a/mkinitramfs b/mkinitramfs index 039eb81..8196b58 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -268,6 +268,9 @@ if [ -n ${ROOT:-} ]; then echo ROOT=${ROOT} ${DESTDIR}/conf/conf.d/root fi +# fstab creation +create_initramfs_fstab ${DESTDIR}/etc/fstab + if ! command -v ldd /dev/null 21 ; then echo WARNING: no ldd around - install libc-bin 2 exit 1 diff --git a/scripts/functions b/scripts/functions index 765802f..43c6adf 100644 --- a/scripts/functions +++ b/scripts/functions @@ -295,6 +295,84 @@ parse_numeric() { fi } +# Search for filesystems needed for mounting in the initramfs. These +# may be required filesystems such as the rootfs, or have initramfs in +# the options. Strip initramfs option from the generated fstab, in +# case the initramfs mount chokes on it. If no root filesystem exists +# in /etc/fstab, create a dummy entry (needed so that the local mount +# can fill in the missing parts from the command-line etc.). +# Echos fstab format to stdout +parse_initramfs_fstab () { + local rootfound copy file MNT_FSNAME MNT_DIR MNT_TYPE MNT_OPTS MNT_FREQ MNT_PASS MNT_JUNK + rootfound=no + for file in /etc/fstab /etc/fstab.d/*.fstab; do + if [ -f ${file} ]; then + while read MNT_FSNAME MNT_DIR MNT_TYPE MNT_OPTS MNT_FREQ MNT_PASS MNT_JUNK + do +case ${MNT_FSNAME} in +|\#*) + continue;; +esac + +copy=no + +case ${MNT_DIR} in +/) + copy=yes + rootfound=yes + ;; +/etc|/usr) + copy=yes + ;; +esac + +case ${MNT_OPTS} in +initramfs) + copy=yes + MNT_OPTS=defaults + ;; +initramfs,*) + copy=yes + MNT_OPTS=${MNT_OPTS#initramfs,} + ;; +*,initramfs) + copy=yes + MNT_OPTS=${MNT_OPTS%,initramfs} +;; +*,initramfs,*) + copy=yes + MNT_OPTS=${MNT_OPTS/,initramfs,/,} + ;; +esac + +if [ ${copy} != yes ]; then +continue; +fi + +echo ${MNT_FSNAME} ${MNT_DIR} ${MNT_TYPE} ${MNT_OPTS} ${MNT_FREQ} ${MNT_PASS} + done ${file} + fi + done + + if [ ${rootfound} = no ]; then + MNT_FSNAME=no_root_filesystem_set_in_fstab + MNT_DIR=/ + MNT_TYPE=unknown + MNT_OPTS=defaults + MNT_FREQ=0 + MNT_PASS=0 +
Bug#652459: initramfs-tools: [patch] Please support mounting of /usr in the initramfs
On Dec 17, Roger Leigh rle...@debian.org wrote: 1) Generation of /etc/fstab in the initramfs, including the rootfs and all the filesystems desired to be mounted This is highly suboptimal, because it suddenly makes the initramfs not generic anymore. The initramfs should: - mount / as usual - look at the rootfs fstab - mount /usr using the information from the rootfs fstab 2) In local mountroot(), rather than just mounting the rootfs, loop over all mountpoints in /etc/fstab and mount them. If there is no need to mount file systems other than /usr, why do it? - ability to NFS mount filesystems other than the rootfs, i.e. it might need nfsmount for local (not that this is a useful use case) More arguments to only mount what we strictly need. and other files to the root filesystem. It additionally permits mounting of /etc separately, thereby permitting it to be encrypted and/or writable while the root filesystem is unencrypted and/or read-only. I do not believe that this is desireable, it is complex and would come for free anyway by a / - /usr move. -- ciao, Marco signature.asc Description: Digital signature