All of lore.kernel.org
 help / color / mirror / Atom feed
* Mounting USB drives on a "read-only-rootfs" based system
@ 2016-06-13 21:22 Jeffrey D Boyer
  2016-06-13 22:01 ` Christopher Larson
  2016-06-14  6:36 ` Richard Leitner
  0 siblings, 2 replies; 9+ messages in thread
From: Jeffrey D Boyer @ 2016-06-13 21:22 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 665 bytes --]

Hello,

New to the list here, so I'm sorry if this question has been asked before, but I couldn't find a direct answer to it.

I have a yocto image that was built using the following bb script line: IMAGE_FEATURES += " read-only-rootfs".

As this image eventually resides on a static flash device, it must be read-only.  However, the system hardware supports removable media (SD card and USB drives), and I'd like to be able to mount and write to those removable drives / partitions for data logging purposes.  What needs to be done in order to make the /media directory auto-mountable when a "read-only" image is specified by the build script?

Thanks.


[-- Attachment #2: Type: text/html, Size: 2741 bytes --]

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

* Re: Mounting USB drives on a "read-only-rootfs" based system
  2016-06-13 21:22 Mounting USB drives on a "read-only-rootfs" based system Jeffrey D Boyer
@ 2016-06-13 22:01 ` Christopher Larson
  2016-06-14 13:18   ` Mike Looijmans
  2016-06-14  6:36 ` Richard Leitner
  1 sibling, 1 reply; 9+ messages in thread
From: Christopher Larson @ 2016-06-13 22:01 UTC (permalink / raw)
  To: Jeffrey D Boyer; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 1272 bytes --]

Afaik usb storage is already automounted by udev on /run/media/, so there's
no need to use /media for that purpose.

On Mon, Jun 13, 2016 at 2:22 PM, Jeffrey D Boyer <Jeffrey.D.Boyer@jci.com>
wrote:

> Hello,
>
>
>
> New to the list here, so I’m sorry if this question has been asked before,
> but I couldn’t find a direct answer to it.
>
>
>
> I have a yocto image that was built using the following bb script line:
> IMAGE_FEATURES += " read-only-rootfs".
>
>
>
> As this image eventually resides on a static flash device, it must be
> read-only.  However, the system hardware supports removable media (SD card
> and USB drives), and I’d like to be able to mount and write to those
> removable drives / partitions for data logging purposes.  What needs to be
> done in order to make the /media directory auto-mountable when a
> “read-only” image is specified by the build script?
>
>
>
> Thanks.
>
>
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
>


-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics

[-- Attachment #2: Type: text/html, Size: 2270 bytes --]

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

* Re: Mounting USB drives on a "read-only-rootfs" based system
  2016-06-13 21:22 Mounting USB drives on a "read-only-rootfs" based system Jeffrey D Boyer
  2016-06-13 22:01 ` Christopher Larson
@ 2016-06-14  6:36 ` Richard Leitner
  1 sibling, 0 replies; 9+ messages in thread
From: Richard Leitner @ 2016-06-14  6:36 UTC (permalink / raw)
  To: yocto

Hi,
you can adjust the mount behaviour for example in your udev mount script
(if you use udev).

If you have a fixed name/mountpoint for your media you can pre-create
that folder (for example /media/data-logging) and let udev's mount.sh
mount media which matches your criteria to that path.

kind regards,
richard
On 06/13/2016 11:22 PM, Jeffrey D Boyer wrote:
> Hello,
> 
>  
> 
> New to the list here, so I’m sorry if this question has been asked
> before, but I couldn’t find a direct answer to it. 
> 
>  
> 
> I have a yocto image that was built using the following bb script line:
> IMAGE_FEATURES += " read-only-rootfs". 
> 
>  
> 
> As this image eventually resides on a static flash device, it must be
> read-only.  However, the system hardware supports removable media (SD
> card and USB drives), and I’d like to be able to mount and write to
> those removable drives / partitions for data logging purposes.  What
> needs to be done in order to make the /media directory auto-mountable
> when a “read-only” image is specified by the build script?
> 
>  
> 
> Thanks.
> 


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

* Re: Mounting USB drives on a "read-only-rootfs" based system
  2016-06-13 22:01 ` Christopher Larson
@ 2016-06-14 13:18   ` Mike Looijmans
  2016-06-14 13:48     ` Jeffrey D Boyer
  0 siblings, 1 reply; 9+ messages in thread
From: Mike Looijmans @ 2016-06-14 13:18 UTC (permalink / raw)
  To: Christopher Larson, Jeffrey D Boyer; +Cc: yocto

Yup, even mdev based images do that with current OE.

I'd expect "/media" to symlink to "run/media" on most devices (regardless 
whether the rootfs is read-only or not). Check if that's the case on your system.

