Flesh out the creation of sparc64 UFS images. This has only been verified

to yield working images in a native build as rootgen.sh generally doesn't
support cross-testing so far.
This commit is contained in:
Marius Strobl 2018-02-05 00:18:21 +00:00
parent 74a53bd131
commit ba8d50d08b
2 changed files with 55 additions and 15 deletions

View File

@ -78,12 +78,22 @@ boot_nogeli_mbr_ufs_legacy() {
doit gpart bootcode -b ${mbr0} ${dev}
s=$(findpart $dev "freebsd-ufs")
if [ -z "$s" ] ; then
die "No freebsd-zfs slice found"
die "No freebsd-ufs slice found"
fi
doit gpart bootcode -p ${mbr2} ${dev}s${s}
exit 0
}
boot_nogeli_vtoc8_ufs_ofw() {
dev=$1
dst=$2
# For non-native builds, ensure that geom_part(4) supports VTOC8.
kldload geom_part_vtoc8.ko
doit gpart bootcode -p ${vtoc8} ${dev}
exit 0
}
DESTDIR=/
# Note: we really don't support geli boot in this script yet.
@ -128,6 +138,9 @@ gptzfs2=${DESTDIR}/boot/gptzfsboot
mbr0=${DESTDIR}/boot/boot0
mbr2=${DESTDIR}/boot/boot
# VTOC8
vtoc8=${DESTDIR}/boot/boot1
# sanity check here
eval boot_${geli}_${scheme}_${fs}_${bios} $dev $DESTDIR $opts || echo "Unsupported boot env: ${geli}-${scheme}-${fs}-${bios}"

View File

@ -193,6 +193,29 @@ mk_geli_mbr_zfs_both() {
# u-boot
# powerpc
mk_sparc64_nogeli_vtoc8_ufs_ofw() {
src=$1
img=$2
mntpt=$3
geli=$4
scheme=$5
fs=$6
bios=$7
cat > ${src}/etc/fstab <<EOF
/dev/ada0a / ufs rw 1 1
EOF
makefs -t ffs -B big -s 200m ${img} ${src}
md=$(mdconfig -f ${img})
# For non-native builds, ensure that geom_part(4) supports VTOC8.
kldload geom_part_vtoc8.ko
gpart create -s VTOC8 ${md}
gpart add -t freebsd-ufs ${md}
${SRCTOP}/tools/boot/install-boot.sh -g ${geli} -s ${scheme} -f ${fs} -b ${bios} -d ${src} ${md}
mdconfig -d -u ${md}
rm -f ${src}/etc/fstab
}
qser="-serial telnet::4444,server -nographic"
# https://wiki.freebsd.org/QemuRecipes
@ -276,10 +299,8 @@ qemu_i386_both()
# qemu-system-ppc64 -drive file=/path/to/disk.img,format=raw
# sparc64
# 10.3 works, 12-current (which one?) hangs
# qemu-system-sparc64 -drive file=/path/to/disk.img,format=raw
# Misc variables
SRCTOP=$(make -v SRCTOP)
cd ${SRCTOP}/stand
@ -293,6 +314,9 @@ DESTDIR=${OBJDIR}/boot-tree
rm -rf ${DESTDIR}
mkdir -p ${DESTDIR}/boot/defaults
mkdir -p ${DESTDIR}/boot/kernel
# XXX boot1 exists only on sparc64
cp /boot/boot1 ${DESTDIR}/boot
cp /boot/loader ${DESTDIR}/boot
cp /boot/kernel/kernel ${DESTDIR}/boot/kernel
echo -h -D -S115200 > ${DESTDIR}/boot.config
# XXX
@ -396,18 +420,21 @@ for arch in powerpc powerpc64; do
done
for arch in sparc64; do
for scheme in sun; do
fs=ufs
for bios in ofw; do
# Create sparse file and mount newly created filesystem(s) on it
img=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.img
sh=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.sh
echo "vvvvvvvvvvvvvvvvvvvvvv Creating $img vvvvvvvvvvvvvvvvvvvvvvv"
rm -f ${img}*
eval mk_${geli}_${scheme}_${fs}_${bios} ${DESTDIR} ${img} ${MNTPT} ${geli} ${scheme} ${fs} ${bios}
eval qemu_${arch}_${bios} ${img} ${sh}
[ -n "${SUDO_USER}" ] && chown ${SUDO_USER} ${img}*
echo "^^^^^^^^^^^^^^^^^^^^^^ Creating $img ^^^^^^^^^^^^^^^^^^^^^^^"
for geli in nogeli; do
for scheme in vtoc8; do
for fs in ufs; do
for bios in ofw; do
# Create sparse file and mount newly created filesystem(s) on it
img=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.img
sh=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.sh
echo "vvvvvvvvvvvvvvvvvvvvvv Creating $img vvvvvvvvvvvvvvvvvvvvvvv"
rm -f ${img}*
eval mk_${arch}_${geli}_${scheme}_${fs}_${bios} ${DESTDIR} ${img} ${MNTPT} ${geli} ${scheme} ${fs} ${bios}
eval qemu_${arch}_${bios} ${img} ${sh}
[ -n "${SUDO_USER}" ] && chown ${SUDO_USER} ${img}*
echo "^^^^^^^^^^^^^^^^^^^^^^ Creating $img ^^^^^^^^^^^^^^^^^^^^^^^"
done
done
done
done
done