summaryrefslogtreecommitdiffstats
path: root/usr.sbin/installboot (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Provide clear errors when trying to install oversized boot loaderkn2020-06-084-4/+25
| | | | | | | | | | | | | | | | 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
* Recommit, now that we found out how to fix the BIOS related issues: gootto2020-03-092-19/+101
| | | | | | | 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@
* Revert previous, there are BIOS that do not like these changes.otto2020-03-072-101/+19
| | | | Sorry for the inconvenience. With help from semarie@.
* Adapt biosboot(8) so it can read boot(8) from an ffs2 filesystem.otto2020-02-282-19/+101
| | | | | | 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@
* don't print a blank line if no stage1 or stage2 aspectsderaadt2019-10-291-6/+8
|
* Fix copyright lines, the "one-inode file system" in i386_softraid.c is myotto2019-09-023-5/+4
| | | | | 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@
* snprintf/vsnprintf return < 0 on error, rather than -1.deraadt2019-07-031-3/+3
|
* When system calls indicate an error they return -1, not some arbitraryderaadt2019-06-288-24/+24
| | | | | | 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.
* Revert last. Breaks landisk snap building for currently unknownkrw2018-12-131-10/+27
| | | | | | reason. Noticed by deraadt@
* Don't allow the bootstrap to overlap the start of the OpenBSD area ofkrw2018-11-251-27/+10
| | | | | | | the disk. Even if the OpenBSD area starts with FS_UNUSED or FS_BOOT partitions. ok deraadt@ as part of larger diff
* avoid freeing r twice in error case; OK otto@miko2018-11-071-2/+2
|
* Remove 'overlap_allowance' parameter from bootstrap().krw2018-09-014-9/+9
| | | | | | It was added to support Vax. Vax is dead Jim. ok deraadt@
* installboot: adapt fileprefix() to future realpath(3) behaviorjcs2018-07-031-9/+25
| | | | | | | | | | | | 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
* Use <elf.h> instead of <elf_abi.h>mpi2017-10-272-4/+4
| | | | ok jasper@, jca@, deraadt@
* Malloc the superblock buffer to make sure that it is properly aligned.naddy2017-06-041-4/+6
| | | | | On i386, clang puts the char array at an odd address in .bss. ok deraadt@
* Add arm64 support.kettenis2017-05-072-3/+20
| | | | ok tom@
* Merge identical amd64 and i386 stanzas.krw2016-08-141-7/+2
| | | | Requested & ok jsing@
* Use more compact idiom to select architecture dependent files to compile. Nokrw2016-07-201-55/+7
| | | | | | | | intentional functional change. Diff from Miod. ok millert@ deraadt@
* Rename findmbrlinux() to findmbrfat(). This function was originallyjsg2016-06-021-4/+4
| | | | | | searching for a linux partition type, now it looks for a fat type. ok kettenis@
* Add support for armv7. Fix an error message in the i386 support beforekettenis2016-05-313-4/+270
| | | | | | creating more copies. ok deraadt@, jsing@
* Use PATH_MAX instead of a hardcoded minimal value. Stack space is cheap andkettenis2016-05-231-2/+2
| | | | | | this isn't the kernel. requested by deraadt@
* remove hppa64 port, which we never got going beyond broken single users.deraadt2016-05-112-43/+1
| | | | | | 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
* Plug a couple of leaks of input buffers.krw2016-04-282-2/+5
| | | | Pointed out by David Carlier.
* We are done providing support for the vax.deraadt2016-03-092-62/+1
| | | | lots of agreement.
* sync() requires unistd.htobiasu2016-02-181-1/+2
| | | | | | Reported by Sigi Rudzio. Thanks! "go for it" deraadt@
* sync() needs unistd.htobiasu2016-01-151-1/+2
|
* Replace lseek/[read|write] with pread|pwrite.krw2015-12-283-34/+23
| | | | ok millert@ a while ago.
* Make gpt_chk_mbr() instances even more identicaller by alwayskrw2015-12-241-2/+2
| | | | | returning 0 or 1 since only boolean checks of the result are done. No need for EINVAL as a return value.
* Make all instances of gpt_chk_mbr() identical (bar static vskrw2015-12-241-6/+4
| | | | | | 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.
* Add prototype for gpt_chk_mbr() to i386_installboot.c. Add 'static' tokrw2015-12-241-2/+3
| | | | | declarations of gpt_chk_mbr() to match prototypes in efidev.c and softraid.c.
* Remove unnecessary options:rpe2015-12-201-3/+3
| | | | | | | - in fsck_msdos, '-f' option is a no-op - newfs_msdos does not need '-t msdos' OK krw@
* Remove NULL-checks before free(). ok tb@mmcc2015-12-101-3/+2
|
* Steal code from kern/subr_disk.c to check for a protective MBR beforekrw2015-12-011-1/+52
| | | | using GPT info. Otherwise GPT remnants might become revenants.
* aviion went awayderaadt2015-12-011-5/+1
|
* Don't need <sys/types.h> and <sys/param.h>. Nuke the former when DEV_BSIZEkrw2015-12-012-4/+2
| | | | is needed.
* Revert the sync -> fsync conversion (at least for the time being) - therejsing2015-11-304-9/+14
| | | | | is a good chance that this is causing the 'No blocks to load' errors that various people have encountered.
* give up on pledge for now.deraadt2015-11-291-4/+1
| | | | this will have to wait until jsing and stsp find time to look at it.
* Apply pledge.deraadt2015-11-265-15/+13
| | | | | The people I asked to review this did not get back to me, so we will test this a different way.
* fix a memory leak in multiple error pathsjsg2015-11-041-6/+8
| | | | ok krw@
* fix a memory leak in an error pathjsg2015-11-031-2/+4
|
* Backout the backout of installboot softraid non-gpt case fix.stsp2015-10-281-1/+7
| | | | krw and I crossed streams
* Revert GPT change. Breaks non-GPT install/upgrade.krw2015-10-281-7/+1
| | | | Found the hard way by reyk@
* In sr_install_bootblk for i386, don't clobber 'part' in non-GPT case.stsp2015-10-281-5/+5
| | | | | | Found the hard way by reyk@. stupid mistake stsp@ ok reyk@
* Fix installboot(8) on i386/amd64 when softraid is on top of GPT.stsp2015-10-253-5/+11
| | | | ok krw deraadt
* Add parenthesis gcc wants and remove defined but unused label gcckrw2015-10-191-4/+3
| | | | | | complains about. ok deraadt@ on parethesis
* LABELSECTOR is a DEV_BSIZE quantity. So multiply by DEV_BSIZE and notkrw2015-10-191-3/+6
| | | | | | d_secsize when calculating disklabel location. ok jsing@
* Nuke unused variable.krw2015-10-191-2/+2
|
* Fix comments.rpe2015-10-181-3/+3
| | | | OK krw@
* Check file sizes only for regular files. The current code breaks savecoretobias2015-10-161-3/+3
| | | | | | due to its kvm handling. ok deraadt
* Merge nlist out of boundary access fix with other nlist implementations.tobias2015-10-161-31/+55
| | | | | | While at it, merge style and typo fixes back into nlist(3), too. ok deraadt, jsing, millert