3

I would like to pack the content of a directory into an ext4 partition image easily, without mounting a loop device.

Background: I am building a version of Android which will mount system partitions as a loop device for ARM. Though I can create those partition images by hand using loop devices, it is very troublesome. I want to use an sh script to automatically do the work, and without needing to loop mount the dd-created image and use cp -rp. The best is to directly pack the files into an image file.

Question: Is there any simple command-line tools without needing loop mount and root permission that can pack files into an ext4 partition image?

1 Answer 1

2

In the Android build system there is a host binary make_ext4fs. You can create ext4 images by this way:

make_ext4fs [ -l <len> ] [ -j <journal size> ] [ -b <block_size> ]
    [ -g <blocks per group> ] [ -i <inodes> ] [ -I <inode size> ]
    [ -L <label> ] [ -f ] [ -a <android mountpoint> ]
    [ -z | -s ] [ -J ]
    <filename> [<directory>]
2
  • Hello, will this work for x86 devices? Commented Sep 7, 2019 at 7:22
  • Can you define journal size block size, inodes, inode size, label android mountpoint and -z -s -j ? Commented Sep 7, 2019 at 16:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .