History log of /freebsd/sbin/reboot/reboot.c (Results 1 – 25 of 123)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# bec5a3c0 14-Jan-2025 Warner Losh <imp@FreeBSD.org>

nextboot: Smarter warning about deleting nextboot

Read only filesystems always error when trying to remove something
with EROFS. However, that's true even if the file isn't there. The
code assumed i

nextboot: Smarter warning about deleting nextboot

Read only filesystems always error when trying to remove something
with EROFS. However, that's true even if the file isn't there. The
code assumed it would always get a ENOENT if the file wasn't there,
but produced a gross message on read only systems. This message was
harmless, but annoying. Instead, stat the file first and return if
it's already not there.

Some readings of POSIX require that the ENOENT error take precidence
over the EROFS error. Linux made this change years ago, and we should
too. POSIX.1-2024 isn't explicit, but does say for unlink() does say
"[EROFS] The directory entry to be unlinked is part of a read-only file
system" and "[ENOENT] A component of path does not name an existing
file" implying that EROFS should only be returned for an existing
file. FreeBSD doesn't implement this, so this workaround is
necessary. Ideally, we'd fix this in the kernel in the future.

Sponsored by: Netflix
Discussed with: jrtc23
Differential Revision: https://reviews.freebsd.org/D48425

show more ...


Revision tags: release/14.2.0, release/13.4.0, release/14.1.0
# ff7de3b4 30-May-2024 John Baldwin <jhb@FreeBSD.org>

nextboot: Permit ZFS boot filesystems mounted at the pool's root

This restores nextboot -k on ZFS setups where /boot is on the root
dataset of a pool.

Reviewed by: jrtc27, glebius
Fixes: 0c3ade2cf

nextboot: Permit ZFS boot filesystems mounted at the pool's root

This restores nextboot -k on ZFS setups where /boot is on the root
dataset of a pool.

Reviewed by: jrtc27, glebius
Fixes: 0c3ade2cf13d nextboot: fix nextboot -k on ZFS
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D45306

show more ...


# 87e63f2e 03-Apr-2024 Mark Johnston <markj@FreeBSD.org>

nextboot: Write nextboot.conf safely

As in the old nextboot.sh script:
- First write everything to a tempfile instead of /boot/nextboot.conf.
- fsync() the tempfile before renaming it to nextboot.co

nextboot: Write nextboot.conf safely

As in the old nextboot.sh script:
- First write everything to a tempfile instead of /boot/nextboot.conf.
- fsync() the tempfile before renaming it to nextboot.conf.

Fixes: fd6d47375a78 ("rescue,nextboot: Install nextboot as a link to reboot, rm nextboot.sh")
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44572

show more ...


Revision tags: release/13.3.0
# bad90cb4 22-Feb-2024 Warner Losh <imp@FreeBSD.org>

nextboot: check unlink, but only warn on !ENOENT

Emulate rm -f from the nextboot.sh script: Report all errors, except
ENOENT. This problems show through, except the expected one when
nextboot.conf i

nextboot: check unlink, but only warn on !ENOENT

Emulate rm -f from the nextboot.sh script: Report all errors, except
ENOENT. This problems show through, except the expected one when
nextboot.conf isn't there.

Sponsored by: Netflix
Reviewed by: rew
Differential Revision: https://reviews.freebsd.org/D44013

show more ...


# 07cba2dd 21-Feb-2024 Warner Losh <imp@FreeBSD.org>

reboot: Emulate nextboot -D better

It used to produce no output when the file couldn't be removed. Emulate
that better by unlinking and ignoring errors. It's used at the end of
reboot always, even w

reboot: Emulate nextboot -D better

It used to produce no output when the file couldn't be removed. Emulate
that better by unlinking and ignoring errors. It's used at the end of
reboot always, even when the file isn't going to be there.

Sponsored by: Netflix
Fixes: 2c479548119a

show more ...


# 0c3ade2c 20-Feb-2024 Gleb Smirnoff <glebius@FreeBSD.org>

nextboot: fix nextboot -k on ZFS

zfsbootcfg(1) expects pool name to operate on, not currently mounted
filesystem name.

Fixes: fd6d47375a78fbf0737012b7cc11180291781e8b


# 3aefe675 20-Feb-2024 Gleb Smirnoff <glebius@FreeBSD.org>

nextboot: fix typo that merged two args into one

