Merge the following from ^/projects/release-arm64 to allow
building FreeBSD/arm64 VM images and memstick.img installation medium: r281786, r281788, r281792: r281786: Add support for building arm64/aarch64 virtual machine images. r281788: 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. r281792: Add a buildenv_setup() prototype, intended to be overridden as needed. For example, the arm64/aarch64 build needs devel/aarch64-binutils, so buildenv_setup() in the release.conf for this architecture handles the installation of the port before buildworld/buildkernel. Sponsored by: The FreeBSD Foundation
This commit is contained in:
commit
6b1cf1b2c2
release
41
release/arm64/make-memstick.sh
Executable file
41
release/arm64/make-memstick.sh
Executable file
@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This script generates a "memstick image" (image that can be copied to a
|
||||
# USB memory stick) from a directory tree. Note that the script does not
|
||||
# clean up after itself very well for error conditions on purpose so the
|
||||
# problem can be diagnosed (full filesystem most likely but ...).
|
||||
#
|
||||
# Usage: make-memstick.sh <directory tree> <image filename>
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
||||
export PATH
|
||||
|
||||
if [ $# -ne 2 ]; then
|
||||
echo "make-memstick.sh /path/to/directory /path/to/image/file"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d ${1} ]; then
|
||||
echo "${1} must be a directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -e ${2} ]; then
|
||||
echo "won't overwrite ${2}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab
|
||||
makefs -B little -o label=FreeBSD_Install ${2}.part ${1}
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "makefs failed"
|
||||
exit 1
|
||||
fi
|
||||
rm ${1}/etc/fstab
|
||||
|
||||
mkimg -s gpt -p efi:=${1}/boot/boot1.efifat -p freebsd-boot:=${1}/boot/gptboot -p freebsd-ufs:=${2}.part -p freebsd-swap::1M -o ${2}
|
||||
rm ${2}.part
|
||||
|
@ -7,6 +7,7 @@
|
||||
## defined in release.sh.
|
||||
#load_chroot_env() { }
|
||||
#load_target_env() { }
|
||||
#buildenv_setup() { }
|
||||
|
||||
## Set the directory within which the release will be built.
|
||||
CHROOTDIR="/scratch"
|
||||
|
@ -42,6 +42,7 @@ export PATH
|
||||
# Prototypes that can be redefined per-chroot or per-target.
|
||||
load_chroot_env() { }
|
||||
load_target_env() { }
|
||||
buildenv_setup() { }
|
||||
|
||||
# The directory within which the release will be built.
|
||||
CHROOTDIR="/scratch"
|
||||
@ -279,6 +280,7 @@ if [ -d ${CHROOTDIR}/usr/ports ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
buildenv_setup
|
||||
load_target_env
|
||||
eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_WMAKEFLAGS} buildworld
|
||||
eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_KMAKEFLAGS} buildkernel
|
||||
|
@ -29,6 +29,13 @@ write_partition_layout() {
|
||||
-p freebsd-ufs/rootfs:=${VMBASE} \
|
||||
-o ${VMIMAGE}
|
||||
;;
|
||||
arm64:aarch64)
|
||||
mkimg -s gpt \
|
||||
-p efi/efiboot:=${BOOTFILES}/efi/boot1/boot1.efifat \
|
||||
${SWAPOPT} \
|
||||
-p freebsd-ufs/rootfs:=${VMBASE} \
|
||||
-o ${VMIMAGE}
|
||||
;;
|
||||
powerpc:powerpc*)
|
||||
mkimg -s apm \
|
||||
-p apple-boot/bootfs:=${BOOTFILES}/powerpc/boot1.chrp/boot1.hfs \
|
||||
|
Loading…
x
Reference in New Issue
Block a user