From 2ddd00cf504c8f2259bd57e531f9de5261fbcaa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alfonso=20S=C3=A1nchez-Beato?= Date: Wed, 8 Jan 2025 14:13:29 -0500 Subject: [PATCH 1/5] core-initrd: build changelong automatically Create new changelog entry when creating new ubuntu-core-initramfs debian source packages. Tweak the version so now it includes snapd version and Ubuntu series. --- core-initrd/build-source-pkgs.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/core-initrd/build-source-pkgs.sh b/core-initrd/build-source-pkgs.sh index 35dcb0d6cd7..a5948c16dc9 100755 --- a/core-initrd/build-source-pkgs.sh +++ b/core-initrd/build-source-pkgs.sh @@ -23,9 +23,12 @@ else commit=$(git rev-parse HEAD) fi -# build info file +# build info file, source the created file to get the variables pushd .. ./mkversion.sh +# shellcheck disable=SC1091 +. data/info +SNAPD_VERSION=$VERSION popd contains_element() { @@ -74,7 +77,13 @@ if [ "$#" -eq 0 ]; then set -- "${deb_dir[@]%/debian}" fi for rel; do - if [ "$rel" != latest ]; then + series=$(dpkg-parsechangelog --file "$rel"/debian/changelog --show-field Distribution) + if [ "$rel" = latest ]; then + ubuntu_ver=$(ubuntu-distro-info --series="$series" -r) + # We might have "xx.xx LTS" + ubuntu_ver=${ubuntu_ver%% *} + else + ubuntu_ver=$rel for p in latest/*; do file=${p#latest/} if contains_element "$file" "${no_link[@]}"; then @@ -86,6 +95,12 @@ for rel; do pushd "$rel" cp -a ../snapd-initramfs/* . + + curr_ver=$(dpkg-parsechangelog --show-field Version) + initrd_ver=${curr_ver%%+*} + next_ver="$initrd_ver"+"$SNAPD_VERSION"+"$ubuntu_ver" + dch -v "$next_ver" "Update to snapd version $SNAPD_VERSION" + dch --distribution "$series" -r "" dpkg-buildpackage -S -sa -d popd done From 3a215841350040dc842c86247aec16a8429daffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alfonso=20S=C3=A1nchez-Beato?= Date: Wed, 8 Jan 2025 14:15:08 -0500 Subject: [PATCH 2/5] core-initrd: move golang to build dependency It was incorrectly a run dependecy. --- core-initrd/24.04/debian/control | 2 +- core-initrd/latest/debian/control | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core-initrd/24.04/debian/control b/core-initrd/24.04/debian/control index 17821633c2a..e20cd7e0b3c 100644 --- a/core-initrd/24.04/debian/control +++ b/core-initrd/24.04/debian/control @@ -7,6 +7,7 @@ Build-Depends: debhelper-compat (= 13), dh-python, cpio, fakeroot, fonts-ubuntu, + golang-go (>=2:1.18~) [!powerpc] | golang-1.18 [!powerpc] | golang-1.21, intel-microcode [amd64] Standards-Version: 4.4.1 Homepage: https://launchpad.net/ubuntu-core-initramfs @@ -15,7 +16,6 @@ Package: ubuntu-core-initramfs Architecture: amd64 arm64 armhf riscv64 Depends: ${python3:Depends}, ${misc:Depends}, dracut-core (>= 051-1), python3:any, - golang-go (>=2:1.18~) [!powerpc] | golang-1.18 [!powerpc] | golang-1.21, dracut-core, busybox-initramfs, zstd, diff --git a/core-initrd/latest/debian/control b/core-initrd/latest/debian/control index 809ffb955f7..92e5b0a428c 100644 --- a/core-initrd/latest/debian/control +++ b/core-initrd/latest/debian/control @@ -7,6 +7,7 @@ Build-Depends: debhelper-compat (= 13), dh-python, cpio, fakeroot, fonts-ubuntu, + golang-go (>=2:1.18~) [!powerpc] | golang-1.18 [!powerpc] | golang-1.21, intel-microcode [amd64] Standards-Version: 4.4.1 Homepage: https://launchpad.net/ubuntu-core-initramfs @@ -15,7 +16,6 @@ Package: ubuntu-core-initramfs Architecture: amd64 arm64 armhf riscv64 Depends: ${python3:Depends}, ${misc:Depends}, dracut-core (>= 051-1), python3:any, - golang-go (>=2:1.18~) [!powerpc] | golang-1.18 [!powerpc] | golang-1.21, dracut-core, busybox-initramfs, zstd, From e0d683f1a66e89c14ab0f8e08e840c1676700075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alfonso=20S=C3=A1nchez-Beato?= Date: Wed, 8 Jan 2025 14:16:20 -0500 Subject: [PATCH 3/5] core-initrd: fix launchpad builds Launchpad dos not allow change in the root of the debian package directory, create the go cache elsewhere. --- core-initrd/24.04/debian/rules | 2 +- core-initrd/latest/debian/rules | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core-initrd/24.04/debian/rules b/core-initrd/24.04/debian/rules index 44cd58a780d..a4647976811 100755 --- a/core-initrd/24.04/debian/rules +++ b/core-initrd/24.04/debian/rules @@ -44,7 +44,7 @@ ifeq (${FIPSBUILD},1) fi endif # dh-golang sets GO111MODULE=off if present, fix that - GO111MODULE=on go build -mod=vendor $(BUILDFLAGS) $(SNAP_TAGS) ./cmd/snap-bootstrap + GOCACHE=/tmp/cache GO111MODULE=on go build -mod=vendor $(BUILDFLAGS) $(SNAP_TAGS) ./cmd/snap-bootstrap override_dh_auto_install: rm -rf debian/tmp diff --git a/core-initrd/latest/debian/rules b/core-initrd/latest/debian/rules index 44cd58a780d..a4647976811 100755 --- a/core-initrd/latest/debian/rules +++ b/core-initrd/latest/debian/rules @@ -44,7 +44,7 @@ ifeq (${FIPSBUILD},1) fi endif # dh-golang sets GO111MODULE=off if present, fix that - GO111MODULE=on go build -mod=vendor $(BUILDFLAGS) $(SNAP_TAGS) ./cmd/snap-bootstrap + GOCACHE=/tmp/cache GO111MODULE=on go build -mod=vendor $(BUILDFLAGS) $(SNAP_TAGS) ./cmd/snap-bootstrap override_dh_auto_install: rm -rf debian/tmp From 7cf6add48456f1cb9724468dd94d011a0845ad63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alfonso=20S=C3=A1nchez-Beato?= Date: Wed, 8 Jan 2025 14:17:19 -0500 Subject: [PATCH 4/5] core-initrd: update changelog to match the one in snappy-dev PPA --- core-initrd/24.04/debian/changelog | 6 ++++++ core-initrd/latest/debian/changelog | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/core-initrd/24.04/debian/changelog b/core-initrd/24.04/debian/changelog index f459d2b9a09..58b5ce469ad 100644 --- a/core-initrd/24.04/debian/changelog +++ b/core-initrd/24.04/debian/changelog @@ -1,3 +1,9 @@ +ubuntu-core-initramfs (69+2.67+git124.g98d9ab6+24.04) noble; urgency=medium + + * Update to snapd version 2.67+git124.g98d9ab6 + + -- Alfonso Sanchez-Beato Wed, 08 Jan 2025 13:51:11 -0500 + ubuntu-core-initramfs (68) noble; urgency=medium [ Valentin David ] diff --git a/core-initrd/latest/debian/changelog b/core-initrd/latest/debian/changelog index dd545950a85..6cfa1a0128a 100644 --- a/core-initrd/latest/debian/changelog +++ b/core-initrd/latest/debian/changelog @@ -1,3 +1,9 @@ +ubuntu-core-initramfs (70+2.67+git124.g98d9ab6+24.10) oracular; urgency=medium + + * Update to snapd version 2.67+git124.g98d9ab6 + + -- Alfonso Sanchez-Beato Wed, 08 Jan 2025 13:52:06 -0500 + ubuntu-core-initramfs (69) oracular; urgency=medium * Add systemd-cryptsetup, which is now a separate package, and libkmod2. From 1408e6448a05f80ed5f1e4cb35f5389bdbfa53c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alfonso=20S=C3=A1nchez-Beato?= Date: Wed, 8 Jan 2025 16:05:13 -0500 Subject: [PATCH 5/5] tests/lib/core-initrd.sh: add some additional packages to build the ubuntu-core-initramfs source packages. --- tests/lib/core-initrd.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/lib/core-initrd.sh b/tests/lib/core-initrd.sh index 9ca87a4ddb0..6054546c382 100644 --- a/tests/lib/core-initrd.sh +++ b/tests/lib/core-initrd.sh @@ -6,9 +6,9 @@ build_and_install_initramfs_deb() ( pushd "$PROJECT_PATH"/core-initrd - # For dpkg-parsechangelog (used by mkversion.sh too) and to have - # the tools needed to build the source package. - quiet eatmydata apt-get install -y dpkg-dev debhelper + # For dpkg-parsechangelog, dch, and ubuntu-distro-info (used by + # mkversion.sh) and to have the tools needed to build the source package. + quiet eatmydata apt-get install -y dpkg-dev debhelper devscripts distro-info codename=$(lsb_release -c -s) latest=$(dpkg-parsechangelog --file latest/debian/changelog --show-field Distribution) if [ "$codename" = "$latest" ]; then