data directory created in the root filesystem image (Yocto Thud)

232 views
Skip to first unread message

vinoth eswaran

unread,
Dec 18, 2018, 4:03:00 AM12/18/18
to Mender List mender.io
Hi,

    I have been using mender for Over the air software update for my IOT project.  I use Yocto to build the image and it was based on Pyro. Mender version used was 1.3.0. Functionalities are working as expected in this version.

Currently, I am rebasing my yocto layers to thud and facing some issues with mender. I can successfully build the image for my system. In the previous release(Pyro and mender 1.3.0) there is no data directory within root filesystem. The 4th partition is mounted as data and is persistent between software updates.
 
   In the yocto image I currently built (thud and mender version 1.7.0), I am seeing a directory name data in the root file system. The contents of data are as expected but the directory should not be part of root file system as per my understanding.

tree data/
data/
├── mender
│   └── device_type
└── u-boot
    └── fw_env.config

Also there is a rule in /etc/fstab to mount the 4th parition as data

# Where the U-Boot environment resides; for devices with SD card support ONLY!
/dev/mmcblk2p1       /uboot               auto       defaults,sync         0  0
/dev/mmcblk2p4       /data                auto       defaults              0  0
 
   There seems to be conflict. I am not sure if I missed some mender config. Any help on this topic is appreciated


Yocto meta layers version used:

meta                
meta-poky            = "HEAD:074cd4f22c8084a9aa8d60af5746ec22120c3155"
meta-oe             
meta-multimedia     
meta-python         
meta-networking      = "HEAD:a15d7f6ebcb0ed76c83c28f854d55e3f9d5b3677"
meta-freescale       = "HEAD:1ec2c308da65f7ad49b99a3100912ae0b5e1dac3"
meta-freescale-3rdparty = "HEAD:56021ac593b6a3f4ed7be351d8f4358a19d8e87a"
meta-freescale-distro = "HEAD:771fb6d4c0c9530083fcc8c5452270bb9b3915ba"
meta-gplv2           = "HEAD:aabc30f3bd03f97326fb8596910b94639fea7575"
meta-mender-core     = "HEAD:c49d2d0f9bf073bf9ff3898154791869c9a922ee"


Mender specific bitbake variables:

bitbake -e eval-image | grep -i ^mender

