Skip to content

Commit

Permalink
chore: update to 1.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasVon2021 committed Sep 19, 2024
1 parent 5bc680b commit f496ae1
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 31 deletions.
23 changes: 8 additions & 15 deletions script/install_release.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/python3
# eg: python3 install_release.py --releasepath=./ --alpha=true
# eg: python3 install_release.py --releasepath=./
# after run this script, need reboot.
import subprocess
import os
Expand Down Expand Up @@ -55,20 +55,13 @@ def main():

# install all software
if os.path.exists(gArgs.releasepath):
if gArgs.alpha == 'true':
cmd = "systemctl disable kvmd-janus && systemctl disable kvmd-hid && systemctl disable kvmd-main \
&& systemctl disable kvmd-video && bash install-kvmd-web.sh && cp package.json /usr/bin/blikvm/package.json"
subprocess.check_output(cmd, shell = True, cwd=gArgs.releasepath )
print('install alpha version successful, start to resatrt service, need 60s...')
cmd = "systemctl daemon-reload && systemctl restart kvmd-web"
subprocess.check_output(cmd, shell = True, cwd=gArgs.releasepath )
print('restart kvmd-web successful')
return
else:
cmd = "bash install-kvmd-main.sh && bash install-ustreamer.sh && bash install-kvmd-hid.sh \
&& bash install-kvmd-web.sh && bash install-kvmd-msd.sh && cp package.json /usr/bin/blikvm/package.json"
subprocess.check_output(cmd, shell = True, cwd=gArgs.releasepath )
print('install new version successful')
cmd = "systemctl disable kvmd-janus && systemctl disable kvmd-hid && systemctl disable kvmd-main \
&& systemctl disable kvmd-video && bash install-kvmd-web.sh && cp package.json /usr/bin/blikvm/package.json"
subprocess.check_output(cmd, shell = True, cwd=gArgs.releasepath )
print('install alpha version successful, start to resatrt service, need 60s...')
cmd = "systemctl daemon-reload && systemctl restart kvmd-web"
subprocess.check_output(cmd, shell = True, cwd=gArgs.releasepath )
print('restart kvmd-web successful')
else:
print(gArgs.releasepath, ' not exit')

Expand Down
2 changes: 1 addition & 1 deletion script/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "v1.4.4",
"version": "v1.4.5",
"md5value": "",
"oled":{
"oled_enable": 1,
Expand Down
22 changes: 9 additions & 13 deletions script/update.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python3
# -*- coding:utf8 -*-
# eg: python3 update.py alpha v1.4.2
# eg: python3 update.py v1.4.2
import json
import os
import sys
Expand Down Expand Up @@ -123,11 +123,10 @@ def main():
sh_path = os.path.split(os.path.realpath(__file__))[0]
make_path = sh_path + '/src'

is_alpha = len(sys.argv) > 1 and sys.argv[1].lower() == "alpha"
specified_version = None
# Check if a version has been passed as an argument
if len(sys.argv) > 2:
specified_version = sys.argv[2]
if len(sys.argv) > 1:
specified_version = sys.argv[1]
# Remove/clear download directory
cmd = "rm -rf /tmp/kvm_update"
output = subprocess.check_output(cmd, shell = True, cwd=sh_path )
Expand Down Expand Up @@ -172,16 +171,16 @@ def main():
# compare version
latest_version_tuple = version_to_tuple("v1.4.0")
run_version_tuple = version_to_tuple(run_version)
if (latest_version != run_version and run_version_tuple < latest_version_tuple) or is_alpha:
if latest_version != run_version:
print("Upgrading ", run_version , " ==> ", latest_version)
# download tar pack
cmd = ""
if board_type == BoardType.V1_CM4 or board_type == BoardType.V2_HAT or board_type == BoardType.V3_PCIE:
# cmd = "curl -kLJo release.tar.gz https://github.com/ThomasVon2021/blikvm/releases/download/" + tag[0:-1] + "/release.tar.gz"
file_name = "release-alpha.tar.gz" if is_alpha else "release.tar.gz"
file_name = "release-alpha.tar.gz"
elif board_type == BoardType.V4_H616:
# cmd = "curl -kLJo release.tar.gz https://github.com/ThomasVon2021/blikvm/releases/download/" + tag[0:-1] + "/release-h616-v4.tar.gz"
file_name = "release-h616-v4-alpha.tar.gz" if is_alpha else "release-h616-v4.tar.gz"
file_name = "release-h616-v4-alpha.tar.gz"
else:
print("get unknow board")
try:
Expand All @@ -196,17 +195,14 @@ def main():
cmd = "tar -zxvf " + file_name
output = subprocess.check_output(cmd, shell = True, cwd=download_path)
install_path = download_path + "release"
if(is_alpha):
cmd = "python3 install_release.py --alpha=true"
else:
cmd = "python3 install_release.py"

cmd = "python3 install_release.py --alpha=true"
output = subprocess.check_output(cmd, shell = True, cwd=install_path)
print(output)
update_result = True
print("All configurations have been reset to default. If you have changed the web or SSH password, you will need to update the configuration again. Config path is /mnt/exec/release/config/app.json", flush=True)
print("Upgrade successful!", flush=True)
else:
print("There is no latest stable version available. You can try the alpha version: python3 /opt/bin/blikvm/script/update.py alpha")
print("There is no latest stable version available.")
a = 0
result_cnt = ""
if update_result == True:
Expand Down

0 comments on commit f496ae1

Please sign in to comment.