1
0
mirror of https://github.com/rancher/os.git synced 2025-09-07 17:54:57 +00:00

Fix installation and trim packages

This commit is contained in:
Darren Shepherd
2021-11-03 22:06:12 -07:00
parent 85e1eb9320
commit f35b3697c3
11 changed files with 167 additions and 43 deletions

View File

@@ -2,15 +2,32 @@
set -x -e
HOST_DIR="${HOST_DIR:-/host}"
RELEASE_FILE="${RELEASE_FILE:-/usr/lib/rancheros-release}"
CONF_FILE="${CONF_FILE:-/run/data/cloud-config}"
function config()
{
if [ ! -e $CONF_FILE ]; then
return 0
fi
if [ ! -e ${HOST}/oem/90_operator.yaml ] || ! diff $CONF_FILE ${HOST}/oem/90/operator.yaml >/dev/null; then
cp -f $CONF_FILE ${HOST}/oem/90/operator.yaml
$REBOOT
fi
}
if [ "$FORCE" != "true" ]; then
if diff $RELEASE_FILE ${HOST_DIR}${RELEASE_FILE} >/dev/null; then
echo Update to date with
cat ${RELEASE_FILE}
REBOOT="nsenter -i -m -t 1 -- reboot"
config
exit 0
fi
fi
config
mount --rbind $HOST_DIR/dev /dev
mount --rbind $HOST_DIR/run /run
bash -x cos-upgrade --directory /