forked from RedPill-TTG/redpill-load
-
Notifications
You must be signed in to change notification settings - Fork 5
192 lines (172 loc) · 8.76 KB
/
make_722.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
name: Make kernel bs patch for 7.2.2-72806 formal using fb kpatch
on:
workflow_dispatch:
inputs:
toolchain:
description: 'DSM toolchain URL for repack zImage'
required: true
default: 'https://sourceforge.net/projects/toolchain-me/files/toolchain%207.2%20beta/broadwellnk-gcc1220_glibc236_x86_64-GPL.txz/download'
linux-src:
description: 'Linux kernel source URL for repack zImage'
required: true
default: 'https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.4.302.tar.xz'
jobs:
build:
runs-on: ubuntu-latest
steps:
#- uses: actions/checkout@v2
- name: Bulid
id: bulid-config
env:
ACTIONS_STEP_DEBUG: true
run: |
# install bsdiff
DSMVER="7.2.2"
REV="72806"
PLATFORMS="apollolake geminilake r1000 v1000 epyc7002"
DT_PLATFORMS="geminilake r1000 v1000 epyc7002"
sudo apt-get install -y bsdiff cpio xz-utils
#ls -al $GITHUB_WORKSPACE/
mkdir /opt/build
mkdir /opt/dist
cd /opt/build
# download old pat for syno_extract_system_patch # thanks for jumkey's idea.
curl -kL https://global.download.synology.com/download/DSM/release/7.0.1/42218/DSM_DS3622xs%2B_42218.pat --output oldpat.tar.gz
curl -kLO https://github.com/PeterSuh-Q3/redpill-load/raw/master/config/models.72
curl -kLO https://github.com/PeterSuh-Q3/redpill-load/raw/master/config/temp-dt-config.json
curl -kLO https://github.com/PeterSuh-Q3/redpill-load/raw/master/config/temp-nondt-config.json
curl -kLO https://github.com/PeterSuh-Q3/redpill-load/raw/master/config/temp-apollolake-config.json
curl -kLO https://github.com/PeterSuh-Q3/redpill-load/raw/master/config/temp-denverton-config.json
curl -kLO https://github.com/PeterSuh-Q3/redpill-load/raw/master/config/temp-epyc7002-config.json
curl -kL https://github.com/PeterSuh-Q3/redpill-load/raw/master/config/custom_config.json -o /opt/dist/custom_config.json
curl -kL https://github.com/PeterSuh-Q3/redpill-load/raw/master/config/rss.json -o /opt/dist/rss.json
for file in `cat models.72`
do
dsmid=$(echo "$file" | sed 's/DS/ds/' | sed 's/RS/rs/' | sed 's/+/p/' | sed 's/DVA/dva/' | sed 's/FS/fs/' | sed 's/SA/sa/' )
cd /opt/build
[ ! -d synoesp ] && mkdir synoesp
echo "Working on $file"
URL="https://global.synologydownload.com/download/DSM/release/${DSMVER}/${REV}/DSM_${file}_${REV}.pat"
URL="$(echo ${URL} | sed 's/+/%2B/g')"
echo ${URL}
curl -kL ${URL} -o ds.pat
tar -C./synoesp/ -xf oldpat.tar.gz rd.gz
cd synoesp
xz -dc < rd.gz >rd 2>/dev/null || echo "extract rd.gz"
echo "finish"
cpio -idm <rd 2>&1 || echo "extract rd"
[ ! -d extract ] && mkdir extract && cd extract
cp ../usr/lib/libcurl.so.4 ../usr/lib/libmbedcrypto.so.5 ../usr/lib/libmbedtls.so.13 ../usr/lib/libmbedx509.so.1 ../usr/lib/libmsgpackc.so.2 ../usr/lib/libsodium.so ../usr/lib/libsynocodesign-ng-virtual-junior-wins.so.7 ../usr/syno/bin/scemd ./
ln -s scemd syno_extract_system_patch
cd ../..
[ ! -d pat ] && mkdir pat
ls -lh ./
sudo LD_LIBRARY_PATH=synoesp/extract synoesp/extract/syno_extract_system_patch ds.pat pat || echo "extract latest pat"
echo "test4"
# is update_pack
if [ ! -f "pat/zImage" ]; then
cd pat
ar x $(ls flashupdate*)
tar xf data.tar.xz
cd ..
fi
. /opt/build/pat/VERSION
#unique="synology_broadwellnk_3622xs+"
platform_name=$(echo "$unique" | awk -F "_" '{print $2}')
echo $platform_name
# make config.json
mkdir -p /opt/dist/${file}/${DSMVER}-${REV}
workfile=/opt/dist/${file}/${DSMVER}-${REV}/config.json
if [ $(echo ${DT_PLATFORMS} | grep ${platform_name} | wc -l ) -eq 0 ]; then
if [ ${platform_name} == "apollolake" ]; then
cp -fv temp-apollolake-config.json ${workfile}
elif [ ${platform_name} == "denverton" ]; then
cp -fv temp-denverton-config.json ${workfile}
else
cp -fv temp-nondt-config.json ${workfile}
fi
else
if [ ${platform_name} == "epyc7002" ]; then
cp -fv temp-epyc7002-config.json ${workfile}
else
cp -fv temp-dt-config.json ${workfile}
fi
fi
jsonfile=$(jq ".os.id=\"${dsmid}_${REV}\"" ${workfile}) && echo $jsonfile | jq . > ${workfile}
jsonfile=$(jq ".os.pat_url=\"${URL}\"" ${workfile}) && echo $jsonfile | jq . > ${workfile}
ossha256=$(sha256sum /opt/build/ds.pat | awk '{print $1}')
jsonfile=$(jq ".os.sha256=\"${ossha256}\"" ${workfile}) && echo $jsonfile | jq . > ${workfile}
value=$(sha256sum /opt/build/pat/zImage | awk '{print $1}')
jsonfile=$(jq ".files.zlinux.sha256=\"${value}\"" ${workfile}) && echo $jsonfile | jq . > ${workfile}
value=$(sha256sum /opt/build/pat/rd.gz | awk '{print $1}')
jsonfile=$(jq ".files.ramdisk.sha256=\"${value}\"" ${workfile}) && echo $jsonfile | jq . > ${workfile}
sed -i "s/DSM_MODEL/${file}/" ${workfile}
sed -i "s/v0.0.0/v${DSMVER}/" ${workfile}
sed -i "s/00000/${REV}/" ${workfile}
# sha256
sha256sum /opt/build/ds.pat | awk '{print $1}' | awk '{print $1 " '${file}' os.sha256"}' >> /opt/dist/files-chksum
sha256sum /opt/build/pat/zImage | awk '{print $1}' | awk '{print $1 " '${file}' files.zlinux.sha256"}' >> /opt/dist/files-chksum
sha256sum /opt/build/pat/rd.gz | awk '{print $1}' | awk '{print $1 " '${file}' files.ramdisk.sha256"}' >> /opt/dist/files-chksum
echo "" >> /opt/dist/files-chksum
echo "" >> /opt/dist/files-chksum
if [ $(echo ${PLATFORMS} | grep ${platform_name} | wc -l ) -eq 0 ]; then
jsonfile=$(jq '.build_configs += [
{
"id": "'$dsmid'-'$DSMVER'-'$REV'",
"platform_name": "'$platform_name'",
"downloads": {
"os": {
"sha256": "'$ossha256'"
}
},
"add_extensions": [
{
"all-modules": "https://raw.githubusercontent.com/PeterSuh-Q3/tcrp-modules/master/all-modules/rpext-index.json",
"storagepanel": "https://raw.githubusercontent.com/PeterSuh-Q3/tcrp-addons/master/storagepanel/rpext-index.json"
}]
}
]' /opt/dist/custom_config.json)
else
jsonfile=$(jq '.build_configs += [
{
"id": "'$dsmid'-'$DSMVER'-'$REV'",
"platform_name": "'$platform_name'",
"downloads": {
"os": {
"sha256": "'$ossha256'"
}
},
"add_extensions": [
{
"all-modules": "https://raw.githubusercontent.com/PeterSuh-Q3/tcrp-modules/master/all-modules/rpext-index.json",
"powersched": "https://raw.githubusercontent.com/PeterSuh-Q3/tcrp-addons/master/powersched/rpext-index.json",
"storagepanel": "https://raw.githubusercontent.com/PeterSuh-Q3/tcrp-addons/master/storagepanel/rpext-index.json"
}]
}
]' /opt/dist/custom_config.json)
fi
echo $jsonfile | jq . > /opt/dist/custom_config.json
# md5
md5sum /opt/build/ds.pat | awk '{print $1}' | awk '{print $1 " '${file}' os.md5"}' >> /opt/dist/md5-chksum
echo "" >> /opt/dist/md5-chksum
osmd5=$(md5sum /opt/build/ds.pat | awk '{print $1}')
remodel=$(echo "$file" | sed 's/DS//' | sed 's/RS/rs/' | sed 's/DVA/dva/' | sed 's/FS/fs/' | sed 's/SA/sa/' )
jsonfile=$(jq '.model += [
{
"mUnique": "synology_'$platform_name'_'$remodel'",
"mLink": "https:\/\/global.synologydownload.com\/download\/DSM\/release\/'$DSMVER'\/'$REV'\/DSM_'${file}'_'$REV'.pat",
"mCheckSum": "'$osmd5'"
}
]' /opt/dist/rss.json)
echo $jsonfile | jq . > /opt/dist/rss.json
ls -l
echo 'Clean Directory!!!!!!!!!!!!!'
sudo find /opt/build/pat -delete
sudo find /opt/build/synoesp -delete
ls -l
done
- name: Upload
uses: actions/upload-artifact@v3
with:
name: kernel-bs-fb-patch-for-all
path: /opt/dist