--- a/sys-kernel/linux-firmware/linux-firmware-20191215.ebuild 2019-12-15 21:39:45.000000000 +0300 +++ b/sys-kernel/linux-firmware/linux-firmware-20191215.ebuild 2020-01-07 05:54:17.338158259 +0300 @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=7 -inherit mount-boot savedconfig +inherit mount-boot savedconfig multiprocessing if [[ ${PV} == 99999999* ]]; then inherit git-r3 @@ -21,13 +21,14 @@ LICENSE="GPL-2 GPL-2+ GPL-3 BSD MIT || ( linux-fw-redistributable ( BSD-2 BSD BSD-4 ISC MIT no-source-code ) ) unknown-license? ( all-rights-reserved )" SLOT="0" -IUSE="initramfs +redistributable savedconfig unknown-license" +IUSE="compress initramfs +redistributable savedconfig unknown-license" RESTRICT="binchecks strip unknown-license? ( bindist )" REQUIRED_USE="initramfs? ( redistributable )" -BDEPEND="initramfs? ( app-arch/cpio )" +BDEPEND="compress? ( app-arch/xz-utils ) + initramfs? ( app-arch/cpio )" #add anything else that collides to this RDEPEND="!savedconfig? ( @@ -297,6 +298,8 @@ src_prepare() { } src_install() { + local f target + save_config ${PN}.conf rm ${PN}.conf || die @@ -311,6 +314,17 @@ src_install() { die "Refusing to install an empty package" fi + if use compress; then + while IFS= read -r -d '' f; do + target=$(readlink "${f}") + ln -sf "${target}".xz "${f}" || die + mv "${f}" "${f}".xz || die + done < <(find . -type l -print0) + + find . -type f -print0 | \ + xargs -0 -P $(makeopts_jobs) -I'{}' xz -C crc32 '{}' || die + fi + insinto /lib/firmware/ doins -r * }