Fixes: fd6d47375a78fbf0737012b7cc11180291781e8b


# 2546c543 18-Feb-2024 Warner Losh <imp@FreeBSD.org>

reboot: Move extern for environ

envorin isn't defined in any header, and gcc is cranky with this inside
a function, so move it to global scope. Both clang and gcc are now happy
with this.

Sponsored

reboot: Move extern for environ

envorin isn't defined in any header, and gcc is cranky with this inside
a function, so move it to global scope. Both clang and gcc are now happy
with this.

Sponsored by: Netflix

show more ...


# 4d0be398 18-Feb-2024 Warner Losh <imp@FreeBSD.org>

reboot: Remove sys/types.h: it's not needed here...


# 33a2406e 16-Feb-2024 Warner Losh <imp@FreeBSD.org>

reboot: Use posix_spawn instead of system

Use posix_spawn to avoid having to allocate memory needed for the system
command line.

Sponsored by: Netflix
Reviewed by: jrtc27
Differential Revision: h

reboot: Use posix_spawn instead of system

Use posix_spawn to avoid having to allocate memory needed for the system
command line.

Sponsored by: Netflix
Reviewed by: jrtc27
Differential Revision: https://reviews.freebsd.org/D43860

show more ...


# e32de962 15-Feb-2024 Warner Losh <imp@FreeBSD.org>

reboot: initialize howto

Make static analyzers happy by initialzing howto to 0. Coverity is
cranky that it could be used unused. But it's analysis is incomplete
because the args to getopt when it wa

reboot: initialize howto

Make static analyzers happy by initialzing howto to 0. Coverity is
cranky that it could be used unused. But it's analysis is incomplete
because the args to getopt when it wasn't initialized preclude it from
being used.

show more ...


# 994cc839 12-Feb-2024 Warner Losh <imp@FreeBSD.org>

reboot: Allow this to be installed as nextboot

Allow nextboot to be a symlink link to reboot. It does everything reboot
does, except doesn't actually setup the sytem to reboot and reboot. Also,
don'

reboot: Allow this to be installed as nextboot

Allow nextboot to be a symlink link to reboot. It does everything reboot
does, except doesn't actually setup the sytem to reboot and reboot. Also,
don't accept the reboot args related to rebooting when in nextboot mode.

Sponsored by: Netflix
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D43830

show more ...


# 91d24077 12-Feb-2024 Warner Losh <imp@FreeBSD.org>

reboot: Implement -o to set kernel options for next boot

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D43829


# 9dcf6cbd 12-Feb-2024 Warner Losh <imp@FreeBSD.org>

reboot: Implement -k in terms of env

kernel isn't special, beyond the sanity checks we do. Add it to the env
rather than pass it into write_nextboot().

Sponsored by: Netflix
Reviewed by: kevans,

reboot: Implement -k in terms of env

kernel isn't special, beyond the sanity checks we do. Add it to the env
rather than pass it into write_nextboot().

Sponsored by: Netflix
Reviewed by: kevans, kib
Differential Revision: https://reviews.freebsd.org/D43828

show more ...


# ecc83424 12-Feb-2024 Warner Losh <imp@FreeBSD.org>

reboot: Implement -e from nextboot

Implement -e foo=bar to add loader environment variables to
nextboot.conf. bar is enclosed in quotes if it isn't already.

Sponsored by: Netflix
Differential Revi

reboot: Implement -e from nextboot

Implement -e foo=bar to add loader environment variables to
nextboot.conf. bar is enclosed in quotes if it isn't already.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D43827

show more ...


# 0df5f659 12-Feb-2024 Warner Losh <imp@FreeBSD.org>

reboot: Implement zfs support

Implement full support for ZFS -k support. For ZFS, we have to set a
property that gets cleared by the boot loaeder for whether or not to
process nextboot.conf. Do this

reboot: Implement zfs support

