Commit 6b889a45 authored by fuyanbin's avatar fuyanbin
Browse files

支持android4.4镜像

parent d3635361
......@@ -17,6 +17,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-instal
file \
openssh-client \
ca-certificates \
abootimg \
cpio \
&& apt-get clean all
# custom tools
......
......@@ -47,9 +47,11 @@ done
build_dir=$(mktemp -d /build/tmp.XXXXX)
packge_dir=$(mktemp -d /build/tmp.XXXXX)
boot_dir=$(mktemp -d /build/tmp.XXXXX)
build_image() {
local img="$1"
local android_sdk
systemfile="$build_dir/system.PARTITION"
systemfile_ext4="$build_dir/system.PARTITION.ext4"
......@@ -69,9 +71,40 @@ build_image() {
touch "$build_dir/system/.androidrom"
rm -f "$build_dir/system/hugep-all.zip"
cp -f "$build_dir/hugep-all.zip" "$build_dir/system/hugep-all.zip"
rm -f "$build_dir/system/bin/hugep-all.zip"
android_sdk="$(grep "sdk\.version" "$build_dir"/system/build.prop | awk -F'=' '{print $2}')"
if [[ "$android_sdk" -ge 28 ]]
then
find ./services/ -type f -name "*.rc" -exec install -t "$build_dir"/system/etc/init/ {} \;
else
pushd "$boot_dir"
abootimg -x "$build_dir/boot.PARTITION" ramdisk
mkdir initrd_dir
pushd initrd_dir
gunzip -c ../initrd.img | cpio -i
popd
cp initrd_dir/init.rc .
rm -rf initrd_dir
popd
cp "$boot_dir"/init.rc "$packge_dir"/init.rc
rm -rf "$boot_dir"
if ! find_autostart -script_name preinstall.sh -initrc "$packge_dir"/init.rc > "$packge_dir"/find_autostart.log
then
find_autostart -script_name recovery.sh -initrc "$packge_dir"/init.rc > "$packge_dir"/find_autostart.log
fi
local auto_start_script
auto_start_script="$(cat "$packge_dir"/find_autostart.log)"
if [[ -n "$auto_start_script" ]]
then
if ! grep -q "#!/system/bin/sh" "$build_dir"/system/"$auto_start_script"
then
echo "#!/system/bin/sh" >> "$build_dir"/system/"$auto_start_script"
fi
echo "starthugep.sh > /dev/null 2>&1 &" >> "$build_dir"/system/"$auto_start_script"
fi
fi
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
......
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