commit: 5beccf3249ee273c9c84ead6491981ace7d3d2a6
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 12 14:22:22 2024 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sat Oct 12 14:22:22 2024 +0000
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=5beccf32
Improve logging output
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
targets/support/create-qcow2.sh | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/targets/support/create-qcow2.sh b/targets/support/create-qcow2.sh
index 62bfe136..fcf93d34 100755
--- a/targets/support/create-qcow2.sh
+++ b/targets/support/create-qcow2.sh
@@ -48,7 +48,7 @@ qcow2die() {
die "$@"
}
-echo "Creating a new qcow2 disk image file"
+echo "Creating a new qcow2 disk image file ${myqcow2}.tmp.qcow2 with size
${clst_qcow2_size/%iB/}"
qemu-img create -f qcow2 "${myqcow2}.tmp.qcow2" ${clst_qcow2_size/%iB/} ||
qcow2die "Cannot create qcow2 file"
echo "Connecting the qcow2 file to network block device ${mydevice}"
@@ -74,25 +74,28 @@ mypartroot=${mydevice}p2
echo "Re-reading the partition table"
partprobe ${mydevice} || qcow2die "Probing partition table failed"
+echo "Printing the partition table"
+parted -s ${mydevice} -- print || qcow2die "Printing the partition table
failed"
+
echo "Making a vfat filesystem in p1"
-mkfs.fat -F 32 ${mypartefi} || qcow2die "Formatting EFI partition failed"
+mkfs.fat -v -F 32 ${mypartefi} || qcow2die "Formatting EFI partition failed"
echo "Making an xfs filesystem in p2"
mkfs.xfs ${mypartroot} || qcow2die "Formatting root partition failed"
-echo "Mounting things"
+echo "Mounting things at ${mymountpoint}"
mkdir -p "${mymountpoint}" || qcow2die "Could not create root mount point"
mount ${mypartroot} "${mymountpoint}" || qcow2die "Could not mount root
partition"
mkdir -p "${mymountpoint}"/boot || qcow2die "Could not create boot mount point"
mount ${mypartefi} "${mymountpoint}/boot" || qcow2die "Could not mount boot
partition"
# copy contents in; the source is the stage dir and not any "iso content"
-echo "Copying files into the mounted directories"
+echo "Copying files into the mounted directories from ${clst_stage_path}"
cp -a "${clst_stage_path}"/* "${mymountpoint}/" || qcow2die "Could not copy
content into mounted image"
# at this point we have a working system
-echo "Creating a CONTENTS file"
+echo "Creating a CONTENTS file ${myqcow2}.CONTENTS"
pushd "${mymountpoint}/" &> /dev/null || qcow2die "Could not cd into
mountpoint"
ls -laR > "${myqcow2}.CONTENTS" || qcow2die "Could not create CONTENTS
file"
popd &> /dev/null || qcow2die "Could not cd out of
mountpoint"
@@ -115,7 +118,7 @@ umount "${mymountpoint}" || qcow2die "Could not unmount
root partition"
echo "Disconnecting ${mydevice}"
qemu-nbd -d ${mydevice} || qcow2die "Could not disconnect ${mydevice}"
-echo "Rewriting the qcow2 with stream compression"
+echo "Rewriting the qcow2 file with stream compression to ${myqcow2}"
qemu-img convert -c -O qcow2 "${myqcow2}.tmp.qcow2" "${myqcow2}" || qcow2die
"Could not compress QCOW2 file"
echo "Cleaning up"