Optionally check for presence of pv and use - feedback sought#86
Optionally check for presence of pv and use - feedback sought#86nhi-vanye wants to merge 1 commit intoflatcar:flatcar-masterfrom
Conversation
If we find pv is installed on the system running flatcar-install, use it to report writing images to disk
| echo "Writing ${IMAGE_FILE}..." | ||
| if [[ "${IMAGE_FILE}" =~ \.bz2$ ]]; then | ||
| ${BZIP_UTIL} -cd "${IMAGE_FILE}" | write_to_disk | ||
| ${have_pv:-cat} "${IMAGE_FILE}" | ${BZIP_UTIL} -cd | write_to_disk |
There was a problem hiding this comment.
Thanks for your PR!
Could we do | "${have_pv:-cat}" | write_do_disk to show the same stats in both cases?
There was a problem hiding this comment.
it seems pv needs to be the first stage in the pipeline in order to include an ETA; when its streaming between stdin and out it doesn't know the total size...
Fitting it into the other places would obviously be easier in stream mode...
So I guess its code simplicity (streaming) vs features (first in pipeline) - I'm not tied to having an ETA so do you have a preferred approach ?
|
Maybe we should also limit the use of |
|
Or make it opt-in via an extra flag? |
Doh! Yes will do. |
optionally use PV to provide feedback while writing to disk
If we find pv is installed on the system running flatcar-install, use it to report writing imagefile to disk
How to use
Install from an image file (not a URL)
This is for feedback - I've only fixed the path I'm using (install from file), happy to extend this to the download path if requested.