public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/udev-gentoo-scripts:master commit in: helpers/, init.d/, /
@ 2012-06-30 23:47 William Hubbs
  0 siblings, 0 replies; 2+ messages in thread
From: William Hubbs @ 2012-06-30 23:47 UTC (permalink / raw
  To: gentoo-commits

commit:     95f2c9b3242d6dea3dd81f4e19c1734216839072
Author:     William Hubbs <williamh <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 30 23:43:50 2012 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Sat Jun 30 23:43:50 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/udev-gentoo-scripts.git;a=commit;h=95f2c9b3

Drop the write_root_link_rule helper

This udev helper created /dev/root, which was a link to the root device.
However, this should not be needed.

---
 Makefile                     |    3 +--
 helpers/write_root_link_rule |   29 -----------------------------
 init.d/udev                  |    2 --
 3 files changed, 1 insertions(+), 33 deletions(-)

diff --git a/Makefile b/Makefile
index 2844d4a..b4fbb67 100644
--- a/Makefile
+++ b/Makefile
@@ -9,8 +9,7 @@ CONFD ?= $(SYSCONFDIR)/conf.d
 INITD ?= $(SYSCONFDIR)/init.d
 
 HELPERS = \
-	helpers/net.sh \
-	helpers/write_root_link_rule
+	helpers/net.sh
 
 all:
 	@echo "Run make install DESTDIR="

diff --git a/helpers/write_root_link_rule b/helpers/write_root_link_rule
deleted file mode 100755
index 56c7998..0000000
--- a/helpers/write_root_link_rule
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-#
-# This script should run before doing udevtrigger at boot.
-# It will create a rule matching the device directory / is on, and
-# creating /dev/root symlink pointing on its device node.
-#
-# This is especially useful for hal looking at /proc/mounts containing
-# a line listing /dev/root as device:
-#   /dev/root / reiserfs rw 0 0
-# 
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation version 2 of the License.
-#
-# (c) 2007-2008 Matthias Schwarzott <zzam@gentoo.org>
-
-eval $(udevadm info --export --export-prefix="ROOT_" --device-id-of-file=/)
-
-[ $? = 0 ] || exit 0
-[ "$ROOT_MAJOR" = 0 ] && exit 0
-
-[ -e /run ] && DIR=/run/udev/rules.d || DIR=/dev/.udev/rules.d
-[ -d "$DIR" ] || mkdir -p "$DIR"
-RULES=$DIR/10-root-link.rules
-
-echo "# Created by /lib/udev/write_root_link_rule" > "${RULES}"
-echo "# This rule should create /dev/root as link to real root device." >> "${RULES}"
-echo "SUBSYSTEM==\"block\", ENV{MAJOR}==\"$ROOT_MAJOR\", ENV{MINOR}==\"$ROOT_MINOR\", SYMLINK+=\"root\"" >> "${RULES}"
-

diff --git a/init.d/udev b/init.d/udev
index 2541a0c..9eb74bd 100644
--- a/init.d/udev
+++ b/init.d/udev
@@ -100,8 +100,6 @@ start_pre()
 		echo "# as we use /etc/init.d/network to set up our network" >> "${f}"
 	fi
 
-	/lib/udev/write_root_link_rule
-
 	if [ -e /proc/sys/kernel/hotplug ]; then
 		echo "" >/proc/sys/kernel/hotplug
 	fi



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

* [gentoo-commits] proj/udev-gentoo-scripts:master commit in: helpers/, init.d/, /
@ 2013-12-31  5:28 William Hubbs
  0 siblings, 0 replies; 2+ messages in thread
From: William Hubbs @ 2013-12-31  5:28 UTC (permalink / raw
  To: gentoo-commits

commit:     d2e712f832cc81db8e35c964991ea3bab7a4b0f0
Author:     William Hubbs <williamh <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 29 03:56:12 2013 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Tue Dec 31 04:15:08 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/udev-gentoo-scripts.git;a=commit;h=d2e712f8

Move code from dev-root-link helper to udev init script

This code should only be run by the udev init script, so let's put it
inside the script instead of making it a helper.

X-Gentoo-Bug: 495086
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=495086

---
 Makefile                 |  1 -
 helpers/dev-root-link.sh | 22 ----------------------
 init.d/udev              | 19 ++++++++++++++++++-
 3 files changed, 18 insertions(+), 24 deletions(-)

diff --git a/Makefile b/Makefile
index d631832..b1739ed 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,6 @@ CONFD ?= $(SYSCONFDIR)/conf.d
 INITD ?= $(SYSCONFDIR)/init.d
 
 HELPERS = \
-	helpers/dev-root-link.sh \
 	helpers/net.sh
 
 all:

diff --git a/helpers/dev-root-link.sh b/helpers/dev-root-link.sh
deleted file mode 100644
index b92c47e..0000000
--- a/helpers/dev-root-link.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh -e
-#
-# dev-root-link.sh: create /dev/root symlink
-#
-# Distributed under the terms of the GNU General Public License v2
-#
-# This is here because some software expects /dev/root to exist.
-# For more information, see this bug:
-# https://bugs.gentoo.org/show_bug.cgi?id=438380
-
-RULESDIR=/run/udev/rules.d
-
-[ -d $RULESDIR ] || mkdir -p $RULESDIR
-
-eval $(udevadm info --export --export-prefix=ROOT_ --device-id-of-file=/ || true)
-
-[ "$ROOT_MAJOR" -a "$ROOT_MINOR" ] || exit 0
-
-# btrfs filesystems have bogus major/minor numbers
-[ "$ROOT_MAJOR" != 0 ] || exit 0
-
-echo 'ACTION=="add|change", SUBSYSTEM=="block", ENV{MAJOR}=="'$ROOT_MAJOR'", ENV{MINOR}=="'$ROOT_MINOR'", SYMLINK+="root"' > $RULESDIR/61-dev-root-link.rules

diff --git a/init.d/udev b/init.d/udev
index 0e9abfe..c861338 100644
--- a/init.d/udev
+++ b/init.d/udev
@@ -93,11 +93,28 @@ start_udevmonitor()
 		--background --exec /bin/udevadm -- monitor ${udev_monitor_opts}
 }
 
+# This is here because some software expects /dev/root to exist.
+# For more information, see this bug:
+# https://bugs.gentoo.org/show_bug.cgi?id=438380
+dev_root_link()
+{
+	local RULESDIR=/run/udev/rules.d
+	[ -d $RULESDIR ] || mkdir -p $RULESDIR
+	eval $(udevadm info --export --export-prefix=ROOT_ --device-id-of-file=/ ||
+		true)
+	[ "$ROOT_MAJOR" -a "$ROOT_MINOR" ] || return 0
+
+	# btrfs filesystems have bogus major/minor numbers
+	[ "$ROOT_MAJOR" != 0 ] || return 0
+
+	echo 'ACTION=="add|change", SUBSYSTEM=="block", ENV{MAJOR}=="'$ROOT_MAJOR'", ENV{MINOR}=="'$ROOT_MINOR'", SYMLINK+="root"' > $RULESDIR/61-dev-root-link.rules
+}
+
 populate_dev()
 {
 	if yesno ${rc_dev_root_symlink:-yes}; then
 		ebegin "Generating a rule to create a /dev/root symlink"
-		/lib/udev/dev-root-link.sh
+		dev_root_link
 		eend $?
 	fi
 


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

end of thread, other threads:[~2013-12-31  5:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-31  5:28 [gentoo-commits] proj/udev-gentoo-scripts:master commit in: helpers/, init.d/, / William Hubbs
  -- strict thread matches above, loose matches on Subject: below --
2012-06-30 23:47 William Hubbs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox