summaryrefslogtreecommitdiff
path: root/usr.sbin/installboot
AgeCommit message (Collapse)Author
2022-02-03installboot(8): Adjustments for EFI platformsVisa Hankala
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@
2022-02-03Rename armv7_installboot.c to efi_installboot.c.Visa Hankala
The code is common to EFI platforms, not specific to armv7. Suggested by kettenis@
2022-02-02Add missing mode argument to open(2) with O_CREAT.Visa Hankala
2021-10-24For open/openat, if the flags parameter does not contain O_CREAT, theTheo de Raadt
3rd (variadic) mode_t parameter is irrelevant. Many developers in the past have passed mode_t (0, 044, 0644, or such), which might lead future people to copy this broken idiom, and perhaps even believe this parameter has some meaning or implication or application. Delete them all. This comes out of a conversation where tb@ noticed that a strange (but intentional) pledge behaviour is to always knock-out high-bits from mode_t on a number of system calls as a safety factor, and his bewilderment that this appeared to be happening against valid modes (at least visually), but no sorry, they are all irrelevant junk. They could all be 0xdeafbeef. ok millert
2021-07-20Add -p option to "prepare" (newfs) a filesystem that will be used forMark Kettenis
the bootloader. This is a no-op on architectures where such a filesystem isn't needed. ok krw@, deraadt@
2021-06-27reuse armv7 installboot for riscv64Jonathan Gray
ok deraadt@
2021-06-03typoTheo de Raadt
2021-06-02Use the same logic in all copies of gpt_chk_mbr(), relaxing theKenneth R Westerback
media length check to allow EFI GPT partitions to be smaller that the entire disk. Consistently use GPTSECTOR instead of randomly tossing in some literal '1's. ok kettenis@
2021-06-02Add GPT support; stolen from i386_installboot.c.Mark Kettenis
ok krw@, deraadt@
2020-07-22force long-names on msdos filenames, so that folk can see pretty namesTheo de Raadt
later. ok kettenis gkoehler
2020-07-19Should use ufs_args here after all.Visa Hankala
While here, make messages more correct.
2020-07-18use correct structure for mounting, duhTheo de Raadt
ok visa kettenis
2020-07-18Create grub.cfg file as requiredTheo de Raadt
ok kettenis
2020-07-17Add powerpc64 support; straight copy from octeon.Mark Kettenis
ok deraadt@
2020-06-27convert macppc, octeon, and loongson to use MI installboot, removingTheo de Raadt
special case scripting in install.md. (macppc still requires manual steps for HFS bootmode) tested by krw, visa, gkoehler
2020-06-08Provide clear errors when trying to install oversized boot loaderkn
sparc64 installboot(8) on softraid(4) with too large files, e.g. unstripped builds, fails poorly with "installboot: softraid installboot failed". This is due to the BIOCINSTALLBOOT ioctl(2) returing the default EINVAL rather than using softraid's sr_error() interface properly; additionally, installboot does not check for such message from the bio(4) layer. Make the kernel generate "boot block too large" and "boot loader too large" messages for softraid devices and have installboot act upon them analogous to bioctl(8), by adapting its bio_status() into the new sr_status() helper. Input, reminder to look at bioctl, same kernel diff from, OK jsing
2020-03-09Recommit, now that we found out how to fix the BIOS related issues: goOtto Moerbeek
back to a 4 byte add instruction. We do not know *why* though, so if somebody likes a challenge... Lots of help from semarie@ who has a few systems showing the issue. ok deraadt@
2020-03-07Revert previous, there are BIOS that do not like these changes.Otto Moerbeek
Sorry for the inconvenience. With help from semarie@.
2020-02-28Adapt biosboot(8) so it can read boot(8) from an ffs2 filesystem.Otto Moerbeek
To do this, installboot(8) patches an extra value into biosboot(8). Code originally from Pedro Martelletto with a twist from myself and kettenis@; ok jsing@ kettenis@
2019-10-29don't print a blank line if no stage1 or stage2 aspectsTheo de Raadt
2019-09-02Fix copyright lines, the "one-inode file system" in i386_softraid.c is myOtto Moerbeek
invention; and I have had little to do with the i386_installboot.[ch] files. This was mixed up in the giant reshuffle a few years back. ok jsing@
2019-07-03snprintf/vsnprintf return < 0 on error, rather than -1.Theo de Raadt
2019-06-28When system calls indicate an error they return -1, not some arbitraryTheo de Raadt
value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
2018-12-13Revert last. Breaks landisk snap building for currently unknownKenneth R Westerback
reason. Noticed by deraadt@
2018-11-25Don't allow the bootstrap to overlap the start of the OpenBSD area ofKenneth R Westerback
the disk. Even if the OpenBSD area starts with FS_UNUSED or FS_BOOT partitions. ok deraadt@ as part of larger diff
2018-11-07avoid freeing r twice in error case; OK otto@miko
2018-09-01Remove 'overlap_allowance' parameter from bootstrap().Kenneth R Westerback
It was added to support Vax. Vax is dead Jim. ok deraadt@
2018-07-03installboot: adapt fileprefix() to future realpath(3) behaviorJoshua Stein
This was relying on realpath(3) working for paths that don't exist yet, which will be changing soon. Use a combination of dirname(3), realpath(3), and basename(3) to construct a sane path while still ensuring that the target directory exists. with martijn ok martijn, deraadt
2017-10-27Use <elf.h> instead of <elf_abi.h>Martin Pieuchot
ok jasper@, jca@, deraadt@
2017-06-04Malloc the superblock buffer to make sure that it is properly aligned.Christian Weisgerber
On i386, clang puts the char array at an odd address in .bss. ok deraadt@
2017-05-07Add arm64 support.Mark Kettenis
ok tom@
2016-08-14Merge identical amd64 and i386 stanzas.Kenneth R Westerback
Requested & ok jsing@
2016-07-20Use more compact idiom to select architecture dependent files to compile. NoKenneth R Westerback
intentional functional change. Diff from Miod. ok millert@ deraadt@
2016-06-02Rename findmbrlinux() to findmbrfat(). This function was originallyJonathan Gray
searching for a linux partition type, now it looks for a fat type. ok kettenis@
2016-05-31Add support for armv7. Fix an error message in the i386 support beforeMark Kettenis
creating more copies. ok deraadt@, jsing@
2016-05-23Use PATH_MAX instead of a hardcoded minimal value. Stack space is cheap andMark Kettenis
this isn't the kernel. requested by deraadt@
2016-05-11remove hppa64 port, which we never got going beyond broken single users.Theo de Raadt
hppa reverse-stack gives us a valuable test case, but most developers don't have a 2nd one to proceed further with this. ok kettenis
2016-04-28Plug a couple of leaks of input buffers.Kenneth R Westerback
Pointed out by David Carlier.
2016-03-09We are done providing support for the vax.Theo de Raadt
lots of agreement.
2016-02-18sync() requires unistd.hTobias Ulmer
Reported by Sigi Rudzio. Thanks! "go for it" deraadt@
2016-01-15sync() needs unistd.hTobias Ulmer
2015-12-28Replace lseek/[read|write] with pread|pwrite.Kenneth R Westerback
ok millert@ a while ago.
2015-12-24Make gpt_chk_mbr() instances even more identicaller by alwaysKenneth R Westerback
returning 0 or 1 since only boolean checks of the result are done. No need for EINVAL as a return value.
2015-12-24Make all instances of gpt_chk_mbr() identical (bar static vsKenneth R Westerback
non-static) by passing disk size as 2nd parameter instead of the different structures holding the disk size info. The fifth copy of gpt_chk_mbr() in fdisk is a little specialer. No functional change.
2015-12-24Add prototype for gpt_chk_mbr() to i386_installboot.c. Add 'static' toKenneth R Westerback
declarations of gpt_chk_mbr() to match prototypes in efidev.c and softraid.c.
2015-12-20Remove unnecessary options:Robert Peichaer
- in fsck_msdos, '-f' option is a no-op - newfs_msdos does not need '-t msdos' OK krw@
2015-12-10Remove NULL-checks before free(). ok tb@mmcc
2015-12-01Steal code from kern/subr_disk.c to check for a protective MBR beforeKenneth R Westerback
using GPT info. Otherwise GPT remnants might become revenants.
2015-12-01aviion went awayTheo de Raadt
2015-12-01Don't need <sys/types.h> and <sys/param.h>. Nuke the former when DEV_BSIZEKenneth R Westerback
is needed.