[PATCH] AOSP: erofs-utils: fix sub directory prefix path in canned fs_config

Gao Xiang hsiangkao at redhat.com
Tue Dec 22 17:31:12 AEDT 2020


On Tue, Dec 22, 2020 at 12:47:33PM +0800, Yue Hu wrote:
> On Tue, 22 Dec 2020 11:44:55 +0800
> Gao Xiang <hsiangkao at redhat.com> wrote:
> 
> > Hi Yue,
> > 
> > On Tue, Dec 22, 2020 at 10:04:30AM +0800, Yue Hu wrote:
> > > From: Yue Hu <huyue2 at yulong.com>
> > > 
> > > We observe that creating image failed to find [%s] in canned fs_config
> > > using --fs-config-file option under Android 10.
> > > 
> > > Notice that canned fs_config has a prefix to sub directory if mount_point
> > > presents. However, erofs_fspath() does not contain the prefix.
> > >   
> > 
> > Thanks for your patch. Let me play with it a bit this weekend (I'm not
> > quite familiar with canned fs_config, it would be of great help to add
> > some hints/steps for me to confirm this issue.... since some other vendors
> > already use it without report (maybe they don't use canned fs_config.)
> 
> Hi Xiang,
> 
> It's been observed under QC/QSSI platform with dynamic partition.
> 
> such as product.img/product_filesystem_config.txt:
> 
> ```txt
>  0 0 755 selabel=u:object_r:rootfs:s0 capabilities=0x0
> product/app 0 0 755 selabel=u:object_r:system_file:s0 capabilities=0x0
> product/app/CalculatorGoogle 0 0 755 selabel=u:object_r:system_file:s0 capabilities=0x0
> ```
> 
> product_filesystem_config.txt should be from below build:
> 
> $(call fs_config,$(zip_root)/PRODUCT,product/) > $(zip_root)/META/product_filesystem_config.txt
> 
> Do not observe this issue in squashfs, so i check related code of squashfs, squashfs have
> considered the mount point, also ext4 does. So, erofs should be same as one long used before.
> 
> After this patch, build & boot are working fine by test.
> 
> Here's a change from mksqushfs: Allow passing fs_config file for generating mksquashfs

Ok, I will try to find some clue to verify later.

> 
> > 
> > > Moreover, we should not add the mount point to fspath on root inode for
> > > fs_config() branch.  
> > 
> > Is there some descriptive words or reference for this? To be honest,
> > I'm quite unsure about this kind of Android-specific things... :(
> 
> Refer to change: mksquashfs: Run android_fs_config() on the root inode
> 
> I think erofs of AOSP has this issue also. Am i right?

Not quite sure if it effects non-canned fs_config after
reading the commit message...
https://android.googlesource.com/platform/external/squashfs-tools/+/85a6bc1e52bb911f195c5dc0890717913938c2d1%5E%21/#F0

And no permission to access Bug 72745016, so...
maybe we need to limit this to non-canned fs_config only?
(at least confirming the original case would be better)

BTW, Also, from its testcase command line in the commit message:
"mksquashfs path system.raw.img -fs-config-file fs_config -android-fs-config"

I'm not sure if "--mount-point" is passed in so I think for
such case no need to use such "goto" as well? 

Thanks,
Gao Xiang



More information about the Linux-erofs mailing list