3 Star 6 Fork 2

Diemit / device_board_raspberrypi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
openharmony_kernel_patch.py 1.71 KB
一键复制 编辑 原始数据 按行查看 历史
Diemit 提交于 2022-06-15 05:40 . rpi4_small
#!/usr/bin/python3
#OpenHarmony linux-5.10 patch
import os
patchlist = [
# '6',
# '11',
# '10',
# '17',
# '18',
# '28',
# '35',
# '40',
# '24',
# '45',
# '44',
# '48',
# '43',
# '52',
# '56',
# '49',
# '57',
# '55',
# '54',
# '64',
# '59',
# '67',
# '66',
# '58',
# '65',
# '68',
# '60',
# '62',
# '70',
# '72',
# '69',
# '73',
# '53',
# '77',
# '75',
# '76',
# '81',
# '82',
# '79',
# '84',
# '74',
# '87',
# '88',
# '91',
# '90',
# '92',
# '89',
# '98',
# '99',
# '95',
# '106',
# '112',
# '117',
# '128',
# '138',
'183',
'184',
'185',
'179',
'182',
'186',
'187',
'192',
'197',
'200',
'170',
'195',
'229',
'231',
'234',
'232'
]
#git fetch https://gitee.com/openharmony/kernel_linux_5.10.git pull/138/head:pr_138
#https://gitee.com/openharmony/kernel_linux_5.10/pulls/138.diff
basepath = '/home/diemit/OpenHarmony/device/board/raspberrypi/rpi4/patches/kernel-5.10'
baseurl = 'https://gitee.com/openharmony/kernel_linux_5.10/pulls'
os.popen(f'mkdir -p {basepath}')
os.chdir(basepath)
for patchid in patchlist:
filename = f'{basepath}/{patchid}.diff'
if not os.path.exists(filename):
print(f'{patchid}.patch 补丁文件不存在,下载补丁保存为{filename}')
result = os.popen(f'wget {baseurl}/{patchid}.diff')
for temp in result.readlines():
print(temp)
#git apply /home/diemit/OpenHarmony/device/rpifdn/patches/kernel-5.10/1.diff
#git apply --stat patchfile
#git apply --check patchfile
os.chdir('/home/diemit/OpenHarmony/kernel/linux/linux-rpi-5.10')
for patchid in patchlist:
patchfile = f'{basepath}/{patchid}.diff'
result = os.popen(f'git apply --check {patchfile}')
print(f'检查补丁{patchid} : git apply {patchfile}')
for temp in result.readlines():
print(temp)
1
https://gitee.com/diemit/device_board_raspberrypi.git
git@gitee.com:diemit/device_board_raspberrypi.git
diemit
device_board_raspberrypi
device_board_raspberrypi
OpenHarmony-3.2-Beta1

搜索帮助