History log of /freebsd-current/sys/tools/embed_mfs.sh
Revision Date Author Comments
# 031beb4e 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line sh pattern

Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# 97a7bf30 02-Nov-2018 Ed Maste <emaste@FreeBSD.org>

embed_mfs.sh: replace some compound statements with conventional ifs

Use the more readable form - there's no need to try being clever.


# 47b5c719 03-Jan-2018 Ed Maste <emaste@FreeBSD.org>

embed_mfs: correctly test grep return value

Reported by: br
MFC with: r326992
Sponsored by: The FreeBSD Foundation


# 2dd51e16 19-Dec-2017 Ed Maste <emaste@FreeBSD.org>

embed_mfs: support embedding mfs into loader

The script originally supported embedding an mfs into ELF files or any
other type of file, because it searched for magic strings to mark the
beginning and end of the embeddable section. It was later modified to
read the section offset and length via readelf, which made it work for
ELF only. Restore the ability to update arbitrary file types by using
the readelf technique for ELF, and the magic string technique for all
others (including PE/COFF files like loader.efi).

Submitted by: Zakary Nafziger <worldofzak@gmail.com>
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D12746


# fe267a55 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

sys: general adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.


# 0bf94a08 17-Oct-2017 Ed Maste <emaste@FreeBSD.org>

embed_mfs: add error handling, usage

Ensure that we are called with two arguments, and that the output file
is writable. Also, if we cannot find the mfs section report the output
file name rather than "kernel", as this script may be used with other
than kernels.

Sponsored by: The FreeBSD Foundation


# 0a502389 10-Jan-2017 Li-Wen Hsu <lwhsu@FreeBSD.org>

Replace using of objdump with elfdump

In-tree objdump is too old to dump new ELF headers. But for example if we
use: `make CROSS_TOOLCHAIN=riscv64-gcc TARGET_ARCH=riscv64` and do not specify
CROSS_BINUTILS_PREFIX in env, embed_mfs.sh cannot find the correct objdump.
This patch just replaces using of objdump with elfdump to collect needed
information.

Later we may also put an ELFDUMP in CROSSENV and use it in embed_mfs.sh .

Reviewed by: emaste, br
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9062


# 3cd77f54 10-Aug-2016 Ruslan Bukin <br@FreeBSD.org>

Consider CROSS_BINUTILS_PREFIX environment variable so we use correct
objdump.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5


# f4c1f0b9 02-Feb-2016 Adrian Chadd <adrian@FreeBSD.org>

Fix MFS builds when both MD_ROOT_SIZE and MFS_IMAGE are specified

MD_ROOT_SIZE and embed_mfs.sh were basically retired as part of
https://reviews.freebsd.org/D2903 .
However, when building a kernel with 'options MD_ROOT_SIZE' specified, this
results in a non-working MFS, as within sys/dev/md/md.c we fall within the
wrong # ifdef.

This patch implements the following:

* Allow kernels to be built without the MD_ROOT_SIZE option, which results
in a kernel built as per D2903.
* Allow kernels to be built with the MD_ROOT_SIZE option, which results
in a kernel built similarly to the pre-D2903 way, with the following
differences:
* The MFS is now put in a separate section within the kernel (oldmfs,
so it differs from the mfs section introduced by D2903).
* embed_mfs.sh is changed, so it looks up the oldmfs section within the
kernel, gets its size and offset, sees if the MFS will fit within the
allocated oldmfs section and only if all is well does a dd of the MFS
image into the kernel.

Submitted by: Stanislav Galabov <sgalabov@gmail.com>
Reviewed by: brooks, imp
Differential Revision: https://reviews.freebsd.org/D5093


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# fcfdd827 05-Feb-2008 Rafal Jaworowski <raj@FreeBSD.org>

Introduce a standalone shell script for embedding MFS image.

This allows to fix a problem with ARM kernel.bin not having the MFS image
embedded: it is objcopied from the kernel.noheader temporary ELF file, which
was not subject to embedding the MFS image previously.

Reviewed by: imp
Approved by: cognet (mentor)