diff options
author | Mike Frysinger <vapier@chromium.org> | 2012-04-16 15:59:35 -0400 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-04-16 14:00:21 -0700 |
commit | caddf529360e3a515729084bb735b3b4e88c112a (patch) | |
tree | 9a321f00311dd4d910dcc6cdf8507d8ce56239de | |
parent | db1d5b20f890c2109a19e7626321c3d51e13e813 (diff) | |
download | vboot-caddf529360e3a515729084bb735b3b4e88c112a.tar.gz |
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>
-rwxr-xr-x | scripts/image_signing/remove_test_label.sh | 3 | ||||
-rwxr-xr-x | scripts/image_signing/set_lsb_release.sh | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/scripts/image_signing/remove_test_label.sh b/scripts/image_signing/remove_test_label.sh index 976f5e6d..6423e390 100755 --- a/scripts/image_signing/remove_test_label.sh +++ b/scripts/image_signing/remove_test_label.sh @@ -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" diff --git a/scripts/image_signing/set_lsb_release.sh b/scripts/image_signing/set_lsb_release.sh index 3299d5bf..5d859d81 100755 --- a/scripts/image_signing/set_lsb_release.sh +++ b/scripts/image_signing/set_lsb_release.sh @@ -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" |