mdev.conf setting example for running with linux kernel's IMA/EVM

趙翊廷 jackend at csie.io
Thu Oct 18 08:36:19 UTC 2018


Thank you for the suggestion using "stat" command  to get Major and Minor
number and can using one rule to do it.

so the setting will be the better one:
[hs]d[a-z]* 0:6 660 *ln -sf /dev/$MDEV /dev/block/$(printf "%d:%d" $(stat
-c "0x%t 0x%T" /dev/$MDEV))

I already tested this setting at my "qemu3.0.0 +busybox-1.29.3 +
linux-kernel-4.14.69" and could create the correct links for the device
nodes.

The attached file is the patch for the "busybox-1.29.3/example/mdev.conf"


Bernhard Reutner-Fischer <rep.dot.nop at gmail.com> 於 2018年10月18日 週四 下午3:47寫道:

> On Wed, 17 Oct 2018 at 11:02, 趙翊廷 <jackend at csie.io> wrote:
>
> > 2. in /etc/mdev.confg we need to add a symbol link something like
> /dev/block/3:0
> >     hd[a-z]* 0:6 660 *ln -sf /dev/$MDEV /dev/block/$(ls -l
> /dev/$MDEV|awk '{print $5}'|tr -d ','):$(ls -l /dev/$MDEV|awk '{print $6}')
> >     sd[a-z]* 0:6 660 *ln -sf /dev/$MDEV /dev/block/$(ls -l
> /dev/$MDEV|awk '{print $5}'|tr -d ','):$(ls -l /dev/$MDEV|awk '{print $6}')
>
> why two rules?
> [hs]d[a-z]*
> and yes, should fix examples/mdev.conf too.
>
> > if $MDEV is hda then will do the following things
> >
> > Get hda's Major=`ls -l /dev/hda | awk '{print $5} | tr -d ',''`
> > Get hda's Minor=`ls -l /dev/$MDEV|awk '{print $6}'`
> > create links: ln -sf /dev/hda /dev/block/$MAJOR:$MINOR
>
> printf "%d:%d" $(stat -c 0x%t\ 0x%T /dev/$MDEV)
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20181018/cb5950c5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mdev.conf.patch
Type: text/x-patch
Size: 564 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20181018/cb5950c5/attachment.bin>


More information about the busybox mailing list