#!/bin/sh

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

# this is created by JSU
rm -f $PKGSETS/$PKGSET/junos-version

OSMAJOR=15
case "$PKG_BOOTSTRAP" in
img) ;; # building a vm image ignore uname
*)
    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
    ;;
esac

# 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
