Up to [local] / src / usr.sbin / installboot
Request diff between arbitrary revisions
Default branch: MAIN
Revision 1.15 / (download) - annotate - [select for diffs], Wed Sep 17 16:12:10 2025 UTC (2 weeks, 3 days ago) by deraadt
Branch: MAIN
CVS Tags: HEAD
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)
use DL_PARTNUM2NAME and DL_PARTNAME2NUM instead of arithmetic relative to 'a'
Revision 1.14 / (download) - annotate - [select for diffs], Sat Feb 22 21:19:22 2025 UTC (7 months, 1 week ago) by kettenis
Branch: MAIN
CVS Tags: OPENBSD_7_7_BASE,
OPENBSD_7_7
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)
Avoid null-pointer deref in the non-GPT case for installboot -c. ok patrick@, deraadt@
Revision 1.13 / (download) - annotate - [select for diffs], Wed Feb 19 21:30:46 2025 UTC (7 months, 2 weeks ago) by kettenis
Branch: MAIN
Changes since 1.12: +28 -12 lines
Diff to previous 1.12 (colored)
Add -c option that sets up the machine to boot from the specified disk. For now, this is only implemented on amd64 and arm64 machines that use UEFI and a GPT partition table. Will be used by the installer soon. ok deraadt@, kn@
Revision 1.12 / (download) - annotate - [select for diffs], Fri Nov 8 10:43:07 2024 UTC (10 months, 3 weeks ago) by kettenis
Branch: MAIN
Changes since 1.11: +9 -1 lines
Diff to previous 1.11 (colored)
Only install a second copy of the bootloader if the EFI System Partition is at least 1MB. This should prevent us from filling up the tiny ESPs that we used to create a few releases ago. ok deraadt@
Revision 1.11 / (download) - annotate - [select for diffs], Wed Oct 30 16:22:33 2024 UTC (11 months ago) by kettenis
Branch: MAIN
Changes since 1.10: +35 -1 lines
Diff to previous 1.10 (colored)
Install a copy of the UEFI bootloader in /efi/openbsd on the EFI system partition. This will allow us to create boot options for the firmware boot manager that other OSes won't interfere with. ok phessler@, tobhe@, kn@
Revision 1.10 / (download) - annotate - [select for diffs], Wed Apr 26 18:04:21 2023 UTC (2 years, 5 months ago) by kn
Branch: MAIN
CVS Tags: OPENBSD_7_6_BASE,
OPENBSD_7_6,
OPENBSD_7_5_BASE,
OPENBSD_7_5,
OPENBSD_7_4_BASE,
OPENBSD_7_4
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)
Fix confusing comments, no object change; with caspar
Revision 1.9 / (download) - annotate - [select for diffs], Tue Nov 22 14:37:58 2022 UTC (2 years, 10 months ago) by kn
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE,
OPENBSD_7_3
Changes since 1.8: +3 -2 lines
Diff to previous 1.8 (colored)
Add missing parantheses around if block Stated during review but missed in the previous commit.
Revision 1.8 / (download) - annotate - [select for diffs], Tue Nov 22 09:53:46 2022 UTC (2 years, 10 months ago) by tobhe
Branch: MAIN
Changes since 1.7: +60 -2 lines
Diff to previous 1.7 (colored)
Copy apple-boot firmware to EFI system partition. This enables automatic bootloader updates on Apple Silicon computers. We rely on fw_update(8) to place apple-boot.bin in /etc/firmware. installboot(8) will pick it up from there and copy it to $ESP/m1n1/boot.bin, if this directory exists. The m1n1 directory and original boot.bin are created by the Asahi Linux installer as part of the initial UEFI environment. The firmware package was manually tested by many. Regress, installation and upgrade with and without apple-boot.bin tested by me. Feedback and ok kettenis@ kn@
Revision 1.7 / (download) - annotate - [select for diffs], Sun Nov 6 12:33:41 2022 UTC (2 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.6: +4 -1 lines
Diff to previous 1.6 (colored)
Don't leak args.fspec in create_filesystem(). ok kn@
Revision 1.6 / (download) - annotate - [select for diffs], Wed Sep 14 16:43:00 2022 UTC (3 years ago) by kn
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE,
OPENBSD_7_2
Changes since 1.5: +8 -11 lines
Diff to previous 1.5 (colored)
Backout "Reflect script failure in exit code" amd64 install using (G)PT seems busted as reported by tb
Revision 1.5 / (download) - annotate - [select for diffs], Fri Sep 9 15:53:16 2022 UTC (3 years ago) by kn
Branch: MAIN
Changes since 1.4: +12 -9 lines
Diff to previous 1.4 (colored)
Reflect script failure in exit code installboot(8) runs newfs(8) and fsck(8) via system(3) but only checks failures of the function itself, always returning zero no matter what the programs/shell returned. This is bad for regress tests relying on correct return codes. create_filesystem() itself must not exit as write_filesystem() calls it and cleans up temporary files upon failure. Make it return -1 if the script returned non-zero so write_filesystem() handles it as error, cleans up and makes installboot exit 1. Stop ignoring create_filesystem()'s return code in md_prepareboot() and exit the same way. Here's the change in behaviour on arm64 (newfs fails because of the vnd/disklabel race, see "Race in disk_attach_callback?" on tech@): # installboot -vp vnd0 ; echo $? newfsing 6694ae5b0d7596ed.i newfs_msdos: /dev/r6694ae5b0d7596ed.i: No such file or directory 0 # ./obj/installboot -vp vnd0 ; echo $? newfsing 6694ae5b0d7596ed.i newfs_msdos: /dev/r6694ae5b0d7596ed.i: No such file or directory 1 Tested on amd64 arm64 macppc octeon powerpc64 sparc64 OK millert
Revision 1.4 / (download) - annotate - [select for diffs], Wed Sep 7 10:21:03 2022 UTC (3 years ago) by kn
Branch: MAIN
Changes since 1.3: +3 -1 lines
Diff to previous 1.3 (colored)
Fix passing explicit stage files Every platform ought to set `stages', `stage1' and optionally `stage2' in md_init(), otherwise passing explicit files results won't work as `stages' is zero-initialised and no default path is set: # installboot -v sd0 /root/BOOTAA64.EFI usage: installboot [-npv] [-r root] disk [stage1] This is correct synopsis and ought to work, but efi_installboot.c has an empty md_init(). Set stage bits to fix this: # ./obj/installboot -nv sd0 /root/BOOTAA64.EFI Using / as root would install bootstrap on /dev/rsd0c using first-stage /root/BOOTAA64.EFI would copy /root/BOOTAA64.EFI to /tmp/installboot.2bGhLGT1eF/efi/boot/bootaa64.efi would write /tmp/installboot.2bGhLGT1eF/efi/boot/startup.nsh This makes regress/usr.sbin/installboot pass on armv7, arm64 and riscv64 (while being lucky or carrying miod's fix for the kernel disklabel race manifesting on vnd).
Revision 1.3 / (download) - annotate - [select for diffs], Wed Aug 31 20:52:15 2022 UTC (3 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.2: +3 -3 lines
Diff to previous 1.2 (colored)
Replace "newfs_msdos" and "fsck_msdos" with "newfs -t msdos" and "fsck -t msdos". Add some missing spaces after "=". Constify the static strings. Prodded a while ago by deraadt@, tweaks from kn@, ok kn@
Revision 1.2 / (download) - annotate - [select for diffs], Thu Feb 3 10:25:14 2022 UTC (3 years, 8 months ago) by visa
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE,
OPENBSD_7_1
Changes since 1.1: +34 -39 lines
Diff to previous 1.1 (colored)
installboot(8): Adjustments for EFI platforms Reduce #ifdef'ing within the control logic to make it clearer that there are no essential differences in behaviour between the platforms. Make installboot(8) write startup.nsh to enable simpler and more consistent code in install.md. Input and OK kettenis@ deraadt@
Revision 1.1 / (download) - annotate - [select for diffs], Thu Feb 3 10:21:13 2022 UTC (3 years, 8 months ago) by visa
Branch: MAIN
Rename armv7_installboot.c to efi_installboot.c. The code is common to EFI platforms, not specific to armv7. Suggested by kettenis@