[arch-general] Mounting root according to fstab the first time (fstab in initrd)?
Garmine 42
mikro001 at gmail.com
Mon Jan 25 14:17:02 UTC 2016
Hi!
I was a bit busy and just got to hacking my mkinitcpio now.
I decided to follow ProgAndy's idea and remove the current way of
mounting (default_mount_handler function) and instead create and use
mount hooks (by default the default_mount_handler and the mount call's
nearest lines is a new, enabled hook now).
This makes it easier to configure custom mount scenarios, even with
exotic configurations such as my /etc on a separate partiton*. Another
advantage is that it is compatible with most mkinitcpio features e.g.
the breakpoints.
Do you think it'd worth to try discussing and submitting my patch to
mkinitcpio's maintainers?
Thank you all for the help! :)
* It is in real a btrfs subvolume and needed in case of a flat
subvolume layout so I can easily snapshot only my /etc while
experimenting with new configurations. Obviously this is impossible in
case of the original mkinitcpio ramdisk because /etc/fstab is not on
the root volume.
Regards,
Garmine
On 20 January 2016 at 21:58, ProgAndy <admin at progandy.de> wrote:
> Am 20.01.2016 um 21:34 schrieb Garmine 42:
>>
>> First I will try to exclude root= and rootflags= parameters from the
>> cmdline and include the fstab via mkinitcpio and see if it finds the root.
>> Do I want to mask remount-fs in this case?
>
>
> That won't work. You'll have to create a hook for mkinitcpio that implements
> a custom mount_handler.
> In the install hook part, read the fstab data, write the necessary stuff to
> the image and add a runtime hook with add_runscript
> In the runtime hook, you change the mount_handler
>
> my_mount_handler() {
> mount ...
> }
> mount_handler="my_mount_handler"
More information about the arch-general
mailing list