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

Fix a bug in freebsd-14.x due to changes in bsdinstall #1573

Merged
merged 2 commits into from
Jul 22, 2024

Conversation

antonalekseev
Copy link
Contributor

Description

Initially the problem was like

❯ vagrant init bento/freebsd-14.0-arm64
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
❯ vagrant up
Bringing machine 'default' up with 'vmware_desktop' provider...
==> default: Cloning VMware VM: 'bento/freebsd-14.0-arm64'. This can take some time...
==> default: Checking if box 'bento/freebsd-14.0-arm64' version '202401.31.0' is up to date...
==> default: Verifying vmnet devices are healthy...
==> default: Preparing network adapters...
==> default: Starting the VMware VM...
==> default: Waiting for the VM to receive an address...
==> default: Forwarding ports...
    default: -- 22 => 2222
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Authentication failure. Retrying...
    default: Warning: Authentication failure. Retrying...
    default: Warning: Authentication failure. Retrying...
    default: Warning: Authentication failure. Retrying...

Really, there was no .ssh in vagrants $HOME

❯ vagrant ssh
(vagrant@127.0.0.1) Password for vagrant@:
Last login: Thu Jul 18 23:38:48 2024 from 172.16.12.1
FreeBSD 14.0-RELEASE (GENERIC) #0 releng/14.0-n265380-f9716eee8ab4: Fri Nov 10 05:54:07 UTC 2023

Welcome to FreeBSD!

[...]
$ ls .ssh
ls: .ssh: No such file or directory

It turns out that since FreeBSD 14.0 bsdinstall reverted to it's former behaviour
and creates ZFS dataset for home rather than /usr/home 1 2

This PR fixes the issue, while preserving the former behaviour for the major versions of FreeBSD < 14, namely freebsd-13.x images.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (non-breaking change that does not add functionality or fix an issue)

Checklist:

  • I have read the CONTRIBUTING document.
  • I have run the pre-merge tests locally and they pass.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • If Gemfile.lock has changed, I have used --conservative to do it and included the full output in the Description above.
  • All new and existing tests passed.
  • All commits have been signed-off for the Developer Certificate of Origin.

Footnotes

  1. https://github.com/freebsd/freebsd-src/commit/3bb92304b4fe79babd19ba0d9c74d29af9117a22

  2. https://reviews.freebsd.org/D40086

Since FreeBSD 14.0, bsdinstall creates ZFS dataset for `home` rather
than `/usr/home`, see
freebsd/freebsd-src@3bb9230.
This way, the previous workaround was broken, preventing the normal
provisioning of the default Vagrant public keys.

Signed-off-by: Anton Alekseev <anton@alekseev.cc>
@antonalekseev antonalekseev requested review from Stromweld and a team as code owners July 18, 2024 22:45
Copy link
Collaborator

@Stromweld Stromweld left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

sonarcloud bot commented Jul 22, 2024

