[oe-commits] org.oe.dev Busybox: patch df rootfs device handling code so that the output works correctly on systems that pivot from one root device to another during boot (SlugOS and variants)

mwester commit openembedded-commits at lists.openembedded.org
Sun Dec 24 02:59:20 UTC 2006


Busybox: patch df rootfs device handling code so that the output works correctly on systems that pivot from one root device to another during boot (SlugOS and variants)

Author: mwester at openembedded.org
Branch: org.openembedded.dev
Revision: 49f9287272ddf4c93c47c0d79762d5a118ea468f
ViewMTN: http://monotone.openembedded.org/revision.psp?id=49f9287272ddf4c93c47c0d79762d5a118ea468f
Files:
1
packages/busybox/busybox-1.2.1/df_rootfs.patch
packages/busybox/busybox_1.2.1.bb
Diffs:

#
# mt diff -r6bcacc9371f97cfdd5bcf5507e1afc90ece8b3ad -r49f9287272ddf4c93c47c0d79762d5a118ea468f
#
# 
# 
# add_file "packages/busybox/busybox-1.2.1/df_rootfs.patch"
#  content [13cf57a7f88b802a64d2f8b30d5e5350d7a3945c]
# 
# patch "packages/busybox/busybox_1.2.1.bb"
#  from [cee068273ebb49d33d57652d7165455d745da0b7]
#    to [00f472fdf311b3847a94bf09c41ef8d9b8fa213e]
# 
============================================================
--- packages/busybox/busybox-1.2.1/df_rootfs.patch	13cf57a7f88b802a64d2f8b30d5e5350d7a3945c
+++ packages/busybox/busybox-1.2.1/df_rootfs.patch	13cf57a7f88b802a64d2f8b30d5e5350d7a3945c
@@ -0,0 +1,34 @@
+--- busybox-1.2.1/coreutils/df.c.orig	2006-11-11 13:25:00.000000000 -0600
++++ busybox-1.2.1/coreutils/df.c	2006-11-11 13:23:15.000000000 -0600
+@@ -47,6 +47,7 @@
+ 	struct statfs s;
+ 	static const char hdr_1k[] = "1k-blocks"; /* default display is kilobytes */
+ 	const char *disp_units_hdr = hdr_1k;
++	int root_done = 0;
+ 
+ #ifdef CONFIG_FEATURE_HUMAN_READABLE
+ 	bb_opt_complementally = "h-km:k-hm:m-hk";
+@@ -112,16 +113,19 @@
+ 									   ) / (blocks_used + s.f_bavail);
+ 			}
+ 
+-			if (strcmp(device, "rootfs") == 0) {
+-				continue;
+-			} else if (strcmp(device, "/dev/root") == 0) {
++			if (strcmp(device, "/dev/root") == 0 || strcmp(device, "rootfs") == 0) {
+ 				/* Adjusts device to be the real root device,
+ 				* or leaves device alone if it can't find it */
+-				if ((device = find_block_device("/")) == NULL) {
++				if ((device = find_block_device(mount_point)) == NULL) {
+ 					goto SET_ERROR;
+ 				}
+ 			}
+ 
++			if (strcmp(mount_point, "/") == 0) {
++				if (root_done) continue;
++				root_done = 1;
++			}
++
+ #ifdef CONFIG_FEATURE_HUMAN_READABLE
+ 			bb_printf("%-20s %9s ", device,
+ 					  make_human_readable_str(s.f_blocks, s.f_bsize, df_disp_hr));
============================================================
--- packages/busybox/busybox_1.2.1.bb	cee068273ebb49d33d57652d7165455d745da0b7
+++ packages/busybox/busybox_1.2.1.bb	00f472fdf311b3847a94bf09c41ef8d9b8fa213e
@@ -1,8 +1,9 @@ require busybox.inc
 require busybox.inc
 
-PR = "r9"
+PR = "r10"
 
 SRC_URI += "file://wget-long-options.patch;patch=1 \
+	   file://df_rootfs.patch;patch=1 \
            file://defconfig"
 
 do_configure () {






More information about the Openembedded-commits mailing list