mdev feature request

Bernhard Fischer rep.nop at aon.at
Mon Sep 25 16:22:03 UTC 2006


On Mon, Sep 25, 2006 at 10:41:06AM -0500, Jason Schoon wrote:
>On 9/25/06, Bernhard Fischer <rep.nop at aon.at> wrote:
>>
>>On Sun, Sep 24, 2006 at 07:24:34PM -0500, Jason Schoon wrote:
>>>On 9/24/06, Michael-Luke Jones <jonesml at fastmail.to> wrote:
>>>>
>>
>>I'd say the easiest way to achieve that without adding too much to the
>>size of mdev is to provide something like debian's update-modules that
>>does concatenate /etc/mdev.d/* into /etc/mdev.conf:
>>
>>cat <<-E_O_F > /etc/mdev.conf
>># Please do not edit this file directly. If you want to change or add
>># anything please take a look at the files in /etc/mdev.d and read
>># the manpage for update-mdev
>>#
>>E_O_F
>>for cfg in /etc/mdev.d/*
>>do
>>  if [ -f "$cfg" ]; then
>>    echo "### update-mdev: start processing $cfg"
>>    if [ -x "$cfg" ]; then
>>      if ! "$cfg"; then
>>        echo "Error while executing $cfg" >&2
>>        exit 1
>>      fi
>>    elif [ -e "$cfg" ]; then
>>      cat $cfg
>>    else
>>      echo "Warning: $cfg does not exist (dangling symlink?)" >&2
>>    fi
>>    echo "### update-mdev: end processing $cfg"

fi

>>done >> /etc/mdev.conf
>>
>>or something to that effect. See update-modules for details (like arch
>>specific subdirectories -- /etc/mdev.d/${ARCH}/).
>>
>>This would ensure that mdev stays small and you can use a configfile
>>hierarchy that can be populated by your package-handling system.
>>
>>HTH,
>>Bernhard
>>
>
>I was trying to come up with an alternative shell-script solution as well.
>I like this one, but I wonder if a large number of people using mdev in
>embedded systems will be using a read-only filesystem like squashfs (that's
>how I use it).  In that case, creating the mdev.conf on the fly would
>require a symlink out to writable area or possibly a unionfs mount.

In principle, i agree. If you're populating /etc/mdev.d/ with scripts
that stem from your package-management system, then you'll have to
provide writable space anyway.
So for a "finalized" install, the /etc/mdev.conf would be populated
already (possibly through post-install hooks that call update-mdev for
packages that put rules into /etc/mdev.d/).
>
>I thought I would see how small it could be made in the code, and decide
>from there if it was worth it or not.

Sure, it's obvious how this is useful for setups that are ro or if
you're very low on space (so cannot afford to duplicate the size the
mdev rules take up since they would exist twice, both in /etc/mdev.d/*
and in the concatenated /etc/mdev.conf).



More information about the busybox mailing list