#!/bin/sh

RELEASE=23.1R1.8
echo "${RELEASE%-[CN][0-9]*}" > $PKGSETS/$PKGSET/junos-release

OSMAJOR=12
current_osmajor=${current_osmajor:-`uname -r | sed 's,JNPR-\([1-9][0-9]*\).*,\1,'`}

if [ ${OSMAJOR:-0} -gt ${current_osmajor:-0} ]; then
    touch $PKGSETS/$PKGSET/.firstboot.upgrade
fi

# Copy additional configuration given during upgrade
if [ -n "$upgrade_with_config_files" ]; then
    dir_upgrade_config=$PKGSETS/$PKGSET/upgrade-config
    mkdir -p $dir_upgrade_config
    cp $upgrade_with_config_files $dir_upgrade_config
fi
# we do not need any of these any more
rm -f $PKGDIR/*.tgz
