Toolchain for m0054-data-fs.ext4
-
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 -
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? -
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.