All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] busybox: fix udhcp check for NFS rootfs for new style /proc/mounts
@ 2011-02-24  1:31 Denys Dmytriyenko
  2011-02-24  2:59 ` Khem Raj
  2011-02-24  2:59 ` Andreas Oberritter
  0 siblings, 2 replies; 4+ messages in thread
From: Denys Dmytriyenko @ 2011-02-24  1:31 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Denys Dmytriyenko

From: Denys Dmytriyenko <denys@ti.com>

* Newer kernels change the format of /proc/mounts slightly when rootfs is
mounted over NFS.

* Old style:
/dev/root / nfs <options> 0 0

* New style:
<server>:<mount> / nfs <options> 0 0

* The regexp in grep can be simplified and rolled into one, but may become
less strict...

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
---
 .../busybox-1.13.2/udhcpc-new-nfsroot.patch        |   16 ++++++++++++++++
 .../busybox-1.18.3/udhcpc-new-nfsroot.patch        |   16 ++++++++++++++++
 recipes/busybox/busybox_1.13.2.bb                  |    2 +-
 recipes/busybox/busybox_1.18.3.bb                  |    2 +-
 recipes/busybox/busybox_1.1x.inc                   |    1 +
 5 files changed, 35 insertions(+), 2 deletions(-)
 create mode 100644 recipes/busybox/busybox-1.13.2/udhcpc-new-nfsroot.patch
 create mode 100644 recipes/busybox/busybox-1.18.3/udhcpc-new-nfsroot.patch

diff --git a/recipes/busybox/busybox-1.13.2/udhcpc-new-nfsroot.patch b/recipes/busybox/busybox-1.13.2/udhcpc-new-nfsroot.patch
new file mode 100644
index 0000000..46aaab9
--- /dev/null
+++ b/recipes/busybox/busybox-1.13.2/udhcpc-new-nfsroot.patch
@@ -0,0 +1,16 @@
+diff -uNr busybox-1.13.2.orig/examples/udhcp/simple.script busybox-1.13.2/examples/udhcp/simple.script
+--- busybox-1.13.2.orig/examples/udhcp/simple.script	2011-02-23 00:30:32.000000000 -0500
++++ busybox-1.13.2/examples/udhcp/simple.script	2011-02-23 17:05:37.873381763 -0500
+@@ -10,7 +10,12 @@
+ 
+ # return 0 if root is mounted on a network filesystem
+ root_is_nfs() {
++	# old style mounts
+ 	grep -qe '^/dev/root.*\(nfs\|smbfs\|ncp\|coda\) .*' /proc/mounts
++	if ! $? ; then
++		# new style mounts
++		grep -qe '^.*:.* / \(nfs\|smbfs\|ncp\|coda\) .*' /proc/mounts
++	fi
+ }
+ 
+ case "$1" in
diff --git a/recipes/busybox/busybox-1.18.3/udhcpc-new-nfsroot.patch b/recipes/busybox/busybox-1.18.3/udhcpc-new-nfsroot.patch
new file mode 100644
index 0000000..46aaab9
--- /dev/null
+++ b/recipes/busybox/busybox-1.18.3/udhcpc-new-nfsroot.patch
@@ -0,0 +1,16 @@
+diff -uNr busybox-1.13.2.orig/examples/udhcp/simple.script busybox-1.13.2/examples/udhcp/simple.script
+--- busybox-1.13.2.orig/examples/udhcp/simple.script	2011-02-23 00:30:32.000000000 -0500
++++ busybox-1.13.2/examples/udhcp/simple.script	2011-02-23 17:05:37.873381763 -0500
+@@ -10,7 +10,12 @@
+ 
+ # return 0 if root is mounted on a network filesystem
+ root_is_nfs() {
++	# old style mounts
+ 	grep -qe '^/dev/root.*\(nfs\|smbfs\|ncp\|coda\) .*' /proc/mounts
++	if ! $? ; then
++		# new style mounts
++		grep -qe '^.*:.* / \(nfs\|smbfs\|ncp\|coda\) .*' /proc/mounts
++	fi
+ }
+ 
+ case "$1" in
diff --git a/recipes/busybox/busybox_1.13.2.bb b/recipes/busybox/busybox_1.13.2.bb
index ef20c62..fca3e93 100644
--- a/recipes/busybox/busybox_1.13.2.bb
+++ b/recipes/busybox/busybox_1.13.2.bb
@@ -1,5 +1,5 @@
 require busybox_1.1x.inc
-PR = "${INC_PR}.3"
+PR = "${INC_PR}.4"
 
 SRC_URI += "\
   file://busybox-1.13.2-awk.patch \
diff --git a/recipes/busybox/busybox_1.18.3.bb b/recipes/busybox/busybox_1.18.3.bb
index 633b70b..f85de86 100644
--- a/recipes/busybox/busybox_1.18.3.bb
+++ b/recipes/busybox/busybox_1.18.3.bb
@@ -1,5 +1,5 @@
 require busybox_1.1x.inc
-PR = "${INC_PR}.0"
+PR = "${INC_PR}.1"
 
 SRC_URI += " \
 	http://busybox.net/downloads/fixes-1.18.3/busybox-1.18.3-buildsys.patch;name=patch01 \
diff --git a/recipes/busybox/busybox_1.1x.inc b/recipes/busybox/busybox_1.1x.inc
index 7623944..aefa57f 100644
--- a/recipes/busybox/busybox_1.1x.inc
+++ b/recipes/busybox/busybox_1.1x.inc
@@ -5,6 +5,7 @@ SRC_URI = "\
   file://fdisk_nios2.patch \
   file://udhcpscript.patch \
   file://udhcpc-fix-nfsroot.patch \
+  file://udhcpc-new-nfsroot.patch \
   file://B921600.patch \
   file://get_header_tar.patch \
   file://busybox-appletlib-dependency.patch \
-- 
1.7.0.4




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

end of thread, other threads:[~2011-02-24  3:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-24  1:31 [PATCH] busybox: fix udhcp check for NFS rootfs for new style /proc/mounts Denys Dmytriyenko
2011-02-24  2:59 ` Khem Raj
2011-02-24  2:59 ` Andreas Oberritter
2011-02-24  3:26   ` Denys Dmytriyenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.