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:
Mike Frysinger
2012-04-16 15:59:35 -04:00
committed by Gerrit
parent db1d5b20f8
commit caddf52936
2 changed files with 2 additions and 4 deletions

View File

@@ -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"

View File

@@ -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"