Implement full support for ZFS -k support. For ZFS, we have to set a
property that gets cleared by the boot loaeder for whether or not to
process nextboot.conf. Do this using system("zfsbootcfg..." rather than
coding the small subset of that program inline to avoid CDDL
contamination of reboot and the complications of disabling CDDL and/or
ZFS. The few bytes needed to implement reboot for systems with zfs is
not worth saving for systems w/o ZFS.

Only set nextboot_enable=YES for UFS filesystems. They are the only one
that need that as the first line. Its presence on ZFS can cause the
kernel to not be oneshot.

Sponsored by: Netflix
Reviewed by: kevans, kib
Differential Revision: https://reviews.freebsd.org/D43824

show more ...


# 2c479548 12-Feb-2024 Warner Losh <imp@FreeBSD.org>

reboot: Implement -D from nextboot

Implement -D from nextboot.sh which deletes the nextboot.conf file and
exists.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D43822


# cfeedadf 12-Feb-2024 Warner Losh <imp@FreeBSD.org>

reboot: Add sanity checking of write to nextboot.conf

Add sanity checking to the write to nextboot. Move to separate function
and allow force to override all errors. If we can't write nextboot.conf,

reboot: Add sanity checking of write to nextboot.conf

Add sanity checking to the write to nextboot. Move to separate function
and allow force to override all errors. If we can't write nextboot.conf,
don't silently fail anymore.

Sponsored by: Netflix
Reviewed by: kevans, kib, markj, jhb
Differential Revision: https://reviews.freebsd.org/D43803

show more ...


# 7cb1a0e6 12-Feb-2024 Warner Losh <imp@FreeBSD.org>

reboot: Don't reboot if the next kernel isn't there

reboot -k garbage won't boot garbage unless /boot/garbage/kernel is
there. Refuse to reboot if it is missing, though allow -f to force
it for spec

reboot: Don't reboot if the next kernel isn't there

reboot -k garbage won't boot garbage unless /boot/garbage/kernel is
there. Refuse to reboot if it is missing, though allow -f to force
it for special-use cases. This is in keeping with nextboot.sh.

Sponsored by: Netflix
Reviewed by: kevans, kib, markj, emaste
Differential Revision: https://reviews.freebsd.org/D43802

show more ...


# 7a3210f2 12-Feb-2024 Warner Losh <imp@FreeBSD.org>

reboot: convert flags to bools

Convert all the command line flags to bools, since that's how we use
them. Sort the includes while adding stdbool.h.

Sponsored by: Netflix
Reviewed by: kevans, kib,

reboot: convert flags to bools

Convert all the command line flags to bools, since that's how we use
them. Sort the includes while adding stdbool.h.

Sponsored by: Netflix
Reviewed by: kevans, kib, emaste
Differential Revision: https://reviews.freebsd.org/D43801

show more ...


# a78bc42b 12-Feb-2024 Warner Losh <imp@FreeBSD.org>

reboot: Disallow -k and -r, it doesn't make sense.

When we're re-rooting to a new /, there is no next kernel. Error out
rather than leaving a timebomb in /boot/nextboot.conf.

Sponsored by: Netflix

reboot: Disallow -k and -r, it doesn't make sense.

When we're re-rooting to a new /, there is no next kernel. Error out
rather than leaving a timebomb in /boot/nextboot.conf.

Sponsored by: Netflix
Reviewed by: kevans, kib, emaste
Differential Revision: https://reviews.freebsd.org/D43800

show more ...


# 0b8224d1 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

Remove copyright strings ifdef'd out

We've ifdef'd out the copyright strings for some time now. Go ahead and
remove the ifdefs. Plus whatever other detritis was left over from other
recent removals.

Remove copyright strings ifdef'd out

We've ifdef'd out the copyright strings for some time now. Go ahead and
remove the ifdefs. Plus whatever other detritis was left over from other
recent removals. These copyright strings are present in the comments and
are largely from CSRG's attempt at adding their copyright to every
binary file (which modern interpretations of the license doesn't
require).

Sponsored by: Netflix

show more ...


# 51e16cb8 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

sbin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl

sbin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix

show more ...


# a294b02f 13-Nov-2023 Konstantin Belousov <kib@FreeBSD.org>

reboot(8): print syscall error on sysctl failure

Noted by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D42561


# 194cc45a 13-Nov-2023 Konstantin Belousov <kib@FreeBSD.org>

reboot(8): adapt for vmmeter v_swappgsin expansion to 64bit

Otherwise reboot(8) requires COMPAT_FREEBSD11 kernel config option.

PR: 275048
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MF

reboot(8): adapt for vmmeter v_swappgsin expansion to 64bit

Otherwise reboot(8) requires COMPAT_FREEBSD11 kernel config option.

PR: 275048
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D42561

show more ...


12345