Commit bb503b90 authored by Simon Wilper's avatar Simon Wilper
Browse files

add optional pv tool

use pv to give feedback on copying the airootfs to RAM when copytoram
kernel parameter is given
parent 28ab1180
...@@ -69,10 +69,23 @@ _mnt_sfs() { ...@@ -69,10 +69,23 @@ _mnt_sfs() {
# defined via initcpio's parse_cmdline() # defined via initcpio's parse_cmdline()
if [ "${copytoram}" = "y" ]; then if [ "${copytoram}" = "y" ]; then
msg -n ":: Copying squashfs image to RAM..." 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}'" echo "ERROR: while copy '${img}' to '/run/archiso/copytoram/${img_fullname}'"
launch_interactive_shell launch_interactive_shell
fi fi
img="/run/archiso/copytoram/${img_fullname}" img="/run/archiso/copytoram/${img_fullname}"
msg "done." msg "done."
fi fi
......
...@@ -18,6 +18,7 @@ build() { ...@@ -18,6 +18,7 @@ build() {
add_binary truncate add_binary truncate
add_binary gpg add_binary gpg
add_binary grep add_binary grep
add_binary pv
add_file /usr/lib/udev/rules.d/60-cdrom_id.rules add_file /usr/lib/udev/rules.d/60-cdrom_id.rules
add_file /usr/lib/udev/rules.d/10-dm.rules add_file /usr/lib/udev/rules.d/10-dm.rules
......
#
# SPDX-License-Identifier: GPL-3.0-or-later
title Arch Linux (x86_64, UEFI) Copy to RAM
linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux
initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux.img
options archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% copytoram
...@@ -6,6 +6,7 @@ linux ...@@ -6,6 +6,7 @@ linux
mkinitcpio mkinitcpio
mkinitcpio-archiso mkinitcpio-archiso
openssh openssh
pv
qemu-guest-agent qemu-guest-agent
syslinux syslinux
virtualbox-guest-utils-nox virtualbox-guest-utils-nox
...@@ -6,3 +6,9 @@ MENU LABEL Arch Linux (x86_64, BIOS) ...@@ -6,3 +6,9 @@ MENU LABEL Arch Linux (x86_64, BIOS)
LINUX /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux LINUX /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux
INITRD /%INSTALL_DIR%/boot/%ARCH%/initramfs-linux.img INITRD /%INSTALL_DIR%/boot/%ARCH%/initramfs-linux.img
APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL%
LABEL arch-ram
MENU LABEL Arch Linux (x86_64, BIOS) Copy to RAM
LINUX /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux
INITRD /%INSTALL_DIR%/boot/%ARCH%/initramfs-linux.img
APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% copytoram
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment