Commit beca0a5b authored by fuyanbin's avatar fuyanbin
Browse files

不用sudo

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