cc_disk_setup: pass options in correct order to utils (#1829)
When testing cc_disk_setup it failed with the following error:
Unexpected error while running command.
Command: ['/sbin/mkfs.ext4', '/dev/sdc1', '-L', 'disk3-fs2']
Exit code: 1
Reason: -
Stdout:
Stderr: mke2fs 1.46.5 (30-Dec-2021)
mkfs.ext4: invalid blocks '-L' on device '/dev/sdc1'
The manpages for mkfs.ext4, mkfs.xfs, and mkswap all indicate that
options should be passed *before* the device name but cc_disk_setup
passed them after the device name - in the case of mkfx.ext4 a
"fs-size" can be passed after the device and that is what the
"-L disk3-fs2" option is being misintepreted as.
This PR ensures that the device name is passed last. The underlying
issue appears to be due to a different in behaviour between glibc and
musl where glibc "helps" applications by re-ordered command-line
parameters by musl does not[1] as it sticks to POSIX spec.
This PR also modifies 2 testcases to cater for this change in the code,
adds a note to disk_setup to clarify that when creating a swap partition
a fs_entry also needs to be specified so that mkswap is run, adds to the
examples how to specify a non-default partition type (i.e. for swap),
and modifies the description for disk_setup to clarify this.
[1] https://wiki.musl-libc.org/functional-differences-from-glibc.html#Miscellaneous_functions_with_GNU_quirks