diff options
author | 2020-07-23 22:52:00 +0200 | |
---|---|---|
committer | 2020-07-24 00:56:47 +0200 | |
commit | 31475eb3e28e326553c89753874df3171cdf33ec (patch) | |
tree | f002db5ed6f1a5d59ed9050c7af9ce06bd62e45b /gen_initramfs.sh | |
parent | cryptsetup: Enable UDEV support (diff) | |
download | genkernel-31475eb3e28e326553c89753874df3171cdf33ec.tar.gz genkernel-31475eb3e28e326553c89753874df3171cdf33ec.tar.bz2 genkernel-31475eb3e28e326553c89753874df3171cdf33ec.zip |
bcache: Switch to UDEV usage
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'gen_initramfs.sh')
-rwxr-xr-x | gen_initramfs.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 0669f740..af0ff44e 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -398,6 +398,7 @@ append_base_layout() { isTrue "${MICROCODE_INITRAMFS}" && build_parameters+=( --microcode-initramfs ) || build_parameters+=( --no-microcode-initramfs ) isTrue "${RAMDISKMODULES}" && build_parameters+=( --ramdisk-modules ) || build_parameters+=( --no-ramdisk-modules ) isTrue "${BUSYBOX}" && build_parameters+=( --busybox ) || build_parameters+=( --no-busybox ) + isTrue "${BCACHE}" && build_parameters+=( --bcache ) || build_parameters+=( --no-bcache ) isTrue "${B2SUM}" && build_parameters+=( --b2sum ) || build_parameters+=( --no-b2sum ) isTrue "${DISKLABEL}" && build_parameters+=( --disklabel ) || build_parameters+=( --no-disklabel ) isTrue "${BTRFS}" && build_parameters+=( --btrfs ) || build_parameters+=( --no-btrfs ) @@ -608,6 +609,32 @@ append_b2sum() { fi } +append_bcache() { + local PN="bcache-tools" + local TDIR="${TEMP}/initramfs-bcache-temp" + if [ -d "${TDIR}" ] + then + rm -r "${TDIR}" || gen_die "Failed to clean out existing '${TDIR}'!" + fi + + populate_binpkg ${PN} + + mkdir -p "${TDIR}" || gen_die "Failed to create '${TDIR}'!" + + unpack "$(get_gkpkg_binpkg "${PN}")" "${TDIR}" + + cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!" + log_future_cpio_content + find . -print0 | "${CPIO_COMMAND}" ${CPIO_ARGS} --append -F "${CPIO_ARCHIVE}" \ + || gen_die "Failed to append bcache to cpio!" + + cd "${TEMP}" || die "Failed to chdir to '${TEMP}'!" + if isTrue "${CLEANUP}" + then + rm -rf "${TDIR}" + fi +} + append_blkid() { local PN="util-linux" local TDIR="${TEMP}/initramfs-blkid-temp" @@ -1869,6 +1896,7 @@ create_initramfs() { append_data 'iscsi' "${ISCSI}" append_data 'luks' "${LUKS}" append_data 'lvm' "${LVM}" + append_data 'bcache' "${BCACHE}" append_data 'mdadm' "${MDADM}" append_data 'modprobed' append_data 'multipath' "${MULTIPATH}" |