How do I change the rootfs file system type used for the sdcard image in yocto?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How do I change the rootfs file system type used for the sdcard image in yocto?

跳至解决方案
11,224 次查看
joerutledge
Contributor III

I'm making my own image recipe and would still like to output the sdcard image as before for my iMX6, however I would like to move it from being based on an ext3 file system to ext4 (or potentially btrfs). For the life of me I can't work out what I need to override to achieve this. Adding ext4 as well as sdcard to the IMAGE_FSTYPES variable in my recipe in my own layer merely gives me both a .ext3 and .ext4 output, of which the .etx3 one appears to be used for the .sdcard image. Either that or it's ext4 mounting as ext3 at boot time... My image inherits core-image and installs CORE_IMAGE_BASE_INSTALL as the basis for my additions.

Any suggestions as to how I *should* be doing this?

Thanks!

1 解答
6,799 次查看
gusarambula
NXP TechSupport
NXP TechSupport

Hello joerutledge,

You may try adding them on the local.conf file just to test them although the imx-base.inc is where these variables are originally set.

I cannot find the original commit but the changes were as follow:

conf/machine/include/imx-base.inc

-SDCARD_ROOTFS ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext3"

-IMAGE_FSTYPES ?= "ext3 sdcard.gz"

+SDCARD_ROOTFS ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext4"

+IMAGE_FSTYPES ?= "ext4 sdcard.gz"

It's odd that it's changing the name but apparently not the file system but I haven't tested it.

在原帖中查看解决方案

5 回复数
6,799 次查看
gusarambula
NXP TechSupport
NXP TechSupport

Hello joerutledge,

As far as I know there was a change on the OpenEmbedded-Core layer and ext4 was the default on all images including the sdcard format. Perhaps you can add the following lines, which was part of this change. I haven’t tested it but hopefully it will help.

SDCARD_ROOTFS ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext4"

IMAGE_FSTYPES ?= "ext4 sdcard.gz"

0 项奖励
6,799 次查看
joerutledge
Contributor III

Where should I try adding those lines? I've had a go at that previously in my own layer overriding conf/machine/include/imx-base.inc, however where I had made changes just seemed to change the name given to the file, not the actual file system. Can you point me at the commits that formed the change in open-embedded-core?

0 项奖励
6,800 次查看
gusarambula
NXP TechSupport
NXP TechSupport

Hello joerutledge,

You may try adding them on the local.conf file just to test them although the imx-base.inc is where these variables are originally set.

I cannot find the original commit but the changes were as follow:

conf/machine/include/imx-base.inc

-SDCARD_ROOTFS ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext3"

-IMAGE_FSTYPES ?= "ext3 sdcard.gz"

+SDCARD_ROOTFS ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext4"

+IMAGE_FSTYPES ?= "ext4 sdcard.gz"

It's odd that it's changing the name but apparently not the file system but I haven't tested it.

6,799 次查看
joerutledge
Contributor III

Maybe I had a dirty build, but forcing the image type in my overridden machine.conf seems to have done the trick.

In my case I needed:

SDCARD_ROOTFS = "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext4"

IMAGE_FSTYPES = "ext4 sdcard"

6,799 次查看
gusarambula
NXP TechSupport
NXP TechSupport

Thank you joerutledge, for posting what worked for you! I'm sure it will help other community users!

0 项奖励