build/uefi: instead of vga, we build uefi (amd64 only)

This commit is contained in:
Franco Fichtner 2016-07-02 11:26:21 +02:00
parent 224768c701
commit 95725b3b28
6 changed files with 52 additions and 39 deletions

View File

@ -1,6 +1,6 @@
STEPS= base boot cdrom chroot clean core distfiles \
kernel nano plugins ports prefetch rebase \
release serial sign skim test vga vm
release serial sign skim test uefi vm
.PHONY: ${STEPS}
PAGER?= less
@ -51,10 +51,10 @@ ports distfiles: base
plugins: ports
core: plugins
packages: core
cdrom vm serial vga nano: packages kernel
cdrom vm serial uefi nano: packages kernel
sets: distfiles packages kernel
images: cdrom nano serial vga vm
release: cdrom nano serial vga
images: cdrom nano serial uefi vm
release: cdrom nano serial uefi
# Expand target arguments for the script append:

View File

@ -115,9 +115,9 @@ A serial memstick image is created using:
# make serial
A vga memstick image is created using:
A uefi memstick image is created using:
# make vga
# make uefi
A flash card disk image (NanoBSD) is created using:
@ -143,7 +143,7 @@ define hooks in the form of e.g.:
}
These hooks are available for all image types, namely
cdrom, nano, serial, vga and vm. Device-specific hooks
cdrom, nano, serial, uefi and vm. Device-specific hooks
are loaded after config-specific hooks and both of them
can coexist in a given build.
@ -231,7 +231,7 @@ Available clean options are:
* sets: remove all sets
* src: reset kernel/base build directory
* stage: reset main staging area
* vga: remove vga image
* uefi: remove uefi image
* vm: remove vm image
The ports tree has a few of our modifications and is sometimes a

View File

@ -81,9 +81,9 @@ for ARG in ${@}; do
setup_stage /usr/obj${SRCDIR}
rm -r /usr/obj${SRCDIR}
;;
vga)
echo ">>> Removing vga image"
rm -f ${IMAGESDIR}/*-vga-${ARCH}.*
uefi)
echo ">>> Removing uefi image"
rm -f ${IMAGESDIR}/*-uefi-${ARCH}.*
;;
vm)
echo ">>> Removing vm image"

View File

@ -264,23 +264,6 @@ setup_copy()
cp -r ${2} ${1}${2}
}
setup_memstick()
{
cat > ${1}/etc/fstab << EOF
# Device Mountpoint FStype Options Dump Pass#
/dev/ufs/${3} / ufs ro,noatime 1 1
tmpfs /tmp tmpfs rw,mode=01777 0 0
EOF
makefs -t ffs -B little -o label=${3} ${2} ${1}
DEV=$(mdconfig -a -t vnode -f "${2}")
gpart create -s BSD "${DEV}"
gpart bootcode -b "${1}"/boot/boot "${DEV}"
gpart add -t freebsd-ufs "${DEV}"
mdconfig -d -u "${DEV}"
}
setup_chroot()
{
echo ">>> Setting up chroot in ${1}"

View File

@ -49,4 +49,17 @@ setup_serial ${STAGEDIR}
setup_extras ${STAGEDIR} ${SELF}
setup_mtree ${STAGEDIR}
setup_entropy ${STAGEDIR}
setup_memstick ${STAGEDIR} ${SERIALIMG} ${LABEL}
cat > ${STAGEDIR}/etc/fstab << EOF
# Device Mountpoint FStype Options Dump Pass#
/dev/ufs/${LABEL} / ufs ro,noatime 1 1
tmpfs /tmp tmpfs rw,mode=01777 0 0
EOF
makefs -t ffs -B little -o label=${LABEL} ${SERIALIMG} ${STAGEDIR}
DEV=$(mdconfig -a -t vnode -f "${SERIALIMG}")
gpart create -s BSD "${DEV}"
gpart bootcode -b "${STAGEDIR}"/boot/boot "${DEV}"
gpart add -t freebsd-ufs "${DEV}"
mdconfig -d -u "${DEV}"

View File

@ -27,24 +27,41 @@
set -e
SELF=vga
SELF=uefi
. ./common.sh && $(${SCRUB_ARGS})
if [ ${ARCH} != "amd64" ]; then
echo ">>> Skipping uefi image for ${ARCH}"
exit 0
fi
check_images ${SELF} ${@}
VGAIMG="${IMAGESDIR}/${PRODUCT_RELEASE}-vga-${ARCH}.img"
UEFIIMG="${IMAGESDIR}/${PRODUCT_RELEASE}-uefi-${ARCH}.img"
# rewrite the disk label, because we're install media
LABEL="${LABEL}_Install"
sh ./clean.sh ${SELF}
setup_stage ${STAGEDIR}
setup_base ${STAGEDIR}
setup_kernel ${STAGEDIR}
setup_packages ${STAGEDIR}
setup_extras ${STAGEDIR} ${SELF}
setup_mtree ${STAGEDIR}
setup_entropy ${STAGEDIR}
setup_memstick ${STAGEDIR} ${VGAIMG} ${LABEL}
setup_stage ${STAGEDIR} work
setup_base ${STAGEDIR}/work
setup_kernel ${STAGEDIR}/work
setup_packages ${STAGEDIR}/work
setup_extras ${STAGEDIR}/work ${SELF}
setup_mtree ${STAGEDIR}/work
setup_entropy ${STAGEDIR}/work
cat > ${STAGEDIR}/work/etc/fstab << EOF
# Device Mountpoint FStype Options Dump Pass#
/dev/ufs/${LABEL} / ufs ro,noatime 1 1
tmpfs /tmp tmpfs rw,mode=01777 0 0
EOF
makefs -B little -o label=${LABEL} ${STAGEDIR}/root.part ${STAGEDIR}/work
mkimg -s gpt -o ${UEFIIMG} -b ${STAGEDIR}/work/boot/pmbr \
-p efi:=${STAGEDIR}/work/boot/boot1.efifat \
-p freebsd-boot:=${STAGEDIR}/work/boot/gptboot \
-p freebsd-ufs:=${STAGEDIR}/root.part