mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-19 19:15:22 +00:00
firmware: size for kernel / base
This commit is contained in:
parent
7f4f0821eb
commit
c5a586e068
@ -742,6 +742,8 @@ class FirmwareController extends ApiControllerBase
|
||||
}
|
||||
}
|
||||
|
||||
/* XXX fixup kernel/base set size */
|
||||
|
||||
/* mark remote packages as "provided", local as "installed" */
|
||||
$translated['provided'] = $type == 'remote' ? "1" : "0";
|
||||
$translated['installed'] = $type == 'local' ? "1" : "0";
|
||||
|
||||
@ -273,13 +273,13 @@ if [ "$pkg_running" == "" ]; then
|
||||
elif [ -z "$base_to_reboot" ]; then
|
||||
if opnsense-update -cbf; then
|
||||
base_to_reboot="$(opnsense-update -v)"
|
||||
# XXX arch return is obsolete
|
||||
base_to_reboot="${base_to_reboot%-*}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$base_to_reboot" ]; then
|
||||
base_to_delete="$(opnsense-update -bv)"
|
||||
base_to_delete="${base_to_delete%-*}"
|
||||
base_to_delete="$(opnsense-version -vp base)"
|
||||
base_is_size="$(opnsense-update -bfSr $base_to_reboot)"
|
||||
if [ "$base_to_reboot" != "$base_to_delete" -a -n "$base_is_size" ]; then
|
||||
if [ "$packages_upgraded" == "" ]; then
|
||||
@ -301,13 +301,13 @@ if [ "$pkg_running" == "" ]; then
|
||||
elif [ -z "$kernel_to_reboot" ]; then
|
||||
if opnsense-update -cfk; then
|
||||
kernel_to_reboot="$(opnsense-update -v)"
|
||||
# XXX arch return is obsolete
|
||||
kernel_to_reboot="${kernel_to_reboot%-*}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$kernel_to_reboot" ]; then
|
||||
kernel_to_delete="$(opnsense-update -kv)"
|
||||
kernel_to_delete="${kernel_to_delete%-*}"
|
||||
kernel_to_delete="$(opnsense-version -vp kernel)"
|
||||
kernel_is_size="$(opnsense-update -fkSr $kernel_to_reboot)"
|
||||
if [ "$kernel_to_reboot" != "$kernel_to_delete" -a -n "$kernel_is_size" ]; then
|
||||
if [ "$packages_upgraded" == "" ]; then
|
||||
|
||||
@ -58,18 +58,21 @@ for PATTERN in ${MTREE_PATTERNS}; do
|
||||
done
|
||||
|
||||
VERSION=$(opnsense-update -v)
|
||||
# XXX only for migration
|
||||
VERSION=${VERSION%-*}
|
||||
|
||||
set_check()
|
||||
{
|
||||
SET=${1}
|
||||
FILE=${2}
|
||||
VER=${3}
|
||||
|
||||
if [ ! -f ${BASE_MTREE} ]; then
|
||||
# XXX complain if file is missing post-18.7
|
||||
return
|
||||
fi
|
||||
|
||||
VER=$(opnsense-version -p ${SET})
|
||||
|
||||
echo ">>> Check installed ${SET} version" >> ${PKG_PROGRESS_FILE}
|
||||
if [ -z "${VER}" -o -z "${VERSION}" ]; then
|
||||
echo "Failed to determine version info."
|
||||
@ -105,8 +108,8 @@ set_check()
|
||||
}
|
||||
|
||||
echo "***GOT REQUEST TO AUDIT HEALTH***" >> ${PKG_PROGRESS_FILE}
|
||||
set_check kernel ${KERNEL_MTREE} "$(opnsense-update -kv)"
|
||||
set_check base ${BASE_MTREE} "$(opnsense-update -bv)"
|
||||
set_check kernel ${KERNEL_MTREE}
|
||||
set_check base ${BASE_MTREE}
|
||||
echo ">>> Check for and install missing package dependencies" >> ${PKG_PROGRESS_FILE}
|
||||
pkg check -da >> ${PKG_PROGRESS_FILE} 2>&1
|
||||
echo ">>> Check for missing or altered package files" >> ${PKG_PROGRESS_FILE}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2017 Franco Fichtner <franco@opnsense.org>
|
||||
# Copyright (C) 2017-2018 Franco Fichtner <franco@opnsense.org>
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@ -25,11 +25,14 @@
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
LIC="BSD2CLAUSE"
|
||||
OS="FreeBSD"
|
||||
OS="HardenedBSD"
|
||||
SEP=${1:-","}
|
||||
|
||||
BV=$(opnsense-update -bv)
|
||||
KV=$(opnsense-update -kv)
|
||||
BV=$(opnsense-version -vp base)
|
||||
KV=$(opnsense-version -vp kernel)
|
||||
|
||||
BS=$(opnsense-version -sp base)
|
||||
KS=$(opnsense-version -sp kernel)
|
||||
|
||||
BL=0
|
||||
KL=0
|
||||
@ -37,5 +40,5 @@ KL=0
|
||||
opnsense-update -Tb || BL=1
|
||||
opnsense-update -Tk || KL=1
|
||||
|
||||
echo "base${SEP}${BV%-*}${SEP}${OS} userland set${SEP}${SEP}${BL}${SEP}${LIC}"
|
||||
echo "kernel${SEP}${KV%-*}${SEP}${OS} kernel set${SEP}${SEP}${KL}${SEP}${LIC}"
|
||||
echo "base${SEP}${BV%-*}${SEP}${OS} userland set${SEP}${BS}${SEP}${BL}${SEP}${LIC}"
|
||||
echo "kernel${SEP}${KV%-*}${SEP}${OS} kernel set${SEP}${BS}${SEP}${KL}${SEP}${LIC}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user