On 14-06-16 00:01, Christopher Larson wrote:
> Afaik usb storage is already automounted by udev on /run/media/, so there's no
> need to use /media for that purpose.
>
> On Mon, Jun 13, 2016 at 2:22 PM, Jeffrey D Boyer <Jeffrey.D.Boyer@jci.com
> <mailto:Jeffrey.D.Boyer@jci.com>> wrote:
>
>     Hello,____
>
>     __ __
>
>     New to the list here, so I’m sorry if this question has been asked before,
>     but I couldn’t find a direct answer to it. ____
>
>     __ __
>
>     I have a yocto image that was built using the following bb script line:
>     IMAGE_FEATURES += " read-only-rootfs". ____
>
>     __ __
>
>     As this image eventually resides on a static flash device, it must be
>     read-only.  However, the system hardware supports removable media (SD card
>     and USB drives), and I’d like to be able to mount and write to those
>     removable drives / partitions for data logging purposes.  What needs to be
>     done in order to make the /media directory auto-mountable when a
>     “read-only” image is specified by the build script?____
>
>     __ __
>
>     Thanks.____
>
>     __ __
>
>
>     --
>     

Kind regards,

Mike Looijmans
System Expert

TOPIC Embedded Products
Eindhovenseweg 32-C, NL-5683 KH Best
Postbus 440, NL-5680 AK Best
Telefoon: +31 (0) 499 33 69 79
E-mail: mike.looijmans@topicproducts.com
Website: www.topicproducts.com

Please consider the environment before printing this e-mail





_______________________________________________
>     yocto mailing list
>     yocto@yoctoproject.org <mailto:yocto@yoctoproject.org>
>     https://lists.yoctoproject.org/listinfo/yocto
>
>
>
>
> --
> Christopher Larson
> clarson at kergoth dot com
> Founder - BitBake, OpenEmbedded, OpenZaurus
> Maintainer - Tslib
> Senior Software Engineer, Mentor Graphics
>
>



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

* Re: Mounting USB drives on a "read-only-rootfs" based system
  2016-06-14 13:18   ` Mike Looijmans
@ 2016-06-14 13:48     ` Jeffrey D Boyer
  2016-06-14 14:28       ` Burton, Ross
  2016-06-15  8:07       ` Mike Looijmans
  0 siblings, 2 replies; 9+ messages in thread
From: Jeffrey D Boyer @ 2016-06-14 13:48 UTC (permalink / raw)
  To: Mike Looijmans, Christopher Larson; +Cc: yocto

Sorry, /media is not a symlink and there is no /run/media link or directory present on my running system.  When I insert an SD card, for example, I get a bit of text on the debug serial port that a card has been detected, but I don't see a mount point anywhere after that.

	root@mySys:/# mmc1: new high speed SDHC card at address 1234
	mmcblk1: mmc1:1234 SA04G 3.63 GiB
	 mmcblk1: p1

It should be noted that if I exclude the " read-only-rootfs" option in the bb script, a normal read/write kernel image is produced and the action of inserting an SD card under those conditions will automatically produce a mount point at /media/mmcblk1p1

FYI, I'm running 3.14 kernel.  Is this a job for aufs?  If so, how would I go about configuring it?


-----Original Message-----
From: Mike Looijmans [mailto:mike.looijmans@topic.nl] 
Sent: Tuesday, June 14, 2016 9:18 AM
To: Christopher Larson <clarson@kergoth.com>; Jeffrey D Boyer <Jeffrey.D.Boyer@jci.com>
Cc: yocto@yoctoproject.org
Subject: Re: [yocto] Mounting USB drives on a "read-only-rootfs" based system

Yup, even mdev based images do that with current OE.

I'd expect "/media" to symlink to "run/media" on most devices (regardless whether the rootfs is read-only or not). Check if that's the case on your system.

On 14-06-16 00:01, Christopher Larson wrote:
> Afaik usb storage is already automounted by udev on /run/media/, so 
> there's no need to use /media for that purpose.
>
> On Mon, Jun 13, 2016 at 2:22 PM, Jeffrey D Boyer 
> <Jeffrey.D.Boyer@jci.com <mailto:Jeffrey.D.Boyer@jci.com>> wrote:
>
>     Hello,____
>
>     __ __
>
>     New to the list here, so I’m sorry if this question has been asked before,
>     but I couldn’t find a direct answer to it. ____
>
>     __ __
>
>     I have a yocto image that was built using the following bb script line:
>     IMAGE_FEATURES += " read-only-rootfs". ____
>
>     __ __
>
>     As this image eventually resides on a static flash device, it must be
>     read-only.  However, the system hardware supports removable media (SD card
>     and USB drives), and I’d like to be able to mount and write to those
>     removable drives / partitions for data logging purposes.  What needs to be
>     done in order to make the /media directory auto-mountable when a
>     “read-only” image is specified by the build script?____
>
>     __ __
>
>     Thanks.____
>
>     __ __
>
>
>     --
>     

Kind regards,

Mike Looijmans
System Expert

TOPIC Embedded Products
Eindhovenseweg 32-C, NL-5683 KH Best
Postbus 440, NL-5680 AK Best
Telefoon: +31 (0) 499 33 69 79
E-mail: mike.looijmans@topicproducts.com
Website: www.topicproducts.com

Please consider the environment before printing this e-mail





_______________________________________________
>     yocto mailing list
>     yocto@yoctoproject.org <mailto:yocto@yoctoproject.org>
>     https://lists.yoctoproject.org/listinfo/yocto
>
>
>
>
> --
> Christopher Larson
> clarson at kergoth dot com
> Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Senior 
> Software Engineer, Mentor Graphics
>
>


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

* Re: Mounting USB drives on a "read-only-rootfs" based system
  2016-06-14 13:48     ` Jeffrey D Boyer
@ 2016-06-14 14:28       ` Burton, Ross
  2016-06-14 16:01         ` Fred Ollinger
  2016-06-15  8:07       ` Mike Looijmans
  1 sibling, 1 reply; 9+ messages in thread
From: Burton, Ross @ 2016-06-14 14:28 UTC (permalink / raw)
  To: Jeffrey D Boyer; +Cc: yocto, Christopher Larson

[-- Attachment #1: Type: text/plain, Size: 349 bytes --]

On 14 June 2016 at 14:48, Jeffrey D Boyer <Jeffrey.D.Boyer@jci.com> wrote:

> FYI, I'm running 3.14 kernel.  Is this a job for aufs?  If so, how would I
> go about configuring it?
>

If you want to support arbitrary mounts then it's probably simplest to
either change /media to be a symlink to /run/media, or put a tmpfs on
/media.

Ross

[-- Attachment #2: Type: text/html, Size: 764 bytes --]

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

* Re: Mounting USB drives on a "read-only-rootfs" based system
  2016-06-14 14:28       ` Burton, Ross
@ 2016-06-14 16:01         ` Fred Ollinger
  0 siblings, 0 replies; 9+ messages in thread
From: Fred Ollinger @ 2016-06-14 16:01 UTC (permalink / raw)
  To: Burton, Ross, Jeffrey D Boyer; +Cc: yocto, Christopher Larson

There's also bind mounts as an option.


       The bind mounts.
              Since Linux 2.4.0 it is possible to remount part of the file hierarchy somewhere else.  The call is:

                     mount --bind olddir newdir

              or by using this fstab entry:

                     /olddir /newdir none bind

              After this call the same contents are accessible in two places.  One can also remount a single  file  (on  a
              single file).

________________________________
From: yocto-bounces@yoctoproject.org <yocto-bounces@yoctoproject.org> on behalf of Burton, Ross <ross.burton@intel.com>
Sent: Tuesday, June 14, 2016 7:28 AM
To: Jeffrey D Boyer
Cc: yocto@yoctoproject.org; Christopher Larson
Subject: Re: [yocto] Mounting USB drives on a "read-only-rootfs" based system


On 14 June 2016 at 14:48, Jeffrey D Boyer <Jeffrey.D.Boyer@jci.com<mailto:Jeffrey.D.Boyer@jci.com>> wrote:
FYI, I'm running 3.14 kernel.  Is this a job for aufs?  If so, how would I go about configuring it?

If you want to support arbitrary mounts then it's probably simplest to either change /media to be a symlink to /run/media, or put a tmpfs on /media.

Ross


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

* Re: Mounting USB drives on a "read-only-rootfs" based system
  2016-06-14 13:48     ` Jeffrey D Boyer
  2016-06-14 14:28       ` Burton, Ross
@ 2016-06-15  8:07       ` Mike Looijmans
  2016-06-15 13:14         ` Jeffrey D Boyer
  1 sibling, 1 reply; 9+ messages in thread
From: Mike Looijmans @ 2016-06-15  8:07 UTC (permalink / raw)
  To: Jeffrey D Boyer, Christopher Larson; +Cc: yocto

On 14-06-16 15:48, Jeffrey D Boyer wrote:
> Sorry, /media is not a symlink and there is no /run/media link or directory present on my running system.  When I insert an SD card, for example, I get a bit of text on the debug serial port that a card has been detected, but I don't see a mount point anywhere after that.
>
> 	root@mySys:/# mmc1: new high speed SDHC card at address 1234
> 	mmcblk1: mmc1:1234 SA04G 3.63 GiB
> 	 mmcblk1: p1
>
> It should be noted that if I exclude the " read-only-rootfs" option in the bb script, a normal read/write kernel image is produced and the action of inserting an SD card under those conditions will automatically produce a mount point at /media/mmcblk1p1

Apparently your distro or image or whatever is lacking some directories. The 
/run/media should have been created automagically.

Are you using udev or mdev for hotplug?

For mdev, I implemented the automounting using /run/media and that should also 
work on read-only-rootfs systems. So I can probably figure out what's wrong 
with your config.

For udev, I don't have a clue, sorry...


> FYI, I'm running 3.14 kernel.  Is this a job for aufs?  If so, how would I go about configuring it?

No, it's not related to autofs or aufs or whatever. It's plain simple udev or 
mdev.



Kind regards,

Mike Looijmans
System Expert

TOPIC Embedded Products
Eindhovenseweg 32-C, NL-5683 KH Best
Postbus 440, NL-5680 AK Best
Telefoon: +31 (0) 499 33 69 79
E-mail: mike.looijmans@topicproducts.com
Website: www.topicproducts.com

Please consider the environment before printing this e-mail







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

* Re: Mounting USB drives on a "read-only-rootfs" based system
  2016-06-15  8:07       ` Mike Looijmans
@ 2016-06-15 13:14         ` Jeffrey D Boyer
  0 siblings, 0 replies; 9+ messages in thread
From: Jeffrey D Boyer @ 2016-06-15 13:14 UTC (permalink / raw)
  To: Mike Looijmans, Christopher Larson; +Cc: yocto

My distro is running udev.  I discovered the automounter script in /etc/udev/rules.d was causing the mount point to be /media.  For all I know, this is default behavior for udev.

Anyway, I think I found a solution.  As suggested by another person on the thread, I went ahead and mounted a tmpfs on the /media directory.  This allowed the udev automount script to function as it did when the squashfs option was disabled.  

Thanks to everyone for all the help.

-----Original Message-----
From: Mike Looijmans [mailto:mike.looijmans@topic.nl] 
Sent: Wednesday, June 15, 2016 4:07 AM
To: Jeffrey D Boyer <Jeffrey.D.Boyer@jci.com>; Christopher Larson <clarson@kergoth.com>
Cc: yocto@yoctoproject.org
Subject: Re: [yocto] Mounting USB drives on a "read-only-rootfs" based system

On 14-06-16 15:48, Jeffrey D Boyer wrote:
> Sorry, /media is not a symlink and there is no /run/media link or directory present on my running system.  When I insert an SD card, for example, I get a bit of text on the debug serial port that a card has been detected, but I don't see a mount point anywhere after that.
>
> 	root@mySys:/# mmc1: new high speed SDHC card at address 1234
> 	mmcblk1: mmc1:1234 SA04G 3.63 GiB
> 	 mmcblk1: p1
>
> It should be noted that if I exclude the " read-only-rootfs" option in 
> the bb script, a normal read/write kernel image is produced and the 
> action of inserting an SD card under those conditions will 
> automatically produce a mount point at /media/mmcblk1p1

Apparently your distro or image or whatever is lacking some directories. The /run/media should have been created automagically.

Are you using udev or mdev for hotplug?

For mdev, I implemented the automounting using /run/media and that should also work on read-only-rootfs systems. So I can probably figure out what's wrong with your config.

For udev, I don't have a clue, sorry...


> FYI, I'm running 3.14 kernel.  Is this a job for aufs?  If so, how would I go about configuring it?

No, it's not related to autofs or aufs or whatever. It's plain simple udev or mdev.



Kind regards,

Mike Looijmans
System Expert

TOPIC Embedded Products
Eindhovenseweg 32-C, NL-5683 KH Best
Postbus 440, NL-5680 AK Best
Telefoon: +31 (0) 499 33 69 79
E-mail: mike.looijmans@topicproducts.com
Website: www.topicproducts.com

Please consider the environment before printing this e-mail






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

end of thread, other threads:[~2016-06-15 13:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-13 21:22 Mounting USB drives on a "read-only-rootfs" based system Jeffrey D Boyer
2016-06-13 22:01 ` Christopher Larson
2016-06-14 13:18   ` Mike Looijmans
2016-06-14 13:48     ` Jeffrey D Boyer
2016-06-14 14:28       ` Burton, Ross
2016-06-14 16:01         ` Fred Ollinger
2016-06-15  8:07       ` Mike Looijmans
2016-06-15 13:14         ` Jeffrey D Boyer
2016-06-14  6:36 ` Richard Leitner

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.