Project

General

Profile

Actions

Feature #7537

closed

want nextboot (one time boot) support

Added by Toomas Soome almost 7 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
zfs - Zettabyte File System
Start date:
2016-11-06
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:
External Bug:

Description

Originally created by Andriy Gapon as https://reviews.freebsd.org/D7612.

The idea is to provide an mechanism for "one time" boot config, meaning, if such config is set, the system will read and remove this config on next boot, and the followup boot will use normal (permanent) boot configuration.

The "nextboot" configuration is stored in pool label pad2 area, which is currently otherwise unused. The boot loader will read the pad2 content, and will remove the config by zeroing the pad2 area, so the next boot will not see the nextboot config and will use normal bootfs property based setup.

Since in illumos the boot environments are managed by beadm command, I don't see much need for another separate tool, so I did extent beadm activate to have two addition options, -t to set nextboot config and -T to remove it. Also beadm list and bootadm list-menu are updated to present the information.

Use case example:

root@test:/home/tsoome# beadm activate -t test
Activated successfully
root@test:/home/tsoome# beadm list
BE             Active Mountpoint Space Policy Created
multiboot-16   -      -          5,56M static 2016-10-30 23:53
multiboot-17   NR     /          106K  static 2016-11-06 13:42
test           T      -          12,6G static 2016-11-06 13:45
root@test:/home/tsoome#

and after reboot:

tsoome@test:~$ beadm list
BE             Active Mountpoint Space Policy Created
multiboot-16   -      -          5,56M static 2016-10-30 23:53
multiboot-17   R      -          2,42M static 2016-11-06 13:42
test           N      /          12,7G static 2016-11-06 13:45
tsoome@test:~$

Some time has passed since this work was started, now the current update is based on two changes:
https://reviews.freebsd.org/D25512
and
https://github.com/openzfs/zfs/commit/108a454a4604df6ea3be817f3cf076726df2c67a

We are using nvlist based data encoding in bootenv area (previous pad2), we provide tooling to update nvlist from os and from boot loader. This way we can implement persistent data storage.

Loader zfs reader is updated to handle bootenv nvlist read and write, and nvlist updates (remove pair, add pair).

From OS userland, the data translation to/from nvlist is done in libzfsbootenv.

The initial publication of this change is https://illumos.org/rb/r/249/, now also available on Gerrit.


Related issues

Related to illumos gate - Feature #13062: loader: make env_discard() publicClosedToomas Soome

Actions
Related to illumos gate - Bug #13444: libbe_py should provide nextboot informationClosedAndy Fiddaman

Actions
Related to illumos gate - Bug #13693: loader: we should support pools without featuresClosedToomas Soome

Actions
Actions #1

Updated by Electric Monk about 3 years ago

  • Gerrit CR set to 777
Actions #2

Updated by Toomas Soome about 3 years ago

  • Description updated (diff)
Actions #3

Updated by Toomas Soome about 3 years ago

Actions #4

Updated by Electric Monk almost 3 years ago

  • Status changed from New to Closed
  • % Done changed from 80 to 100

git commit b713c91e508f40be7797bedd4ae1146ef0652625

commit  b713c91e508f40be7797bedd4ae1146ef0652625
Author: Toomas Soome <tsoome@me.com>
Date:   2020-11-13T17:03:33.000Z

    7537 want nextboot (one time boot) support
    Reviewed by: Jason King <jason.brian.king+illumos@gmail.com>
    Reviewed by: Andy Fiddaman <andy@omniosce.org>
    Reviewed by: C Fraire <cfraire@me.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions #5

Updated by Andy Fiddaman over 2 years ago

  • Related to Bug #13444: libbe_py should provide nextboot information added
Actions #6

Updated by Toomas Soome over 2 years ago

  • Related to Bug #13693: loader: we should support pools without features added
Actions

Also available in: Atom PDF