Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse
Brand Logo

ModalAI Forum

  1. ModalAI Support Forum
  2. Software Development
  3. VOXL SDK
  4. Toolchain for m0054-data-fs.ext4

Toolchain for m0054-data-fs.ext4

Scheduled Pinned Locked Moved VOXL SDK
5 Posts 2 Posters 559 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Rowan DempsterR Offline
    Rowan DempsterR Offline
    Rowan Dempster
    Regular
    wrote on last edited by
    #1

    Hi Modal,

    I'm looking into adding some data in the m0054-data-fs.ext file system. I'm having some trouble getting the voxl2 to work correctly when I try to add the data and then create a new Android sparse image that I flash instead of m0054-data-fs.ext. Would it be possible to provide me with the tools used to create that m0054-data-fs.ext file system at ModalAI so that I can use the exact same tools to create the sparse android image after adding my files to it?

    Thank you,
    Rowan

    Rowan DempsterR 1 Reply Last reply
    0
    • Rowan DempsterR Rowan Dempster

      Hi Modal,

      I'm looking into adding some data in the m0054-data-fs.ext file system. I'm having some trouble getting the voxl2 to work correctly when I try to add the data and then create a new Android sparse image that I flash instead of m0054-data-fs.ext. Would it be possible to provide me with the tools used to create that m0054-data-fs.ext file system at ModalAI so that I can use the exact same tools to create the sparse android image after adding my files to it?

      Thank you,
      Rowan

      Rowan DempsterR Offline
      Rowan DempsterR Offline
      Rowan Dempster
      Regular
      wrote on last edited by Rowan Dempster
      #2

      I found https://gitlab.com/voxl-public/system-image-build/meta-voxl2/-/blob/qrb5165-ubun1.0-14.1a/recipes-products/image/qti-ubuntu-robotics-image.bbappend#L148, which is in bitbake language (not familiar)?

      Is

      do_makeuserdata() {
          make_ext4fs -s -l ${USERDATA_SIZE_EXT4} ${IMAGE_EXT4_SELINUX_OPTIONS} \
              -a /data -b 4096 ${DEPLOY_DIR_IMAGE}/${OVERLAYIMAGE_TARGET} ${IMAGE_ROOTFS}/data
      }
      

      something I could do just on normal ubuntu in CI? I'm thinking to build a cleo-specific userdata in CI with all of our custom software.

      What are ${IMAGE_EXT4_SELINUX_OPTIONS}, is there some secret sauce there?

      Rowan DempsterR ModeratorM 2 Replies Last reply
      0
      • Rowan DempsterR Rowan Dempster

        I found https://gitlab.com/voxl-public/system-image-build/meta-voxl2/-/blob/qrb5165-ubun1.0-14.1a/recipes-products/image/qti-ubuntu-robotics-image.bbappend#L148, which is in bitbake language (not familiar)?

        Is

        do_makeuserdata() {
            make_ext4fs -s -l ${USERDATA_SIZE_EXT4} ${IMAGE_EXT4_SELINUX_OPTIONS} \
                -a /data -b 4096 ${DEPLOY_DIR_IMAGE}/${OVERLAYIMAGE_TARGET} ${IMAGE_ROOTFS}/data
        }
        

        something I could do just on normal ubuntu in CI? I'm thinking to build a cleo-specific userdata in CI with all of our custom software.

        What are ${IMAGE_EXT4_SELINUX_OPTIONS}, is there some secret sauce there?

        Rowan DempsterR Offline
        Rowan DempsterR Offline
        Rowan Dempster
        Regular
        wrote on last edited by
        #3

        For anyone reading this in the future this works:

        docker run --rm --privileged \
            -v "$SYSTEM_IMAGE_DIR":/system-image:ro \
            -v "$CLEO_IMAGE_DIR":/cleo-image \
            -v "$CLEO_PROVISION_DIR":/cleo-provision:ro \
            ubuntu:18.04 bash -c "
            set -e
            
            # Install tools
            apt-get update -qq
            apt-get install -y -qq android-tools-fsutils e2fsprogs >/dev/null
            
            # Extract stock data partition contents
            echo 'Extracting stock m0054-data-fs.ext4...'
            mkdir -p /tmp/data_root
            
            # Convert sparse to raw and mount
            simg2img /system-image/m0054-data-fs.ext4 /tmp/stock_raw.ext4
            mkdir -p /mnt/stock
            mount -o loop,ro /tmp/stock_raw.ext4 /mnt/stock
            
            # Copy all stock files
            cp -a /mnt/stock/* /tmp/data_root/
            umount /mnt/stock
            rm /tmp/stock_raw.ext4
            
            echo 'Stock contents copied.'
            
            # Add cleo-provision directory
            cp -a /cleo-provision /tmp/data_root/cleo-provision
            
            echo 'Added cleo-provision directory'
            
            # Create the ext4 image using same parameters as BitBake recipe:
            #   -s            : sparse output
            #   -l SIZE       : filesystem size in bytes
            #   -a /data      : android mount point
            #   -b 4096       : block size
            make_ext4fs -s -l $USERDATA_SIZE_EXT4 -a /data -b 4096 /cleo-image/m0054-data-fs.ext4 /tmp/data_root
            
            echo ''
            echo 'Created sparse ext4 image successfully'
        "
        

        You'll need to be on an arm64 architecture.

        1 Reply Last reply
        0
        • Rowan DempsterR Rowan Dempster

          I found https://gitlab.com/voxl-public/system-image-build/meta-voxl2/-/blob/qrb5165-ubun1.0-14.1a/recipes-products/image/qti-ubuntu-robotics-image.bbappend#L148, which is in bitbake language (not familiar)?

          Is

          do_makeuserdata() {
              make_ext4fs -s -l ${USERDATA_SIZE_EXT4} ${IMAGE_EXT4_SELINUX_OPTIONS} \
                  -a /data -b 4096 ${DEPLOY_DIR_IMAGE}/${OVERLAYIMAGE_TARGET} ${IMAGE_ROOTFS}/data
          }
          

          something I could do just on normal ubuntu in CI? I'm thinking to build a cleo-specific userdata in CI with all of our custom software.

          What are ${IMAGE_EXT4_SELINUX_OPTIONS}, is there some secret sauce there?

          ModeratorM Offline
          ModeratorM Offline
          Moderator
          ModalAI Team
          wrote on last edited by
          #4

          @Rowan-Dempster thank you for sharing this! Does this mean you can create a custom data file partition that you can flash using fastboot? We have not explored this before but it has been asked a few times. This could be very helpful for other developers.

          Rowan DempsterR 1 Reply Last reply
          0
          • ModeratorM Moderator

            @Rowan-Dempster thank you for sharing this! Does this mean you can create a custom data file partition that you can flash using fastboot? We have not explored this before but it has been asked a few times. This could be very helpful for other developers.

            Rowan DempsterR Offline
            Rowan DempsterR Offline
            Rowan Dempster
            Regular
            wrote on last edited by
            #5

            @Moderator Hi Modal,

            Does this mean you can create a custom data file partition that you can flash using fastboot?

            Yes that is correct.

            We have not explored this before but it has been asked a few times. This could be very helpful for other developers.

            I'm certainly hopeful that it will be helpful here at Cleo Robotics! So far with my prototyping it works as expected and cuts flashing time of some large docker images we have here at Cleo down by a noticeable fraction (no file overhead via fastboot like with ADB).

            I think the snippet I posted covers the baseline functionality of getting a custom "payload" into the data partition. However if there is more I can elaborate on in terms of the toolchain / what's in the payload, and if that elaboration will be helpful to other VOXL2 developers, I would be happy to elaborate 🙂 Just let me know!

            Other similar discussion points I tackled recently that I'm happy to talk about lessons of:

            • Flashing the system image and VOXL/CLEO SDK through a Windows Machine (journeys in USB device drivers)
            • Building Flutter applications for uniform flashing process across all operating systems
            • Building release bundles (i.e. a collection of partition binaries) in CI
            1 Reply Last reply
            0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            ModalAI
            Categories Recent Tags ModalAI.com Docs
            © 2026 ModalAI® · Accelerating autonomy for smaller, smarter, safer drones · Powered by NodeBB
            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups