From patchwork Fri Mar 28 21:29:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denys Dmytriyenko X-Patchwork-Id: 27382 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f197.google.com (mail-pd0-f197.google.com [209.85.192.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C7AE620545 for ; Fri, 28 Mar 2014 21:30:16 +0000 (UTC) Received: by mail-pd0-f197.google.com with SMTP id fp1sf12531781pdb.4 for ; Fri, 28 Mar 2014 14:30:15 -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=tcOR23nVxhS1oU09BE6+E7RJo+0Ge2qzHhTi9cT5ruc=; b=afgmDcec3k7PfzZTQk19FJOcHJcADzU8YrTe7EvvXRDFqoIgBJzuKaX/claho58RMP CgvRBkc+xzuV3wvlKlTnPyXbbThgwgiM3MaBvH9xpoeORlmOkYC5cIzo4oVfjM4VdviM qZyTotn6ojMu2UMXFYxP4sFBRsSHPVSlY3IKU+scKAKV6PPLNweERgeI5K/tdnCUrxwn Umaw0qdfrput8HgkjqhnpIrMJbE25QvZmza5rwEsYlUR4txbUmo4/QUEs0iZZ8X4MeA0 owM2i4W0xPRDGJmtsABIq4nCmE1gQgYwYCVHt7VNBJFh/TUx7Z6bjw0rhk+F4FHeFR03 Q1Rg== X-Gm-Message-State: ALoCoQnvGjWjgGnhYT6TBcZ85hRj6ocE5D6LUZt/nC/EssCcJxvRGzlWPgj0kMeYn9wcUUZ5yTg3 X-Received: by 10.66.188.238 with SMTP id gd14mr4140841pac.18.1396042215501; Fri, 28 Mar 2014 14:30:15 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.108.10 with SMTP id i10ls1709354qgf.62.gmail; Fri, 28 Mar 2014 14:30:15 -0700 (PDT) X-Received: by 10.220.161.8 with SMTP id p8mr9132743vcx.4.1396042214873; Fri, 28 Mar 2014 14:30:14 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id tm8si1500231vdc.26.2014.03.28.14.30.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Mar 2014 14:30:14 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id oz11so6183569veb.5 for ; Fri, 28 Mar 2014 14:30:14 -0700 (PDT) X-Received: by 10.52.240.207 with SMTP id wc15mr7755819vdc.14.1396042214526; Fri, 28 Mar 2014 14:30:14 -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 v8csp40526vcv; Fri, 28 Mar 2014 14:30:14 -0700 (PDT) X-Received: by 10.66.249.233 with SMTP id yx9mr10932914pac.3.1396042213696; Fri, 28 Mar 2014 14:30:13 -0700 (PDT) Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id f8si4371777pbc.415.2014.03.28.14.30.13 for ; Fri, 28 Mar 2014 14:30:13 -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 84B0E6B59C; Fri, 28 Mar 2014 21:29:54 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from vms173017pub.verizon.net (vms173017pub.verizon.net [206.46.173.17]) by mail.openembedded.org (Postfix) with ESMTP id 203C76B58B for ; Fri, 28 Mar 2014 21:29:49 +0000 (UTC) Received: from gandalf.denix.org ([unknown] [71.191.205.189]) by vms173017.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0N3600CST11QUQ80@vms173017.mailsrvcs.net> for openembedded-core@lists.openembedded.org; Fri, 28 Mar 2014 16:29:50 -0500 (CDT) Received: from localhost.localdomain (elrond [192.168.0.7]) by gandalf.denix.org (Postfix) with ESMTP id D02B820085; Fri, 28 Mar 2014 17:29:49 -0400 (EDT) From: Denys Dmytriyenko To: openembedded-core@lists.openembedded.org Date: Fri, 28 Mar 2014 17:29:44 -0400 Message-id: <1396042184-7372-1-git-send-email-denis@denix.org> X-Mailer: git-send-email 1.9.1 Cc: Denys Dmytriyenko Subject: [OE-core] [PATCH] [RFC] 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.128.174 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/. Signed-off-by: Denys Dmytriyenko --- meta/recipes-core/udev/udev-extraconf/mount.sh | 14 +++++++------- meta/recipes-core/udev/udev-extraconf_1.0.bb | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) 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.0.bb index 3810b28..bae997c 100644 --- a/meta/recipes-core/udev/udev-extraconf_1.0.bb +++ b/meta/recipes-core/udev/udev-extraconf_1.0.bb @@ -4,7 +4,7 @@ LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" -PR = "r16" +PR = "r17" SRC_URI = " \ file://automount.rules \