Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [RFC] base-files: add kernel hook for /boot freespace
@ 2023-05-29 15:44 abenson
  2023-05-29 18:47 ` [PR PATCH] [Updated] " abenson
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: abenson @ 2023-05-29 15:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 763 bytes --]

There is a new pull request by abenson against master on the void-packages repository

https://github.com/abenson/void-packages kernel_bootsize_hook
https://github.com/void-linux/void-packages/pull/44137

[RFC] base-files: add kernel hook for /boot freespace
    <leah2> we should make a kernel install hook check that prints a big
            warning if /boot is full after running it...

Thoughts:

1. Change the threshold size? Make it configurable?
2. Change the threshold to a percentage? I think that's less useful.
3. Change what package this is shipped with? I'm not sure if it applies to all configurations we support/consider.
4. Wording of the message?

A patch file from https://github.com/void-linux/void-packages/pull/44137.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-kernel_bootsize_hook-44137.patch --]
[-- Type: text/x-diff, Size: 2088 bytes --]

From df0e3d48974aa64a44199f7492c95686c083d62b Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 29 May 2023 10:38:49 -0500
Subject: [PATCH] base-files: add kernel hook for /boot freespace

---
 srcpkgs/base-files/files/50-bootsize.postinst | 22 +++++++++++++++++++
 srcpkgs/base-files/template                   |  4 +++-
 2 files changed, 25 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/base-files/files/50-bootsize.postinst

diff --git a/srcpkgs/base-files/files/50-bootsize.postinst b/srcpkgs/base-files/files/50-bootsize.postinst
new file mode 100644
index 000000000000..ada23bc3ee00
--- /dev/null
+++ b/srcpkgs/base-files/files/50-bootsize.postinst
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# Kernel hook to check for filled /boot partitions
+#
+# Arguments passed to this script: $1 pkgname, $2 version.
+#
+PKGNAME="$1"
+VERSION="$2"
+
+# freespace = blocksize * freeblocks
+freespace=$(( $(stat -f -c %S /boot) * $(stat -f -c %f /boot) ))
+
+# freespace for /boot is <= 100MB
+if [ $freespace -le 104857600 ]; then
+cat <<ENDMSG
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * WARNING: /boot has less than 100MB available. Use 'vkpurge' to ensure *
+ * there will be enough space for future kernels. Your system may become *
+ * unbootable otherwise.                                                 *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ENDMSG
+fi
diff --git a/srcpkgs/base-files/template b/srcpkgs/base-files/template
index 27b83604b648..24c73001770e 100644
--- a/srcpkgs/base-files/template
+++ b/srcpkgs/base-files/template
@@ -1,7 +1,7 @@
 # Template file for 'base-files'
 pkgname=base-files
 version=0.143
-revision=1
+revision=2
 bootstrap=yes
 depends="xbps-triggers"
 short_desc="Void Linux base system files"
@@ -85,6 +85,8 @@ do_install() {
 	vbin ${FILESDIR}/vkpurge
 	vman ${FILESDIR}/vkpurge.8
 
+	vinstall ${FILESDIR}/50-bootsize.postinst 0755 etc/kernel.d/post-install 50-bootsize
+
 	vbin ${FILESDIR}/lsb_release
 
 	# Install default dracut configuration.

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2023-07-30 17:49 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-29 15:44 [PR PATCH] [RFC] base-files: add kernel hook for /boot freespace abenson
2023-05-29 18:47 ` [PR PATCH] [Updated] " abenson
2023-05-29 18:53 ` abenson
2023-05-29 18:56 ` [PR PATCH] [Updated] " abenson
2023-05-29 19:06 ` [PR REVIEW] " abenson
2023-05-29 19:07 ` [PR PATCH] [Updated] " abenson
2023-05-30 14:30 ` mhmdanas
2023-05-30 14:30 ` mhmdanas
2023-05-31 22:04 ` 0x5c
2023-05-31 22:18 ` [PR REVIEW] " 0x5c
2023-06-02 19:32 ` abenson
2023-06-02 19:35 ` [PR PATCH] [Updated] " abenson
2023-06-02 20:59 ` [PR REVIEW] " classabbyamp
2023-06-02 20:59 ` classabbyamp
2023-06-02 22:47 ` [PR PATCH] [Updated] " abenson
2023-06-02 22:47 ` abenson
2023-06-02 22:49 ` abenson
2023-06-27 11:19 ` ahesford
2023-07-03 23:12 ` [PR PATCH] [Updated] " abenson
2023-07-03 23:25 ` abenson
2023-07-04  2:59 ` abenson
2023-07-30 17:49 ` [PR PATCH] [Merged]: " classabbyamp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).