aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2021-03-26 23:57:50 +0100
committerThomas Deutschmann <whissi@gentoo.org>2021-03-26 23:57:50 +0100
commitcbe66396bdcfdcecd0bbd933c1c94704fd43a13e (patch)
tree35f8a359003aee82eedff298de854ae6777ff0cd
parentlinuxrc: Fix log message (diff)
downloadgenkernel-cbe66396bdcfdcecd0bbd933c1c94704fd43a13e.tar.gz
genkernel-cbe66396bdcfdcecd0bbd933c1c94704fd43a13e.tar.bz2
genkernel-cbe66396bdcfdcecd0bbd933c1c94704fd43a13e.zip
gen_initramfs.sh: append_zfs(): Update UDEV dir in UDEV rules
Because we are copying UDEV rules from host system, we have to ensure that used UDEV dir matches our initramfs environment to prevent errors like failed to execute '/lib/udev/vdev_id' '/lib/udev/vdev_id -e': No such file or directory Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
-rwxr-xr-xgen_initramfs.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 9a9f07d..aedd038 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -1111,6 +1111,15 @@ append_zfs() {
local dest_file="${TDIR%/}${udev_file/${udevdir}/${udevdir_initramfs}}"
cp -aL "${udev_file}" "${dest_file}" \
|| gen_die "Failed to copy '${udev_file}' to '${dest_file}'"
+
+ if [[ "${dest_file}" == *.rules ]]
+ then
+ print_info 5 "Updating UDEV dir in '${dest_file}' ..."
+ sed -i \
+ -e "s|${udevdir}|${udevdir_initramfs}|g" \
+ "${dest_file}" \
+ || gen_die "Failed to update UDEV dir in '${dest_file}'"
+ fi
done
cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!"