git: 33510b16e663 - stable/14 - nextboot: Reimplement missing -a option

From: Dag-Erling Smørgrav <des_at_FreeBSD.org>
Date: Sat, 13 Dec 2025 22:55:54 UTC
The branch stable/14 has been updated by des:

URL: https://cgit.FreeBSD.org/src/commit/?id=33510b16e663bde5be5e4a56ccb17f848c41ef4e

commit 33510b16e663bde5be5e4a56ccb17f848c41ef4e
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2025-12-13 22:46:25 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2025-12-13 22:54:14 +0000

    nextboot: Reimplement missing -a option
    
    PR:             260520
    MFC after:      3 days
    Fixes:          e307eb94ae52 ("loader: zfs should support bootonce an nextboot")
---
 sbin/reboot/nextboot.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sbin/reboot/nextboot.sh b/sbin/reboot/nextboot.sh
index 0c9cca51eb8d..5b8611b499ab 100644
--- a/sbin/reboot/nextboot.sh
+++ b/sbin/reboot/nextboot.sh
@@ -115,6 +115,10 @@ set -e
 
 nextboot_tmp=$(mktemp $(dirname ${nextboot_file})/nextboot.XXXXXX)
 
+if [ ${append} = "YES" -a -f ${nextboot_file} ]; then
+	cp -f ${nextboot_file} ${nextboot_tmp}
+fi
+
 if [ -n "${zfs}" ]; then
 	zfsbootcfg -z ${zfs} -n freebsd:nvstore -k nextboot_enable -v YES
 	cat >> ${nextboot_tmp} << EOF