composite: add factory target

This commit is contained in:
Franco Fichtner 2022-02-17 15:32:21 +01:00
parent e782af9d8a
commit 5f64cb5902
9 changed files with 64 additions and 20 deletions

View File

@ -28,7 +28,7 @@ STEPS= audit arm base boot chroot clean clone compress confirm core \
nano options packages plugins ports prefetch print rebase \
release rename rewind serial sign skim test update upload \
verify vga vm xtools
SCRIPTS= batch distribution hotfix nightly
SCRIPTS= batch distribution factory hotfix nightly
.PHONY: ${STEPS} ${SCRIPTS}

View File

@ -141,6 +141,10 @@ A virtual machine full disk image is created using:
# make vm
A special embedded device image based on vm variety:
# make factory
Release sets can be built as follows although the result is
an unpredictable set of images depending on the previous
build states:

View File

@ -36,6 +36,7 @@ check_image ${SELF} ${@}
VMFORMAT="vmdk"
VMSIZE="20G"
VMSWAP="1G"
VMEXTRAS=${SELF}
if [ -n "${1}" ]; then
VMFORMAT=${1}
@ -53,6 +54,10 @@ if [ -n "${3}" ]; then
fi
fi
if [ -n "${4}" ]; then
VMEXTRAS=${4}
fi
VMIMG="${IMAGESDIR}/${PRODUCT_RELEASE}-vm-${PRODUCT_ARCH}.${VMFORMAT}"
VMBASE="vmbase"
@ -111,7 +116,7 @@ cp -R ${STAGEDIR}/mnt/boot ${STAGEDIR}
setup_kernel ${STAGEDIR}/mnt
setup_packages ${STAGEDIR}/mnt
setup_extras ${STAGEDIR}/mnt ${SELF}
setup_extras ${STAGEDIR}/mnt ${VMEXTRAS}
setup_entropy ${STAGEDIR}/mnt
cat > ${STAGEDIR}/mnt/etc/fstab << EOF

0
composite/batch.sh Executable file → Normal file
View File

2
composite/distribution.sh Executable file → Normal file
View File

@ -25,7 +25,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
eval "$(make print-PRODUCT_ARCH,PRODUCT_CORE,PRODUCT_FLAVOUR,PRODUCT_VERSION,SETSDIR)"
eval "$(make print-PRODUCT_ARCH,PRODUCT_CORE,PRODUCT_FLAVOUR,SETSDIR)"
PACKAGESET=$(find ${SETSDIR} -name "packages-*-${PRODUCT_FLAVOUR}-${PRODUCT_ARCH}.tar")

52
composite/factory.sh Normal file
View File

@ -0,0 +1,52 @@
#!/bin/sh
# Copyright (c) 2022 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
eval "$(make print-PRODUCT_ARCH,PRODUCT_CORE,PRODUCT_FLAVOUR,PRODUCT_ZFS,SETSDIR)"
PACKAGESET=$(find ${SETSDIR} -name "packages-*-${PRODUCT_FLAVOUR}-${PRODUCT_ARCH}.tar")
if [ ! -f "${PACKAGESET}" ]; then
echo ">>> Cannot continue without packages set"
exit 1
fi
COREFILE=$(tar -tf ${PACKAGESET} | grep -x "\./All/${PRODUCT_CORE}-[0-9].*\.txz")
if [ -z "${COREFILE}" ]; then
echo ">>> Cannot continue without core package: ${PRODUCT_CORE}"
exit 1
fi
COREFILE=$(basename ${COREFILE%%.txz})
FS=ufs
if [ -n "${PRODUCT_ZFS}" ]; then
FS=zfs
fi
make info
make vm-raw,3G,off,serial VERSION=${COREFILE##*-}-${FS}

0
composite/hotfix.sh Executable file → Normal file
View File

0
composite/nightly.sh Executable file → Normal file
View File

View File

@ -123,22 +123,5 @@ vm_hook()
{
loader_conf_fixup ${1}
cat > ${1}/tmp/vm.xml << EOF
<serialspeed>${PRODUCT_COMSPEED}</serialspeed>
<primaryconsole>video</primaryconsole>
<secondaryconsole>serial</secondaryconsole>
EOF
sed -i '' -e "/<system>/r ${1}/tmp/vm.xml" ${1}${CONFIG_XML}
rm ${1}/tmp/vm.xml
echo "-S${PRODUCT_COMSPEED} -D" > ${1}/boot.config
cat >> ${1}/boot/loader.conf << EOF
comconsole_speed="${PRODUCT_COMSPEED}"
console="vidconsole,comconsole"
boot_multicons="YES"
boot_serial="YES"
EOF
touch ${1}/.probe.for.growfs.nano
}