summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xroot_image15
1 files changed, 9 insertions, 6 deletions
diff --git a/root_image b/root_image
index 09dc97f..fcc152d 100755
--- a/root_image
+++ b/root_image
@@ -78,7 +78,8 @@ PACKAGES=(kexec-tools less psmisc openssh-server \
gdb strace ltrace linux-perf trace-cmd blktrace sysstat \
hdparm mdadm lvm2 \
btrfs-progs jfsutils nilfs-tools f2fs-tools \
- bc attr gawk acl rsync git python3-docutils)
+ bc attr gawk acl rsync git python3-docutils \
+ stress-ng)
# stress testing:
PACKAGES+=(fio dbench bonnie++ fsmark)
@@ -237,9 +238,9 @@ update_oob_packages()
trim_image()
{
- e2fsck -f "$ktest_image"
- resize2fs -M "$ktest_image" # shrinks the file
- resize2fs "$ktest_image" "$IMAGE_SIZE" # re-grows as sparse
+ e2fsck -f "$1"
+ resize2fs -M "$1" # shrinks the file
+ resize2fs "$1" "$IMAGE_SIZE" # re-grows as sparse
}
umount_image()
@@ -264,14 +265,16 @@ cmd_update()
MNT=$(mktemp --tmpdir -d $(basename "$0")-XXXXXXXXXX)
trap 'umount_image' EXIT
- mount "$ktest_image" "$MNT"
+ cp "$ktest_image" "$ktest_image".new
+ mount "$ktest_image".new "$MNT"
update_packages
update_oob_packages
update_files
umount_image
- trim_image
+ trim_image "$ktest_image".new
+ mv "$ktest_image".new "$ktest_image"
}
cmd_create()