summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-07-11 14:15:42 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2022-07-11 14:15:42 -0400
commit080b746079f28d3a2d1956c31ee1e09f48ecdbce (patch)
tree0ac6b71ff8c20bd5cfc298588ed43a4a0590e8c9
parent8d4d826f2b1665f43d9eefa35cfba1b2d8a53189 (diff)
Add stress-ng to root image
Also, change root-image to not update the existing image in place, so we don't screw up running VMs. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-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()