-
Notifications
You must be signed in to change notification settings - Fork 77
Core26 checkbox-ce-oem snapcraft.yaml (New) #2573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c8b1111
feat: initial setup
tomli380576 af21571
feat: can successfully build
tomli380576 54f0198
fix: replace mentions of checkbox24 with checkbox26
tomli380576 0a37546
fix: typo
tomli380576 daaca6e
fix: classic snaps don't have 'connect'
tomli380576 c60c029
fix: use raise
tomli380576 beaf4c5
fix: copilot suggestion
tomli380576 c31621c
doc: document the docker plug
tomli380576 885ac42
fix: typos
tomli380576 a73d937
ci: add 26 to cross and native builds
tomli380576 5aff649
fix: missing snapcraft version
tomli380576 dd8abde
ci: specify channel
tomli380576 3d5798b
fix: uc26 can successfully build now
tomli380576 d19ea8f
test: add tmate
tomli380576 e30eaa6
fix: add detached: true
tomli380576 dcf9be4
hack: use noble
tomli380576 1f8f9d4
fix: bad path
tomli380576 7646350
fix: remove tmate
tomli380576 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_classic26/.gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| checkbox-provider-ce-oem/ | ||
| *.snap |
44 changes: 44 additions & 0 deletions
44
contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_classic26/config/config_vars
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # follow KEY=value syntax | ||
| WIFI_INTERFACE=wlan0 | ||
| # WATCHDOG_KERNEL_MOD=iTCO_wdt | ||
| # ALSADEVICE=hw:CARD=bytrt5660,DEV=0 | ||
| OPEN_N_SSID=ubuntu-cert-n-open-tpelab | ||
| OPEN_BG_SSID=ubuntu-cert-bg-open-tpelab | ||
| OPEN_AC_SSID=ubuntu-cert-ac-open-tpelab | ||
| OPEN_AX_SSID=ubuntu-cert-ax-open | ||
| WPA_N_SSID=ubuntu-cert-n-wpa-tpelab | ||
| WPA_BG_SSID=ubuntu-cert-bg-wpa-tpelab | ||
| WPA_AC_SSID=ubuntu-cert-ac-wpa-tpelab | ||
| WPA_AX_SSID=ubuntu-cert-ax-wpa | ||
| WPA_N_PSK=insecure | ||
| WPA_BG_PSK=insecure | ||
| WPA_AC_PSK=insecure | ||
| WPA_AX_PSK=insecure | ||
| BTDEVADDR=C0:B5:D7:C1:74:38 | ||
| # obex server in office: C0:B5:D7:C1:74:38 | ||
| # obex server in lab: 28:3A:4D:46:79:C0, 7C:B2:7D:4B:14:95 | ||
| WWAN_APN=internet | ||
| WWAN_NET_IF=ppp0 | ||
| WWAN_CONTROL_IF=ttyACM3 | ||
| STRESS_BOOT_ITERATIONS=100 | ||
| STRESS_S3_ITERATIONS=100 | ||
| STRESS_S4_ITERATIONS=100 | ||
| TEST_TARGET_IPERF=10.102.88.25,10.102.182.100,10.102.182.137,10.102.182.101 | ||
| # iperf server in office: 10.102.88.25 | ||
| # iperf server in lab: 10.102.182.100, 10.102.182.137 | ||
| STRESS_S4_WAIT_DELAY=120 | ||
| STRESS_S4_SLEEP_DELAY=60 | ||
| STRESS_S3_SLEEP_DELAY=60 | ||
| STRESS_BOOT_WAKEUP_DELAY=120 | ||
| STRESS_S3_WAIT_DELAY=150 | ||
| STRESS_BOOT_WAIT_DELAY=150 | ||
| WIFI_AP_SETUPTIME=30 | ||
| WWAN_SETUPTIME=30 | ||
| TPM2TOOLS_TCTI_NAME=device | ||
| TPM2TOOLS_DEVICE_FILE=/dev/tpm0 | ||
| MODEL_GRADE=signed | ||
| WATCHDOG_TYPE=wdat_wdt | ||
| WATCHDOG_IDENTITY=wdat_wdt | ||
| RTC_DEVICE_FILE=/dev/rtc0 | ||
| SNAPD_TASK_TIMEOUT=600 | ||
|
|
3 changes: 3 additions & 0 deletions
3
contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_classic26/launchers/checkbox-cli-wrapper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/bin/sh | ||
|
|
||
| exec checkbox-cli "$@" |
59 changes: 59 additions & 0 deletions
59
contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_classic26/launchers/configure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| #!/usr/bin/env python3 | ||
| # Copyright 2018-2026 Canonical Ltd. | ||
| # All rights reserved. | ||
| # | ||
| # Written by: | ||
| # Maciej Kisielewski <maciej.kisielewski@canonical.com> | ||
| # Sylvain Pineau <sylvain.pineau@canonical.com> | ||
| import os | ||
| import re | ||
| import sys | ||
|
|
||
| sys.path.append(os.path.expandvars("$SNAP/usr/lib/python3/dist-packages")) | ||
| sitepkgpath = "$SNAP/lib/python{}.{}/site-packages".format( | ||
| sys.version_info[0], sys.version_info[1]) | ||
| sys.path.append(os.path.expandvars(sitepkgpath)) | ||
|
|
||
| sys.path.append(os.path.expandvars( | ||
| "$SNAP/checkbox-runtime/usr/lib/python3/dist-packages")) | ||
| runtimepath = "$SNAP/checkbox-runtime/lib/python{}.{}/site-packages".format( | ||
| sys.version_info[0], sys.version_info[1]) | ||
| sys.path.append(os.path.expandvars(runtimepath)) | ||
|
|
||
| try: | ||
| from checkbox_support.snap_utils.config import update_configuration | ||
| from checkbox_support.snap_utils.config import print_checkbox_conf | ||
| except ImportError: | ||
| msg = """ | ||
| checkbox-support not found! | ||
| You need to install the checkbox26 snap: | ||
|
|
||
| sudo snap install checkbox26 | ||
| """ | ||
| print(os.path.expandvars(msg), file=sys.stderr) | ||
| sys.exit(1) | ||
|
|
||
|
|
||
| def main(): | ||
| # we need run as root to be able to write to /var/snap/... | ||
| if os.geteuid() != 0: | ||
| raise SystemExit('You have to run this command with sudo') | ||
|
|
||
| if len(sys.argv) > 1 and sys.argv[1] == '-l': | ||
| print_checkbox_conf() | ||
| return | ||
|
|
||
| key_re = re.compile(r"^(?:[A-Z0-9]+_?)*[A-Z](?:_?[A-Z0-9])*$") | ||
| vars_to_set = dict() | ||
| for pair in sys.argv[1:]: | ||
| k, _, v = pair.partition('=') | ||
| if not key_re.match(k) or not v: | ||
| raise SystemExit("'%s' is not a valid configuration entry. " | ||
| "Should be KEY=val" % pair) | ||
| k = k.replace('_', '-').lower() | ||
| vars_to_set[k] = v | ||
| update_configuration(vars_to_set) | ||
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| main() | ||
4 changes: 4 additions & 0 deletions
4
contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_classic26/launchers/shell-wrapper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #!/bin/bash | ||
|
|
||
| echo "$SNAP_NAME runtime shell, type 'exit' to quit the session" | ||
| exec bash |
9 changes: 9 additions & 0 deletions
9
contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_classic26/launchers/test-runner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/usr/bin/env checkbox-cli-wrapper | ||
| [launcher] | ||
| app_id = com.canonical.contrib:checkbox | ||
| launcher_version = 1 | ||
| stock_reports = text, submission_files, certification | ||
|
|
||
| [test plan] | ||
| unit = com.canonical.contrib::ce-oem-iot-server-26-04 | ||
| filter = com.canonical.contrib::ce-oem-iot-server-26-04* |
46 changes: 46 additions & 0 deletions
46
contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_classic26/launchers/wrapper_local
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| #!/bin/bash | ||
|
|
||
| case "$SNAP_ARCH" in | ||
| "amd64") ARCH='x86_64-linux-gnu' | ||
| ;; | ||
| "i386") ARCH='i386-linux-gnu' | ||
| ;; | ||
| "arm64") ARCH='aarch64-linux-gnu' | ||
| ;; | ||
| "armhf") ARCH='arm-linux-gnueabihf' | ||
| ;; | ||
| *) | ||
| echo "Unsupported architecture: $SNAP_ARCH" | ||
| exit 1 | ||
| ;; | ||
|
Copilot marked this conversation as resolved.
|
||
| esac | ||
|
|
||
| ################################################ | ||
| # Launcher common exports for any checkbox app # | ||
| ################################################ | ||
|
|
||
| RUNTIME=/snap/checkbox26/current | ||
| if [ ! -d "$RUNTIME" ]; then | ||
| echo "You need to install the checkbox26 snap." | ||
| echo "" | ||
| echo "You can do this with this command:" | ||
| echo "snap install checkbox26" | ||
| exit 1 | ||
| fi | ||
|
|
||
| export LC_ALL=C.UTF-8 | ||
| PERL_VERSION=$(perl -e '$^V=~/^v(\d+\.\d+)/;print $1') | ||
| export PERL5LIB="$PERL5LIB:$SNAP/usr/lib/$ARCH/perl/$PERL_VERSION:$SNAP/usr/lib/$ARCH/perl5/$PERL_VERSION:$SNAP/usr/share/perl/$PERL_VERSION:$SNAP/usr/share/perl5" | ||
| export GI_TYPELIB_PATH=$SNAP/usr/lib/girepository-1.0:$SNAP/usr/lib/$ARCH/girepository-1.0 | ||
| export PATH="$PATH:$SNAP/usr/bin:$SNAP/usr/sbin:$SNAP/sbin:/snap/bin" | ||
| export PYTHONPATH="$SNAP/usr/lib/python3/dist-packages:$PYTHONPATH" | ||
| export ALSA_CONFIG_PATH=/usr/share/alsa/alsa.conf | ||
|
|
||
| if [ -e $RUNTIME/wrapper_common_classic ]; then | ||
| . $RUNTIME/wrapper_common_classic | ||
| else | ||
| echo "ERROR: no $RUNTIME/wrapper_common_classic found" | ||
| exit 1 | ||
| fi | ||
|
|
||
| exec "$@" | ||
55 changes: 55 additions & 0 deletions
55
contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_classic26/snap/hooks/configure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| #!/usr/bin/env python3 | ||
| # Copyright 2017-2024 Canonical Ltd. | ||
| # All rights reserved. | ||
|
|
||
| """ | ||
| This hook reads `config_vars` file from the root of a snap and reenters this | ||
| configuration using snapd's config facilities and rewrites the file to a | ||
| checkbox config format in `$SNAP_DATA/checkbox.conf`. | ||
|
|
||
| config_vars should list all the configuration variables in a `key=value` | ||
| syntax. The line can list variable name only, if the variable should not have a | ||
| default value. All keys should comprise of CAPS, numbers and underscores (_). | ||
| E.g.: | ||
|
|
||
| OPEN_N_SSID | ||
| OPEN_BG_SSID | ||
| STRESS_S3_WAIT_DELAY=60 | ||
|
|
||
| To change those values use the configure launcher. | ||
| E.g. | ||
| $ checkbox-ce-oem.configure OPEN_N_SSID=my-wifi | ||
|
|
||
| If you __really__ need to change those values using `snap set` command, | ||
| you need to change CAPS to lowercase and underscores to dashes (-). | ||
|
|
||
| E.g. | ||
| $ snap set checkbox-ce-oem open-n-ssid=my-wifi | ||
| """ | ||
|
|
||
| import os | ||
| import sys | ||
|
|
||
| sys.path.append(os.path.expandvars("$SNAP/usr/lib/python3/dist-packages")) | ||
| sitepkgpath = "$SNAP/lib/python{}.{}/site-packages".format( | ||
| sys.version_info[0], sys.version_info[1]) | ||
| sys.path.append(os.path.expandvars(sitepkgpath)) | ||
|
|
||
| sys.path.append(os.path.expandvars( | ||
| "$SNAP/checkbox-runtime/usr/lib/python3/dist-packages")) | ||
| runtimepath = "$SNAP/checkbox-runtime/lib/python{}.{}/site-packages".format( | ||
| sys.version_info[0], sys.version_info[1]) | ||
| sys.path.append(os.path.expandvars(runtimepath)) | ||
|
|
||
| try: | ||
| from checkbox_support.snap_utils.config import refresh_configuration | ||
| except ImportError: | ||
| msg = """ | ||
| checkbox-support not found! | ||
| You need to install the checkbox26 snap: | ||
|
|
||
| sudo snap install checkbox26 | ||
| """ | ||
| print(os.path.expandvars(msg), file=sys.stderr) | ||
| sys.exit(0) | ||
| refresh_configuration() |
4 changes: 4 additions & 0 deletions
4
contrib/checkbox-ce-oem/checkbox-ce-oem-snap/series_classic26/snap/hooks/install
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #!/bin/sh | ||
|
|
||
| set -e | ||
| snapctl set slave=disabled |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.