Commit beca0a5b authored by fuyanbin's avatar fuyanbin
Browse files

不用sudo

parent 85e8cf16
...@@ -49,28 +49,28 @@ build_image() { ...@@ -49,28 +49,28 @@ build_image() {
if file "$systemfile" | grep "Android sparse image" if file "$systemfile" | grep "Android sparse image"
then then
simg2img "$systemfile" "$systemfile_ext4" simg2img "$systemfile" "$systemfile_ext4"
loopdev=$(sudo losetup -P -f --show "$systemfile_ext4") loopdev=$(losetup -P -f --show "$systemfile_ext4")
else else
loopdev=$(sudo losetup -P -f --show "$systemfile") loopdev=$(losetup -P -f --show "$systemfile")
fi fi
mkdir "$build_dir/system" mkdir "$build_dir/system"
sudo mount "$loopdev" "$build_dir/system" mount "$loopdev" "$build_dir/system"
sudo touch "$build_dir/system/.androidrom" touch "$build_dir/system/.androidrom"
sudo rm -f "$build_dir/system/hugep-all.zip" rm -f "$build_dir/system/hugep-all.zip"
sudo cp -f "$build_dir/hugep-all.zip" "$build_dir/system/hugep-all.zip" cp -f "$build_dir/hugep-all.zip" "$build_dir/system/hugep-all.zip"
sudo find ./services/ -type f -name "*.rc" -exec install -t "$build_dir"/system/etc/init/ {} \; find ./services/ -type f -name "*.rc" -exec install -t "$build_dir"/system/etc/init/ {} \;
sudo find ./services/ -type f ! -name "*.rc" -exec install -m 0777 -t "$build_dir"/system/bin/ {} \; find ./services/ -type f ! -name "*.rc" -exec install -m 0777 -t "$build_dir"/system/bin/ {} \;
for file in $(find ./services/ -type f ! -name "*.rc") for file in $(find ./services/ -type f ! -name "*.rc")
do do
sudo chcon u:object_r:drmserver_exec:s0 "$build_dir/system/bin/$(basename "$file")" chcon u:object_r:drmserver_exec:s0 "$build_dir/system/bin/$(basename "$file")"
done done
sudo umount "$loopdev" umount "$loopdev"
sudo losetup -d "$loopdev" losetup -d "$loopdev"
rm -rf "$build_dir/system" rm -rf "$build_dir/system"
sync sync
...@@ -81,7 +81,7 @@ build_image() { ...@@ -81,7 +81,7 @@ build_image() {
rm -f "$systemfile_ext4" rm -f "$systemfile_ext4"
fi fi
aml_image_v2_packer -r "./$build_dir/image.cfg" "$build_dir" "$(basename "$img")" aml_image_v2_packer -r "./$build_dir/image.cfg" "$build_dir" "$(basename "$img")"
sudo rm -rf "./$build_dir/" rm -rf "./$build_dir/"
} }
genarae_vendor_confg() { genarae_vendor_confg() {
......
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