Skip to content

T8311: fix initramfs hook "dpkg-architecture: command not found"#1127

Merged
c-po merged 1 commit intovyos:currentfrom
c-po:fix-initramfs
Mar 2, 2026
Merged

T8311: fix initramfs hook "dpkg-architecture: command not found"#1127
c-po merged 1 commit intovyos:currentfrom
c-po:fix-initramfs

Conversation

@c-po
Copy link
Member

@c-po c-po commented Feb 28, 2026

Change summary

Commit f487756 ("T8311: De-hardcode arch for live-build-config 10-vyos-addons") introduced a regression where an unavailable third-party helper script was invoked during initramfs hook execution, breaking the ISO build process.

update-initramfs: Generating /boot/initrd.img-6.6.127-vyos
live-boot: core filesystems devices utils wget blockdev.
/etc/initramfs-tools/hooks/10-vyos-addons: line 3: dpkg-architecture: command not found

The dpkg-architecture helper, provided by the dpkg-dev package, is not available during hook execution. The same result can be achieved using GNU coreutils instead:

On x86_64 (aka amd64) both yield the same result:

$ echo $(uname -m)-linux-gnu
x86_64-linux-gnu
$ echo $(dpkg-architecture -qDEB_HOST_MULTIARCH)
x86_64-linux-gnu

On aarch64 (aka arm64) both yield the same result:

$ echo $(uname -m)-linux-gnu
aarch64-linux-gnu
$ echo $(dpkg-architecture -qDEB_HOST_MULTIARCH)
aarch64-linux-gnu

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

How to test / Smoketest result

After the fix, building a new ISO and navigation to the live-boot section shows no more errors:

update-initramfs: Generating /boot/initrd.img-6.6.124-vyos
live-boot: core filesystems devices utils wget blockdev.
(Reading database ... 29750 files and directories currently installed.)
Purging configuration files for smartmontools (7.3-1+b1) ...

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@c-po c-po added the bp/circinus Create automatic backport for circinus label Feb 28, 2026
@github-actions
Copy link

github-actions bot commented Feb 28, 2026

👍
No issues in PR Title / Commit Title

@github-actions github-actions bot added the current VyOS rolling release label Feb 28, 2026
@c-po c-po changed the title T8311: fix "dpkg-architecture: command not found" T8311: fix live-boot hook "dpkg-architecture: command not found" Feb 28, 2026
Commit f487756 ("T8311: De-hardcode arch for live-build-config
10-vyos-addons") introduced a regression where an unavailable third-party
helper script was invoked during initramfs hook execution, breaking the ISO
build process.

  update-initramfs: Generating /boot/initrd.img-6.6.127-vyos
  live-boot: core filesystems devices utils wget blockdev.
  /etc/initramfs-tools/hooks/10-vyos-addons: line 3: dpkg-architecture: command not found

The dpkg-architecture helper, provided by the dpkg-dev package, is not
available during hook execution. The same result can be achieved using GNU
coreutils instead:

On x86_64 (aka amd64) both yield the same result:
  $ echo $(uname -m)-linux-gnu
  x86_64-linux-gnu
  $ echo $(dpkg-architecture -qDEB_HOST_MULTIARCH)
  x86_64-linux-gnu

On aarch64 (aka arm64) both yield the same result:
  $ echo $(uname -m)-linux-gnu
  aarch64-linux-gnu
  $ echo $(dpkg-architecture -qDEB_HOST_MULTIARCH)
  aarch64-linux-gnu
@c-po c-po changed the title T8311: fix live-boot hook "dpkg-architecture: command not found" T8311: fix initramfs hook "dpkg-architecture: command not found" Feb 28, 2026
@c-po c-po requested review from jestabro, sever-sever and zdc February 28, 2026 18:32
Copy link
Member

@dmbaturin dmbaturin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think using uname is probably a good idea because coreutils are guaranteed to be installed in any functional system while everything else is highly variable, and dpkg-dev in chroot serve no other useful purposes.

I find the hardcoded suffix -linux-gnu aesthetically unappealing but I'm happy to go with that because there's no chance we'll realistically support GNU/Hurd or any other kernel in VyOS as a build option, and Debian has no official non-GNU flavors, and the $cpu-$os-$flavor format is very unlikely to change.

Copy link
Member

@sever-sever sever-sever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use (uname -m) instead of dpkg-architecture for chroot.

@c-po c-po merged commit 1dc2c77 into vyos:current Mar 2, 2026
9 checks passed
@vyosbot vyosbot added mirror-initiated This PR initiated for mirror sync workflow mirror-completed and removed mirror-initiated This PR initiated for mirror sync workflow labels Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bp/circinus Create automatic backport for circinus current VyOS rolling release mirror-completed

Development

Successfully merging this pull request may close these issues.

4 participants