build: while here make COMPORT configurable and rename SPEED to COMSPEED

This commit is contained in:
Franco Fichtner 2021-02-02 13:38:01 +01:00
parent 679f0cc68e
commit cf3f923da2
5 changed files with 29 additions and 23 deletions

View File

@ -79,7 +79,8 @@ ABI?= ${SETTINGS}
KERNEL?= SMP
ADDITIONS?= os-dyndns${SUFFIX}
DEVICE?= A10
SPEED?= 115200
COMSPEED?= 115200
COMPORT?= 0x3f8
UEFI?= dvd serial vga vm
GITBASE?= https://github.com/opnsense
MIRRORS?= https://opnsense.c0urier.net \
@ -152,10 +153,10 @@ ${STEP}: lint-steps
-S ${SRCDIR} -P ${PORTSDIR} -p ${PLUGINSDIR} -T ${TOOLSDIR} \
-C ${COREDIR} -R ${PORTSREFDIR} -t ${TYPE} -k "${PRIVKEY}" \
-K "${PUBKEY}" -l "${SIGNCHK}" -L "${SIGNCMD}" -d ${DEVICE} \
-m ${MIRRORS:Ox:[1]} -o "${STAGEDIRPREFIX}" -c ${SPEED} \
-m ${MIRRORS:Ox:[1]} -o "${STAGEDIRPREFIX}" -c ${COMSPEED} \
-b ${SRCBRANCH} -B ${PORTSBRANCH} -e ${PLUGINSBRANCH} \
-g ${TOOLSBRANCH} -E ${COREBRANCH} -G ${PORTSREFBRANCH} \
-H "${COREENV}" -u "${UEFI:tl}" -U "${SUFFIX}" \
-H "${COREENV}" -u "${UEFI:tl}" -U "${SUFFIX}" -i ${COMPORT} \
-V "${ADDITIONS}" -O "${GITBASE}" -r "${SERVER}" \
-q "${VERSIONS}" -h "${PLUGINSENV}" -I "${UPLOADDIR}" \
-D "${EXTRABRANCH}" -A "${PORTSREFURL}" ${${STEP}_ARGS}

View File

@ -48,13 +48,15 @@ All build steps are invoked via make(1):
Available early build options are:
* SETTINGS: the name of the requested local configuration
* CONFIGDIR: read configuration from other directory and override SETTINGS
* CONFIGDIR: read configuration from other directory and override SETTINGS
Available build options are:
* ABI: a custom ABI (defaults to SETTINGS)
* ADDITIONS: a list of packages/plugins to add to images
* ARCH: the target architecture if not native
* COMPORT: serial port, e.g. "0x3f8" (default)
* COMSPEED: serial speed, e.g. "115200" (default)
* DEVICE: loads device-specific modifications, e.g. "A10" (default)
* FLAVOUR: "OpenSSL" (default), "LibreSSL", "Base"
* KERNEL: the kernel config to use, e.g. SMP (default)
@ -62,9 +64,8 @@ Available build options are:
* NAME: "OPNsense" (default)
* PRIVKEY: the private key for signing sets
* PUBKEY: the public key for signing sets
* SPEED: serial speed, e.g. "115200" (default)
* TYPE: the base name of the top package to be installed
* SUFFIX: the suffix of top package name (empty, "-devel")
* TYPE: the base name of the top package to be installed
* UEFI: Use amd64 hybrid images for said images, e.g. "vga vm"
* VERSION: a version tag (if applicable)

View File

@ -28,7 +28,7 @@
set -e
OPTS="A:a:B:b:C:c:D:d:E:e:F:f:G:g:H:h:I:K:k:L:l:m:n:O:o:P:p:q:R:r:S:s:T:t:U:u:v:V:"
OPTS="A:a:B:b:C:c:D:d:E:e:F:f:G:g:H:h:I:i:K:k:L:l:m:n:O:o:P:p:q:R:r:S:s:T:t:U:u:v:V:"
while getopts ${OPTS} OPT; do
case ${OPT} in
@ -50,7 +50,7 @@ while getopts ${OPTS} OPT; do
export COREDIR=${OPTARG}
;;
c)
export PRODUCT_SPEED=${OPTARG}
export PRODUCT_COMSPEED=${OPTARG}
;;
d)
export PRODUCT_DEVICE_REAL=${OPTARG}
@ -96,6 +96,9 @@ while getopts ${OPTS} OPT; do
I)
export UPLOADDIR=${OPTARG}
;;
i)
export PRODUCT_COMPORT=${OPTARG}
;;
L)
if [ -n "${OPTARG}" ]; then
export PRODUCT_SIGNCMD=${OPTARG}
@ -188,6 +191,8 @@ PORTSDIR
PORTSREFDIR
PRODUCT_ABI
PRODUCT_ARCH
PRODUCT_COMPORT
PRODUCT_COMSPEED
PRODUCT_DEVICE_REAL
PRODUCT_FLAVOUR
PRODUCT_GITBASE
@ -200,7 +205,6 @@ PRODUCT_PHP
PRODUCT_PYTHON
PRODUCT_RUBY
PRODUCT_SERVER
PRODUCT_SPEED
PRODUCT_TYPE
PRODUCT_VERSION
SRCBRANCH

View File

@ -29,7 +29,7 @@ nano_hook()
cat > ${1}/tmp/nano.xml << EOF
<use_mfs_tmp/>
<use_mfs_var/>
<serialspeed>${PRODUCT_SPEED}</serialspeed>
<serialspeed>${PRODUCT_COMSPEED}</serialspeed>
<primaryconsole>serial</primaryconsole>
<secondaryconsole>video</secondaryconsole>
EOF
@ -38,10 +38,10 @@ EOF
sed -i '' -e '/<rrd>/,/<\/rrd>/d' ${1}${CONFIG_XML}
echo "-S${PRODUCT_SPEED} -D" > ${1}/boot.config
echo "-S${PRODUCT_COMSPEED} -D" > ${1}/boot.config
cat >> ${1}/boot/loader.conf << EOF
comconsole_speed="${PRODUCT_SPEED}"
comconsole_speed="${PRODUCT_COMSPEED}"
console="comconsole,vidconsole"
boot_multicons="YES"
boot_serial="YES"
@ -55,16 +55,16 @@ serial_hook()
loader_conf_fixup ${1}
cat > ${1}/tmp/serial.xml << EOF
<serialspeed>${PRODUCT_SPEED}</serialspeed>
<serialspeed>${PRODUCT_COMSPEED}</serialspeed>
<primaryconsole>serial</primaryconsole>
EOF
sed -i '' -e "/<system>/r ${1}/tmp/serial.xml" ${1}${CONFIG_XML}
rm ${1}/tmp/serial.xml
echo "-S${PRODUCT_SPEED} -D" > ${1}/boot.config
echo "-S${PRODUCT_COMSPEED} -D" > ${1}/boot.config
cat >> ${1}/boot/loader.conf << EOF
comconsole_speed="${PRODUCT_SPEED}"
comconsole_speed="${PRODUCT_COMSPEED}"
console="comconsole"
boot_serial="YES"
EOF

View File

@ -29,7 +29,7 @@ nano_hook()
cat > ${1}/tmp/nano.xml << EOF
<use_mfs_tmp/>
<use_mfs_var/>
<serialspeed>${PRODUCT_SPEED}</serialspeed>
<serialspeed>${PRODUCT_COMSPEED}</serialspeed>
<primaryconsole>serial</primaryconsole>
<secondaryconsole>video</secondaryconsole>
EOF
@ -38,11 +38,11 @@ EOF
sed -i '' -e '/<rrd>/,/<\/rrd>/d' ${1}${CONFIG_XML}
echo "-S${PRODUCT_SPEED} -D" > ${1}/boot.config
echo "-S${PRODUCT_COMSPEED} -D" > ${1}/boot.config
cat >> ${1}/boot/loader.conf << EOF
hw.uart.console="io:0x3f8,br:${PRODUCT_SPEED}"
comconsole_speed="${PRODUCT_SPEED}"
hw.uart.console="io:${PRODUCT_COMPORT},br:${PRODUCT_COMSPEED}"
comconsole_speed="${PRODUCT_COMSPEED}"
console="comconsole,vidconsole"
boot_multicons="YES"
boot_serial="YES"
@ -56,17 +56,17 @@ serial_hook()
loader_conf_fixup ${1}
cat > ${1}/tmp/serial.xml << EOF
<serialspeed>${PRODUCT_SPEED}</serialspeed>
<serialspeed>${PRODUCT_COMSPEED}</serialspeed>
<primaryconsole>serial</primaryconsole>
EOF
sed -i '' -e "/<system>/r ${1}/tmp/serial.xml" ${1}${CONFIG_XML}
rm ${1}/tmp/serial.xml
echo "-S${PRODUCT_SPEED} -D" > ${1}/boot.config
echo "-S${PRODUCT_COMSPEED} -D" > ${1}/boot.config
cat >> ${1}/boot/loader.conf << EOF
hw.uart.console="io:0x3f8,br:${PRODUCT_SPEED}"
comconsole_speed="${PRODUCT_SPEED}"
hw.uart.console="io:${PRODUCT_COMPORT},br:${PRODUCT_COMSPEED}"
comconsole_speed="${PRODUCT_COMSPEED}"
console="comconsole"
boot_serial="YES"
EOF