diff --git a/Makefile b/Makefile index 5b68af3..27eb94e 100644 --- a/Makefile +++ b/Makefile @@ -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} diff --git a/README.md b/README.md index 09b0d2f..6184b29 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/build/vm.sh b/build/vm.sh index e46b21b..980a7ea 100644 --- a/build/vm.sh +++ b/build/vm.sh @@ -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 diff --git a/composite/batch.sh b/composite/batch.sh old mode 100755 new mode 100644 diff --git a/composite/distribution.sh b/composite/distribution.sh old mode 100755 new mode 100644 index e346b3d..ea3263a --- a/composite/distribution.sh +++ b/composite/distribution.sh @@ -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") diff --git a/composite/factory.sh b/composite/factory.sh new file mode 100644 index 0000000..6f6902a --- /dev/null +++ b/composite/factory.sh @@ -0,0 +1,52 @@ +#!/bin/sh + +# Copyright (c) 2022 Franco Fichtner +# +# 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} diff --git a/composite/hotfix.sh b/composite/hotfix.sh old mode 100755 new mode 100644 diff --git a/composite/nightly.sh b/composite/nightly.sh old mode 100755 new mode 100644 diff --git a/config/22.1/extras.conf b/config/22.1/extras.conf index 63e50f4..e109d99 100644 --- a/config/22.1/extras.conf +++ b/config/22.1/extras.conf @@ -123,22 +123,5 @@ vm_hook() { loader_conf_fixup ${1} - cat > ${1}/tmp/vm.xml << EOF - ${PRODUCT_COMSPEED} - video - serial -EOF - sed -i '' -e "//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 }