git clone https://aosp.tuna.tsinghua.edu.cn/kernel/common.git
arch/um/drivers/vde_user.c:8:10: fatal error: libvdeplug.h: 没有那个文件或目录
#include
arch/um/drivers/pcap_user.c:7:10: fatal error: pcap.h: 没有那个文件或目录
#include
安装
sudo apt-get install libvdeplug-dev
sudo apt-get install libpcap-dev
[ 17% 445/2490] build out/target/product/uml/obj/ETC/fs_config_files_system_intermediates/fs_config_files_system
FAILED: out/target/product/uml/obj/ETC/fs_config_files_system_intermediates/fs_config_files_system
/bin/bash -c "build/make/tools/fs_config/fs_config_generator.py fsconfig --aid-header system/core/include/private/android_filesystem_config.h --capability-header bionic/libc/kernel/uapi/linux/capability.h --partition system --all-partitions --files --out_file out/target/product/uml/obj/ETC/fs_config_files_system_intermediates/fs_config_files_system /dev/null"
usage: fs_config_generator.py fsconfig [-h] --aid-header AID_HEADER
--capability-header CAPABILITY_HEADER
--partition PARTITION
[--all-partitions ALL_PARTITIONS]
[--files] [--dirs] --out_file OUT_FILE
fsconfig [fsconfig ...]
fs_config_generator.py fsconfig: error: argument --all-partitions: expected one argument
错误提示–all-partitions没有参数。
$(LOCAL_BUILT_MODULE): PRIVATE_PARTITION_LIST := $(fs_config_generate_extra_partition_list)
$(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN)
$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(system_capability_header)
@mkdir -p $(dir $@)
$< fsconfig \
--aid-header $(PRIVATE_ANDROID_FS_HDR) \
--capability-header $(PRIVATE_ANDROID_CAP_HDR) \
--partition system \
--all-partitions $(subst $(space),$(comma),$(PRIVATE_PARTITION_LIST)) \
--files \
--out_file $@ \
$(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
从上面代码知道,–all-partition的参数是PRIVATE_PARTITION_LIST变量指定的。
$(LOCAL_BUILT_MODULE): PRIVATE_PARTITION_LIST := $(fs_config_generate_extra_partition_list)
从上面代码知道,PRIVATE_PARTITION_LIST是由fs_config_generate_extra_partition_list指定的。
# List of supported vendor, oem, odm, product and product_services Partitions
fs_config_generate_extra_partition_list := $(strip \
$(if $(BOARD_USES_VENDORIMAGE)$(BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE),vendor) \
$(if $(BOARD_USES_OEMIMAGE)$(BOARD_OEMIMAGE_FILE_SYSTEM_TYPE),oem) \
$(if $(BOARD_USES_ODMIMAGE)$(BOARD_ODMIMAGE_FILE_SYSTEM_TYPE),odm) \
$(if $(BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE),product) \
$(if $(BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE),product_services) \
)
从上面代码知道,fs_config_generate_extra_partition_list等于vendor,oem,odm,product_services。
就修改fs_config_generate_extra_partition_list = product
修改如下:
diff --git a/tools/fs_config/Android.mk b/tools/fs_config/Android.mk
index 96db0f39f..d571acaab 100644
--- a/tools/fs_config/Android.mk
+++ b/tools/fs_config/Android.mk
@@ -35,6 +35,7 @@ fs_config_generate_extra_partition_list := $(strip \
$(if $(BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE),product) \
$(if $(BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE),product_services) \
)
+fs_config_generate_extra_partition_list := product
FAILED: out/target/product/uml/obj/ETC/treble_sepolicy_tests_27.0_intermediates/treble_sepolicy_tests_27.0
/bin/bash -c "(out/host/linux-x86/bin/treble_sepolicy_tests -l out/host/linux-x86/lib64/libsepolwrap.so -f out/target/product/uml/obj/ETC/plat_file_contexts_intermediates/plat_file_contexts -f out/target/product/uml/obj/ETC/vendor_file_contexts_intermediates/vendor_file_contexts -b out/target/product/uml/obj/ETC/built_plat_sepolicy_intermediates/built_plat_sepolicy -m out/target/product/uml/obj/ETC/treble_sepolicy_tests_27.0_intermediates/27.0_mapping.combined.cil -o out/target/product/uml/obj/ETC/treble_sepolicy_tests_27.0_intermediates/built_27.0_plat_sepolicy -p out/target/product/uml/obj/ETC/sepolicy_intermediates/sepolicy -u out/target/product/uml/obj/ETC/built_plat_sepolicy_intermediates/base_plat_pub_policy.cil ) && (touch out/target/product/uml/obj/ETC/treble_sepolicy_tests_27.0_intermediates/treble_sepolicy_tests_27.0 )"
The following domain(s) must be associated with the "coredomain" attribute because they are executed off of /system:
init_eth0
从输出信息看出: init_eth0的属性不对。
然后定位到字符串init_eth0在输出文件out/target/product/uml/obj/ETC/vendor_file_contexts_intermediates/vendor_file_contexts中对应文件是device/generic/uml/sepolicy/file_contexts中,init_eth0变量在device/generic/sepolicy/init_eth0.te中init_eth0的属性是domain,根据错误提示需要修改成coredomain
type init_eth0, domain; ====>type init_eth0, coredomain;
修改的patch为
diff --git a/sepolicy/init_eth0.te b/sepolicy/init_eth0.te
index f088073..11418e2 100644
--- a/sepolicy/init_eth0.te
+++ b/sepolicy/init_eth0.te
@@ -1,4 +1,4 @@
-type init_eth0, domain;
+type init_eth0, coredomain;
type init_eth0_exec, system_file_type, exec_type, file_type;
Seandroid 基础