All of lore.kernel.org
 help / color / mirror / Atom feed
* Question about multi rootfs UIDs when using wic
@ 2018-01-19 16:00 Volker Vogelhuber
  2018-01-22 10:39 ` Volker Vogelhuber
  0 siblings, 1 reply; 12+ messages in thread
From: Volker Vogelhuber @ 2018-01-19 16:00 UTC (permalink / raw)
  To: openembedded-core

I'm currently trying to create a multi RootFS WIC image as mentioned in
directdisk-multi-rootfs.wks. For that I have two image recipes. One that 
is creating only an ext4 image (image-recovery), and the second that is 
also creating a WIC image (image-main). I used the IMAGE_FSTYPES 
variable for that. The WKS file for the second image is integrating the 
recovery image by specifying --rootfs-dir=image-recovery in it's part 
description.

# primary / recovery image
part / --source rootfs --rootfs-dir=image-main --exclude-path mnt/data/ 
mnt/data2/ --fstype=ext4 --label primary_rootfs --align 1024 --size 700 
--overhead-factor=1.0
part /recovery --source rootfs --rootfs-dir=image-recovery --fstype=ext4 
--label recovery_rootfs --align 1024 --size 640 --overhead-factor=1.0

The UIDs of the second rootfs (image-main) are correctly set to 0 within 
the file system when calling mkfs.ext4 during prepare_rootfs_ext. For 
the recovery rootfs the UID is always set to my own (host) one which is 
of course not valid for the image where that UID does not exist.
I tried calling the mkfs.ext4 command myself from a terminal and for 
whatever reason an image created out of the rootfs folder of the second 
image (image-main) recipe is deployed with the correct UID 0, while the 
rootfs folder of the first image (image-recovery) recipe always uses the 
UID of the source folder/files.

I search the code of e2fsprogs for the line that sets the UID and added 
a printf in set_inode_extra. There I can see clearly that the source UID 
for the file is 0 for the rootfs of the image-main rootfs folder while 
it is 10000 (my own UID) for the image-recovery. I wonder how the UID of 
the image-main rootfs folder can be zero when I don't call any command 
with root permissions. I searched for a preparation step where the UIDs 
are managed in the scripts folder of Yocto, but didn't found any hint 
for the whole behavior. So while it is good that the rootfs partition of 
the main rootfs has the UID set correctly to zero, I can't understand 
why it happens. On the other side I can understand why the UID of the 
recovery rootfs is set to my own one, but it stops me from booting that 
rootfs because the UIDs of the files and folders are set to a user that 
does not exist on the target system.

Can someone please explain to me, how that UID handling is meant to be done?


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

end of thread, other threads:[~2018-05-11 14:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-19 16:00 Question about multi rootfs UIDs when using wic Volker Vogelhuber
2018-01-22 10:39 ` Volker Vogelhuber
2018-05-02 15:51   ` Ricardo Ribalda Delgado
2018-05-02 16:31     ` Volker Vogelhuber
2018-05-02 16:44       ` Scott Rifenbark
2018-05-02 18:18         ` Ricardo Ribalda Delgado
2018-05-02 18:22           ` Scott Rifenbark
2018-05-02 18:17       ` Ricardo Ribalda Delgado
2018-05-02 18:25         ` Ricardo Ribalda Delgado
2018-05-07 13:22           ` Ricardo Ribalda Delgado
2018-05-08 13:38             ` Volker Vogelhuber
2018-05-11 14:27               ` Ricardo Ribalda Delgado

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.