Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-kernel/linux-firmware/
Date: Sat, 03 Aug 2019 17:42:16
Message-Id: 1564854125.ab67f953d2114b604581132459ed7a9e4cbdf4df.whissi@gentoo
1 commit: ab67f953d2114b604581132459ed7a9e4cbdf4df
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Sat Aug 3 17:41:05 2019 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Sat Aug 3 17:42:05 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ab67f953
7
8 sys-kernel/linux-firmware: hide mount-boot function calls behind USE flag
9
10 This will avoid unnecessary mount/umount of /boot when USE=-initramfs.
11
12 Package-Manager: Portage-2.3.69, Repoman-2.3.16
13 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
14
15 .../linux-firmware-20190726-r2.ebuild | 21 ++++++++++++++++++---
16 .../linux-firmware/linux-firmware-99999999.ebuild | 21 ++++++++++++++++++---
17 2 files changed, 36 insertions(+), 6 deletions(-)
18
19 diff --git a/sys-kernel/linux-firmware/linux-firmware-20190726-r2.ebuild b/sys-kernel/linux-firmware/linux-firmware-20190726-r2.ebuild
20 index 6e50d29e9c7..0dfd117b3b8 100644
21 --- a/sys-kernel/linux-firmware/linux-firmware-20190726-r2.ebuild
22 +++ b/sys-kernel/linux-firmware/linux-firmware-20190726-r2.ebuild
23 @@ -27,6 +27,7 @@ RESTRICT="binchecks strip
24
25 BDEPEND="initramfs? ( app-arch/cpio )"
26
27 +#add anything else that collides to this
28 RDEPEND="!savedconfig? (
29 redistributable? (
30 !sys-firmware/alsa-firmware[alsa_cards_ca0132]
31 @@ -71,7 +72,9 @@ RDEPEND="!savedconfig? (
32 )
33 )"
34
35 -#add anything else that collides to this
36 +pkg_pretend() {
37 + use initramfs && mount-boot_pkg_pretend
38 +}
39
40 src_unpack() {
41 if [[ ${PV} == 99999999* ]]; then
42 @@ -317,7 +320,8 @@ pkg_preinst() {
43 ewarn "USE=savedconfig is active. You must handle file collisions manually."
44 fi
45
46 - mount-boot_pkg_preinst
47 + # Make sure /boot is available if needed.
48 + use initramfs && mount-boot_pkg_preinst
49 }
50
51 pkg_postinst() {
52 @@ -335,5 +339,16 @@ pkg_postinst() {
53 fi
54 done
55
56 - mount-boot_pkg_postinst
57 + # Don't forget to umount /boot if it was previously mounted by us.
58 + use initramfs && mount-boot_pkg_postinst
59 +}
60 +
61 +pkg_prerm() {
62 + # Make sure /boot is mounted so that we can remove /boot/amd-uc.img!
63 + use initramfs && mount-boot_pkg_prerm
64 +}
65 +
66 +pkg_postrm() {
67 + # Don't forget to umount /boot if it was previously mounted by us.
68 + use initramfs && mount-boot_pkg_postrm
69 }
70
71 diff --git a/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild b/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild
72 index 6fd9059b3d5..0211e6e23f2 100644
73 --- a/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild
74 +++ b/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild
75 @@ -27,6 +27,7 @@ RESTRICT="binchecks strip
76
77 BDEPEND="initramfs? ( app-arch/cpio )"
78
79 +#add anything else that collides to this
80 RDEPEND="!savedconfig? (
81 redistributable? (
82 !sys-firmware/alsa-firmware[alsa_cards_ca0132]
83 @@ -71,7 +72,9 @@ RDEPEND="!savedconfig? (
84 )
85 )"
86
87 -#add anything else that collides to this
88 +pkg_pretend() {
89 + use initramfs && mount-boot_pkg_pretend
90 +}
91
92 src_unpack() {
93 if [[ ${PV} == 99999999* ]]; then
94 @@ -317,7 +320,8 @@ pkg_preinst() {
95 ewarn "USE=savedconfig is active. You must handle file collisions manually."
96 fi
97
98 - mount-boot_pkg_preinst
99 + # Make sure /boot is available if needed.
100 + use initramfs && mount-boot_pkg_preinst
101 }
102
103 pkg_postinst() {
104 @@ -335,5 +339,16 @@ pkg_postinst() {
105 fi
106 done
107
108 - mount-boot_pkg_postinst
109 + # Don't forget to umount /boot if it was previously mounted by us.
110 + use initramfs && mount-boot_pkg_postinst
111 +}
112 +
113 +pkg_prerm() {
114 + # Make sure /boot is mounted so that we can remove /boot/amd-uc.img!
115 + use initramfs && mount-boot_pkg_prerm
116 +}
117 +
118 +pkg_postrm() {
119 + # Don't forget to umount /boot if it was previously mounted by us.
120 + use initramfs && mount-boot_pkg_postrm
121 }