diff options
author | nachoparker <nacho@ownyourbits.com> | 2017-11-09 16:06:13 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2017-11-09 16:06:13 +0300 |
commit | 9fbdb3e357814f9f8398d229c4ed834f233bf023 (patch) | |
tree | 48c765361eefce656e342d2f71096dd031703a30 /buildlib.sh | |
parent | 1955ecec9c9cc368b48e14abff60a2be597954c2 (diff) |
build: fix devel build clash with unattended
Diffstat (limited to 'buildlib.sh')
-rw-r--r-- | buildlib.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/buildlib.sh b/buildlib.sh index 42352f7c..56b2240a 100644 --- a/buildlib.sh +++ b/buildlib.sh @@ -191,3 +191,19 @@ function generate_changelog() sed '/HEAD ->\|origin/s|\[.*\(tag: v[0-9]\+\.[0-9]\+\.[0-9]\+\).*\]|[\1]|' | \ sed 's|* \[tag: |\n[|' > changelog.md } + +function deactivate_unattended_upgrades() +{ + local IMG=$1 + local SECTOR + local OFFSET + SECTOR=$( fdisk -l "$IMG" | grep Linux | awk '{ print $2 }' ) + OFFSET=$(( SECTOR * 512 )) + + [ -f "$IMG" ] || { echo "no image"; return 1; } + mkdir -p tmpmnt + sudo mount "$IMG" -o offset="$OFFSET" tmpmnt || return 1 + sudo rm -f tmpmnt/etc/apt/apt.conf.d/20nextcloudpi-upgrades + sudo umount -l tmpmnt + rmdir tmpmnt &>/dev/null +} |