Skip to content

Commit

Permalink
Use the 2023-10-10 base OS image for image builder
Browse files Browse the repository at this point in the history
  • Loading branch information
TojikCZ committed Nov 1, 2023
1 parent 262481b commit ee1a1c3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Telemetry improvement
* Attempt to turn the RPi wifi power management off in the images
* Stop showing the tune menu after connecting to the printer
* Use the 2023-10-10 Raspberry Pi OS base image for the image builder

0.7.1rc1 (2023-08-10)
* Fixed HTTP response status on HEAD request for non-existing files
Expand Down
32 changes: 16 additions & 16 deletions image_builder/image_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
INITRD_NAME = f"initrd.img-{KERNEL_VERSION_NAME}"
VMLINUZ_NAME = f"vmlinuz-{KERNEL_VERSION_NAME}"

IMAGE_URL = "https://downloads.raspberrypi.org/raspios_lite_armhf/images/" \
"raspios_lite_armhf-2023-05-03/2023-05-03-raspios-bullseye-armhf" \
"-lite.img.xz"
IMAGE_URL = ("https://downloads.raspberrypi.org/raspios_lite_armhf/images/"
"raspios_lite_armhf-2023-10-10/2023-10-10-raspios-bookworm-armhf"
"-lite.img.xz")

DATA_FILE = "data.json"
COMPRESSED_IMAGE_NAME = "source_image.img.xz"
Expand Down Expand Up @@ -277,7 +277,6 @@ def build_image():
run_command("chmod +x pishrink.sh")

# --- Get source image ---

if not os.path.exists(SOURCE_IMAGE_NAME) or args.refresh:
print("Cleaning up old image files")
run_command(f"rm {COMPRESSED_IMAGE_NAME}", check=False)
Expand Down Expand Up @@ -346,8 +345,8 @@ def build_image():
print("Copying the generated vmlinuz and initrd")
initrd_loop = mount_image(SACRIFICIAL_IMAGE_NAME, expand=False)

run_command(f"cp {BOOTFS_MOUNT}/{VMLINUZ_NAME} .")
run_command(f"cp {BOOTFS_MOUNT}/{INITRD_NAME} .")
run_command(f"cp {ROOTFS_MOUNT}/boot/{VMLINUZ_NAME} .")
run_command(f"cp {ROOTFS_MOUNT}/boot/{INITRD_NAME} .")
run_command(f"cp -r {ROOTFS_MOUNT}/lib/modules/"
f"{KERNEL_VERSION_NAME} .")

Expand Down Expand Up @@ -409,25 +408,26 @@ def build_image():

print("Installing dependencies")
run_over_ssh("sudo apt-get install -y git python3-pip pigpio libcap-dev "
"libmagic1 libturbojpeg0 libatlas-base-dev libffi-dev")
"libmagic1 libturbojpeg0 libatlas-base-dev libffi-dev "
"cmake iptables")

print("Installing PrusaLink")
# Caution: not tied to requirements-pi.txt
run_over_ssh("pip install wiringpi")
run_over_ssh("pip install --break-system-packages wiringpi")
if args.multi_instance:
run_over_ssh("pip install ipcqueue")
run_over_ssh("pip install --break-system-packages ipcqueue")
if args.dev or args.branch_or_hash is not None:
hash_part = ""
if args.branch_or_hash is not None:
hash_part = f"@{args.branch_or_hash}"
run_over_ssh("pip install git+https://github.com/prusa3d/"
"gcode-metadata.git")
run_over_ssh("pip install git+https://github.com/prusa3d/"
"Prusa-Connect-SDK-Printer.git")
run_over_ssh("pip install git+https://github.com/prusa3d/"
f"Prusa-Link.git{hash_part}")
run_over_ssh("pip install --break-system-packages git+https://"
"github.com/prusa3d/gcode-metadata.git")
run_over_ssh("pip install --break-system-packages git+https://"
"github.com/prusa3d/Prusa-Connect-SDK-Printer.git")
run_over_ssh("pip install --break-system-packages git+https://"
f"github.com/prusa3d/Prusa-Link.git{hash_part}")
else:
run_over_ssh("pip install prusalink")
run_over_ssh("pip install --break-system-packages prusalink")

output = subprocess.run(
shlex.split(SSH_COMMAND + ".local/bin/prusalink --version"),
Expand Down

0 comments on commit ee1a1c3

Please sign in to comment.