MENDER_ARTIFACT_EXTRA_ARGS=""
MENDER_ARTIFACT_NAME="release-thud"
MENDER_ARTIFACT_SIGNING_KEY=""
MENDER_BOOT_PART="/dev/mmcblk2p1"
MENDER_BOOT_PART_DEFAULT="/dev/mmcblk2p1"
MENDER_BOOT_PART_DEFAULT_mender-ubi=""
MENDER_BOOT_PART_FSTYPE="auto"
MENDER_BOOT_PART_FSTYPE_DEFAULT="auto"
MENDER_BOOT_PART_MOUNT_LOCATION="/uboot"
MENDER_BOOT_PART_MOUNT_LOCATION_mender-grub_mender-bios="/boot/grub"
MENDER_BOOT_PART_MOUNT_LOCATION_mender-uboot="/uboot"
MENDER_BOOT_PART_NUMBER="1"
MENDER_BOOT_PART_NUMBER_DEFAULT="1"
MENDER_BOOT_PART_NUMBER_DEFAULT_mender-ubi=""
MENDER_BOOT_PART_SIZE_MB="16"
MENDER_BOOT_PART_SIZE_MB_DEFAULT="16"
MENDER_BOOT_PART_SIZE_MB_DEFAULT_mender-ubi="0"
MENDER_CALC_ROOTFS_SIZE="761856"
MENDER_DATA_PART="/dev/mmcblk2p4"
MENDER_DATA_PART_DEFAULT="/dev/mmcblk2p4"
MENDER_DATA_PART_DEFAULT_mender-ubi="/dev/mmcblk2p2"
MENDER_DATA_PART_FSTYPE="auto"
MENDER_DATA_PART_FSTYPE_DEFAULT="auto"
MENDER_DATA_PART_FSTYPE_DEFAULT_mender-ubi="ubifs"
MENDER_DATA_PART_NUMBER="4"
MENDER_DATA_PART_NUMBER_DEFAULT="4"
MENDER_DATA_PART_SIZE_MB="1536"
MENDER_DATA_PART_SIZE_MB_DEFAULT="128"
MENDER_DEVICE_TYPE="alen-iot-gateway"
MENDER_DEVICE_TYPES_COMPATIBLE="alen-iot-gateway"
MENDER_DEVICE_TYPES_COMPATIBLE_DEFAULT="alen-iot-gateway"
MENDER_DEVICE_TYPE_DEFAULT="alen-iot-gateway"
MENDER_DEVICE_TYPE_DEFAULT_beaglebone-yocto_mender-grub="alen-iot-gateway-grub"
MENDER_FEATURES_ENABLE=" mender-uboot mender-systemd mender-image mender-image-sd"
MENDER_FLASH_MINIMUM_IO_UNIT="512"
MENDER_GRUB_STORAGE_DEVICE=""
MENDER_GRUB_STORAGE_DEVICE_DEFAULT=""
MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET="2"
MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET_DEFAULT="2"
MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET_DEFAULT_mender-grub_mender-bios_mender-image-bios="1"
MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET_DEFAULT_mender-grub_mender-bios_mender-image-gpt="34"
MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET_DEFAULT_mender-ubi="0"
MENDER_IMAGE_BOOTLOADER_FILE="u-boot.imx"
MENDER_IMAGE_BOOTLOADER_FILE_DEFAULT=""
MENDER_IMAGE_BOOTLOADER_FILE_DEFAULT_mender-grub_mender-bios="grub-core.img"
MENDER_IMAGE_BOOTLOADER_FILE_DEFAULT_mender-ubi="u-boot.imx"
MENDER_IMAGE_ROOTFS_MAXSIZE_DEFAULT="761856"
MENDER_IMAGE_ROOTFS_MAXSIZE_DEFAULT_mender-ubi=""
MENDER_IMAGE_ROOTFS_SIZE_DEFAULT="655360"
MENDER_INVENTORY_POLL_INTERVAL_SECONDS="180"
MENDER_IS_ON_MTDID=""
MENDER_MAXIMUM_LEB_COUNT="1024"
MENDER_MBR_BOOTLOADER_FILE=""
MENDER_MBR_BOOTLOADER_FILE_DEFAULT=""
MENDER_MBR_BOOTLOADER_FILE_DEFAULT_mender-grub_mender-bios="boot.img"
MENDER_MBR_BOOTLOADER_LENGTH="446"
MENDER_MTDIDS=""
MENDER_MTDPARTS=""
MENDER_MTD_UBI_DEVICE_NAME=""
MENDER_MTD_UBI_DEVICE_NAME_DEFAULT=""
MENDER_MTD_UBI_DEVICE_NAME_DEFAULT_mender-ubi="ubi"
MENDER_NAND_FLASH_PAGE_SIZE="2048"
MENDER_PARTITIONING_OVERHEAD_KB="16384"
MENDER_PARTITIONING_OVERHEAD_KB_DEFAULT="16384"
MENDER_PARTITIONING_OVERHEAD_KB_DEFAULT_mender-ubi="3178496"
MENDER_PARTITION_ALIGNMENT="8388608"
MENDER_PARTITION_ALIGNMENT_DEFAULT="8388608"
MENDER_PARTITION_ALIGNMENT_DEFAULT_mender-ubi="8388608"
MENDER_RESERVED_SPACE_BOOTLOADER_DATA="16777216"
MENDER_RESERVED_SPACE_BOOTLOADER_DATA_DEFAULT="16777216"
MENDER_RESERVED_SPACE_BOOTLOADER_DATA_DEFAULT_mender-uboot="16777216"
MENDER_ROOTFS_PART_A="/dev/mmcblk2p2"
MENDER_ROOTFS_PART_A_DEFAULT="/dev/mmcblk2p2"
MENDER_ROOTFS_PART_A_NAME="/dev/mmcblk2p2"
MENDER_ROOTFS_PART_A_NAME_DEFAULT="/dev/mmcblk2p2"
MENDER_ROOTFS_PART_A_NAME_DEFAULT_mender-ubi="/dev/mmcblk2:rootfsa"
MENDER_ROOTFS_PART_A_NUMBER="2"
MENDER_ROOTFS_PART_A_NUMBER_DEFAULT="2"
MENDER_ROOTFS_PART_A_NUMBER_DEFAULT_mender-ubi="0"
MENDER_ROOTFS_PART_B="/dev/mmcblk2p3"
MENDER_ROOTFS_PART_B_DEFAULT="/dev/mmcblk2p3"
MENDER_ROOTFS_PART_B_NAME="/dev/mmcblk2p3"
MENDER_ROOTFS_PART_B_NAME_DEFAULT="/dev/mmcblk2p3"
MENDER_ROOTFS_PART_B_NAME_DEFAULT_mender-ubi="/dev/mmcblk2:rootfsb"
MENDER_ROOTFS_PART_B_NUMBER="3"
MENDER_ROOTFS_PART_B_NUMBER_DEFAULT="3"
MENDER_ROOTFS_PART_B_NUMBER_DEFAULT_mender-ubi="1"
MENDER_STATE_SCRIPTS_VERSION="2"
MENDER_STORAGE_DEVICE="/dev/mmcblk2"
MENDER_STORAGE_DEVICE_BASE="/dev/mmcblk2p"
MENDER_STORAGE_DEVICE_BASE_DEFAULT="/dev/mmcblk2p"
MENDER_STORAGE_DEVICE_BASE_DEFAULT_mender-ubi="/dev/mmcblk2_"
MENDER_STORAGE_DEVICE_DEFAULT="/dev/mmcblk0"
MENDER_STORAGE_DEVICE_DEFAULT_mender-ubi="ubi0"
MENDER_STORAGE_PEB_SIZE="8388608"
MENDER_STORAGE_TOTAL_SIZE_MB="3072"
MENDER_STORAGE_TOTAL_SIZE_MB_DEFAULT="1024"
MENDER_UBI_LEB_PEB_BLOCK_OVERHEAD="0"
MENDER_UBI_LEB_SIZE="8388608"
MENDER_UBI_TOTAL_BAD_PEB_OVERHEAD="0"
MENDER_UBI_TOTAL_FIXED_OVERHEAD="33554432"
MENDER_UBI_TOTAL_LEB_PEB_OVERHEAD="0"
MENDER_UBOOT_AUTO_CONFIGURE="0"
MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET="8388608"
MENDER_UBOOT_ENV_UBIVOL_NUMBER_1="3"
MENDER_UBOOT_ENV_UBIVOL_NUMBER_2="4"
MENDER_UBOOT_POST_SETUP_COMMANDS=""
MENDER_UBOOT_POST_SETUP_COMMANDS_DEFAULT=""
MENDER_UBOOT_PRE_SETUP_COMMANDS=""
MENDER_UBOOT_PRE_SETUP_COMMANDS_DEFAULT=""
MENDER_UBOOT_STORAGE_DEVICE="1"
MENDER_UBOOT_STORAGE_DEVICE_DEFAULT=""
MENDER_UBOOT_STORAGE_DEVICE_DEFAULT_mender-ubi="dummy"
MENDER_UBOOT_STORAGE_INTERFACE="mmc"
MENDER_UBOOT_STORAGE_INTERFACE_DEFAULT=""
MENDER_UBOOT_STORAGE_INTERFACE_DEFAULT_mender-ubi="dummy"
MENDER_UPDATE_POLL_INTERVAL_SECONDS="180"
mender_create_scripts_version_file() {
mender_flash_mtdpart() {
mender_get_clean_kernel_devicetree() {
mender_get_mtdparts() {
mender_merge_bootfs_and_image_boot_files() {
mender_number_to_hex() {
mender_part_image() {
mender_update_fstab_file() {

Thanks & Regards,
Vinoth

Kristian Amlie

unread,
Dec 18, 2018, 4:20:58 AM12/18/18
to men...@lists.mender.io, vinoth eswaran
On 18/12/2018 10:02, vinoth eswaran wrote:
> Hi,
>
>     I have been using mender for Over the air software update for my IOT
> project.  I use Yocto to build the image and it was based on Pyro.
> Mender version used was 1.3.0. Functionalities are working as expected
> in this version.
>
> Currently, I am rebasing my yocto layers to thud and facing some issues
> with mender. I can successfully build the image for my system. In the
> previous release(Pyro and mender 1.3.0) there is no data directory
> within root filesystem. The 4th partition is mounted as data and is
> persistent between software updates.
>  
>    In the yocto image I currently built (thud and mender version 1.7.0),
> I am seeing a directory name data in the root file system. The contents
> of data are as expected but the directory should not be part of root
> file system as per my understanding.
>
> tree data/
> data/
> ├── mender
> │   └── device_type
> └── u-boot
>     └── fw_env.config

Where exactly are you seeing this? On the device? Or in the build tree?
In the build tree it is expected to see this on thud, because we now
treat all partitions as part of one tree, and then handle the exclusions
during the image building, using the IMAGE_ROOTFS_EXCLUDE_PATH mechanism.

(The reason the variable doesn't start with MENDER is that it was meant
for inclusion in OpenEmbedded, but they never merged it)

--
Kristian

signature.asc

Mirza Krak

unread,
Dec 18, 2018, 4:45:30 PM12/18/18
to Mender List mender.io
On Tue, Dec 18, 2018 at 10:03 AM vinoth eswaran <evino...@gmail.com> wrote:
Hi,

    I have been using mender for Over the air software update for my IOT project.  I use Yocto to build the image and it was based on Pyro. Mender version used was 1.3.0. Functionalities are working as expected in this version.

Currently, I am rebasing my yocto layers to thud and facing some issues with mender. I can successfully build the image for my system. In the previous release(Pyro and mender 1.3.0) there is no data directory within root filesystem. The 4th partition is mounted as data and is persistent between software updates.
 
   In the yocto image I currently built (thud and mender version 1.7.0), I am seeing a directory name data in the root file system. The contents of data are as expected but the directory should not be part of root file system as per my understanding.

tree data/
data/
├── mender
│   └── device_type
└── u-boot
    └── fw_env.config

It seems that this is a bug and as of "sumo" I believe you install to /data during build but this should be cleaned up later during the build., I created this one https://tracker.mender.io/browse/MEN-2290.

Though it should not pose any problems as the root filesystem content should not be visible when you do an mount of "mmcblk0p4" on /data. Or does your experience differ?

--
Mirza Krak | Embedded Solutions Architect | https://mender.io

 Northern.tech AS | @northerntechHQ




Mirza Krak

unread,
Dec 21, 2018, 5:16:57 AM12/21/18
to Mender List mender.io, Kristian Amlie
On Tue, Dec 18, 2018 at 10:45 PM Mirza Krak <mirza...@northern.tech> wrote:
On Tue, Dec 18, 2018 at 10:03 AM vinoth eswaran <evino...@gmail.com> wrote:
Hi,

    I have been using mender for Over the air software update for my IOT project.  I use Yocto to build the image and it was based on Pyro. Mender version used was 1.3.0. Functionalities are working as expected in this version.

Currently, I am rebasing my yocto layers to thud and facing some issues with mender. I can successfully build the image for my system. In the previous release(Pyro and mender 1.3.0) there is no data directory within root filesystem. The 4th partition is mounted as data and is persistent between software updates.
 
   In the yocto image I currently built (thud and mender version 1.7.0), I am seeing a directory name data in the root file system. The contents of data are as expected but the directory should not be part of root file system as per my understanding.

tree data/
data/
├── mender
│   └── device_type
└── u-boot
    └── fw_env.config

It seems that this is a bug and as of "sumo" I believe you install to /data during build but this should be cleaned up later during the build., I created this one https://tracker.mender.io/browse/MEN-2290.

There is now a PR as well:


Thanks to @Kristian Amlie 

Reply all
Reply to author
Forward
0 new messages