Skip to content

Commit

Permalink
make raspbian_lepotato download latest image automatically, better ch…
Browse files Browse the repository at this point in the history
…ecksum url
  • Loading branch information
guysoft committed Nov 8, 2024
1 parent 0a39a13 commit 2a3807b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/custompios_core/base_image_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def download_image_rpi(board: Dict[str, Any], dest_folder: str):
return

def get_checksum_libre_computer(os_name: str, os_version: str, file_name: str) -> Optional[str]:
checksum_url = f"https://computer-libre-distro.us-east-1.linodeobjects.com/ci/{os_name}/{os_version}/SHA256SUMS"
checksum_url = f"https://distro.libre.computer/ci/{os_name}/{os_version}/SHA256SUMS"
checksum_files_data = download_webpage(checksum_url)
for line in checksum_files_data.splitlines():
checksum, name = line.split(maxsplit=1)
Expand All @@ -191,7 +191,8 @@ def download_image_libre_computer(board: Dict[str, Any], dest_folder: str):
if os_name == "debian":
file_name = f"{os_name}-{os_version}-{port}-{arch}-{board}.img.xz"
download_url = f"https://distro.libre.computer/ci/{os_name}/{os_version}/{urllib.parse.quote(file_name)}"

elif os_name == "raspbian":
download_url = f"https://distro.libre.computer/ci/{os_name}/{os_version}/{urllib.parse.quote(file_name)}"
checksum = get_checksum_libre_computer(os_name, os_version, file_name)
if checksum is None:
print(f"Error: Can't find the correct checksum for {file_name}")
Expand Down
8 changes: 5 additions & 3 deletions src/images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ images:
BASE_IMAGE_RASPBIAN: "no"
raspbian_lepotato:
description: "Le Potato AML-S905X-CC Raspbian image"
url: "https://distro.libre.computer/ci/raspbian/11/2023-05-03-raspbian-bullseye-arm64-lite%2Baml-s905x-cc.img.xz"
checksum: "https://distro.libre.computer/ci/raspbian/11/SHA256SUMS"
type: http
type: libre.computer
os_name: raspbian
os_version: 12
distribution: bookworm
port: lite
env:
BASE_ARCH: arm64
BASE_DISTRO: raspbian
Expand Down

0 comments on commit 2a3807b

Please sign in to comment.