public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Andrew Nowa Ammerlaan <andrewammerlaan@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: [gentoo-dev] [PATCH 4/5] sys-kernel/linux-firmware: complain less when /boot is not, mounted
Date: Wed, 26 Jun 2024 22:08:33 +0200	[thread overview]
Message-ID: <6dea0d2f-c4aa-4604-8ec2-df1f93bfc13c@gentoo.org> (raw)
In-Reply-To: <445f5086-fc75-4a54-bba7-ee3e7ccf035b@gentoo.org>

 From 45a34aecafa64a666976e3d3d7944f8c8ff1e058 Mon Sep 17 00:00:00 2001
From: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
Date: Tue, 25 Jun 2024 16:32:42 +0200
Subject: [PATCH] sys-kernel/linux-firmware: complain less when /boot is not
  mounted

when using dist-kernel we can correct the problem and then
emerge --config ...

Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
---
  .../linux-firmware-20240410.ebuild            | 21 +++++++++++++------
  .../linux-firmware-20240513.ebuild            | 21 +++++++++++++------
  .../linux-firmware-20240610.ebuild            | 21 +++++++++++++------
  .../linux-firmware-99999999.ebuild            | 21 +++++++++++++------
  4 files changed, 60 insertions(+), 24 deletions(-)

diff --git a/sys-kernel/linux-firmware/linux-firmware-20240410.ebuild 
b/sys-kernel/linux-firmware/linux-firmware-20240410.ebuild
index 1bb6954d00c88..b8bbed17f1a6d 100644
--- a/sys-kernel/linux-firmware/linux-firmware-20240410.ebuild
+++ b/sys-kernel/linux-firmware/linux-firmware-20240410.ebuild
@@ -69,7 +69,15 @@ QA_PREBUILT="*"
  PATCHES=( "${FILESDIR}"/${PN}-copy-firmware-r4.patch )

  pkg_pretend() {
-	use initramfs && mount-boot_pkg_pretend
+	if use initramfs; then
+		if [[ -z ${ROOT} ]] && use dist-kernel; then
+			# Check, but don't die because we can fix the problem and then
+			# emerge --config ... to re-run installation.
+			nonfatal mount-boot_check_status
+		else
+			mount-boot_pkg_pretend
+		fi
+	fi
  }

  pkg_setup() {
@@ -379,7 +387,7 @@ pkg_preinst() {
  	fi

  	# Make sure /boot is available if needed.
-	use initramfs && mount-boot_pkg_preinst
+	use initramfs && ! use dist-kernel && mount-boot_pkg_preinst
  }

  pkg_postinst() {
@@ -397,21 +405,22 @@ pkg_postinst() {
  		fi
  	done

-	# Don't forget to umount /boot if it was previously mounted by us.
  	if use initramfs; then
  		if [[ -z ${ROOT} ]] && use dist-kernel; then
  			dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}"
+		else
+			# Don't forget to umount /boot if it was previously mounted by us.
+			mount-boot_pkg_postinst
  		fi
-		mount-boot_pkg_postinst
  	fi
  }

  pkg_prerm() {
  	# Make sure /boot is mounted so that we can remove /boot/amd-uc.img!
-	use initramfs && mount-boot_pkg_prerm
+	use initramfs && ! use dist-kernel && mount-boot_pkg_prerm
  }

  pkg_postrm() {
  	# Don't forget to umount /boot if it was previously mounted by us.
-	use initramfs && mount-boot_pkg_postrm
+	use initramfs && ! use dist-kernel && mount-boot_pkg_postrm
  }
diff --git a/sys-kernel/linux-firmware/linux-firmware-20240513.ebuild 
b/sys-kernel/linux-firmware/linux-firmware-20240513.ebuild
index 1bb6954d00c88..b8bbed17f1a6d 100644
--- a/sys-kernel/linux-firmware/linux-firmware-20240513.ebuild
+++ b/sys-kernel/linux-firmware/linux-firmware-20240513.ebuild
@@ -69,7 +69,15 @@ QA_PREBUILT="*"
  PATCHES=( "${FILESDIR}"/${PN}-copy-firmware-r4.patch )

  pkg_pretend() {
-	use initramfs && mount-boot_pkg_pretend
+	if use initramfs; then
+		if [[ -z ${ROOT} ]] && use dist-kernel; then
+			# Check, but don't die because we can fix the problem and then
+			# emerge --config ... to re-run installation.
+			nonfatal mount-boot_check_status
+		else
+			mount-boot_pkg_pretend
+		fi
+	fi
  }

  pkg_setup() {
@@ -379,7 +387,7 @@ pkg_preinst() {
  	fi

  	# Make sure /boot is available if needed.
-	use initramfs && mount-boot_pkg_preinst
+	use initramfs && ! use dist-kernel && mount-boot_pkg_preinst
  }

  pkg_postinst() {
@@ -397,21 +405,22 @@ pkg_postinst() {
  		fi
  	done

-	# Don't forget to umount /boot if it was previously mounted by us.
  	if use initramfs; then
  		if [[ -z ${ROOT} ]] && use dist-kernel; then
  			dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}"
+		else
+			# Don't forget to umount /boot if it was previously mounted by us.
+			mount-boot_pkg_postinst
  		fi
-		mount-boot_pkg_postinst
  	fi
  }

  pkg_prerm() {
  	# Make sure /boot is mounted so that we can remove /boot/amd-uc.img!
-	use initramfs && mount-boot_pkg_prerm
+	use initramfs && ! use dist-kernel && mount-boot_pkg_prerm
  }

  pkg_postrm() {
  	# Don't forget to umount /boot if it was previously mounted by us.
-	use initramfs && mount-boot_pkg_postrm
+	use initramfs && ! use dist-kernel && mount-boot_pkg_postrm
  }
diff --git a/sys-kernel/linux-firmware/linux-firmware-20240610.ebuild 
b/sys-kernel/linux-firmware/linux-firmware-20240610.ebuild
index 1bb6954d00c88..b8bbed17f1a6d 100644
--- a/sys-kernel/linux-firmware/linux-firmware-20240610.ebuild
+++ b/sys-kernel/linux-firmware/linux-firmware-20240610.ebuild
@@ -69,7 +69,15 @@ QA_PREBUILT="*"
  PATCHES=( "${FILESDIR}"/${PN}-copy-firmware-r4.patch )

  pkg_pretend() {
-	use initramfs && mount-boot_pkg_pretend
+	if use initramfs; then
+		if [[ -z ${ROOT} ]] && use dist-kernel; then
+			# Check, but don't die because we can fix the problem and then
+			# emerge --config ... to re-run installation.
+			nonfatal mount-boot_check_status
+		else
+			mount-boot_pkg_pretend
+		fi
+	fi
  }

  pkg_setup() {
@@ -379,7 +387,7 @@ pkg_preinst() {
  	fi

  	# Make sure /boot is available if needed.
-	use initramfs && mount-boot_pkg_preinst
+	use initramfs && ! use dist-kernel && mount-boot_pkg_preinst
  }

  pkg_postinst() {
@@ -397,21 +405,22 @@ pkg_postinst() {
  		fi
  	done

-	# Don't forget to umount /boot if it was previously mounted by us.
  	if use initramfs; then
  		if [[ -z ${ROOT} ]] && use dist-kernel; then
  			dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}"
+		else
+			# Don't forget to umount /boot if it was previously mounted by us.
+			mount-boot_pkg_postinst
  		fi
-		mount-boot_pkg_postinst
  	fi
  }

  pkg_prerm() {
  	# Make sure /boot is mounted so that we can remove /boot/amd-uc.img!
-	use initramfs && mount-boot_pkg_prerm
+	use initramfs && ! use dist-kernel && mount-boot_pkg_prerm
  }

  pkg_postrm() {
  	# Don't forget to umount /boot if it was previously mounted by us.
-	use initramfs && mount-boot_pkg_postrm
+	use initramfs && ! use dist-kernel && mount-boot_pkg_postrm
  }
diff --git a/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild 
b/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild
index dc02d051d7ea4..88c5398099a38 100644
--- a/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild
+++ b/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild
@@ -84,7 +84,15 @@ pkg_setup() {
  }

  pkg_pretend() {
-	use initramfs && mount-boot_pkg_pretend
+	if use initramfs; then
+		if [[ -z ${ROOT} ]] && use dist-kernel; then
+			# Check, but don't die because we can fix the problem and then
+			# emerge --config ... to re-run installation.
+			nonfatal mount-boot_check_status
+		else
+			mount-boot_pkg_pretend
+		fi
+	fi
  }

  src_unpack() {
@@ -379,7 +387,7 @@ pkg_preinst() {
  	fi

  	# Make sure /boot is available if needed.
-	use initramfs && mount-boot_pkg_preinst
+	use initramfs && ! use dist-kernel && mount-boot_pkg_preinst
  }

  pkg_postinst() {
@@ -397,21 +405,22 @@ pkg_postinst() {
  		fi
  	done

-	# Don't forget to umount /boot if it was previously mounted by us.
  	if use initramfs; then
  		if [[ -z ${ROOT} ]] && use dist-kernel; then
  			dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}"
+		else
+			# Don't forget to umount /boot if it was previously mounted by us.
+			mount-boot_pkg_postinst
  		fi
-		mount-boot_pkg_postinst
  	fi
  }

  pkg_prerm() {
  	# Make sure /boot is mounted so that we can remove /boot/amd-uc.img!
-	use initramfs && mount-boot_pkg_prerm
+	use initramfs && ! use dist-kernel && mount-boot_pkg_prerm
  }

  pkg_postrm() {
  	# Don't forget to umount /boot if it was previously mounted by us.
-	use initramfs && mount-boot_pkg_postrm
+	use initramfs && ! use dist-kernel && mount-boot_pkg_postrm
  }



  reply	other threads:[~2024-06-26 20:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-26 19:09 [gentoo-dev] [PATCH] kernel-build.eclass: identify dist-kernels, and warn users Andrew Nowa Ammerlaan
2024-06-26 20:06 ` [gentoo-dev] [PATCH 0/5] mount-boot.eclass: revises /boot checking for dist-kernels, add checks for ESP Andrew Nowa Ammerlaan
2024-06-26 20:06   ` [gentoo-dev] [PATCH 1/5] mount-boot.eclass: check for ESP as well as /boot, split, eclass Andrew Nowa Ammerlaan
2024-06-26 20:07     ` [gentoo-dev] [PATCH 2/5] kernel-install.eclass: move mount-boot check to, dist-kernel-utils.eclass Andrew Nowa Ammerlaan
2024-06-26 20:08       ` [gentoo-dev] [PATCH 3/5] linux-mod-r1.eclass: check /boot if we are re-installing, dist-kernel Andrew Nowa Ammerlaan
2024-06-26 20:08         ` Andrew Nowa Ammerlaan [this message]
2024-06-26 20:09           ` [gentoo-dev] [PATCH 5/5] sys-firmware/intel-microcode: complain less when /boot is not, mounted Andrew Nowa Ammerlaan
2024-06-27  4:07       ` [gentoo-dev] [PATCH 2/5] kernel-install.eclass: move mount-boot check to, dist-kernel-utils.eclass Ulrich Mueller
2024-06-27 14:26         ` [gentoo-dev] [PATCH 2/5 v2] " Andrew Nowa Ammerlaan
2024-06-27  4:00     ` [gentoo-dev] [PATCH 1/5] mount-boot.eclass: check for ESP as well as /boot, split, eclass Ulrich Mueller
2024-06-27 14:24       ` [gentoo-dev] [PATCH 1/5 v2] " Andrew Nowa Ammerlaan
2024-06-28  6:33         ` Ulrich Mueller
2024-06-28  9:18           ` [gentoo-dev] [PATCH 1/5 v3] " Andrew Nowa Ammerlaan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6dea0d2f-c4aa-4604-8ec2-df1f93bfc13c@gentoo.org \
    --to=andrewammerlaan@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox