mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
swmodd: 2.1.16
This commit is contained in:
parent
b29e32fcb7
commit
7babfc6995
2 changed files with 11 additions and 17 deletions
|
|
@ -5,7 +5,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=swmodd
|
||||
PKG_VERSION:=2.1.15
|
||||
PKG_VERSION:=2.1.16
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
|
|
|
|||
|
|
@ -101,6 +101,13 @@ update_network_ns() {
|
|||
json_select ..
|
||||
}
|
||||
|
||||
nginx_hack() {
|
||||
# replace nginx user to root user
|
||||
if [ -f "${BUNDLE:?}/${NAME:?}/rootfs/etc/nginx/nginx.conf" ]; then
|
||||
sed -i 's/^user .*;$/user root;/' "${BUNDLE}/${NAME}/rootfs/etc/nginx/nginx.conf"
|
||||
fi
|
||||
}
|
||||
|
||||
update_config_json() {
|
||||
|
||||
if [ ! -f "${BUNDLE:?}/${NAME:?}/config.json" ]; then
|
||||
|
|
@ -125,10 +132,12 @@ update_config_json() {
|
|||
json_select linux
|
||||
json_for_each_item update_network_ns namespaces
|
||||
json_dump >config.json
|
||||
|
||||
nginx_hack
|
||||
}
|
||||
|
||||
pull_image_from_registry() {
|
||||
local temp raw blobsize disksize exsize
|
||||
local temp disksize exsize
|
||||
|
||||
if [ -z "${BUNDLE}" -o -z "${NAME}" -o -z "${REGURL}" ]; then
|
||||
log "Information missing for installation"
|
||||
|
|
@ -155,21 +164,6 @@ pull_image_from_registry() {
|
|||
OPTS="--src-creds ${LOGIN}"
|
||||
INSPECT_OPT="--creds ${LOGIN}"
|
||||
fi
|
||||
# inspect and get size check system
|
||||
raw=$(skopeo --command-timeout 30s inspect ${INSPECT_OPT} --raw ${REGURL})
|
||||
blobsize=$(echo $raw|jq '[ .layers[].size ] | add' 2>/dev/null)
|
||||
if [ -z "${blobsize}" ]; then
|
||||
blobsize=0
|
||||
fi
|
||||
|
||||
exsize=$(( blobsize * 2 ))
|
||||
# Get the available disk space
|
||||
disksize=$(df -P -k ${temp} |tail -n +2 |awk '{print $4}')
|
||||
if [ "${disksize}" -lt "${exsize}" ]; then
|
||||
log "Not enough memory ${blobsize} available ${disksize}, download aborted"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! skopeo --command-timeout 4m copy ${OPTS} ${REGURL} oci:${NAME}_tmp:latest >/dev/null 2>&1; then
|
||||
log "Failed to download image"
|
||||
cd -
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue