/**************************************************************************** * can't set android permissions - built without android support * 说明: * 昨天在使用Ubuntu自带的mkuserimg打包Android ext4镜像时出现这个错误,今天 * 找一下原因,解决一下。 * * 2016-9-10 深圳 南山平山村 曾剑锋 ***************************************************************************/ 一、参考文档: 1. [Bug 1293267] Re: make_ext4fs results in "can't set android permissions - built without android support" https://lists.ubuntu.com/archives/foundations-bugs/2014-October/213902.html 二、原因解释如下: 1. When trying to use make_ext4fs command(through the mkuserimg script), it errors out with "can't set android permissions - built without android support", solution was to compile from source and add "-Icore/include -DANDROID" parameter, works fine. 2. 从上可知,是make_ext4fs编译时参数没给对; 3. 从Android源码编译的角度来说是编译成功了,也就是说Ubuntu自带了一个make_ext4fs,但没有添加Android的支持,所以只需要将Android编译出来的bin文件路径添加到PATH最前面就可以解决了。 export PATH=/home/zengjf/myandroid/out/host/linux-x86/bin:$PATH 三、运行效果如下: zengjf@zengjf:~/myandroid$ mkuserimg.sh -s out/target/product/sabresd_6dq/system out/target/product/sabresd_6dq/obj/PACKAGING/systemimage_intermediates/system.img ext4 system 374476800 out/target/product/sabresd_6dq/root/file_contexts make_ext4fs -s -T -1 -S out/target/product/sabresd_6dq/root/file_contexts -l 374476800 -a system out/target/product/sabresd_6dq/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/sabresd_6dq/system Creating filesystem with parameters: Size: 374476800 Block size: 4096 Blocks per group: 32768 Inodes per group: 7632 Inode size: 256 Journal blocks: 1428 Label: Blocks: 91425 Block groups: 3 Reserved block group size: 23 Created filesystem with 1304/22896 inodes and 79090/91425 blocks zengjf@zengjf:~/myandroid$