Skip to content
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

core-initrd: fix some issues with ubuntu-core-initramfs package builds #14909

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions core-initrd/24.04/debian/changelog
Original file line number Diff line number Diff line change
@@ -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 <[email protected]> Wed, 08 Jan 2025 13:51:11 -0500

ubuntu-core-initramfs (68) noble; urgency=medium

[ Valentin David ]
Expand Down
2 changes: 1 addition & 1 deletion core-initrd/24.04/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion core-initrd/24.04/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 17 additions & 2 deletions core-initrd/build-source-pkgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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
Expand All @@ -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
6 changes: 6 additions & 0 deletions core-initrd/latest/debian/changelog
Original file line number Diff line number Diff line change
@@ -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 <[email protected]> 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.
Expand Down
2 changes: 1 addition & 1 deletion core-initrd/latest/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion core-initrd/latest/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tests/lib/core-initrd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading