build: make images behave a little more like the rest of the system

Build only one at a time by cleaning up the old one individually.
While there, update the README to reflect reality.
This commit is contained in:
Franco Fichtner 2016-01-20 17:45:36 +01:00
parent 686fb5cc4c
commit 23fda3eec1
7 changed files with 57 additions and 33 deletions

View File

@ -135,6 +135,11 @@ the following works:
# make ports-<packagename>[,...]
For even faster ports building it may be of use to cache all
distribution files before running the actual build:
# make distfiles
Core packages (pristine copies) can be batch-built using:
# make core-<repo_branch_or_tag>[,...]
@ -145,7 +150,7 @@ generated and modified by ports.sh and core.sh.
Release sets can be built using:
# make release
# make release VERSION=product.version.number_revision
Kernel, base, packages and release sets are stored under /tmp/sets
@ -158,12 +163,15 @@ via the clean script:
Available options are:
* images: remove all available images
* src: reset the kernel/base build directory
* kernel: remove the kernel set
* base: remove the base set
* distfiles: remove the distfiles set
* iso: remove iso image
* kernel: remove the kernel set
* memstick: remove memstick images
* nano: remove nano image
* packages: remove the packages set
* release: remove the release set
* src: reset the kernel/base build directory
* stage: reset the main staging area
The ports tree has a few of our modifications and is sometimes a

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2014-2015 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2014-2016 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -31,21 +31,6 @@ set -e
for ARG in ${@}; do
case ${ARG} in
stage)
setup_stage ${STAGEDIR}
;;
src)
setup_stage /usr/obj${SRCDIR}
;;
images)
echo ">>> Removing images"
rm -rf ${IMAGESDIR}
;;
kernel)
echo ">>> Removing kernel set"
rm -f ${SETSDIR}/kernel-*-${ARCH}.txz
rm -f ${SETSDIR}/kernel-*-${ARCH}.txz.sig
;;
base)
echo ">>> Removing base set"
rm -f ${SETSDIR}/base-*-${ARCH}.txz
@ -53,6 +38,28 @@ for ARG in ${@}; do
rm -f ${SETSDIR}/base-*-${ARCH}.obsolete
rm -f ${SETSDIR}/base-*-${ARCH}.obsolete.sig
;;
distfiles)
echo ">>> Removing distfiles set"
rm -f ${SETSDIR}/distfiles-*.tar
;;
iso)
echo ">>> Removing iso image"
rm -f ${IMAGESDIR}/*-cdrom-${ARCH}.iso
;;
kernel)
echo ">>> Removing kernel set"
rm -f ${SETSDIR}/kernel-*-${ARCH}.txz
rm -f ${SETSDIR}/kernel-*-${ARCH}.txz.sig
;;
memstick)
echo ">>> Removing memstick images"
rm -f ${IMAGESDIR}/*-serial-${ARCH}.img
rm -f ${IMAGESDIR}/*-vga-${ARCH}.img
;;
nano)
echo ">>> Removing nano image"
rm -f ${IMAGESDIR}/*-nano-${ARCH}.img
;;
packages)
echo ">>> Removing packages set"
rm -f ${SETSDIR}/packages-*-${PRODUCT_FLAVOUR}-${ARCH}.tar
@ -61,9 +68,11 @@ for ARG in ${@}; do
echo ">>> Removing release set"
rm -f ${SETSDIR}/release-*-${PRODUCT_FLAVOUR}-${ARCH}.tar
;;
distfiles)
echo ">>> Removing distfiles set"
rm -f ${SETSDIR}/distfiles-*.tar
stage)
setup_stage ${STAGEDIR}
;;
src)
setup_stage /usr/obj${SRCDIR}
;;
esac
done

View File

@ -130,12 +130,6 @@ export PACKAGESDIR="/.pkg"
# bootstrap target directories
mkdir -p ${STAGEDIR} ${IMAGESDIR} ${SETSDIR}
# target files
export CDROM="${IMAGESDIR}/${PRODUCT_RELEASE}-cdrom-${ARCH}.iso"
export SERIALIMG="${IMAGESDIR}/${PRODUCT_RELEASE}-serial-${ARCH}.img"
export VGAIMG="${IMAGESDIR}/${PRODUCT_RELEASE}-vga-${ARCH}.img"
export NANOIMG="${IMAGESDIR}/${PRODUCT_RELEASE}-nano-${ARCH}.img"
# print environment to showcase all of our variables
env | sort

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2014-2015 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2014-2016 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -29,9 +29,13 @@ set -e
. ./common.sh && $(${SCRUB_ARGS})
CDROM="${IMAGESDIR}/${PRODUCT_RELEASE}-cdrom-${ARCH}.iso"
# rewrite the disk label, because we're install media
LABEL="${LABEL}_Install"
sh ./clean.sh iso
setup_stage ${STAGEDIR}
setup_base ${STAGEDIR}
setup_kernel ${STAGEDIR}

View File

@ -1,7 +1,7 @@
#!/bin/sh
# Copyright (c) 2014-2016 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2010-2011 Scott Ullrich <sullrich@gmail.com>
# Copyright (c) 2014-2015 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -30,9 +30,14 @@ set -e
. ./common.sh && $(${SCRUB_ARGS})
SERIALIMG="${IMAGESDIR}/${PRODUCT_RELEASE}-serial-${ARCH}.img"
VGAIMG="${IMAGESDIR}/${PRODUCT_RELEASE}-vga-${ARCH}.img"
# rewrite the disk label, because we're install media
LABEL="${LABEL}_Install"
sh ./clean.sh memstick
setup_stage ${STAGEDIR}
setup_base ${STAGEDIR}
setup_kernel ${STAGEDIR}

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2015 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2015-2016 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2004-2009 Scott Ullrich <sullrich@gmail.com>
# Copyright (c) 2005 Poul-Henning Kamp <phk@FreeBSD.org>
#
@ -31,6 +31,10 @@ set -e
. ./common.sh && $(${SCRUB_ARGS})
NANOIMG="${IMAGESDIR}/${PRODUCT_RELEASE}-nano-${ARCH}.img"
sh ./clean.sh nano
. ${SRCDIR}/tools/tools/nanobsd/FlashDevice.sub
sub_FlashDevice generic 4g

View File

@ -38,7 +38,7 @@ if [ ! -f ${STAGEDIR}${PACKAGESDIR}/All/${PRODUCT_TYPE}-${PRODUCT_VERSION}.txz ]
exit 1
fi
sh ./clean.sh release images
sh ./clean.sh release
setup_stage ${STAGEDIR}