Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Wilper <sxw@chronowerks.de>2021-01-01 03:15:33 +0100
committerSimon Wilper <sxw@chronowerks.de>2021-05-14 19:46:23 +0200
commitc3914f980fa2c59fa42bc17af73200cf5365bbf9 (patch)
treeb17f40e0ac6e3d18853eaa0cffdc9187232bcee5
parent3a5877d9f913d1151e8f729a46a7ecef643252b0 (diff)
add optional pv tool
use pv to give feedback on copying the airootfs to RAM when copytoram kernel parameter is given
-rw-r--r--hooks/archiso15
-rw-r--r--install/archiso1
2 files changed, 15 insertions, 1 deletions
diff --git a/hooks/archiso b/hooks/archiso
index 1b848ce..485fb0f 100644
--- a/hooks/archiso
+++ b/hooks/archiso
@@ -69,10 +69,23 @@ _mnt_sfs() {
# defined via initcpio's parse_cmdline()
if [ "${copytoram}" = "y" ]; then
msg -n ":: Copying squashfs image to RAM..."
- if ! cp -- "${img}" "/run/archiso/copytoram/${img_fullname}" ; then
+
+ # in case we have pv use it to display copy progress feedback otherwise
+ # fallback to using plain cp
+ if [ -x /usr/bin/pv ]; then
+ echo ""
+ (pv "${img}" > "/run/archiso/copytoram/${img_fullname}")
+ local rc=$?
+ else
+ (cp -- "${img}" "/run/archiso/copytoram/${img_fullname}")
+ local rc=$?
+ fi
+
+ if [ $rc != 0 ]; then
echo "ERROR: while copy '${img}' to '/run/archiso/copytoram/${img_fullname}'"
launch_interactive_shell
fi
+
img="/run/archiso/copytoram/${img_fullname}"
msg "done."
fi
diff --git a/install/archiso b/install/archiso
index 74948c7..df0f6b5 100644
--- a/install/archiso
+++ b/install/archiso
@@ -18,6 +18,7 @@ build() {
add_binary truncate
add_binary gpg
add_binary grep
+ add_binary pv
add_file /usr/lib/udev/rules.d/60-cdrom_id.rules
add_file /usr/lib/udev/rules.d/10-dm.rules