mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-26 19:25:02 +00:00
signer scripts: use make_temp_dir helper
The common code takes care of cleaning up temporary files for us if we use the right helpers. These scripts don't though, so the temp files end up not getting cleaned and over time, /tmp/ files up with crap. The common helper takes care of unmounting and removing, so converting these files over should be safe. BUG=None TEST=`./signer/signer_poller.py -s` signs local images and leaves no /tmp/tmp.* junk Change-Id: I87aa122895997a5ec0017665203fdc8d14e0ab2a Reviewed-on: https://gerrit.chromium.org/gerrit/20329 Reviewed-by: Gaurav Shah <gauravsh@chromium.org> Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
set -e
|
||||
image=$1
|
||||
|
||||
rootfs=$(mktemp -d)
|
||||
rootfs=$(make_temp_dir)
|
||||
mount_image_partition ${image} 3 ${rootfs}
|
||||
trap "umount ${rootfs}; rm -rf ${rootfs}" EXIT
|
||||
sed -i 's/test//' "${rootfs}/etc/lsb-release"
|
||||
|
||||
@@ -47,9 +47,8 @@ EOF
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local rootfs=$(mktemp -d)
|
||||
local rootfs=$(make_temp_dir)
|
||||
mount_image_partition_ro "$image" 3 "$rootfs"
|
||||
trap "sudo umount $rootfs; rm -rf $rootfs" EXIT
|
||||
if [ -n "$key" ]; then
|
||||
sudo umount "$rootfs"
|
||||
mount_image_partition "$image" 3 "$rootfs"
|
||||
|
||||
Reference in New Issue
Block a user