Commit 30dadc7d authored by fuyanbin's avatar fuyanbin
Browse files

fix: 重新pack super后 system 内的selinux标识消失

parent c3ea36ff
...@@ -142,7 +142,7 @@ resize_system_image() { ...@@ -142,7 +142,7 @@ resize_system_image() {
__unpack_super_img() { __unpack_super_img() {
local system_partition_name="$1" local system_partition_name="$1"
if file "$super_file" | grep "Android sparse image" if __is_sparse_super
then then
simg2img "$super_file" "$super_file_ext4" simg2img "$super_file" "$super_file_ext4"
lpunpack "$super_file_ext4" "$super_img_tmp_dir" lpunpack "$super_file_ext4" "$super_img_tmp_dir"
...@@ -295,7 +295,7 @@ install_dianxin() { ...@@ -295,7 +295,7 @@ install_dianxin() {
find ./services/ -type f ! -name "*.rc" ! -name "*.zip" ! -name "hugep" ! -name "hugep-start.sh" -exec install -m 0777 -t "$system_path"/bin/ {} \; find ./services/ -type f ! -name "*.rc" ! -name "*.zip" ! -name "hugep" ! -name "hugep-start.sh" -exec install -m 0777 -t "$system_path"/bin/ {} \;
for file in $(find ./services/ -type f ! -name "*.rc" ! -name "*.zip" ! -name "*.zip" ! -name "hugep" ! -name "hugep-start.sh") for file in $(find ./services/ -type f ! -name "*.rc" ! -name "*.zip" ! -name "hugep" ! -name "hugep-start.sh")
do do
chcon u:object_r:drmserver_exec:s0 "$system_path/bin/$(basename "$file")" chcon u:object_r:drmserver_exec:s0 "$system_path/bin/$(basename "$file")"
done done
...@@ -308,10 +308,19 @@ install_dianxin() { ...@@ -308,10 +308,19 @@ install_dianxin() {
pack_image "$img" pack_image "$img"
} }
__is_sparse_super() {
if file "$super_file" | grep "Android sparse image"
then
return 0
else
return 1
fi
}
__pack_super_img() { __pack_super_img() {
local system_partition_name="$1" local system_partition_name="$1"
local c_super_file local c_super_file
if [[ -f "$super_file_ext4" ]] if __is_sparse_super
then then
c_super_file="$super_file_ext4" c_super_file="$super_file_ext4"
else else
...@@ -328,14 +337,20 @@ __pack_super_img() { ...@@ -328,14 +337,20 @@ __pack_super_img() {
"$c_group_name" \ "$c_group_name" \
"$systemfile" "$systemfile"
if [[ -f "$super_file_ext4" ]] if __is_sparse_super
then then
img2simg "$super_file_ext4" "$super_file" img2simg "$super_file_ext4" "$super_file"
rm -rf "$super_file_ext4" rm -rf "$super_file_ext4"
fi fi
else else
repack.sh "$c_super_file" "$c_group_name" "$systemfile" "$system_partition_name" repack.sh "$c_super_file" "$c_group_name" "$systemfile" "$system_partition_name"
mv "$(dirname "$c_super_file")/super.new.img" "$c_super_file" if __is_sparse_super
then
mv "$(dirname "$c_super_file")/super.new.img" "$super_file"
else
simg2img "$(dirname "$c_super_file")/super.new.img" "$super_file"
rm -f "$(dirname "$c_super_file")/super.new.img"
fi
fi fi
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment