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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
10,555 Views
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 Solution
6,130 Views
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.

View solution in original post

5 Replies
6,130 Views
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 Kudos
6,130 Views
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 Kudos
6,131 Views
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,130 Views
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,130 Views
gusarambula
NXP TechSupport
NXP TechSupport

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

0 Kudos