Skip to content

Commit

Permalink
build: always create 4 partitions instead of 3, Windows likes that
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed May 25, 2017
1 parent 2160deb commit cccd73b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
5 changes: 4 additions & 1 deletion build/vga.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,13 @@ EOF
makefs -B little -o label=${LABEL} ${STAGEDIR}/root.part ${STAGEDIR}/work

UEFIBOOT=
GPTDUMMY=

if [ ${PRODUCT_ARCH} = "amd64" -a -n "${PRODUCT_UEFI}" ]; then
UEFIBOOT="-p efi:=${STAGEDIR}/work/boot/boot1.efifat"
GPTDUMMY="-p freebsd-swap::512k"
fi

mkimg -s gpt -o ${VGAIMG} -b ${STAGEDIR}/work/boot/pmbr ${UEFIBOOT} \
-p freebsd-boot:=${STAGEDIR}/work/boot/gptboot \
-p freebsd-boot:=${STAGEDIR}/work/boot/gptboot ${GPTDUMMY} \
-p freebsd-ufs:=${STAGEDIR}/root.part
19 changes: 13 additions & 6 deletions build/vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,13 @@ cat > ${STAGEDIR}/mnt/etc/fstab << EOF
/dev/gpt/rootfs / ufs rw 1 1
EOF

GPTDUMMY="-p freebsd-swap::512k"
SWAPARGS=
UEFIBOOT=

if [ ${PRODUCT_ARCH} = "amd64" -a -n "${PRODUCT_UEFI}" ]; then
UEFIBOOT="-p efi:=${STAGEDIR}/boot/boot1.efifat"
fi

if [ -n "${VMSWAP}" ]; then
SWAPARGS="-p freebsd-swap/swapfs::${VMSWAP}"
Expand All @@ -89,18 +95,19 @@ if [ -n "${VMSWAP}" ]; then
EOF
fi

if [ -z "${VMSWAP}" -a -z "${UEFIBOOT}" ]; then
GPTDUMMY=
elif [ -n "${VMSWAP}" -a -n "${UEFIBOOT}" ]; then
GPTDUMMY=
fi

umount ${STAGEDIR}/mnt
mdconfig -d -u ${MD}

echo -n ">>> Building vm image... "

UEFIBOOT=
if [ ${PRODUCT_ARCH} = "amd64" -a -n "${PRODUCT_UEFI}" ]; then
UEFIBOOT="-p efi:=${STAGEDIR}/boot/boot1.efifat"
fi

mkimg -s gpt -f ${VMFORMAT} -o ${VMIMG} -b ${STAGEDIR}/boot/pmbr \
${UEFIBOOT} -p freebsd-boot/bootfs:=${STAGEDIR}/boot/gptboot \
-p freebsd-ufs/rootfs:=${VMBASE} ${SWAPARGS}
${GPTDUMMY} -p freebsd-ufs/rootfs:=${VMBASE} ${SWAPARGS}

echo "done"

0 comments on commit cccd73b

Please sign in to comment.