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

bastille upgrade cannot upgrade from release to itself #300

Closed
lifepillar opened this issue Dec 30, 2020 · 4 comments
Closed

bastille upgrade cannot upgrade from release to itself #300

lifepillar opened this issue Dec 30, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@lifepillar
Copy link

I have recently updated my host from 12.1-RELEASE to 12.2-RELEASE. Today, I have tried for the first time to upgrade my jails, currently based on 12.1-RELEASE. For that, I have successfully run bastille update 12.1-RELEASE, then I have rebooted. Now, when I try:

bastille upgrade 12.1-RELEASE 12.2-RELEASE  

or, equivalently:

freebsd-update -b /data/bastille/releases/12.1-RELEASE -r 12.2-RELEASE upgrade

I get this error:

freebsd-update: Cannot upgrade from 12.2-RELEASE to itself

Any idea why? freebsd-version in any of my jails still outputs 12.1-RELEASE-p12. My Bastille configuration is essentially the default one, except that I have disabled ZFS and changed bastille_prefix to /data/bastille. The original release was bootstrapped with bastille bootstrap 12.1-RELEASE.

Bastille and FreeBSD version (paste bastille -v && freebsd-version -kru output)

0.7.20200714
12.2-RELEASE-p1
12.2-RELEASE-p1
12.2-RELEASE-p2

How did you install bastille? (port/pkg/git)

port

@lifepillar lifepillar added the bug Something isn't working label Dec 30, 2020
@zachfi
Copy link

zachfi commented Jan 1, 2021

I see this too. Confused how to upgrade.

@johnjgsmith
Copy link

Getting the same issue here.

@JRGTH
Copy link
Collaborator

JRGTH commented Jan 10, 2021

Hello, a fix has been applied in this PR: ed8ff8b to properly upgrade base RELEASE, the update is a two step as expected but I will briefly explain it here.

Usage:
bastille upgrade 12.1-RELEASE 12.2-RELEASE
bastille upgrade 12.1-RELEASE 12.2-RELEASE -f
bastille upgrade 12.1-RELEASE install
bastille upgrade 12.1-RELEASE install -f
Where -f|--force may be useful to: Force freebsd-update fetch to proceed in the case of an unfinished upgrade.

Current issue example:

root@nas-mserver: ~# bastille upgrade 12.1-RELEASE 12.2-RELEASE -f
src component not installed, skipped
freebsd-update: Cannot upgrade from 12.2-RELEASE to itself
root@nas-mserver: ~# bastille cmd test freebsd-version
[test]:
12.1-RELEASE-p10

After patch applied examples

Upgrade Step #1 (I optionally used --force option here):

root@nas-mserver: ~# bastille upgrade 12.1-RELEASE 12.2-RELEASE -f
src component not installed, skipped
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching metadata signature for 12.1-RELEASE from update1.freebsd.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... done.

The following components of FreeBSD seem to be installed:
kernel/generic world/base world/doc

The following components of FreeBSD do not seem to be installed:
kernel/generic-dbg world/base-dbg world/lib32 world/lib32-dbg

Does this look reasonable (y/n)? y

Fetching metadata signature for 12.2-RELEASE from update1.freebsd.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... done.
Preparing to download files... done.
The following files will be removed as part of updating to
12.2-RELEASE-p2:
/etc/rc.d/abi
/usr/include/c++/v1/experimental/any
/usr/include/c++/v1/experimental/chrono
/usr/include/c++/v1/experimental/numeric
/usr/include/c++/v1/experimental/optional
...................
........................
..............................
/var/db/etcupdate/current/etc/termcap.small
/var/db/mergemaster.mtree
/var/db/services.db
/var/yp/Makefile.dist
To install the downloaded upgrades, run "/usr/sbin/freebsd-update install".

Please run 'bastille upgrade 12.1-RELEASE install' to finish installing updates.

**Upgrade Step #2:

root@nas-mserver: ~# bastille upgrade 12.1-RELEASE install
src component not installed, skipped
Installing updates...
Kernel updates have been installed.  Please reboot and run
"/usr/sbin/freebsd-update install" again to finish installing updates.
root@nas-mserver: ~# bastille upgrade 12.1-RELEASE install
src component not installed, skipped
Installing updates...Scanning /mnt/storage/bastille/releases/12.1-RELEASE/usr/share/certs/blacklisted for certificates...
Scanning /mnt/storage/bastille/releases/12.1-RELEASE/usr/share/certs/trusted for certificates...
 done.
root@nas-mserver: ~# bastille cmd test freebsd-version
[test]:
12.2-RELEASE-p2

Notes:
The base RELEASE will remains named as 12.1-RELEASE despite it has been upgraded to 12.2-RELEASE as expected, and this should remains this way since there may be the case an user already has been bootstrapped the 12.2-RELEASE.

Alternatively an user can also bootstrap an 12.2-RELEASE, then stop the jail then manually edit config files to make the thinjail to point to the new RELEASE path, IIRC I've created a command called change in order to make this configuration dynamically but never got much of attention but will look for again.

As expected UPGRADING a base RELEASE will affect all child containers depending on said RELEASE, so be warned.

Similar upgrade steps for Thickjail Here: #273

Regards

@bmac2
Copy link
Collaborator

bmac2 commented Oct 19, 2023

@JRGTH put this in a PR in JAN 2021. Closing as fixed.

@bmac2 bmac2 closed this as completed Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants