summaryrefslogtreecommitdiff
path: root/usr.sbin/installboot
AgeCommit message (Collapse)Author
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.
2015-11-30Revert the sync -> fsync conversion (at least for the time being) - thereJoel Sing
is a good chance that this is causing the 'No blocks to load' errors that various people have encountered.
2015-11-29give up on pledge for now.Theo de Raadt
this will have to wait until jsing and stsp find time to look at it.
2015-11-26Apply pledge.Theo de Raadt
The people I asked to review this did not get back to me, so we will test this a different way.
2015-11-04fix a memory leak in multiple error pathsJonathan Gray
ok krw@
2015-11-03fix a memory leak in an error pathJonathan Gray
2015-10-28Backout the backout of installboot softraid non-gpt case fix.Stefan Sperling
krw and I crossed streams
2015-10-28Revert GPT change. Breaks non-GPT install/upgrade.Kenneth R Westerback
Found the hard way by reyk@
2015-10-28In sr_install_bootblk for i386, don't clobber 'part' in non-GPT case.Stefan Sperling
Found the hard way by reyk@. stupid mistake stsp@ ok reyk@
2015-10-25Fix installboot(8) on i386/amd64 when softraid is on top of GPT.Stefan Sperling
ok krw deraadt
2015-10-19Add parenthesis gcc wants and remove defined but unused label gccKenneth R Westerback
complains about. ok deraadt@ on parethesis
2015-10-19LABELSECTOR is a DEV_BSIZE quantity. So multiply by DEV_BSIZE and notKenneth R Westerback
d_secsize when calculating disklabel location. ok jsing@
2015-10-19Nuke unused variable.Kenneth R Westerback
2015-10-18Fix comments.Robert Peichaer
OK krw@
2015-10-16Check file sizes only for regular files. The current code breaks savecoreTobias Stoeckmann
due to its kvm handling. ok deraadt
2015-10-16Merge nlist out of boundary access fix with other nlist implementations.Tobias Stoeckmann
While at it, merge style and typo fixes back into nlist(3), too. ok deraadt, jsing, millert
2015-10-15Add an extra argument to bootstrap() to allow for a limited overlap between anMiod Vallat
existing partition and the boot blocks span, and update all callers to require an overlap limit of zero sectors (thus not changing their behaviour). Then, add proper support for vax: copy the 2nd-stage boot block to /boot and install the 1st-stage boot block at the beginning of the disk, retaining the disklabel; allow for an overlap of up to 16 sectors, which is perfectly fine as long as your `a' partition is FFS. Note that regular installs will not even have such an overlap, because the default OpenBSD span on a disk on vax starts at sector 16, but installation media use sperific layout which require this. ok krw@
2015-10-15give up; include stdlib.h from the .h file, sighTheo de Raadt
2015-10-14worse, need even more includes...Theo de Raadt
2015-10-14add includes for crc32() and uuid_dec_be() missed in rev 1.11Jonathan Gray
ok krw@
2015-10-14Backout last. Breaks sparc64, amoung other dubiousness.Kenneth R Westerback
requested by deraadt@
2015-10-12Check that the disk specified on the command line is the disk thatKenneth R Westerback
files are copied to. Error out with 'cross-device install' if not. ok millert@, ok deraadt@ & jsing@ for previous version
2015-10-11needs at least some include love; choosing <stdlib.h>Theo de Raadt
2015-10-08Refactor fileprefix() and filecopy() to use warn() instead of err()Kenneth R Westerback
to display error message, and to return error indications (NULL and -1 respectively). Use the error indications in write_efisystem() to unwind in the face of more error conditions. In other cases just exit(1) to emulation current behaviour. ok deraadt@
2015-10-07Add initial support for installing UEFI boot files to a GTP EFI SystemKenneth R Westerback
Partition. Further work to be done in-tree. ok deraadt@
2015-10-05Out, damned whitespace!Kenneth R Westerback