Skip to content

Commit

Permalink
Merge pull request #132 from alfonsosanchezbeato/fix-focal-run
Browse files Browse the repository at this point in the history
Use patchelf to make sure the dynamic linker from the base is used
  • Loading branch information
sil2100 authored Jun 28, 2023
2 parents 660487a + 00d6d3d commit 03dabad
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ ubuntu-image (3.0+23.04ubuntu2) UNRELEASED; urgency=medium
* Don't scan build machine for OS entries when generating GRUB config:
dpkg-divert os-prober around update-grub.

[ Alfonso Sanchez-Beato ]
* Run patchelf so we get dynamic linker and libs from the core22 base.

-- mjdonis <[email protected]> Thu, 11 May 2023 12:29:08 +0200

ubuntu-image (2.2+22.10ubuntu1) kinetic; urgency=medium
Expand Down
13 changes: 10 additions & 3 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ summary: Create Ubuntu images
description: |
Official tool for building Ubuntu images, currently supporing Ubuntu Core
snap-based images and preinstalled Ubuntu classic images.
version: 3.0+snap3
version: 3.0+snap4
grade: stable
confinement: classic
base: core22
Expand All @@ -22,7 +22,7 @@ apps:

parts:
ubuntu-image:
plugin: go
plugin: nil
source: .
source-type: git
build-packages:
Expand All @@ -42,8 +42,15 @@ parts:
- make
- kpartx
- qemu-utils
build-attributes: [ enable-patchelf ]
override-build: |
snapcraftctl build
ins_bin=$SNAPCRAFT_PART_INSTALL/bin/
mkdir -p "$ins_bin"
# Make ubuntu-image statically compiled to avoid libc deps.
# We need this as setting interpreter/rpath is known to cause
# issues with go binaries (https://github.com/NixOS/patchelf/issues/146).
# On compiling statically go, see https://mt165.co.uk/blog/static-link-go/
CGO_ENABLED=0 go build -o "$ins_bin" ./cmd/ubuntu-image/
# create a symlink /usr/bin/fakeroot -> /usr/bin/fakeroot-tcp
cd $SNAPCRAFT_PART_INSTALL/usr/bin/
ln -s fakeroot-tcp fakeroot
Expand Down

0 comments on commit 03dabad

Please sign in to comment.