All of lore.kernel.org
 help / color / mirror / Atom feed
* Question about wic partition creation
@ 2016-11-01 15:14 Nicolas Bigaouette
  2016-11-07 23:13 ` Ed Bartosh
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Bigaouette @ 2016-11-01 15:14 UTC (permalink / raw)
  To: yocto

We are using Yocto (jethro and krogoth) to build an image for a device.

I organized the compilation process into multiple stages for easier 
integration with our tooling. The last stage is a call to `wic` to 
create a drive image that we can then `dd` to a real drive to get a 
workable system.

I am faced with a problem where I would like the top-level directory of 
one of the partition created by wic to have a different owner than root.

I am able to tell wic the partition information (size, filesystem, etc.) 
but I can't find a way to tell wic to change permissions of 
files/directories inside the partition...

As an example I have an entry like the following at the end of my `.wks`:
 > part /opt/mnt        --label extra  --fstype=ext4 --align 1024 
--ondisk sda --size=2040
which will add an extra partition after all others on the final image. 
An entry in `/etc/fstab` will be added so that the partition will be 
mounted to `/opt/mnt`.

Note that the partition should be empty: I'm not populating it with any 
files or directories.

But after booting the system, the directory `/opt/mnt` will have the 
permissions of the top-level directory of the created partition, and by 
default those are `0755` and owned by `root:root`.

So my question is: How can I change this so that it's owned by a 
specific uid and gid (`1000:1000`)?

I am investigating plugins for now (for example by having a 
`meta-mylayer/scripts/lib/wic/plugins/source/fsimage-mypartition.py`) 
but I still can't see how I can change the owner of the directory. 
Should I provide a rootfs-like directory which is empty but owned by the 
proper uid and gid?

Note that letting users be able to mount the partition (by adding 
`users` to `/etc/fstab`) is not what I want; it would _not_ change the 
permissions/owner of the top-level directory of the partition.

Thank you very much!

Regards,

Nicolas


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

* Re: Question about wic partition creation
  2016-11-01 15:14 Question about wic partition creation Nicolas Bigaouette
@ 2016-11-07 23:13 ` Ed Bartosh
  0 siblings, 0 replies; 2+ messages in thread
From: Ed Bartosh @ 2016-11-07 23:13 UTC (permalink / raw)
  To: Nicolas Bigaouette; +Cc: yocto

On Tue, Nov 01, 2016 at 11:14:48AM -0400, Nicolas Bigaouette wrote:
> We are using Yocto (jethro and krogoth) to build an image for a device.
> 
> I organized the compilation process into multiple stages for easier
> integration with our tooling. The last stage is a call to `wic` to
> create a drive image that we can then `dd` to a real drive to get a
> workable system.
>
Do you use wic images produced by bitbake or run wic after bitbake build?

> I am faced with a problem where I would like the top-level directory
> of one of the partition created by wic to have a different owner
> than root.
> 
> I am able to tell wic the partition information (size, filesystem,
> etc.) but I can't find a way to tell wic to change permissions of
> files/directories inside the partition...
>
> As an example I have an entry like the following at the end of my `.wks`:
> > part /opt/mnt        --label extra  --fstype=ext4 --align 1024
> --ondisk sda --size=2040
> which will add an extra partition after all others on the final
> image. An entry in `/etc/fstab` will be added so that the partition
> will be mounted to `/opt/mnt`.
> 
> Note that the partition should be empty: I'm not populating it with
> any files or directories.
> 
> But after booting the system, the directory `/opt/mnt` will have the
> permissions of the top-level directory of the created partition, and
> by default those are `0755` and owned by `root:root`.
> 
> So my question is: How can I change this so that it's owned by a
> specific uid and gid (`1000:1000`)?

> I am investigating plugins for now (for example by having a
> `meta-mylayer/scripts/lib/wic/plugins/source/fsimage-mypartition.py`)
> but I still can't see how I can change the owner of the directory.
> Should I provide a rootfs-like directory which is empty but owned by
> the proper uid and gid?
>
Yes, that's what I'd suggest to do. rootfs plugin may help you with
this. If it doesn't work as expected please create bug for me in Yocto
bugzilla.

> Note that letting users be able to mount the partition (by adding
> `users` to `/etc/fstab`) is not what I want; it would _not_ change
> the permissions/owner of the top-level directory of the partition.

--
Regards,
Ed


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

end of thread, other threads:[~2016-11-07 23:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-01 15:14 Question about wic partition creation Nicolas Bigaouette
2016-11-07 23:13 ` Ed Bartosh

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.