Re: [patch v2 1/3] wait host devs in base module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/23/2012 11:31 PM, Vivek Goyal wrote:

> On Thu, Aug 23, 2012 at 11:02:22AM +0800, dyoung@xxxxxxxxxx wrote:
>> each dev in host_devs[] should be waited in initqueue to make sure they
>> are oneline before initqueue finish.
>>
>> Add a new wait_host_devs.sh in base module to make this a generic thing.
>> Because all the devs in fstab lines are also added to host_devs, so no need
>> do same wait in fstab-sys module anymore.
>>
>> [v2->v3]: do not add slave devices to host_devs
>>           wait for persistent dev name in initramfs
>>
>> Signed-off-by: Dave Young <dyoung@xxxxxxxxxx>
>> ---
>>  dracut.sh                               |   16 ++++++++++++++++
>>  modules.d/95fstab-sys/module-setup.sh   |    1 -
>>  modules.d/95fstab-sys/wait-mount-dev.sh |   22 ----------------------
>>  modules.d/99base/module-setup.sh        |    1 +
>>  modules.d/99base/wait-host-devs.sh      |   20 ++++++++++++++++++++
>>  5 files changed, 37 insertions(+), 23 deletions(-)
>>
>> --- dracut.orig/dracut.sh
>> +++ dracut/dracut.sh
>> @@ -903,6 +903,22 @@ done
>>  
>>  dinfo "*** Including modules done ***"
>>  
>> +get_persistent_dev() {
>> +    local i _tmp
>> +    local _dev=${1##*/}
>> +
>> +    for i in /dev/disk/by-id/*; do
>> +        _tmp=$(readlink $i)
>> +        [ "${_tmp##*/}" = "$_dev" ] && echo $i && return
>> +    done
>> +}
>> +
> 
> I am wondering that will it be better to rely on user to pass the
> persistent device name instead of we trying to convert it into a name
> generated by udev.
> 
> I kind of prefer to let user provide the persistent name instead of 
> dong tricks internally. (Either in fstab or using --device option).


This patchset make the wait_for_dev globally, it will wait for all
devices in host_devs.  This not only limited to fstab and --device
passed items, such as below code, for these system mountpoint it's still
necessary to find the udev name if we want to wait them in initramfs:

    push host_mp \
        "/" \
        "/etc" \
        "/usr" \
        "/usr/bin" \
        "/usr/sbin" \
        "/usr/lib" \
        "/usr/lib64" \
        "/boot"

    for mp in "${host_mp[@]}"; do
        mountpoint "$mp" >/dev/null 2>&1 || continue
        push host_devs $(readlink -f "/dev/block/$(find_block_device
"$mp")")
    done


-- 
Thanks
Dave
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux