You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qubes-installer-qubes-os/anaconda/dracut/fetch-updates-disk

34 lines
828 B

#!/bin/bash
# fetch-updates-disk - fetch updates from a block device
command -v getarg >/dev/null || . /lib/dracut-lib.sh
command -v unpack_updates_img >/dev/null || . /lib/anaconda-lib.sh
dev="$1"
path="${2:-/updates.img}"
[ -d "$path" ] && path=$path/updates.img
[ -b "$dev" ] || exit 1
info "anaconda: fetching updates from $dev:$path"
mnt="$(find_mount $dev)"
if [ -n "$mnt" ]; then
cp $mnt$path /tmp/updates.img
else
tmpmnt="$(mkuniqdir /run/install tmpmnt)"
if mount -o ro $dev $tmpmnt; then
cp $tmpmnt$path /tmp/updates.img
umount $tmpmnt
fi
rmdir $tmpmnt
fi
if [ -f /tmp/updates.img ]; then
unpack_updates_img /tmp/updates.img /updates
rm /tmp/updates.img
echo "$dev:$path" >> /tmp/liveupdates.done
else
warn "anaconda: failed to get updates from $dev:$path"
fi