@Stromweld Stromweld merged commit 4496079 into chef:main Jul 22, 2024
5 checks passed
hunleyd added a commit to hunleyd/bento that referenced this pull request Sep 5, 2024
* 'main' of github.com:chef/bento:
  Update ubuntu-24.04 to latest ISO urls (24.04 to 24.04.1) (chef#1577)
  Fix arm64 builds for debian 11 (chef#1571)
  Fix a bug in freebsd-14.x due to changes in bsdinstall (chef#1573)
  🐛 fix shell exec err (chef#1572)
devmuppet added a commit to devmuppet/bento_box that referenced this pull request Oct 24, 2024
* Add FreeBSD 14.0-RELEASE (chef#1538)

Signed-off-by: Li-Wen Hsu <lwhsu@lwhsu.org>

* Fix os_arch of freebsd-13-aarch64 config (chef#1539)

Signed-off-by: Li-Wen Hsu <lwhsu@lwhsu.org>

* Bump almalinux minor versions (chef#1540)

* - update to rockylinux 9.3 (chef#1542)

* Bump Debian to v12.4, released December 10th, 2023 (chef#1541)

* Update latest OS versions and fix arm64 build list command (chef#1543)

* Update latest OS versions and fix arm64 build list command
---------

* Fix upload public/private flag lookup (chef#1544)

* fix upload public or private flag lookup
* oracle 7 cleanup script error removing linux-firmware
* ubuntu 23.10 post install command on file that doesn't exist

* vagrant cloud cpu architecture support added (chef#1546)

* vagrant cloud cpu architecture support added

* fix metadata basename (chef#1548)

fixed metadata base_boxname
updated debian 11 to 11.9
updated debian 12 to 12.5

* Fix waiting for ssh - ubuntu netplan dhcp-identifer format error (chef#1550)

* bumped iso url versions (chef#1553)

* Update to FreeBSD 13.3 (chef#1556)

* Update (chef#1559)

Add amz Linux 2023 and update testing scripts

* switch to ubuntu-latest runners (chef#1561)

- Add back iso check, packer lint, and amazonlinux builds to build pipeline
- Fix amazonlinux 2 build script
- Added amazonlinux 2023 build scripts
- Migrate Virtualbox and Qemu builds to github hosted runners from self-hosted runners
- Added test-kitchen and kitchen-vagrant dependencies to gemspec
- Added arg for bento test command to specify a specific build to test - this passes the arg to the kitchen test command
- Fix vagrant post-processor to specify custom vagrant file for freebsd builds
- Remove gui true from windows custom vagrant file
- Fix test to skip removing linux-firmware on oraclelinux
- Renamed oracle boxes to oraclelinux for consistency and remove edge cases in code
- Removed unused -c flag for specifying a specific config file for bento build
- Added --on-error flag to bento build command to pass to packer command
- Added cpu architecture support to bento build command, so it'll only test builds that work with the current cpu architecture
- Remove additional Ubuntu user-date last-command that may be locking macaddress
- Add to test to move failed test boxes to builds/failed_testing directory
- Changed ssh_timeout to 15m

* fix typo in README (chef#1554)

* fix typo in README
* fix virtio-win.iso directory in README
* fix mount of downloaded iso in qemu
* Upgrade Windows 11 to 23H2

* add macos build (chef#1566)

- Require ruby >= 3.0.0
- Add parallels-ipsw source
- Added MacOS template for parallels-ipsw
- Created MacOS scripts
- Adjusted build flags to all be lower case for consistency
- Removed extra amazonlinux directories to be more consistent with other builds
- Added build_files directory for all temp files to be stored in during packer building
- Opensuse-leap-15.5 updated to 15.6
- Remove Fedora 38 and add 40 builds
- Remove Ubuntu 23.10 and add 24.04 builds

* Fix qemu_format="raw" causing wrong format for qemu (chef#1568)

* setup workflow for hosted runners (chef#1547)

* setup workflow for hosted runners

* bump AlmaLinux 8 version to 8.10 (chef#1569)

* update OS versions (chef#1570)

* update OS versions

---------

Signed-off-by: Corey Hemminger <hemminger@hotmail.com>

* 🐛 fix shell exec err (chef#1572)

Signed-off-by: acejilam <acejilam@gmail.com>

* Fix a bug in freebsd-14.x due to changes in bsdinstall (chef#1573)

Since FreeBSD 14.0, bsdinstall creates ZFS dataset for `home` rather
than `/usr/home`, see
freebsd/freebsd-src@3bb9230.
This way, the previous workaround was broken, preventing the normal
provisioning of the default Vagrant public keys.

Signed-off-by: Anton Alekseev <anton@alekseev.cc>
Co-authored-by: Corey Hemminger <hemminger@hotmail.com>

* Fix arm64 builds for debian 11 (chef#1571)

* fix open-vm-tools installation in debian11

Signed-off-by: fgierlinger <2966031+fgierlinger@users.noreply.github.com>

* prevent "unknown ioctl 1976" log spam

Signed-off-by: fgierlinger <2966031+fgierlinger@users.noreply.github.com>

---------

Signed-off-by: fgierlinger <2966031+fgierlinger@users.noreply.github.com>
Co-authored-by: Corey Hemminger <hemminger@hotmail.com>

* Update ubuntu-24.04 to latest ISO urls (24.04 to 24.04.1) (chef#1577)

Signed-off-by: Phillip Ross <phillip.w.g.ross@gmail.com>

* update hashicorp/qemu packer plugin to fix QEMU build, supporting efi_drop_efivars variable (chef#1580)

* update Ubuntu Jammy releases (chef#1578)

* update Ubuntu releases

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* 23.10 removed

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

---------

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
Co-authored-by: Corey Hemminger <hemminger@hotmail.com>

* Bump Debian from 12.5 to 12.7 (chef#1579)

Signed-off-by: Seth Grover <seth.d.grover@gmail.com>

* add Ubuntu 24.10 (Oracular Oriole) (chef#1583)

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

---------

Signed-off-by: Li-Wen Hsu <lwhsu@lwhsu.org>
Signed-off-by: Corey Hemminger <hemminger@hotmail.com>
Signed-off-by: acejilam <acejilam@gmail.com>
Signed-off-by: Anton Alekseev <anton@alekseev.cc>
Signed-off-by: fgierlinger <2966031+fgierlinger@users.noreply.github.com>
Signed-off-by: Phillip Ross <phillip.w.g.ross@gmail.com>
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
Signed-off-by: Seth Grover <seth.d.grover@gmail.com>
Co-authored-by: Li-Wen Hsu <lwhsu@lwhsu.org>
Co-authored-by: Shawn Kelly O'Shea <shawn@eth0.net>
Co-authored-by: Phillip Ross <phillipross@users.noreply.github.com>
Co-authored-by: Seth Grover <13872653+mmguero@users.noreply.github.com>
Co-authored-by: Corey Hemminger <hemminger@hotmail.com>
Co-authored-by: Theo Dickinson <theodson@gmail.com>
Co-authored-by: Jimmy Huang <jimmy.huang@duragility.com>
Co-authored-by: Matthias Blümel <blaimi@blaimi.de>
Co-authored-by: Daniel Widerin <daniel@widerin.net>
Co-authored-by: ls-2018 <m202140037@xs.ustb.edu.cn>
Co-authored-by: Anton Alekseev <anton@alekseev.cc>
Co-authored-by: fgierlinger <2966031+fgierlinger@users.noreply.github.com>
Co-authored-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants