Commit graph

264 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
Ed Maste 05f2347421 Make i386 memstick images bootable.
This reverts the i386 part of r342283, "Rework UEFI ESP generation", and
the followup commit in r342690.

r342283 added an ESP to the i386 memstick image, and as a side effect
made the ESP the active partition, not the bootcode-containing UFS
partition.  As a result the i386 memstick images would not boot in
either UEFI or legacy mode - UEFI failed because we do not support i386
UEFI booting, and legacy mode failed because the partition with legacy
bootcode was not active.

The bootcode-containing UFS partition is again the only, and active,
partition.

PR:		246494
Reported by:	Jorge Maidana
Differential Revision:	The FreeBSD Foundation
2020-05-24 18:25:49 +00:00
Glen Barber 252373ac4c Escape a new line following r342283.
Sponsored by:	The FreeBSD Foundation
2019-01-02 16:22:33 +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 a7d9306a40 release: set -e to exit on error in iso image scripts
Reviewed by:	gjb
Differential Revision:	https://reviews.freebsd.org/D17651
2018-10-22 19:39:20 +00:00
Ed Maste bf249c5a0a switch i386 memstick installer images to MBR
Some BIOSes have trouble booting from GPT in non-UEFI mode.  This is
commonly reported with Lenovo laptops, including my x220.  As we do not
currently support booting FreeBSD/i386 via UEFI there's no reason to
prefer GPT.

The "vestigial swap partition" was added in r265017 to work around an
issue with loader's GPT support, so we should not need it when using
MBR.

We may want to make the same change to amd64, although the issue there is
mitigated by such systems booting via UEFI in the common case.

PR:		227422
Reviewed by:	gjb
MFC after:	3 weeks
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
2018-04-12 19:00:22 +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
Glen Barber f295b9db79 Add general configuration files used by release/release.sh for
big-iron installation images.

MFC after:	3 days
MFC with:	r325948, r325949, r325950, r325951
Sponsored by:	The FreeBSD Foundation
2017-11-17 18:00:52 +00:00
Eitan Adler a2aef24aa3 Update several more URLs
- Primarily http -> https
- Primarily FreeBSD project URLs
2017-10-29 08:17:03 +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 708c2585e3 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 change applies arm64's r308171 to the other make-memstick.sh
versions.

Reviewed by:	gjb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D12195
2017-09-05 12:57:45 +00:00
Ed Maste 93cf995aef mkisoimages.sh: remove obsolete x$var convention
Ancient shells had trouble with empty variables but this has not been
relevant for FreeBSD for a very long time (decades?).
2017-09-04 22:37:28 +00:00
Glen Barber 8834318685 Merge ^/projects/release-install-debug:
- Rework MANIFEST generation and parsing via bsdinstall(8).
- Allow selecting debugging distribution sets during install.
- Rework bsdinstall(8) to fetch remote debug distribution sets
  when they are not available on the local install medium.
- Allow selecting additional non-GENERIC kernels during install.
  At present, GENERIC is still required, and installed by default.

Tested with:	head@r293203
Sponsored by:	The FreeBSD Foundation
2016-01-05 21:05:17 +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
Devin Teske 27065039bc Fix argument quoting and remove unnecessary braces
MFC after:	3 weeks
X-MFC-to:	stable/10
2015-09-10 22:47:26 +00:00
Glen Barber b0dd717602 Use mkimg(1) to create the i386 memstick images, similar to
how is done for amd64.  The exception here is there is no
EFI partition for i386.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2015-05-23 00:32:58 +00:00
Glen Barber 1e7c1f1742 Initial rewrite to consolidate VM image build scripts into one.
There may be some very sharp edges here while refactoring.

 - Move amd64/mk-vmimage.sh -> scripts/mk-vmimage.sh.
 - Remove vm-base target from Makefile.vm.
 - In vm-image target, use getopts flags for argument passing.
 - Create tools/vmimage.subr, containing default and prototype
   for the following functions that are used to drive the build,
   run in this order:

   vm_install_base()
   vm_extra_install_base()
   vm_extra_install_packages()
   vm_extra_install_ports()
   vm_extra_enable_services()
   vm_extra_pre_umount()
   vm_create_disk()
   vm_extra_create_disk()

 - In tools/azure.conf, override:

   vm_extra_install_base()
   vm_extra_pre_umount()
   vm_extra_create_disk()

 - In tools/openstack.conf, override:

   vm_extra_install_base()
   vm_extra_pre_umount()

Sponsored by:	The FreeBSD Foundation
2014-11-05 13:22:19 +00:00
Glen Barber 6943fb9ff2 Fix output file name for openstack images.
No further conversion is necessary for this
VM file target, so there is no need to append
the '.raw' suffix here.

Sponsored by:	The FreeBSD Foundation
2014-10-29 19:44:34 +00:00
Glen Barber 573e7cca4b Initial commit providing a mechanism to create
openstack images as part of the release build.

This mimics the way Microsoft Azure images are
built, with the addition of installing the
net/cloud-init package and adding a (commented)
rc.conf(5) entry for cloudinit.

Sponsored by:	The FreeBSD Foundation
2014-10-29 17:04:09 +00:00
Glen Barber 461f70f64a Remove a few vestiges of passing an exit code to
panic().

Sponsored by:	The FreeBSD Foundation
2014-10-29 16:20:49 +00:00
Glen Barber f27438c752 Avoid hard-coding the Azure image file format.
While here, avoid using OSRELEASE for the output
file name.

Sponsored by:	The FreeBSD Foundation
2014-10-29 16:18:29 +00:00
Glen Barber f38d42ba63 Output an informational message when mkimg(1) runs, so it
does not appear that the process has stopped while waiting
for a 'y/n' response when waagent is deprovisioned.

Sponsored by:	The FreeBSD Foundation
2014-10-14 15:18:22 +00:00
Glen Barber 60b7edb5a7 Fix signal list to trigger umount(8).
Sponsored by:	The FreeBSD Foundation
2014-10-14 12:13:43 +00:00
Glen Barber 3991f309ed Add a separate make(1) target to release/Makefile to
build FreeBSD virtual machine disk images for use on
the Microsoft Azure service.

For now, this target is not directly connected to the
build, however can be manually invoked.

The 'vm-azure' target invokes {amd64,i386}/mk-azure.sh,
which does the heavy lifting to produce proper VHDs.
mk-azure.sh uses a configuration file, defaulting to
tools/azure.conf if otherwise unset.

Sponsored by:	The FreeBSD Foundation
2014-10-14 11:48:28 +00:00
Glen Barber 41a29c1ab2 Revert r272793, r272794, r272795:
Remove implementation of vm_prebuild_setup(),
  vm_setup(), and vm_postbuild_setup().

  It does not scale well, and I am not happy with
  their implementation.

Sponsored by:	The FreeBSD Foundation
2014-10-14 11:20:08 +00:00
Glen Barber 648326ad2d Reference vm_prebuild_setup(), vm_setup(), and
vm_postbuild_setup() functions.

Sponsored by:	The FreeBSD Foundation
2014-10-09 04:10:58 +00:00
Glen Barber 4ac2ee7f8c Allow mk-vmimage.sh to accept a configuration file as
an argument to '-c'.

Sponsored by:	The FreeBSD Foundation
2014-10-09 03:50:38 +00:00
Glen Barber ed79fb4ea9 Add prototypes for build-specific tuning:
- vm_prebuild_setup():
	Steps to run prior to creating the file-backed
	disk image.

 - vm_setup():
	Steps to run while the file-backed disk image
	is mounted.

 - vm_postbuild_setup():
	Steps to run after the file-backed disk image
	is dismounted.

The intention is to override as necessary via build
configuration files, as needed.

Sponsored by:	The FreeBSD Foundation
2014-10-09 03:29:52 +00:00
Glen Barber 655f2eb770 Add /usr/local/bin and /usr/local/sbin to PATH, needed
if third-party software needs to use utilities outside
of the base system during post-install stages (indexinfo
is one culprit).

Sponsored by:	The FreeBSD Foundation
2014-10-09 03:20:28 +00:00
Glen Barber 47480336de If the vm-base target fails, prevent the vm-image target
from being run since it cannot possibly succeed.

Sponsored by:	The FreeBSD Foundation
2014-10-02 18:23:53 +00:00
Glen Barber d04dbaf828 Remove the first argument to panic(), which was initially
intended to be the exit code, however when a non-zero exit
code was returned to release/Makefile, this would prevent
any remaining (and possibly successful) stages from being
attempted.

Sponsored by:	The FreeBSD Foundation
2014-10-02 18:20:01 +00:00
Glen Barber 0bc9be5e74 Avoid using env(1) to set values passed to mk-vmimage.sh,
and instead pass the values as arguments to the script,
making it easier to run this by hand, without 'make release'.

Add usage_vm_base() and usage_vm_image() usage helpers.

Sponsored by:	The FreeBSD Foundation
2014-10-01 19:13:42 +00:00
Glen Barber fadf2a24fe Separate release/scripts/mk-vmimage.sh to machine-specific
scripts, making it possible to mimic the functionality for
non-x86 targets.

Move echo output if MAKEFLAGS is empty outside of usage().

Remove TARGET/TARGET_ARCH evaluation.

Sponsored by:	The FreeBSD Foundation
2014-10-01 17:05:40 +00:00
Glen Barber a29123a849 Fix indentation for diff reduction with commits to follow.
Sponsored by:	The FreeBSD Foundation
2014-04-25 19:43:18 +00:00
Glen Barber cac71a6495 Revert r264907 and r264908:
Restore make-memstick.sh back to its original state to
unbreak booting for machines that do not support GPT.

I have in-progress work to keep the MBR layout and add
the EFI partition, but it is not yet ready, and does
need at least one full release build to be certain it
does not break.

Sponsored by:	The FreeBSD Foundation
2014-04-25 18:46:54 +00:00
Glen Barber ad22db2755 Style cleanup
- Indent 1 full tab where needed
 - Use $() for shell exec
 - Insert a space between '$(( ))' parens

MFC After:	1 week
X-MFC-With:	r264907
Sponsored by:	The FreeBSD Foundation
2014-04-25 01:55:14 +00:00
Glen Barber 6dceb683a7 Refactor make-memstick.sh to avoid creating the 'dangerously
dedicated' partition scheme, reported to cause the memstick.img
to fail to boot.

Similar to how make-memstick.sh worked on stable/8, use makefs(8)
to create the actual filesystem.  Then calculate the size of the
resulting image file, create the GPT partition scheme, then dd(1)
the filesystem created with makefs(8) to the freebsd-ufs GPT
partition.

This was tested on a known-working machine[1] for regression, and
a known-not-working machine[2] to ensure the boot issue has been
resolved.

Testers:	myself [1], db [2]
MFC After:	1 week
Sponsored by:	The FreeBSD Foundation
2014-04-25 01:38:57 +00:00
Glen Barber 6f50c4ea71 Update the pkg-stage target to be more compatible with pkg-1.2:
- Add a release-dvd.conf pkg(8) configuration file to override
   the default FreeBSD.conf configuration.
 - Remove architecture-specific pkg-stage.conf files, consolidate,
   and move their contents to scripts/pkg-stage.sh.
 - Use 'pkg -vv' to determine the ABI, which is used as the
   cache directory.

Prior to these changes, it would be possible for pkg-stage to fetch
conflicting binary packages from multiple repositories.

Tested against:	head@r260522, stable/10@r260522

MFC after:	3 days
X-Insta-MFC:	possibly
Sponsored by:	The FreeBSD Foundation
2014-01-16 16:12:09 +00:00
Glen Barber df6fb2b5b3 Simplify PKG_ABI for pkg-stage.sh.
Submitted by:	hrs
MFC after:	3 days
X-MFC-With:	r258310
Sponsored by:	The FreeBSD Foundation
2013-11-18 20:01:52 +00:00
Glen Barber 6d86d28981 Fix how ABI is evaluated so it matches more than a dot-zero
case.

MFC after:	3 days
X-MFC-With:	r258310
Sponsored by:	The FreeBSD Foundation
2013-11-18 17:52:18 +00:00
Glen Barber 1d9e5a791b Set the PKG_CACHEDIR directory to 'dvd/' instead of 'release/'
in preparation of adding a 'dvd1.iso' target.

MFC after:	3 days
X-MFC-With:	r258305, r258307, r258308
Sponsored by:	The FreeBSD Foundation
2013-11-18 16:11:19 +00:00
Glen Barber 042a51f641 Add a script and configuration files to fetch pre-built packages
from pkg.FreeBSD.org for inclusion on release medium (dvd1.iso).

The script sources ${.CURDIR}/${TARGET}/pkg-stage.conf, which sets
several environment variables, such as the pkg(8) ABI, PACKAGESITE,
PKG_DBDIR, and PKG_CACHEDIR.  PKG_CACHEDIR is set to the directory
on the release medium used by bsdconfig(8) (/packages/${ABI}).  ABI
is determined by output of 'make -C /usr/src/release -V REVISION'.
See pkg.conf(5) for descripton on other variables set here.

The list of packages to include are set within the configuration
file.

The script and configuration files are intended to be run by the
'make dvd' target within the release directory, and assume the
release is built within a chroot environment (such as by using
release.sh).

Relevant updates to release/Makefile will follow.

Sponsored by:	The FreeBSD Foundation
2013-11-18 15:22:55 +00:00
Hiroki Sato de17cbcc7e - Add CHECKSUM.* support in Makefile[1].
- Use ln -fs to create a symlink.
- Remove pkgadd for docports.
- Use WITHOUT_JADETEX=yes instead of WITH_JADETEX=no.
- Add {WORLD,KERNEL}_FLAGS to [BTWK]MAKE.
- Use makefs(8) and gpart(8) for sparc64 ISO image[2].
- Add publisher option to makefs(8)[2].

Based on work by:	gjb[1]
Discussed with:		marius, nwhitehorn[2]
2013-02-03 10:26:24 +00:00
Hiroki Sato 0e4b6f5ed7 ISO 9660 specification allows only "d-characters" and "a-characters" in the
Volume Descriptor (section 7.4).  In short, upper-case alphanumeric + some
symbols only.  While the makefs utility automatically converts the characters,
$LABEL should be consistent in the scripts.
2013-01-08 21:13:58 +00:00
Nathan Whitehorn 986e0c7801 Use UFS labels and bsdlabels (like the 8.x memsticks) instead of GPT to
fix problems with some BIOSes.

MFC after:	3 days
2011-10-09 16:23:04 +00:00
Nathan Whitehorn e59e2d8ec7 Farewall, sysinstall! You served us well for many years, but 10.0 is one
digit beyond your time.

Various sysinstall dependencies (e.g. libftpio, libdisk, libodialog, etc.)
will be cleaned up in coming days. Some will take longer than others due to
a few other consumers (tzsetup and sade).
2011-10-03 15:13:09 +00:00