Skip to content

Simplify the gadget logic on this branch dedicated to UC24/arm64#136

Merged
alfonsosanchezbeato merged 2 commits into
canonical:24from
nicoharnois:simplify-gadget
Jul 30, 2025
Merged

Simplify the gadget logic on this branch dedicated to UC24/arm64#136
alfonsosanchezbeato merged 2 commits into
canonical:24from
nicoharnois:simplify-gadget

Conversation

@nicoharnois

Copy link
Copy Markdown
Contributor

A lot of tests in the Makefile are useless as we maintain a dedicated branch per UC version and architecture. The commit simplifies the gadget logic, and get rid of the Makefile by migrating everything into the snapcraft.yaml file.

The bootloader configuration file and the kernel command line have been merged in a single file.

Helpers for cross-compilation are not needed, thus removed.

A lot of tests in the Makefile are useless as we maintain a dedicated
branch per UC version and architecture. The commit simplifies the gadget
logic, and get rid of the Makefile by migrating everything into the
snapcraft.yaml file.

The bootloader configuration file and the kernel command line have been
merged in a single file.

Helpers for cross-compilation are not needed, thus removed.
@nicoharnois

Copy link
Copy Markdown
Contributor Author

The patch was tested using the following procedure:

  • build the gadget from the local branch
  • build an image using ubuntu-image and pointing to the local snap:
  • ubuntu-image snap --allow-snapd-kernel-mismatch ./test-model.model --snap ~/github/pi-gadget/pi_24-3_arm64.snap
  • Flash the image on an SD card using Raspberry Pi Imager
  • load the image on a RPi Zero 2W and check that the image boots and go until the user prompt

Also, the content of the gadget has been compared before/after the patch by unsquashing the gadget, and it matches exactly.

Finally, I loaded an ubuntu classic image on a Raspberry Zero 2W, and successfully ran snapcraft in a copy of the local branch on the target itself, still comparing the generated snap file content by using the "unsquashfs".

@Meulengracht Meulengracht left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I built this from source and tested on my Rpi4B - it reaches login.

@alfonsosanchezbeato alfonsosanchezbeato left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks, this is a very nice clean-up

Comment thread snapcraft.yaml Outdated
Comment on lines +52 to +53
for file in fixup start bootcode; do \
install -m 644 ${CRAFT_PART_BUILD}/usr/lib/${RPI_FW}/${file}* ${CRAFT_PART_INSTALL}/boot-assets/; \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you do not need the \ or ; at the end in these lines

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review Alfonso, just added a new commit to remove these

@alfonsosanchezbeato
alfonsosanchezbeato merged commit 238daa9 into canonical:24 Jul 30, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants