Commit Graph

16 Commits

Author SHA1 Message Date
Warner Losh
d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Jessica Clarke
1a9b1c367f release: Add support for building on non-FreeBSD
This requires two sets of changes. Firstly, for non-FreeBSD, we do not
know where tools are in PATH (and it is likely that some are not in
system directories and have been built as bootstrap tools during the
build), so we should leave PATH alone and trust the user. Secondly,
makefs needs a master.passwd for building images from a METALOG file, so
pass the directory in the image tree to makefs's -N option in order to
pick up a valid FreeBSD master.passwd; this is unnecessary on FreeBSD
(except in the edge case of building an image that refers to users or
groups not present in the host's database, which is unlikely but
technically possible) but harmless so can be done unconditionally.

Reviewed by:	brooks, emaste, gjb
Differential Revision:	https://reviews.freebsd.org/D34001
2022-02-28 22:37:37 +00:00
Jessica Clarke
13cb004130 release: Support -DNO_ROOT image building
This requires a bunch of METALOG mangling to include the files we inject
into the tree. The mkisoimages.sh and make-memstick.sh scripts are now
called with the current directory inside the tree so that the relative
paths in the METALOG match up with the current directory. The scripts do
not require this when not using a METALOG, but for simplicity we always
do so. The Makefile mangles the real METALOG created from the install,
as those files are shared across all uses of the tree, but the shell
scripts create a temporary copy of the METALOG that they mangle as their
tree modifications are specific to that image. We also need to pass -D
to makefs to turn any duplicate METALOG entry errors into warnings, as
we have many (harmless) instances of those.

Whilst dvd1.iso should work, the !NOPKG code will need more work to
support this.

All media will also lack mergemaster and etcupdate trees, since more
work is needed to add -DNO_ROOT modes to them. Users of install media
built this way will have to manually bootstrap them.

Reviewed by:	brooks, gjb
Differential Revision:	https://reviews.freebsd.org/D33999
2022-02-28 22:37:03 +00:00
Mitchell Horne
e0f9cec7d6 arm64: set the correct partition type in make-memstick.sh
We create a UFS root filesystem using makefs(8), and later pass it to
mkimg(1) when creating the final image. The correct partition type is
freebsd-ufs; the freebsd parition type is for partitions containing a
BSD disklabel.

Reviewed by:	emaste
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26987
2020-10-30 18:22:46 +00:00
Rebecca Cran
db8b561345 Rework UEFI ESP generation
Currently, the installer uses pre-created 800KB FAT12 filesystems that
it dd's onto the ESP partition.
This changeset improves that by having the installer generate a FAT32
filesystem directly onto the ESP using newfs_msdos and then copying
loader.efi into /EFI/freebsd.
For live installs it then runs efibootmgr to add a FreeBSD boot entry
in the BIOS.

Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D17947
2018-12-20 19:39:37 +00:00
Ed Maste
8ea90e075c make-memstick.sh: put partition args on separate lines
This makes it easier to identify the individual partition types and
facilitates comparisons across architectures.

Reviewed by:	gjb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2018-04-10 19:49:04 +00:00
Ed Maste
355534688c make-memstick.sh: use UFSv2
There's not much practical difference as far as install media is
concerned but newfs creates UFSv2 by default and it is sensible to use
the contemporary UFS version.

I also intend to change makefs to create UFSv2 by default (to match
newfs) so we'll want make-memstick.sh to be explicit, rather than
relying on the host tool's default.

Reviewed by:	andrew, gjb, jhibbits
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D12231
2017-09-11 14:41:57 +00:00
Ed Maste
f20be204d6 revert unintentional changes from r323436 2017-09-11 14:35:43 +00:00
Ed Maste
e9346a94d1 boot1: remove BOOT1_MAXSIZE default value
This Makefile relies on Makefile.fat providing the correct value for
BOOT1_MAXSIZE and BOOT1_OFFSET. Since BOOT1_OFFSET had no default value
here the build would already fail if Makefile.fat did not provide
correct values.

Sponsored by:	The FreeBSD Foundation
2017-09-11 14:33:04 +00:00
Ed Maste
52c3243424 arm64 make-memstick.sh: use 'set -e' to abort if any step fails
Also remove the now-redundant error handling that was only for makefs.

This script was run on an older FreeBSD host that lacked efi-on-mbr
support in makefs. A warning was emitted on the console (from makefs)
but the script continued running and exited with 0.

Reviewed by:	gjb
Sponsored by:	The FreeBSD Foundation
2016-11-01 14:50:32 +00:00
Wojciech Macek
af625dc998 ARM64: move to GPT scheme in sysinstall
It's time to abandon MBR installations on
     ARM64 platforms.

     Obtained from:         Semihalf
     Submitted by:          Dominik Ermel <der@semihalf.com>
     Sponsored by:          Cavium
     Reviewed by:           gjb, emaste, marcel
     Approved by:           re (gjb)
     Differential Revision: https://reviews.freebsd.org/D6798
2016-07-07 05:47:42 +00:00
Glen Barber
10c40dfa68 Prevent memstick installation medium from attempting to mount
the root filesystem read-write.  This causes problems booting
the memstick installation medium from write-protected USB flash
drives.

Submitted by:	A.J. Kehoe IV [1], Oliver Jones [2]
PR:		187161 [1], 205886 [2]
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2016-01-05 03:20:45 +00:00
Glen Barber
082a550bba Do not nest the BSD and MBR partitions, which produces
an unbootable image.  Use just an MBR scheme instead.

Sponsored by:	The FreeBSD Foundation
2015-04-27 18:07:11 +00:00
Glen Barber
62e0fc0426 Generate the arm64/aarch64 memstick image as MBR instead of
GPT.

Boot tested by:	andrew
Sponsored by:	The FreeBSD Foundation
2015-04-27 17:39:40 +00:00
Glen Barber
e19e678123 Remove the gptboot partition from the arm64 memory stick image,
which is not needed/used.

Sponsored by:	The FreeBSD Foundation
2015-04-22 13:52:29 +00:00
Glen Barber
47a5593e1b Copy amd64/make-memstick.sh to arm64/make-memstick.sh for
aarch64 memory stick images.

Although arm64 does not yet have USB support, the memstick
image should be bootable with certain virtualization tools,
such as qemu.

Sponsored by:	The FreeBSD Foundation
2015-04-20 20:13:02 +00:00