[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-hotplug
Subject:    Re: how to create /dev/root
From:       Harald Hoyer <harald () redhat ! com>
Date:       2008-07-16 15:37:17
Message-ID: 487E15AD.3030708 () redhat ! com
[Download RAW message or body]

piterpk wrote:
> > On Sat, Jul 12, 2008 at 04:52, Marco d'Itri <md@linux.it> wrote:
> > > I added this to the Debian udev init script, run between mounting /dev
> > > and starting udevtrigger.
> > > 
> > > mountpoint at least on Debian systems is part of sysvinit and happens to
> > > be in /bin, but if /usr is available then you can as well use stat(1).
> > > 
> > > create_devroot_rule() {
> > > local udevroot="$1"
> > > local rootnumbers=$(mountpoint -q -d / || true)
> > > local rootmajor=${rootnumbers%:*}
> > > local rootminor=${rootnumbers#*:}
> > > [ "$rootmajor" -a "$rootminor" ] || return 0
> > > 
> > > echo 'ACTION=="add", SUBSYSTEM=="block", ENV{MAJOR}=="'$rootmajor'", \
> > > ENV{MINOR}=="'$rootminor'",
> SYMLINK+="root"' > /dev/.udev/rules.d/rules.d/61-dev-root-link.rules
> > > }
> 
> Based in original Marco´s code, we are using this one:
> 
> # Create rootdev rules
> DEVICENUMBER=$( /bin/stat -c %d / )
> MAJORNUMBER=$(($DEVICENUMBER / 256))
> MINORNUMBER=$(($DEVICENUMBER % 256))
> 
> echo 'ACTION=="add", SUBSYSTEM=="block", ENV{MAJOR}=="'$MAJORNUMBER'", \
> ENV{MINOR}=="'$MINORNUMBER'", SYMLINK+="root"' > \
> /dev/.udev/rules.d/61-dev-root-link.rules 
> But our uses stat instead mountpoint (mountpoint is in /usr/bin and stat is in \
> /bin)

Fedora:

$ which stat
/usr/bin/stat


["smime.p7s" (application/x-pkcs7-signature)]
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic