Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] udev-extraconf: Add -o silent to auto mount
@ 2013-04-10  6:25 Saul Wold
  2013-04-10  6:25 ` [PATCH 2/2] busybox: fail on no media Saul Wold
  2013-04-10  9:34 ` [PATCH 1/2] udev-extraconf: Add -o silent to auto mount Hongxu Jia
  0 siblings, 2 replies; 3+ messages in thread
From: Saul Wold @ 2013-04-10  6:25 UTC (permalink / raw)
  To: openembedded-core

This will silence some of the noisy output from mount and the kernel
when trying to automount filesystems or devices

[YOCTO #3935]

Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
 meta/recipes-core/udev/udev-extraconf/mount.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh
index 99c76b2..7b58361 100644
--- a/meta/recipes-core/udev/udev-extraconf/mount.sh
+++ b/meta/recipes-core/udev/udev-extraconf/mount.sh
@@ -22,7 +22,7 @@ automount() {
 
 	! test -d "/media/$name" && mkdir -p "/media/$name"
 	
-	if ! $MOUNT -t auto $DEVNAME "/media/$name"
+	if ! $MOUNT -o silent -t auto $DEVNAME "/media/$name"
 	then
 		#logger "mount.sh/automount" "$MOUNT -t auto $DEVNAME \"/media/$name\" failed!"
 		rm_dir "/media/$name"
-- 
1.8.0.2




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

* [PATCH 2/2] busybox: fail on no media
  2013-04-10  6:25 [PATCH 1/2] udev-extraconf: Add -o silent to auto mount Saul Wold
@ 2013-04-10  6:25 ` Saul Wold
  2013-04-10  9:34 ` [PATCH 1/2] udev-extraconf: Add -o silent to auto mount Hongxu Jia
  1 sibling, 0 replies; 3+ messages in thread
From: Saul Wold @ 2013-04-10  6:25 UTC (permalink / raw)
  To: openembedded-core

The current behaviour of busybox is to try all fstype when automounting
even when no media exists.  The util-linux mount command bails when no
media exists, so change the behaviour of busybox to do the same.

It could also be argued that the KERN_INFO message from btrfs could be
removed, but that would be harder to accomplish.

Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
 .../busybox/busybox-1.20.2/fail_on_no_media.patch  | 24 ++++++++++++++++++++++
 meta/recipes-core/busybox/busybox_1.20.2.bb        |  3 ++-
 2 files changed, 26 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/busybox/busybox-1.20.2/fail_on_no_media.patch

diff --git a/meta/recipes-core/busybox/busybox-1.20.2/fail_on_no_media.patch b/meta/recipes-core/busybox/busybox-1.20.2/fail_on_no_media.patch
new file mode 100644
index 0000000..166c619
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox-1.20.2/fail_on_no_media.patch
@@ -0,0 +1,24 @@
+Upstream-Status: Pending
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+
+Index: busybox-1.20.2/util-linux/mount.c
+===================================================================
+--- busybox-1.20.2.orig/util-linux/mount.c
++++ busybox-1.20.2/util-linux/mount.c
+@@ -598,7 +598,13 @@ static int mount_it_now(struct mntent *m
+ 				break;
+ 			errno = errno_save;
+ 		}
+-
++		/*
++		 * Break if there is no media, no point retrying for all
++		 * fs types since there is no media available
++		 */
++		if ((rc == -1) && (errno == ENOMEDIUM || errno == ENODEV)) {
++			bb_perror_msg_and_die("mounting %s on %s failed", mp->mnt_fsname, mp->mnt_dir);
++		}
+ 		if (!rc || (vfsflags & MS_RDONLY) || (errno != EACCES && errno != EROFS))
+ 			break;
+ 		if (!(vfsflags & MS_SILENT))
diff --git a/meta/recipes-core/busybox/busybox_1.20.2.bb b/meta/recipes-core/busybox/busybox_1.20.2.bb
index c09a492..401c1eb 100644
--- a/meta/recipes-core/busybox/busybox_1.20.2.bb
+++ b/meta/recipes-core/busybox/busybox_1.20.2.bb
@@ -31,7 +31,8 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
            file://busybox-syslog.service.in \
            file://busybox-klogd.service.in \
            file://testsuite-du-du-k-works-fix-false-positive.patch \
-           file://strict-atime.patch"
+           file://strict-atime.patch \
+           file://fail_on_no_media.patch"
 
 SRC_URI[tarball.md5sum] = "e025414bc6cd79579cc7a32a45d3ae1c"
 SRC_URI[tarball.sha256sum] = "eb13ff01dae5618ead2ef6f92ba879e9e0390f9583bd545d8789d27cf39b6882"
-- 
1.8.0.2




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

* Re: [PATCH 1/2] udev-extraconf: Add -o silent to auto mount
  2013-04-10  6:25 [PATCH 1/2] udev-extraconf: Add -o silent to auto mount Saul Wold
  2013-04-10  6:25 ` [PATCH 2/2] busybox: fail on no media Saul Wold
@ 2013-04-10  9:34 ` Hongxu Jia
  1 sibling, 0 replies; 3+ messages in thread
From: Hongxu Jia @ 2013-04-10  9:34 UTC (permalink / raw)
  To: Saul Wold; +Cc: openembedded-core

On 04/10/2013 02:25 PM, Saul Wold wrote:
> This will silence some of the noisy output from mount and the kernel
> when trying to automount filesystems or devices
>
> [YOCTO #3935]
>
> Signed-off-by: Saul Wold <sgw@linux.intel.com>
> ---
>   meta/recipes-core/udev/udev-extraconf/mount.sh | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh
> index 99c76b2..7b58361 100644
> --- a/meta/recipes-core/udev/udev-extraconf/mount.sh
> +++ b/meta/recipes-core/udev/udev-extraconf/mount.sh
> @@ -22,7 +22,7 @@ automount() {
>   
>   	! test -d "/media/$name" && mkdir -p "/media/$name"
>   	
> -	if ! $MOUNT -t auto $DEVNAME "/media/$name"
> +	if ! $MOUNT -o silent -t auto $DEVNAME "/media/$name"
>   	then
>   		#logger "mount.sh/automount" "$MOUNT -t auto $DEVNAME \"/media/$name\" failed!"
>   		rm_dir "/media/$name"
I have tested on atom-pc,  mount option "silent" is unrecognized.
...
root@atom-pc:~# mount -o silent -t auto /dev/sdb1 /media/sdb1
mount: mounting /dev/sdb1 on /media/sdb1 failed: Invalid argument
...

Without this option, mount is ok
...
root@atom-pc:~# mount -t auto /dev/sdb1 /media/sdb1
root@atom-pc:~# mount
/dev/sdb1 on /media/sdb1 type ext4 (rw,relatime,data=ordered)
...

root@atom-pc:~# which mount
/bin/mount
root@atom-pc:~# ls /bin/mount -al
lrwxrwxrwx    1 root     root            12 Apr 10 07:44 /bin/mount -> 
/bin/busybox

branch master 6d4d42d63db4c3fcffd831ce359599f3ee1d710e

Thanks,
Hongxu





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

end of thread, other threads:[~2013-04-10  9:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-10  6:25 [PATCH 1/2] udev-extraconf: Add -o silent to auto mount Saul Wold
2013-04-10  6:25 ` [PATCH 2/2] busybox: fail on no media Saul Wold
2013-04-10  9:34 ` [PATCH 1/2] udev-extraconf: Add -o silent to auto mount Hongxu Jia

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