Skip to content

Commit

Permalink
Rebase Ubuntu Core Desktop changes on top of core24:
Browse files Browse the repository at this point in the history
* Add a Github Actions workflow to test build the snap.
* Configure snap settings defaults via gadget.yaml.
* Configure some interface connects for ubuntu-desktop-session via
  gadget.yaml.
* Turn on the graphical boot splash screen.
* Add a cloud-init script to do some first-boot config for the
  network-manager and lxd snaps.

Co-authored-by: Ken VanDine <ken.vandine@canonical.com>
Co-authored-by: Robert Ancell <robert.ancell@canonical.com>
Co-authored-by: Sergio Costas Rodriguez <sergio.costas@canonical.com>
  • Loading branch information
4 people committed Jun 25, 2024
1 parent 5f1e9c7 commit 33eae03
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 4 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/build-snap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: build-snap
on:
pull_request:
push:
branches:
- main
- 22
- 24

jobs:
snap:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: snapcore/action-build@v1
id: snapcraft
with:
# Switch back to stable once https://github.com/canonical/snapcraft/pull/4850 is released.
snapcraft-channel: edge
- uses: actions/upload-artifact@v4
with:
name: 'snap'
path: ${{ steps.snapcraft.outputs.snap}}
4 changes: 4 additions & 0 deletions extra/cloud.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#cloud-config
datasource_list: [NoCloud]
runcmd:
- /snap/pc-desktop/current/extra-setup.sh
1 change: 1 addition & 0 deletions extra/cmdline.extra
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
quiet splash
14 changes: 14 additions & 0 deletions extra/extra-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

if [ -d /var/snap/network-manager/current/ ]; then
mkdir -p /var/snap/network-manager/current/conf.d
cat > /var/snap/network-manager/current/conf.d/disable-polkit.conf <<EOF
[main]
auth-polkit=false
EOF
fi

if [ -x /snap/bin/lxd ]; then
#initalize lxd with zfs storage backend for sudo support
/snap/bin/lxd init --storage-backend zfs --auto
fi
43 changes: 42 additions & 1 deletion gadget/gadget-amd64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ volumes:
# UEFI will boot the ESP partition by default first
type: C12A7328-F81F-11D2-BA4B-00A0C93EC93B
# Size of around two seeds to allow for remodeling
size: 1200M
size: 7000M
update:
edition: 2
content:
Expand Down Expand Up @@ -59,3 +59,44 @@ volumes:
filesystem: ext4
type: 0FC63DAF-8483-4772-8E79-3D69D8477DE4
size: 1G

defaults:
system:
experimental.user-daemons: true
experimental.dbus-activation: true
refresh.retain: 2
service.ssh.listen-address: 127.0.0.1
swap.size: 4G

# Connect ubuntu-desktop-session
connections:
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:account-control
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:avahi-control
slot: dVK2PZeOLKA7vf1WPCap9F8luxTk9Oll:avahi-control
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:desktop-launch
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:hardware-observe
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:home
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:hostname-control
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:locale-control
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:login-session-observe
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:login-session-control
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:mount-observe
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:network-control
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:network-observe
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:polkit-agent
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:process-control
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:shutdown
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:system-observe
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:shell-config-files
slot: system:system-files
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:time-control
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:timeserver-control
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:timezone-control
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:upower-observe
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:network-manager
slot: RmBXKl6HO6YOC2DE4G2q1JzWImC04EUy:service
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:bluez
slot: JmzJi9kQvHUWddZ32PDJpBRXUpGRxvNS:service
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:bluetooth-control
- plug: LVkazk0JLrL0ivuHRlv3wp3bK1nAgwtN:cups-control
slot: m1eQacDdXCthEwWQrESei3Zao3d5gfJF:cups-control
12 changes: 9 additions & 3 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
name: pc
name: pc-desktop
version: '24-0.1'
type: gadget
base: core24
build-base: core24
base: core24-desktop
summary: PC gadget for generic devices
description: |
This gadget enables generic pc devices to work with Ubuntu Core
This gadget enables generic pc devices to work with Ubuntu Core Desktop
confinement: strict
grade: stable
platforms:
amd64:
icon: icon.png

#package-repositories:
Expand Down Expand Up @@ -86,3 +89,6 @@ parts:
# We need to install directly in the project dir as snapcraft checks there
# for gadget.yaml instead of looking first at the prime folder.
install -m 644 gadget-"${CRAFT_ARCH_BUILD_FOR}".yaml "${CRAFT_PROJECT_DIR}"/gadget.yaml
extra:
source: ./extra
plugin: dump

0 comments on commit 33eae03

Please sign in to comment.