From patchwork Tue Apr 1 03:54:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denys Dmytriyenko X-Patchwork-Id: 27513 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E344E20341 for ; Tue, 1 Apr 2014 03:54:27 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id e16sf21289664qcx.10 for ; Mon, 31 Mar 2014 20:54:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=SZMVnejTtCCConzAKdxCKXbw8HaYkC70LfCwM2q6Fis=; b=ISpnJTWl+kEBt2PG6Jihb4sDUc9aQulktbllntr+y5xjexynLkZar3lJUXbbOz144r IKpCPYxwHKs9FmXXOueGUKZV0OcSLKelypDhqcx3Bdgmv0invGDXytovcYmhYp11jFYo dW3D+EpJtsyeaoQsDHEXmfk8TiBarArHD/h400tMJek/zqPb7lYoRiYrIamEi7pshrCy y7XtNQaHkzPAetOtG8j5newkHR+lZa/TkFNhGo9dUQvJsCbsqz4w9lk95XBKBnD7Mhrv v+Ecn81i5GgBj029tvmTak+NjSFw4JApe6OGEKbJtLVEVFJAxJwnWTpera7Yy3Sx4zAj Jx3g== X-Gm-Message-State: ALoCoQlHgfSRFE/Shkq105L144lhswMtqrGfYFCluG9uQoW9y6522d3tiAAMRQ85JssuNjy7sKFO X-Received: by 10.58.169.198 with SMTP id ag6mr3177480vec.22.1396324467149; Mon, 31 Mar 2014 20:54:27 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.89.70 with SMTP id u64ls2600947qgd.80.gmail; Mon, 31 Mar 2014 20:54:27 -0700 (PDT) X-Received: by 10.52.51.197 with SMTP id m5mr22355920vdo.9.1396324467048; Mon, 31 Mar 2014 20:54:27 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id cb3si3354156vdc.59.2014.03.31.20.54.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 31 Mar 2014 20:54:26 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id il7so8882659vcb.4 for ; Mon, 31 Mar 2014 20:54:26 -0700 (PDT) X-Received: by 10.52.191.100 with SMTP id gx4mr22425234vdc.4.1396324466845; Mon, 31 Mar 2014 20:54:26 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.12.8 with SMTP id v8csp194794vcv; Mon, 31 Mar 2014 20:54:26 -0700 (PDT) X-Received: by 10.66.144.227 with SMTP id sp3mr29012202pab.100.1396324465902; Mon, 31 Mar 2014 20:54:25 -0700 (PDT) Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id bp1si10344817pbb.49.2014.03.31.20.54.25 for ; Mon, 31 Mar 2014 20:54:25 -0700 (PDT) Received-SPF: pass (google.com: domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Received: from mail.openembedded.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 689946F8F6; Tue, 1 Apr 2014 03:54:18 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from vms173025pub.verizon.net (vms173025pub.verizon.net [206.46.173.25]) by mail.openembedded.org (Postfix) with ESMTP id A948B6AFB5 for ; Tue, 1 Apr 2014 03:54:12 +0000 (UTC) Received: from gandalf.denix.org ([unknown] [71.191.205.189]) by vms173025.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0N3C00BF42UDYY00@vms173025.mailsrvcs.net> for openembedded-core@lists.openembedded.org; Mon, 31 Mar 2014 22:54:13 -0500 (CDT) Received: from localhost.localdomain (elrond [192.168.0.7]) by gandalf.denix.org (Postfix) with ESMTP id 245CC2009B; Mon, 31 Mar 2014 23:54:13 -0400 (EDT) From: Denys Dmytriyenko To: openembedded-core@lists.openembedded.org Date: Mon, 31 Mar 2014 23:54:11 -0400 Message-id: <1396324451-26983-1-git-send-email-denis@denix.org> X-Mailer: git-send-email 1.9.1 Cc: Denys Dmytriyenko Subject: [OE-core] [PATCH v2] udev-extraconf: update mount.sh to use /run/media instead of /media X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: denis@denix.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Denys Dmytriyenko This is done to work around the issue of auto-mounting block devices (i.e. SD cards) when root filesystem is still in read-only mode and creating /media/ mount-points by udev is not possible. That is due to udev (/etc/rcS.d/S03udev) getting started earlier than checkroot (/etc/rcS.d/S10checkroot.sh) gets a chance to re-mount the rootfs as read-write. Although, canonical FHS specifies /media/ as a mount point for removable media devices, the latest 2.3 version was released in 2004 and since then FreeDesktop/udisks and other tools adopted the new /run/media// location. That was done to overcome read-only rootfs limitation, since /run is usually a tmpfs mounted partition, plus avoid name-clash between users. For our embedded systems environment we assume single-user operation and hence simplify mount point to just /run/media/. But for proper per-user mounting to /run/media//, some sort of session management is required along with the tool like udisks, that is out of scope of this simple udev-based auto-mounting. Signed-off-by: Denys Dmytriyenko --- v2 - drop PR, bump PV, elaborate on session/user mounting option meta/recipes-core/udev/udev-extraconf/mount.sh | 14 +++++++------- .../udev/{udev-extraconf_1.0.bb => udev-extraconf_1.1.bb} | 2 -- 2 files changed, 7 insertions(+), 9 deletions(-) rename meta/recipes-core/udev/{udev-extraconf_1.0.bb => udev-extraconf_1.1.bb} (99%) diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh index cb57e47..3e4f21f 100644 --- a/meta/recipes-core/udev/udev-extraconf/mount.sh +++ b/meta/recipes-core/udev/udev-extraconf/mount.sh @@ -20,7 +20,7 @@ done automount() { name="`basename "$DEVNAME"`" - ! test -d "/media/$name" && mkdir -p "/media/$name" + ! test -d "/run/media/$name" && mkdir -p "/run/media/$name" # Silent util-linux's version of mounting auto if [ "x`readlink $MOUNT`" = "x/bin/mount.util-linux" ] ; then @@ -38,12 +38,12 @@ automount() { ;; esac - if ! $MOUNT -t auto $DEVNAME "/media/$name" + if ! $MOUNT -t auto $DEVNAME "/run/media/$name" then - #logger "mount.sh/automount" "$MOUNT -t auto $DEVNAME \"/media/$name\" failed!" - rm_dir "/media/$name" + #logger "mount.sh/automount" "$MOUNT -t auto $DEVNAME \"/run/media/$name\" failed!" + rm_dir "/run/media/$name" else - logger "mount.sh/automount" "Auto-mount of [/media/$name] successful" + logger "mount.sh/automount" "Auto-mount of [/run/media/$name] successful" touch "/tmp/.automount-$name" fi } @@ -60,7 +60,7 @@ rm_dir() { # No ID_FS_TYPE for cdrom device, yet it should be mounted name="`basename "$DEVNAME"`" -[ -e /sys/block/$name/device/media ] && media_type=`cat /sys/block/$name/device/media` +[ -e /sys/block/$name/device/run/media ] && media_type=`cat /sys/block/$name/device/run/media` if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ] && [ -n "$ID_FS_TYPE" -o "$media_type" = "cdrom" ]; then if [ -x "$PMOUNT" ]; then @@ -87,5 +87,5 @@ if [ "$ACTION" = "remove" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; then # Remove empty directories from auto-mounter name="`basename "$DEVNAME"`" - test -e "/tmp/.automount-$name" && rm_dir "/media/$name" + test -e "/tmp/.automount-$name" && rm_dir "/run/media/$name" fi diff --git a/meta/recipes-core/udev/udev-extraconf_1.0.bb b/meta/recipes-core/udev/udev-extraconf_1.1.bb similarity index 99% rename from meta/recipes-core/udev/udev-extraconf_1.0.bb rename to meta/recipes-core/udev/udev-extraconf_1.1.bb index 3810b28..d69056d 100644 --- a/meta/recipes-core/udev/udev-extraconf_1.0.bb +++ b/meta/recipes-core/udev/udev-extraconf_1.1.bb @@ -4,8 +4,6 @@ LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" -PR = "r16" - SRC_URI = " \ file://automount.rules \ file://mount.sh \