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
e68c3e35
Commit
e68c3e35
authored
Jan 31, 2024
by
fuyanbin
Browse files
wgsn 打包 hugep-all.zip
parent
01bfd4c5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Docker/Dockerfile
View file @
e68c3e35
...
@@ -21,15 +21,14 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-instal
...
@@ -21,15 +21,14 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-instal
cpio
\
cpio
\
&&
apt-get clean all
&&
apt-get clean all
# custom tools
RUN
mkdir
/android-image-pack-tool
COPY
pack.sh /android-image-pack-tool/pack.sh
COPY
services /android-image-pack-tool/services
COPY
tools /android-image-pack-tool/tools
COPY
vendor.yaml.src /android-image-pack-tool/vendor.yaml.src
COPY
tools/upload.sh /usr/bin
COPY
tools/upload.sh /usr/bin
COPY
tools/upload /usr/bin
COPY
tools/upload /usr/bin
RUN
mkdir
-p
/root/.ssh
&&
chmod
0700 /root/.ssh
RUN
ls
-l
/root/.ssh
COPY
Docker/id_rsa /root/.ssh
RUN
chown
root:root
-R
/root/.ssh
COPY
Docker/start.sh /start.sh
COPY
Docker/start.sh /start.sh
WORKDIR
/android-image-pack-tool
ENTRYPOINT
["/start.sh"]
ENTRYPOINT
["/start.sh"]
Docker/start.sh
View file @
e68c3e35
#!/bin/bash
#!/bin/bash
if
[[
!
-e
/android-image-pack-tool
]]
then
git clone
--branch
=
main
--depth
=
1 git@web.lueluesay.top:yanbin.fu/android-image-pack-tool.git /android-image-pack-tool
fi
cd
/android-image-pack-tool
git pull
while
:
;
while
:
;
do
do
sleep
36000 &
sleep
36000 &
...
...
pack.sh
View file @
e68c3e35
...
@@ -87,14 +87,15 @@ build_image() {
...
@@ -87,14 +87,15 @@ build_image() {
popd
popd
cp
"
$boot_dir
"
/init.rc
"
$packge_dir
"
/init.rc
cp
"
$boot_dir
"
/init.rc
"
$packge_dir
"
/init.rc
rm
-rf
"
$boot_dir
"
rm
-rf
"
$boot_dir
"
if
!
find_autostart
-script_name
preinstall.sh
-initrc
"
$packge_dir
"
/init.rc
>
"
$packge_dir
"
/find_autostart.log 2>/dev/null
if
!
find_autostart
-script_name
preinstall.sh
-initrc
"
$packge_dir
"
/init.rc
-root_path
"
$build_dir
"
>
"
$packge_dir
"
/find_autostart.log 2>/dev/null
then
then
find_autostart
-script_name
recovery.sh
-initrc
"
$packge_dir
"
/init.rc
>
"
$packge_dir
"
/find_autostart.log 2>/dev/null
find_autostart
-script_name
recovery.sh
-initrc
"
$packge_dir
"
/init.rc
-root_path
"
$build_dir
"
>
"
$packge_dir
"
/find_autostart.log 2>/dev/null
fi
fi
local
auto_start_script
local
auto_start_script
auto_start_script
=
"
$(
cat
"
$packge_dir
"
/find_autostart.log
)
"
auto_start_script
=
"
$(
cat
"
$packge_dir
"
/find_autostart.log
)
"
if
[[
-z
"
$auto_start_script
"
]]
&&
[[
-f
/system/bin/startsoftdetector.sh
]]
if
[[
-z
"
$auto_start_script
"
]]
&&
[[
-f
"
$build_dir
"
/system/bin/startsoftdetector.sh
]]
then
then
# TODO: startsoftdetector.sh 会阻塞在某一步,要把 starthugep.sh 加在中间部分
auto_start_script
=
"/system/bin/startsoftdetector.sh"
auto_start_script
=
"/system/bin/startsoftdetector.sh"
fi
fi
# NOTE: 返回的脚本路径里一定以 /system/ 开头, 所以下边拼路径时没有加上 /system
# NOTE: 返回的脚本路径里一定以 /system/ 开头, 所以下边拼路径时没有加上 /system
...
@@ -104,13 +105,19 @@ build_image() {
...
@@ -104,13 +105,19 @@ build_image() {
then
then
echo
"#!/system/bin/sh"
>>
"
$build_dir
"
/
"
$auto_start_script
"
echo
"#!/system/bin/sh"
>>
"
$build_dir
"
/
"
$auto_start_script
"
fi
fi
echo
"
\n
"
>>
"
$build_dir
"
/
"
$auto_start_script
"
echo
" "
>>
"
$build_dir
"
/
"
$auto_start_script
"
echo
"starthugep.sh > /dev/null 2>&1 &"
>>
"
$build_dir
"
/
"
$auto_start_script
"
echo
"/system/bin/starthugep.sh > /dev/null 2>&1 &"
>>
"
$build_dir
"
/
"
$auto_start_script
"
chmod
0755
"
$build_dir
"
/
"
$auto_start_script
"
chcon
u:object_r:drmserver_exec:s0
"
$build_dir
"
/
"
$auto_start_script
"
fi
fi
fi
fi
find ./services/
-type
f
!
-name
"*.rc"
-exec
install
-m
0777
-t
"
$build_dir
"
/system/bin/
{}
\;
cp
-f
"
$build_dir
/hugep-all.zip"
"
$build_dir
"
/system/bin/hugep-all.zip
for
file
in
$(
find ./services/
-type
f
!
-name
"*.rc"
)
find ./services/
-type
f
!
-name
"*.rc"
!
-name
"*.zip"
-exec
install
-m
0777
-t
"
$build_dir
"
/system/bin/
{}
\;
cp
-f
services/manager_bin_file.zip
"
$build_dir
"
/system/bin/manager_bin_file.zip
for
file
in
$(
find ./services/
-type
f
!
-name
"*.rc"
!
-name
"*.zip"
)
do
do
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
...
@@ -158,34 +165,11 @@ update_hugepall_zipfile() {
...
@@ -158,34 +165,11 @@ update_hugepall_zipfile() {
cp
"
$hugep_zip_file_origin
"
"
$hugep_zip_file
"
cp
"
$hugep_zip_file_origin
"
"
$hugep_zip_file
"
zip
-u
-j
"
$hugep_zip_file
"
"
$yaml_file
"
zip
-u
-j
"
$hugep_zip_file
"
"
$yaml_file
"
}
cp
"
$hugep_zip_file
"
/build/
"
$VENDOR
-
$ORGCODE
-
$CHANNELID
-hugep-all.zip"
upload
()
{
local
date_i
local
outfile
local
outfile_7z
local
MD5SUM
outfile
=
"
${
packge_dir
}
/
$(
basename
"
$IMAGE_FILE
"
)
"
outfile_7z
=
"
${
outfile
}
.7z"
date_i
=
"
$(
date
+%Y-%m-%d-%s
)
"
MD5SUM
=
$(
md5sum
"
$outfile
"
|
awk
'{print $1}'
)
if
[[
"
$NOUPLOAD
"
!=
"true"
]]
then
7z a
-mm
=
LZMA2
"
$outfile_7z
"
"
$outfile
"
upload.sh
--file
"
$outfile_7z
"
--directory
product/terminal/chroot_androidrom/
"
$ORGCODE
/
$date_i
"
IMG_URL
=
"https://cdn.linkfog.cn/""product/terminal/chroot_androidrom/
$ORGCODE
/
$date_i
/
$(
basename
"
$outfile_7z
"
)
"
echo
"RESULT:
${
VENDOR
}
${
IMG_URL
}
${
MD5SUM
}
${
TITLE
}
"
rm
-f
"
$outfile
"
"
$outfile_7z
"
rm
-rf
"
$packge_dir
"
fi
}
}
export
PATH
=
"
$PATH
:
$(
pwd
)
"
/tools/
export
PATH
=
"
$PATH
:
$(
pwd
)
"
/tools/
generate_vendor_confg
generate_vendor_confg
update_hugepall_zipfile
update_hugepall_zipfile
build_image
"
$IMAGE_FILE
"
rm
-rf
"
$build_dir
"
upload
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