diff options
author | nachoparker <nacho@ownyourbits.com> | 2017-11-09 21:12:42 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2017-11-10 11:15:38 +0300 |
commit | f557c8d8b643aef38228a84e23489f2e17a94b4e (patch) | |
tree | e4befe155a540eb4d7c36bbc61d94b7e4b64cb8a /buildlib.sh | |
parent | 94b7021f1f3ad0d0d83fbd647b854d5343b077c0 (diff) |
Revert "update: wait running apt processes"v0.34.2
This reverts commit 31470473f8418a47156545d73e4952ef7edbcc48.
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 56b2240a..a1d8b20e 100644 --- a/buildlib.sh +++ b/buildlib.sh @@ -143,6 +143,22 @@ function copy_to_image() rmdir tmpmnt &>/dev/null } +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 +} + function download_resize_raspbian_img() { local SIZE=$1 |