linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* how to create /dev/root
@ 2008-07-12  2:52 Marco d'Itri
  2008-07-15 13:50 ` Kay Sievers
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Marco d'Itri @ 2008-07-12  2:52 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 667 bytes --]

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
}

-- 
ciao,
Marco

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-07-16 15:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-12  2:52 how to create /dev/root Marco d'Itri
2008-07-15 13:50 ` Kay Sievers
2008-07-16 14:51 ` piterpk
2008-07-16 15:37 ` Harald Hoyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).