Bug #11782
closedreboot -f ends up creating bad /boot/transient.conf
100%
Description
A command such as the following:
reboot -f -- "/platform/i86pc/kernel/amd64/unix -B console=ttya"
causes reboot to invoke
uadmin()
with boot arguments including a quoted boot path. uadmin calls bootadm:bootadm -m update_temp -o '/platform/i86pc/kernel/amd64/unix -B zfs-bootfs=rpool/ROOT/20191003,bootpath="/pci@0,0/pci1af4,2@4/blkdev@0,0:b" -B console=ttya'
which creates a
/boot/transient.conf
file that loader cannot parse due to the quote characters around the bootpath.% cat /boot/transient.conf bootfile="/platform/i86pc/kernel/amd64/unix;unix" boot-args="-B zfs-bootfs=rpool/ROOT/20191003,bootpath="/pci@0,0/pci1af4,2@4/blkdev@0,0:b" -B console=ttya"
One place that this occurs is when a stale boot archive is detected during boot. In that case filesystem/usr
reboots the system using a command such as this.
Updated by Toomas Soome over 3 years ago
Andy Fiddaman wrote:
A command such as the following:
[...]
causes reboot to invokeuadmin()
with boot arguments including a quoted boot path. uadmin calls bootadm:
[...]
which creates a/boot/transient.conf
file that loader cannot parse due to the quote characters around the bootpath.
[...]One place that this occurs is when a stale boot archive is detected during boot. In that case
filesystem/usr
reboots the system using a command such as this.
Missing backslashes or apostrophes.
with apostrophes:
ok show boot-args -B zfs-bootfs=rpool/ROOT/20191003,bootpath="/pci@0,0/pci1af4,2@4/blkdev@0,0:b" -B console=ttya ok
yep, this is bug in bootadm.
Updated by Andy Fiddaman over 3 years ago
bootadm testing:
bloody% beadm list BE Active Mountpoint Space Policy Created 20190926 - - 28.3M static 2019-09-26 09:23 20191003 - - 37.5M static 2019-10-03 10:27 test - - 42.5M static 2019-10-04 13:44 2019100501-onu NR / 48.0G static 2019-10-05 09:20 bloody% pfexec bootadm -m update_temp -o '/platform/i86pc/kernel/amd64/unix -B zfs-bootfs=rpool/ROOT/20191003,bootpath="/pci@0,0/pci1af4,2@4/blkdev@0,0:b" -B console=ttya' bloody% cat /boot/transient.conf bootfile='/platform/i86pc/kernel/amd64/unix;unix' boot-args='-B zfs-bootfs=rpool/ROOT/20191003,bootpath="/pci@0,0/pci1af4,2@4/blkdev@0,0:b" -B console=ttya' bloody% pfexec init 6
Type '?' for a list of commands, 'help' for more detailed help. ok show boot-args -B zfs-bootfs=rpool/ROOT/20191003,bootpath="/pci@0,0/pci1af4,2@4/blkdev@0,0:b" -B console=ttya ok boot Loading /platform/i86pc/kernel/amd64/unix... Loading /platform/i86pc/amd64/boot_archive... Loading /platform/i86pc/amd64/boot_archive.hash... Booting... Loading kmdb... unix: forcing kpti to OFF due to boot argument SunOS Release 5.11 Version omnios-ba_reboot-ebcfd43a90 64-bit Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2017-2019 OmniOS Community Edition (OmniOSce) Association. Hostname: bloody bloody console login: root Password: OmniOS 5.11 omnios-master-f6dc5c6aa0 October 2019 root@bloody:~# root@bloody:~# beadm list BE Active Mountpoint Space Policy Created 20190926 - - 28.3M static 2019-09-26 09:23 20191003 N / 37.6M static 2019-10-03 10:27 test - - 42.5M static 2019-10-04 13:44 2019100501-onu R - 48.0G static 2019-10-05 09:20
Updated by Electric Monk over 3 years ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
git commit e39d848858aa235e4715efe1293ed57ddb0231c5
commit e39d848858aa235e4715efe1293ed57ddb0231c5 Author: Andy Fiddaman <omnios@citrus-it.co.uk> Date: 2019-10-11T21:19:23.000Z 11782 reboot -f ends up creating bad /boot/transient.conf 11783 Print a message when rebooting due to a stale boot archive Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: Dominik Hassler <hadfl@omniosce.org> Approved by: Dan McDonald <danmcd@joyent.com>