Bug 1003207 - Dracut needs support for bcache
Dracut needs support for bcache
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: dracut (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: dracut-maint
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 998543 999690 1008227 1008228
  Show dependency treegraph
 
Reported: 2013-08-31 16:19 EDT by Rolf Fokkens
Modified: 2013-09-15 15:28 EDT (History)
5 users (show)

See Also:
Fixed In Version: dracut-033-1.fc21
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-12 09:15:04 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Initial attempt to build a bcache module for dracut (594 bytes, application/x-shellscript)
2013-09-01 10:53 EDT, Rolf Fokkens
no flags Details

  None (edit)
Description Rolf Fokkens 2013-08-31 16:19:59 EDT
Description of problem:

Bug 998543 is related to a change wich implements SSD caching. As such Bug 998543 is a SelfContained change for F20, but for F21 the Change is intended toe be SystemWide. This implies among others dracut support for bcache.

This Bug is a starting point for the steps to be taken.
Comment 1 Rolf Fokkens 2013-09-01 05:41:46 EDT
Started discussion on devel@:
https://lists.fedoraproject.org/pipermail/devel/2013-September/188625.html
Comment 2 Igor Gnatenko 2013-09-01 06:04:38 EDT
We have initramfs hook at bcache-tools, but I don't know how we should use it.
Comment 3 Igor Gnatenko 2013-09-01 07:05:17 EDT
http://bcache.evilpiepirate.org/#index6h1
ok. our steps I think:
we should port initramfs hook to dracut module (https://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html#_developer_manual)
Rolf, can you do this ?
Comment 4 Rolf Fokkens 2013-09-01 10:53:01 EDT
Created attachment 792597 [details]
Initial attempt to build a bcache module for dracut

I throw the bcache initramfs/hook and 90mdraid/module-setup.sh in the blender, and the result is my first attempt for a dracut module.

It tested it and it does work, so that's OK. I even disabled the bcache udev rule on my root FS, which provided prof that the initramfs worked because /dev/bcache* devices were there.

What worries me is the fact that 90mdraid/module-setup.sh has more checks that I left out because I don't understand them.

I'm also wondering if this should be part of dracut, or part of bcache-tools.
Comment 5 Harald Hoyer 2013-09-02 04:39:06 EDT
Well, dracut-032 already contains a bcache module:

http://git.kernel.org/cgit/boot/dracut/dracut.git/tree/modules.d/90bcache/module-setup.sh

$ rpm -qf /usr/lib/dracut/modules.d/90bcache/
dracut-032-11.git20130822

$ cat /usr/lib/dracut/modules.d/90bcache/module-setup.sh 
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh

check() {
    type -P probe-bcache >/dev/null || return 1

    [[ $hostonly ]] || [[ $mount_needs ]] && {
        for fs in "${host_fs_types[@]}"; do
            [[ $fs = "bcache" ]] && return 0
        done
        return 255
    }

    return 0
}

depends() {
    return 0
}

installkernel() {
    instmods bcache
}

install() {
    inst_multiple probe-bcache ${udevdir}/bcache-register
    inst_rules 61-bcache.rules
}



What else do you need?
Comment 6 Rolf Fokkens 2013-09-02 05:32:14 EDT
Thanks, looks like that takes care of it.

Looking forward: blkid (util-linux) may obsolete probe-bcache, see bug 1001120. 

I'll leave this bug open to address it when util-linux is updated, OK?
Comment 7 Rolf Fokkens 2013-09-05 02:44:33 EDT
For F20 probe-bcache will be obsoleted indeed by util-linux:

https://bugzilla.redhat.com/show_bug.cgi?id=1001120#c13
Comment 8 Nimimo 2013-09-05 06:35:38 EDT
Removing probe-bcache will be a Fedora-specific change until
upstream can assume everyone has the next util-linux release.
If you go ahead with it, I'd recommend patching the Dracut
module in preference to an upstream change.
Comment 9 Rolf Fokkens 2013-09-09 04:35:06 EDT
Did some testing in an f20 image, the bcache module in dracut works fine.
Comment 10 Harald Hoyer 2013-09-12 09:14:45 EDT
dracut-033-1.fc21
Comment 11 Rolf Fokkens 2013-09-14 07:21:34 EDT
This is not really a bug (yet), but for the record:

Testing demonstrated the following:

${host_fs_types[@]} appears to rely on blkid. With the current util-linux there's no bcache reported in host_fs_types, so dracut only creates a working initramfs with the -N option. When using the new util-linux (2.24) blkid reports bcache, and then dracut creates a working initramfs without the -N option.

In the end for F20 this won't be an issue, but if (only __if__) bcache is backported to F19 (or older?) this may lead to confusion for users. This also depends on dracut and util-linux being backported.
Comment 12 Harald Hoyer 2013-09-14 07:27:54 EDT
(In reply to Rolf Fokkens from comment #11)
> This is not really a bug (yet), but for the record:
> 
> Testing demonstrated the following:
> 
> ${host_fs_types[@]} appears to rely on blkid. With the current util-linux
> there's no bcache reported in host_fs_types, so dracut only creates a
> working initramfs with the -N option. When using the new util-linux (2.24)
> blkid reports bcache, and then dracut creates a working initramfs without
> the -N option.
> 
> In the end for F20 this won't be an issue, but if (only __if__) bcache is
> backported to F19 (or older?) this may lead to confusion for users. This
> also depends on dracut and util-linux being backported.

yes, true

Note You need to log in before you can comment on or make changes to this bug.