{"id":13818350,"url":"https://github.com/canonical/pi-gadget","last_synced_at":"2025-05-15T23:31:49.386Z","repository":{"id":42007898,"uuid":"143415718","full_name":"canonical/pi-gadget","owner":"canonical","description":"Universal pi (pi2,pi3,pi4,cm3,cm4 and future) gadget snap for Ubuntu Core and classic systems.","archived":false,"fork":false,"pushed_at":"2024-09-09T16:58:21.000Z","size":12184,"stargazers_count":33,"open_issues_count":20,"forks_count":62,"subscribers_count":35,"default_branch":"20-arm64","last_synced_at":"2024-09-15T06:42:13.066Z","etag":null,"topics":["raspberry-pi","raspberry-pi-3","raspberrypi","raspberrypi-4","raspberrypi3","raspberrypi4"],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/canonical.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-03T10:50:19.000Z","updated_at":"2024-09-04T14:22:46.000Z","dependencies_parsed_at":"2024-01-18T04:08:40.888Z","dependency_job_id":"35ba9260-755d-4139-9220-64fae8a7c9d8","html_url":"https://github.com/canonical/pi-gadget","commit_stats":null,"previous_names":["canonical/pi-gadget"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canonical%2Fpi-gadget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canonical%2Fpi-gadget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canonical%2Fpi-gadget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canonical%2Fpi-gadget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/canonical","download_url":"https://codeload.github.com/canonical/pi-gadget/tar.gz/refs/heads/20-arm64","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225387192,"owners_count":17466375,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["raspberry-pi","raspberry-pi-3","raspberrypi","raspberrypi-4","raspberrypi3","raspberrypi4"],"created_at":"2024-08-04T07:00:43.539Z","updated_at":"2024-11-19T16:30:57.106Z","avatar_url":"https://github.com/canonical.png","language":"Makefile","funding_links":[],"categories":["Security hardening"],"sub_categories":["Gadget snaps (board support)"],"readme":"# Raspberry Pi \"Universal\" Gadget Snap\n\nThis repository contains the source for an [Ubuntu\nCore](https://ubuntu.com/core) gadget snap that runs universally on all the\nRaspberry Pi boards currently supported by Ubuntu Core (Raspberry Pi 2B, 3B,\n3A+, 3B+, 4B, Pi Zero 2 W, Compute Module 3, Compute Module 3+ and Compute\nModule 4).\n\nBuilding with [snapcraft](https://snapcraft.io/docs/snapcraft-overview)(see\nbelow) will obtain various components from the bionic-updates archive,\nincluding:\n\n* the bootloader firmware from the linux-firmware-raspi2 package\n* the device-tree(s) from the linux-modules-\\\u003cver\\\u003e-raspi2 package\n* u-boot binaries (for various models) from the u-boot-rpi package\n* u-boot boot script from the flash-kernel package (classic gadgets only)\n\nOn core builds, a silent boot with a splash screen is included. The splash\nscreen binary comes from\n[git://git.yoctoproject.org/psplash](http://git.yoctoproject.org/cgit/cgit.cgi/psplash/).\nPlease see the `psplash/` sub directory for patches and adjustments in use.\n\n## Gadget Snaps\n\nGadget snaps are a special type of snaps that contain device specific support\ncode and data. You can read more about them in the snapcraft forum:\n\nhttps://forum.snapcraft.io/t/the-gadget-snap/\n\n## Reporting Issues\n\nPlease report all issues here on the github page via:\nhttps://github.com/snapcore/pi-gadget/issues\n\n## Branding\n\nThis gadget snap comes with a boot splash. To change the logo you can add a new\npng file to the psplash subdirectory of this tree, adjust the \"SPLASH=\" option\nin `psplash/config` to point to this file and rebuild the gadget.\n\nTo turn off the splash screen completely please edit `configs/core/cmdline.txt`\nand remove the `splash` and the `vt.handoff=2` keywords from the default kernel\ncommand line.\n\n## Branches\n\nThis repository contains the following branches for Ubuntu Core versions and\nthe two Raspberry Pi architectures(_armhf_ and _arm64_):\n\n* 18-arm64 - the branch for Core 18 on arm64\n* 18-armhf - the branch for Core 18 on armhf\n* 20-arm64 - the branch for Core 20 on arm64 (**default**)\n* 20-armhf - the branch for Core 20 on armhf\n* 22-arm64 - the branch for Core 22 on arm64\n* 22-armhf - the branch for Core 22 on armhf\n* classic - the branch for Ubuntu Server images (universal gadget)\n* desktop - the branch for Ubuntu Desktop images (universal gadget)\n\n## Building\n\nThere are two general approaches to building the pi-gadget snap: _managed_ and\n_manual managed_.\n\nThe easiest managed approach is to simply run `snapcraft` within the root of\nthis repository on a classic Ubuntu installation, such as an amd64-based Ubuntu\nserver or desktop, or even an arm64-based Ubuntu running on a Raspberry Pi.\nSnapcraft will create either a [Multipass](https://multipass.run/) or\n[LXD](https://linuxcontainers.org/lxd/introduction/) build environment and\nproduce the gadget snap automatically.\n\nAnother managed option is to run `snapcraft remote-build`. This command\noffloads the snap build process to the [Launchpad build\nfarm](https://launchpad.net/builders), pushing the potentially foreign\narchitecture snap back to your machine when the build completes. See [Remote\nbuild](https://snapcraft.io/docs/remote-build) for further details.\n\nManaged build environments will mirror the distro series declared in the `base`\nsetting of the gadget's snapcraft.yaml, such as _core20_ or _core18_.\n\nManually managed builds include building the gadget snap on Ubuntu Core running\non a Raspberry Pi, for example, and systems where you want to first manually\nisolate a build from the host system. In both cases, you first manually\ncreate an LXD instance from which you can run `snapcraft --destructive-mode` to\nuse the instance as the build environment.\n\nExamples of both a _managed_ build and a _manually managed_ build are outlined\nbelow.\n\n### Example managed build\n\nThis is likely the most convenient build method as the gadget is automatically\nbuilt within a container on the host machine.\n\n#### Prerequisites\n\n- An Ubuntu host (20.04 or newer is recommended)\n- [Snapcraft](https://snapcraft.io/docs/snapcraft-overview)\n\n#### Method\n\nTo build the gadget snap, switch to the appropriate branch and simply\nrun the `snapcraft` command:\n\n```bash\n$ git clone https://github.com/snapcore/pi-gadget\n$ cd pi-gadget\n$ git checkout 20-armhf\n$ snapcraft\n[...]\nSnapped pi_20-1_armhf.snap\n```\n\nBy default, _snapcraft_ attempts to build the gadget snap in a\n[Multipass](https://multipass.run/) container, isolating the host system from\nthe build system. [Building on LXD](https://snapcraft.io/docs/build-on-lxd) is\nanother option that can be faster, especially when iterating over builds.\n\nIf Multipass or LXD is not already installed, _Snapcraft_ will install the\nappropriate packages and run through their setup before building the gadget.\n\nBoth Multipass and LXD allow for the build architecture to differ from the\n_run-on_ architecture, as defined by the `architecture` stanza in the\n_snapcraft.yaml_ for the gadget snap:\n\n```yaml\narchitecture\n  - build-on: [amd64, armhf]\n    run-on: armhf\n```\n\nSee [Architectures](https://snapcraft.io/docs/architectures) for more details\non defining architectures and [Image\nbuilding](https://ubuntu.com/core/docs/board-enablement#heading--image-building)\nfor instructions on how to build a bootable image that includes the gadget snap.\n\n### Example manually managed build\n\nThis method allows for the gadget snap to be built on the same hardware the\ngadget is intended for.\n\n#### Prerequisites\n\n- A [supported Raspberry Pi](https://ubuntu.com/core/docs/supported-platforms)\n  with [UC20+ installed](https://ubuntu.com/core/docs/uc20/install)\n- An SSH connection to the Raspberry Pi\n- Raspberry Pi internet access\n\n#### Method\n\nTo build the gadget snap:\n1. Install and set up [LXD](https://linuxcontainers.org/lxd/introduction/)\n1. Launch a fresh instance of Ubuntu 20.04\n1. Within the instance:\n   - Install snapcraft\n   - Clone the repo, switch to the appropriate build and arch branch\n   - Build the gadget with snapcraft\n1. Exit the instance and obtain the snap from within the container\n\nRunning the following commands on the Raspberry Pi will perform the above process:\n\n```no-highlight\n$ sudo snap install lxd\n$ sudo lxd init --auto\n$ sudo lxc launch ubuntu:20.04 focal\n$ sudo lxc shell focal\n# snap install snapcraft --classic\n# git clone https://github.com/snapcore/pi-gadget/\n# cd pi-gadget\n# snapcraft --destructive-mode\n[...]\nSnapped pi_20-1_arm64.snap\n# exit\n$ lxc file pull focal/root/pi-gadget/pi_20-1_arm64.snap .\n```\n\nSee [Image\nbuilding](https://ubuntu.com/core/docs/board-enablement#heading--image-building)\nfor instructions on how to build a bootable image that includes the gadget\nsnap.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcanonical%2Fpi-gadget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcanonical%2Fpi-gadget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcanonical%2Fpi-gadget/lists"}