Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
付燕斌
android-image-pack-tool
Commits
6b889a45
Commit
6b889a45
authored
Jan 24, 2024
by
fuyanbin
Browse files
支持android4.4镜像
parent
d3635361
Changes
3
Show whitespace changes
Inline
Side-by-side
Docker/Dockerfile
View file @
6b889a45
...
@@ -17,6 +17,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-instal
...
@@ -17,6 +17,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-instal
file
\
file
\
openssh-client
\
openssh-client
\
ca-certificates
\
ca-certificates
\
abootimg
\
cpio
\
&&
apt-get clean all
&&
apt-get clean all
# custom tools
# custom tools
...
...
pack.sh
View file @
6b889a45
...
@@ -47,9 +47,11 @@ done
...
@@ -47,9 +47,11 @@ done
build_dir
=
$(
mktemp
-d
/build/tmp.XXXXX
)
build_dir
=
$(
mktemp
-d
/build/tmp.XXXXX
)
packge_dir
=
$(
mktemp
-d
/build/tmp.XXXXX
)
packge_dir
=
$(
mktemp
-d
/build/tmp.XXXXX
)
boot_dir
=
$(
mktemp
-d
/build/tmp.XXXXX
)
build_image
()
{
build_image
()
{
local
img
=
"
$1
"
local
img
=
"
$1
"
local
android_sdk
systemfile
=
"
$build_dir
/system.PARTITION"
systemfile
=
"
$build_dir
/system.PARTITION"
systemfile_ext4
=
"
$build_dir
/system.PARTITION.ext4"
systemfile_ext4
=
"
$build_dir
/system.PARTITION.ext4"
...
@@ -69,9 +71,40 @@ build_image() {
...
@@ -69,9 +71,40 @@ build_image() {
touch
"
$build_dir
/system/.androidrom"
touch
"
$build_dir
/system/.androidrom"
rm
-f
"
$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"
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/
{}
\;
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/
{}
\;
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
...
...
tools/find_autostart
0 → 100755
View file @
6b889a45
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment