Commit 897b2c96 authored by Franco Fichtner's avatar Franco Fichtner

rc: add changelog fetch script for #341

parent 7116568b
......@@ -21,12 +21,11 @@ EOF
cat /etc/rc.bak >> /etc/rc
rm -f /etc/rc.bak
echo "Writing package version"
echo "Writing package metadata"
mkdir -p /usr/local/opnsense/version
if [ -f /usr/local/opnsense/version/opnsense ]; then
mv /usr/local/opnsense/version/opnsense /usr/local/opnsense/version/opnsense.last
fi
echo "%%CORE_COMMIT%%" > /usr/local/opnsense/version/opnsense
echo "%%CORE_NAME%%" > /usr/local/opnsense/version/opnsense.name
echo "%%CORE_ABI%%" > /usr/local/opnsense/version/opnsense.abi
......
/src/etc/pkg.conf
/src/etc/pkg/**
/src/etc/ssh/**
/src/etc/php/**
/src/etc/php.ini
/src/lib/**
*.DS_Store
*.codekit
*.mo
*.pyc
*.sass-cache
*.volt.php
*.pyc
*.mo
/src/etc/php.ini
/src/etc/php/**
/src/etc/pkg.conf
/src/etc/pkg/**
/src/etc/ssh/**
/src/lib/**
/src/opnsense/changelog
#!/bin/sh
# Copyright (c) 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
# 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.
set -e
CORE_ABI=$(cat /usr/local/opnsense/version/opnsense.abi 2> /dev/null)
SYS_ABI=$(opnsense-verify -a 2> /dev/null)
URL="https://pkg.opnsense.org"
URL="${URL}/${SYS_ABI}/${CORE_ABI}"
URL="${URL}/sets/changelog.txz"
DESTDIR="/usr/local/opnsense/changelog"
WORKDIR="/tmp/changelog"
FETCH="fetch -aqT 30"
rm -rf ${WORKDIR}
mkdir -p ${WORKDIR}
${FETCH} -o ${WORKDIR}/changelog.txz.sig "${URL}.sig"
${FETCH} -o ${WORKDIR}/changelog.txz "${URL}"
opnsense-verify -q ${WORKDIR}/changelog.txz
mkdir -p ${DESTDIR}
rm ${DESTDIR}/*
tar -C ${DESTDIR} -xJf ${WORKDIR}/changelog.txz
......@@ -62,6 +62,8 @@ tmp_pkg_update_file="/tmp/pkg_updates.output"
# Check if pkg is already runnig
pkg_running=`ps -x | grep "pkg " | grep -v "grep"`
if [ "$pkg_running" == "" ]; then
# load changelogs first
/usr/local/opnsense/scripts/firmware/changelog.sh
# start pkg update
pkg update -f > $tmp_pkg_update_file &
pkg_running="started" # Set running state to arbitrary value
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment