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

* Re: [PR PATCH] [Updated] [RFC] base-files: add kernel hook for /boot freespace
  2023-05-29 15:44 [PR PATCH] [RFC] base-files: add kernel hook for /boot freespace abenson
@ 2023-05-29 18:47 ` abenson
  2023-05-29 18:53 ` abenson
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: abenson @ 2023-05-29 18:47 UTC (permalink / raw)
  To: ml

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

There is an updated 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: 2098 bytes --]

From 7d33058e9a945f1c9db684ae66cc058bc79972b7 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..6a0b89e211ea
--- /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 sufficient space to write the next kernel and generate  *
+	 * its initrd. Your system may otherwise become unbootable.              *
+	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+	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

* Re: [RFC] base-files: add kernel hook for /boot freespace
  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
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: abenson @ 2023-05-29 18:53 UTC (permalink / raw)
  To: ml

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

New comment by abenson on void-packages repository

https://github.com/void-linux/void-packages/pull/44137#issuecomment-1567424718

Comment:
> 100MB might be a little bit big? In my `/boot` each kernel + initramfs + config is ~30MB (zfs and mkinitcpio so that might be different from the usual). maybe 50 or 60 MB?

I based it on dracut default, which looking at my systems have each kernel+initrd pair at about 90M.

```
% ls /boot/vmlinuz* | while read ver; do
  du -csh /boot/*$(xbps-uhelper getpkgversion $ver)* | grep total; done
91M	total
91M	total
91M	total
92M	total
```

> maybe it could go in `linux-base`

That sounds much more appropriate than `base-files`.

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

* Re: [PR PATCH] [Updated] [RFC] base-files: add kernel hook for /boot freespace
  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 ` abenson
  2023-05-29 19:06 ` [PR REVIEW] " abenson
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: abenson @ 2023-05-29 18:56 UTC (permalink / raw)
  To: ml

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

There is an updated 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: 2178 bytes --]

From 3fa8a86fa80b0b689b7be16cba311c8283c19175 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 29 May 2023 13:55:46 -0500
Subject: [PATCH] linux-base: kernel post-install hook for /boot freepsace

---
 srcpkgs/linux-base/files/50-bootsize.postinst | 22 +++++++++++++++++++
 srcpkgs/linux-base/template                   |  7 ++++--
 2 files changed, 27 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux-base/files/50-bootsize.postinst

diff --git a/srcpkgs/linux-base/files/50-bootsize.postinst b/srcpkgs/linux-base/files/50-bootsize.postinst
new file mode 100644
index 000000000000..6a0b89e211ea
--- /dev/null
+++ b/srcpkgs/linux-base/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 sufficient space to write the next kernel and generate  *
+	 * its initrd. Your system may otherwise become unbootable.              *
+	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+	ENDMSG
+fi
diff --git a/srcpkgs/linux-base/template b/srcpkgs/linux-base/template
index 249f21fa27f2..0cce02c9e988 100644
--- a/srcpkgs/linux-base/template
+++ b/srcpkgs/linux-base/template
@@ -1,8 +1,7 @@
 # Template file for 'linux-base'
 pkgname=linux-base
-version=2021.07.21
+version=2022.05.29
 revision=1
-build_style=meta
 short_desc="Linux kernel base dependencies"
 maintainer="Érico Nogueira <ericonr@disroot.org>"
 license="Public Domain"
@@ -16,3 +15,7 @@ case "$XBPS_TARGET_MACHINE" in
 		depends="linux-firmware-amd linux-firmware-nvidia linux-firmware-network dracut"
 		;;
 esac
+
+do_install() {
+	vinstall ${FILESDIR}/50-bootsize.postinst 0755 etc/kernel.d/post-install 50-bootsize
+}

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

* Re: [PR REVIEW] [RFC] base-files: add kernel hook for /boot freespace
  2023-05-29 15:44 [PR PATCH] [RFC] base-files: add kernel hook for /boot freespace abenson
                   ` (2 preceding siblings ...)
  2023-05-29 18:56 ` [PR PATCH] [Updated] " abenson
@ 2023-05-29 19:06 ` abenson
  2023-05-29 19:07 ` [PR PATCH] [Updated] " abenson
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: abenson @ 2023-05-29 19:06 UTC (permalink / raw)
  To: ml

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

New review comment by abenson on void-packages repository

https://github.com/void-linux/void-packages/pull/44137#discussion_r1209515748

Comment:
 
![...](https://github.com/void-linux/void-packages/assets/227317/4ed38842-401f-4ff8-a945-f6133c86ab09)


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

* Re: [PR PATCH] [Updated] [RFC] base-files: add kernel hook for /boot freespace
  2023-05-29 15:44 [PR PATCH] [RFC] base-files: add kernel hook for /boot freespace abenson
                   ` (3 preceding siblings ...)
  2023-05-29 19:06 ` [PR REVIEW] " abenson
@ 2023-05-29 19:07 ` abenson
  2023-05-30 14:30 ` mhmdanas
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: abenson @ 2023-05-29 19:07 UTC (permalink / raw)
  To: ml

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

There is an updated 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: 2171 bytes --]

From b08318ac0732d61176763d66e57b6b3ceec7a705 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 29 May 2023 13:55:46 -0500
Subject: [PATCH] linux-base: post-install hook for /boot freespace

---
 srcpkgs/linux-base/files/50-bootsize.postinst | 22 +++++++++++++++++++
 srcpkgs/linux-base/template                   |  7 ++++--
 2 files changed, 27 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux-base/files/50-bootsize.postinst

diff --git a/srcpkgs/linux-base/files/50-bootsize.postinst b/srcpkgs/linux-base/files/50-bootsize.postinst
new file mode 100644
index 000000000000..6a0b89e211ea
--- /dev/null
+++ b/srcpkgs/linux-base/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 sufficient space to write the next kernel and generate  *
+	 * its initrd. Your system may otherwise become unbootable.              *
+	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+	ENDMSG
+fi
diff --git a/srcpkgs/linux-base/template b/srcpkgs/linux-base/template
index 249f21fa27f2..d04e7ad12bb6 100644
--- a/srcpkgs/linux-base/template
+++ b/srcpkgs/linux-base/template
@@ -1,8 +1,7 @@
 # Template file for 'linux-base'
 pkgname=linux-base
-version=2021.07.21
+version=2023.05.29
 revision=1
-build_style=meta
 short_desc="Linux kernel base dependencies"
 maintainer="Érico Nogueira <ericonr@disroot.org>"
 license="Public Domain"
@@ -16,3 +15,7 @@ case "$XBPS_TARGET_MACHINE" in
 		depends="linux-firmware-amd linux-firmware-nvidia linux-firmware-network dracut"
 		;;
 esac
+
+do_install() {
+	vinstall ${FILESDIR}/50-bootsize.postinst 0755 etc/kernel.d/post-install 50-bootsize
+}

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

* Re: [RFC] base-files: add kernel hook for /boot freespace
  2023-05-29 15:44 [PR PATCH] [RFC] base-files: add kernel hook for /boot freespace abenson
                   ` (4 preceding siblings ...)
  2023-05-29 19:07 ` [PR PATCH] [Updated] " abenson
@ 2023-05-30 14:30 ` mhmdanas
  2023-05-30 14:30 ` mhmdanas
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: mhmdanas @ 2023-05-30 14:30 UTC (permalink / raw)
  To: ml

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

New comment by mhmdanas on void-packages repository

https://github.com/void-linux/void-packages/pull/44137#issuecomment-1568540012

Comment:
> I based it on dracut default, which looking at my systems have each kernel+initrd pair at about 90M.

That number is sure to increase in the future, how can we ensure it is updated in a timely manner?

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

* Re: [RFC] base-files: add kernel hook for /boot freespace
  2023-05-29 15:44 [PR PATCH] [RFC] base-files: add kernel hook for /boot freespace abenson
                   ` (5 preceding siblings ...)
  2023-05-30 14:30 ` mhmdanas
@ 2023-05-30 14:30 ` mhmdanas
  2023-05-31 22:04 ` 0x5c
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: mhmdanas @ 2023-05-30 14:30 UTC (permalink / raw)
  To: ml

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

New comment by mhmdanas on void-packages repository

https://github.com/void-linux/void-packages/pull/44137#issuecomment-1568540012

Comment:
> I based it on dracut default, which looking at my systems have each kernel+initrd pair at about 90M.

That number is sure to increase in the future, how can we ensure the limit is updated in a timely manner?

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

* Re: [RFC] base-files: add kernel hook for /boot freespace
  2023-05-29 15:44 [PR PATCH] [RFC] base-files: add kernel hook for /boot freespace abenson
                   ` (6 preceding siblings ...)
  2023-05-30 14:30 ` mhmdanas
@ 2023-05-31 22:04 ` 0x5c
  2023-05-31 22:18 ` [PR REVIEW] " 0x5c
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: 0x5c @ 2023-05-31 22:04 UTC (permalink / raw)
  To: ml

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

New comment by 0x5c on void-packages repository

https://github.com/void-linux/void-packages/pull/44137#issuecomment-1571025636

Comment:
> > I based it on dracut default, which looking at my systems have each kernel+initrd pair at about 90M.
> 
> That number is sure to increase in the future, how can we ensure the limit is updated in a timely manner?

Considering a move to mkinitcpio seems inevitable, the only update for a long while might be a lowering of the value

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

* Re: [PR REVIEW] [RFC] base-files: add kernel hook for /boot freespace
  2023-05-29 15:44 [PR PATCH] [RFC] base-files: add kernel hook for /boot freespace abenson
                   ` (7 preceding siblings ...)
  2023-05-31 22:04 ` 0x5c
@ 2023-05-31 22:18 ` 0x5c
  2023-06-02 19:32 ` abenson
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: 0x5c @ 2023-05-31 22:18 UTC (permalink / raw)
  To: ml

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

New review comment by 0x5c on void-packages repository

https://github.com/void-linux/void-packages/pull/44137#discussion_r1212366086

Comment:
I think that message might be noticed more if printed in red or "bold" red

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

* Re: [PR REVIEW] [RFC] base-files: add kernel hook for /boot freespace
  2023-05-29 15:44 [PR PATCH] [RFC] base-files: add kernel hook for /boot freespace abenson
                   ` (8 preceding siblings ...)
  2023-05-31 22:18 ` [PR REVIEW] " 0x5c
@ 2023-06-02 19:32 ` abenson
  2023-06-02 19:35 ` [PR PATCH] [Updated] " abenson
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: abenson @ 2023-06-02 19:32 UTC (permalink / raw)
  To: ml

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

New review comment by abenson on void-packages repository

https://github.com/void-linux/void-packages/pull/44137#discussion_r1214749628

Comment:
It's not hard to add. Too bad we don't have `msg_warn` any other helpers here.

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

* Re: [PR PATCH] [Updated] [RFC] base-files: add kernel hook for /boot freespace
  2023-05-29 15:44 [PR PATCH] [RFC] base-files: add kernel hook for /boot freespace abenson
                   ` (9 preceding siblings ...)
  2023-06-02 19:32 ` abenson
@ 2023-06-02 19:35 ` abenson
  2023-06-02 20:59 ` [PR REVIEW] " classabbyamp
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: abenson @ 2023-06-02 19:35 UTC (permalink / raw)
  To: ml

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

There is an updated 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: 2390 bytes --]

From aff3b5b4bf49466fa5b8842f04a316e6e65788cc Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 29 May 2023 13:55:46 -0500
Subject: [PATCH] linux-base: post-install hook for /boot freespace

---
 srcpkgs/linux-base/files/50-bootsize.postinst | 31 +++++++++++++++++++
 srcpkgs/linux-base/template                   |  7 +++--
 2 files changed, 36 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux-base/files/50-bootsize.postinst

diff --git a/srcpkgs/linux-base/files/50-bootsize.postinst b/srcpkgs/linux-base/files/50-bootsize.postinst
new file mode 100644
index 000000000000..bb323222883d
--- /dev/null
+++ b/srcpkgs/linux-base/files/50-bootsize.postinst
@@ -0,0 +1,31 @@
+#!/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
+	if [ -t 1 -a -n "$(tput colors)" ]; then
+		# Set output to be bold and red, if supported
+		tput setaf 1
+		tput bold
+	fi
+	cat <<-'ENDMSG'
+	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+	 * WARNING: /boot has less than 100MB available. Use `vkpurge` to ensure *
+	 * there will be sufficient space to write the next kernel and generate  *
+	 * its initrd. Your system may otherwise become unbootable.              *
+	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+	ENDMSG
+	if [ -t 1 -a -n "$(tput colors)" ]; then
+		# Reset output back to normal
+		tput sgr0
+	fi
+fi
diff --git a/srcpkgs/linux-base/template b/srcpkgs/linux-base/template
index 249f21fa27f2..d04e7ad12bb6 100644
--- a/srcpkgs/linux-base/template
+++ b/srcpkgs/linux-base/template
@@ -1,8 +1,7 @@
 # Template file for 'linux-base'
 pkgname=linux-base
-version=2021.07.21
+version=2023.05.29
 revision=1
-build_style=meta
 short_desc="Linux kernel base dependencies"
 maintainer="Érico Nogueira <ericonr@disroot.org>"
 license="Public Domain"
@@ -16,3 +15,7 @@ case "$XBPS_TARGET_MACHINE" in
 		depends="linux-firmware-amd linux-firmware-nvidia linux-firmware-network dracut"
 		;;
 esac
+
+do_install() {
+	vinstall ${FILESDIR}/50-bootsize.postinst 0755 etc/kernel.d/post-install 50-bootsize
+}

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

* Re: [PR REVIEW] [RFC] base-files: add kernel hook for /boot freespace
  2023-05-29 15:44 [PR PATCH] [RFC] base-files: add kernel hook for /boot freespace abenson
                   ` (10 preceding siblings ...)
  2023-06-02 19:35 ` [PR PATCH] [Updated] " abenson
@ 2023-06-02 20:59 ` classabbyamp
  2023-06-02 20:59 ` classabbyamp
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: classabbyamp @ 2023-06-02 20:59 UTC (permalink / raw)
  To: ml

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

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/44137#discussion_r1214834083

Comment:
```suggestion
	if [ -z "$NO_COLOR" -a -t 1 -a -n "$(tput colors)" ]; then
```

https://no-color.org/


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

* Re: [PR REVIEW] [RFC] base-files: add kernel hook for /boot freespace
  2023-05-29 15:44 [PR PATCH] [RFC] base-files: add kernel hook for /boot freespace abenson
                   ` (11 preceding siblings ...)
  2023-06-02 20:59 ` [PR REVIEW] " classabbyamp
@ 2023-06-02 20:59 ` classabbyamp
  2023-06-02 22:47 ` [PR PATCH] [Updated] " abenson
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: classabbyamp @ 2023-06-02 20:59 UTC (permalink / raw)
  To: ml

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

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/44137#discussion_r1214834967

Comment:
```suggestion
	if [ -z "$NO_COLOR" -a -t 1 -a -n "$(tput colors)" ]; then
```


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

* Re: [PR PATCH] [Updated] [RFC] base-files: add kernel hook for /boot freespace
  2023-05-29 15:44 [PR PATCH] [RFC] base-files: add kernel hook for /boot freespace abenson
                   ` (12 preceding siblings ...)
  2023-06-02 20:59 ` classabbyamp
@ 2023-06-02 22:47 ` abenson
  2023-06-02 22:47 ` abenson
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: abenson @ 2023-06-02 22:47 UTC (permalink / raw)
  To: ml

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

There is an updated 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: 3426 bytes --]

From aff3b5b4bf49466fa5b8842f04a316e6e65788cc Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 29 May 2023 13:55:46 -0500
Subject: [PATCH 1/2] linux-base: post-install hook for /boot freespace

---
 srcpkgs/linux-base/files/50-bootsize.postinst | 31 +++++++++++++++++++
 srcpkgs/linux-base/template                   |  7 +++--
 2 files changed, 36 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux-base/files/50-bootsize.postinst

diff --git a/srcpkgs/linux-base/files/50-bootsize.postinst b/srcpkgs/linux-base/files/50-bootsize.postinst
new file mode 100644
index 000000000000..bb323222883d
--- /dev/null
+++ b/srcpkgs/linux-base/files/50-bootsize.postinst
@@ -0,0 +1,31 @@
+#!/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
+	if [ -t 1 -a -n "$(tput colors)" ]; then
+		# Set output to be bold and red, if supported
+		tput setaf 1
+		tput bold
+	fi
+	cat <<-'ENDMSG'
+	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+	 * WARNING: /boot has less than 100MB available. Use `vkpurge` to ensure *
+	 * there will be sufficient space to write the next kernel and generate  *
+	 * its initrd. Your system may otherwise become unbootable.              *
+	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+	ENDMSG
+	if [ -t 1 -a -n "$(tput colors)" ]; then
+		# Reset output back to normal
+		tput sgr0
+	fi
+fi
diff --git a/srcpkgs/linux-base/template b/srcpkgs/linux-base/template
index 249f21fa27f2..d04e7ad12bb6 100644
--- a/srcpkgs/linux-base/template
+++ b/srcpkgs/linux-base/template
@@ -1,8 +1,7 @@
 # Template file for 'linux-base'
 pkgname=linux-base
-version=2021.07.21
+version=2023.05.29
 revision=1
-build_style=meta
 short_desc="Linux kernel base dependencies"
 maintainer="Érico Nogueira <ericonr@disroot.org>"
 license="Public Domain"
@@ -16,3 +15,7 @@ case "$XBPS_TARGET_MACHINE" in
 		depends="linux-firmware-amd linux-firmware-nvidia linux-firmware-network dracut"
 		;;
 esac
+
+do_install() {
+	vinstall ${FILESDIR}/50-bootsize.postinst 0755 etc/kernel.d/post-install 50-bootsize
+}

From f1da7ae327f0d8057b40ec4d1385196c88bacd8f Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson@gmail.com>
Date: Fri, 2 Jun 2023 17:47:37 -0500
Subject: [PATCH 2/2] Update srcpkgs/linux-base/files/50-bootsize.postinst

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/linux-base/files/50-bootsize.postinst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/linux-base/files/50-bootsize.postinst b/srcpkgs/linux-base/files/50-bootsize.postinst
index bb323222883d..1141ddabb699 100644
--- a/srcpkgs/linux-base/files/50-bootsize.postinst
+++ b/srcpkgs/linux-base/files/50-bootsize.postinst
@@ -24,7 +24,7 @@ if [ $freespace -le 104857600 ]; then
 	 * its initrd. Your system may otherwise become unbootable.              *
 	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 	ENDMSG
-	if [ -t 1 -a -n "$(tput colors)" ]; then
+	if [ -z "$NO_COLOR" -a -t 1 -a -n "$(tput colors)" ]; then
 		# Reset output back to normal
 		tput sgr0
 	fi

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

* Re: [PR PATCH] [Updated] [RFC] base-files: add kernel hook for /boot freespace
  2023-05-29 15:44 [PR PATCH] [RFC] base-files: add kernel hook for /boot freespace abenson
                   ` (13 preceding siblings ...)
  2023-06-02 22:47 ` [PR PATCH] [Updated] " abenson
@ 2023-06-02 22:47 ` abenson
  2023-06-02 22:49 ` abenson
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: abenson @ 2023-06-02 22:47 UTC (permalink / raw)
  To: ml

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

There is an updated 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: 4425 bytes --]

From aff3b5b4bf49466fa5b8842f04a316e6e65788cc Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 29 May 2023 13:55:46 -0500
Subject: [PATCH 1/3] linux-base: post-install hook for /boot freespace

---
 srcpkgs/linux-base/files/50-bootsize.postinst | 31 +++++++++++++++++++
 srcpkgs/linux-base/template                   |  7 +++--
 2 files changed, 36 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux-base/files/50-bootsize.postinst

diff --git a/srcpkgs/linux-base/files/50-bootsize.postinst b/srcpkgs/linux-base/files/50-bootsize.postinst
new file mode 100644
index 000000000000..bb323222883d
--- /dev/null
+++ b/srcpkgs/linux-base/files/50-bootsize.postinst
@@ -0,0 +1,31 @@
+#!/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
+	if [ -t 1 -a -n "$(tput colors)" ]; then
+		# Set output to be bold and red, if supported
+		tput setaf 1
+		tput bold
+	fi
+	cat <<-'ENDMSG'
+	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+	 * WARNING: /boot has less than 100MB available. Use `vkpurge` to ensure *
+	 * there will be sufficient space to write the next kernel and generate  *
+	 * its initrd. Your system may otherwise become unbootable.              *
+	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+	ENDMSG
+	if [ -t 1 -a -n "$(tput colors)" ]; then
+		# Reset output back to normal
+		tput sgr0
+	fi
+fi
diff --git a/srcpkgs/linux-base/template b/srcpkgs/linux-base/template
index 249f21fa27f2..d04e7ad12bb6 100644
--- a/srcpkgs/linux-base/template
+++ b/srcpkgs/linux-base/template
@@ -1,8 +1,7 @@
 # Template file for 'linux-base'
 pkgname=linux-base
-version=2021.07.21
+version=2023.05.29
 revision=1
-build_style=meta
 short_desc="Linux kernel base dependencies"
 maintainer="Érico Nogueira <ericonr@disroot.org>"
 license="Public Domain"
@@ -16,3 +15,7 @@ case "$XBPS_TARGET_MACHINE" in
 		depends="linux-firmware-amd linux-firmware-nvidia linux-firmware-network dracut"
 		;;
 esac
+
+do_install() {
+	vinstall ${FILESDIR}/50-bootsize.postinst 0755 etc/kernel.d/post-install 50-bootsize
+}

From f1da7ae327f0d8057b40ec4d1385196c88bacd8f Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson@gmail.com>
Date: Fri, 2 Jun 2023 17:47:37 -0500
Subject: [PATCH 2/3] Update srcpkgs/linux-base/files/50-bootsize.postinst

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/linux-base/files/50-bootsize.postinst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/linux-base/files/50-bootsize.postinst b/srcpkgs/linux-base/files/50-bootsize.postinst
index bb323222883d..1141ddabb699 100644
--- a/srcpkgs/linux-base/files/50-bootsize.postinst
+++ b/srcpkgs/linux-base/files/50-bootsize.postinst
@@ -24,7 +24,7 @@ if [ $freespace -le 104857600 ]; then
 	 * its initrd. Your system may otherwise become unbootable.              *
 	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 	ENDMSG
-	if [ -t 1 -a -n "$(tput colors)" ]; then
+	if [ -z "$NO_COLOR" -a -t 1 -a -n "$(tput colors)" ]; then
 		# Reset output back to normal
 		tput sgr0
 	fi

From 299ca69498a18c125c4a448581a68c6791f702a1 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson@gmail.com>
Date: Fri, 2 Jun 2023 17:47:46 -0500
Subject: [PATCH 3/3] Update srcpkgs/linux-base/files/50-bootsize.postinst

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/linux-base/files/50-bootsize.postinst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/linux-base/files/50-bootsize.postinst b/srcpkgs/linux-base/files/50-bootsize.postinst
index 1141ddabb699..ee49af0c3712 100644
--- a/srcpkgs/linux-base/files/50-bootsize.postinst
+++ b/srcpkgs/linux-base/files/50-bootsize.postinst
@@ -12,7 +12,7 @@ freespace=$(( $(stat -f -c %S /boot) * $(stat -f -c %f /boot) ))
 
 # freespace for /boot is <= 100MB
 if [ $freespace -le 104857600 ]; then
-	if [ -t 1 -a -n "$(tput colors)" ]; then
+	if [ -z "$NO_COLOR" -a -t 1 -a -n "$(tput colors)" ]; then
 		# Set output to be bold and red, if supported
 		tput setaf 1
 		tput bold

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

* Re: [PR PATCH] [Updated] [RFC] base-files: add kernel hook for /boot freespace
  2023-05-29 15:44 [PR PATCH] [RFC] base-files: add kernel hook for /boot freespace abenson
                   ` (14 preceding siblings ...)
  2023-06-02 22:47 ` abenson
@ 2023-06-02 22:49 ` abenson
  2023-06-27 11:19 ` ahesford
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: abenson @ 2023-06-02 22:49 UTC (permalink / raw)
  To: ml

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

There is an updated 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: 2503 bytes --]

From a1770c52fa91a42f177d7c4e8361f0bd14926a16 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 29 May 2023 13:55:46 -0500
Subject: [PATCH] linux-base: post-install hook for /boot freespace

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/linux-base/files/50-bootsize.postinst | 31 +++++++++++++++++++
 srcpkgs/linux-base/template                   |  7 +++--
 2 files changed, 36 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux-base/files/50-bootsize.postinst

diff --git a/srcpkgs/linux-base/files/50-bootsize.postinst b/srcpkgs/linux-base/files/50-bootsize.postinst
new file mode 100644
index 000000000000..ee49af0c3712
--- /dev/null
+++ b/srcpkgs/linux-base/files/50-bootsize.postinst
@@ -0,0 +1,31 @@
+#!/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
+	if [ -z "$NO_COLOR" -a -t 1 -a -n "$(tput colors)" ]; then
+		# Set output to be bold and red, if supported
+		tput setaf 1
+		tput bold
+	fi
+	cat <<-'ENDMSG'
+	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+	 * WARNING: /boot has less than 100MB available. Use `vkpurge` to ensure *
+	 * there will be sufficient space to write the next kernel and generate  *
+	 * its initrd. Your system may otherwise become unbootable.              *
+	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+	ENDMSG
+	if [ -z "$NO_COLOR" -a -t 1 -a -n "$(tput colors)" ]; then
+		# Reset output back to normal
+		tput sgr0
+	fi
+fi
diff --git a/srcpkgs/linux-base/template b/srcpkgs/linux-base/template
index 249f21fa27f2..d04e7ad12bb6 100644
--- a/srcpkgs/linux-base/template
+++ b/srcpkgs/linux-base/template
@@ -1,8 +1,7 @@
 # Template file for 'linux-base'
 pkgname=linux-base
-version=2021.07.21
+version=2023.05.29
 revision=1
-build_style=meta
 short_desc="Linux kernel base dependencies"
 maintainer="Érico Nogueira <ericonr@disroot.org>"
 license="Public Domain"
@@ -16,3 +15,7 @@ case "$XBPS_TARGET_MACHINE" in
 		depends="linux-firmware-amd linux-firmware-nvidia linux-firmware-network dracut"
 		;;
 esac
+
+do_install() {
+	vinstall ${FILESDIR}/50-bootsize.postinst 0755 etc/kernel.d/post-install 50-bootsize
+}

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

* Re: [RFC] base-files: add kernel hook for /boot freespace
  2023-05-29 15:44 [PR PATCH] [RFC] base-files: add kernel hook for /boot freespace abenson
                   ` (15 preceding siblings ...)
  2023-06-02 22:49 ` abenson
@ 2023-06-27 11:19 ` ahesford
  2023-07-03 23:12 ` [PR PATCH] [Updated] " abenson
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: ahesford @ 2023-06-27 11:19 UTC (permalink / raw)
  To: ml

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

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/44137#issuecomment-1609302229

Comment:
The threshold need not be configurable. Just make it 2x (the size of the largest kernel plus the size of the largest initramfs). 

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

* Re: [PR PATCH] [Updated] [RFC] base-files: add kernel hook for /boot freespace
  2023-05-29 15:44 [PR PATCH] [RFC] base-files: add kernel hook for /boot freespace abenson
                   ` (16 preceding siblings ...)
  2023-06-27 11:19 ` ahesford
@ 2023-07-03 23:12 ` abenson
  2023-07-03 23:25 ` abenson
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: abenson @ 2023-07-03 23:12 UTC (permalink / raw)
  To: ml

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

There is an updated 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: 2792 bytes --]

From bcd14e609c4bf8bfb02206b349409328ddc22939 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 29 May 2023 13:55:46 -0500
Subject: [PATCH] linux-base: post-install hook for /boot freespace

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/linux-base/files/50-bootsize.postinst | 35 +++++++++++++++++++
 srcpkgs/linux-base/template                   |  7 ++--
 2 files changed, 40 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux-base/files/50-bootsize.postinst

diff --git a/srcpkgs/linux-base/files/50-bootsize.postinst b/srcpkgs/linux-base/files/50-bootsize.postinst
new file mode 100644
index 000000000000..6a313d638624
--- /dev/null
+++ b/srcpkgs/linux-base/files/50-bootsize.postinst
@@ -0,0 +1,35 @@
+#!/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) ))
+
+vmlinuz=$(find /boot -maxdepth 1 -type f -name 'vmlinuz*' | xargs stat -c '%s' | sort -r | head -n1)
+initramfs=$(find /boot -maxdepth 1 -type f -name 'initramfs*' | xargs stat -c '%s' | sort -r | head -n1)
+totalneeded=$(( 2 * (initramfs + vmlinuz) ))
+
+# freespace for /boot is <=  2*(largest kernel + largest initrd)
+if [ $freespace -le $totalneeded ]; then
+	if [ -z "$NO_COLOR" -a -t 1 -a -n "$(tput colors)" ]; then
+		# Set output to be bold and red, if supported
+		tput setaf 1
+		tput bold
+	fi
+	cat <<-'ENDMSG'
+	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+	 * WARNING: /boot has less than 100MB available. Use `vkpurge` to ensure *
+	 * there will be sufficient space to write the next kernel and generate  *
+	 * its initrd. Your system may otherwise become unbootable.              *
+	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+	ENDMSG
+	if [ -z "$NO_COLOR" -a -t 1 -a -n "$(tput colors)" ]; then
+		# Reset output back to normal
+		tput sgr0
+	fi
+fi
diff --git a/srcpkgs/linux-base/template b/srcpkgs/linux-base/template
index 249f21fa27f2..d04e7ad12bb6 100644
--- a/srcpkgs/linux-base/template
+++ b/srcpkgs/linux-base/template
@@ -1,8 +1,7 @@
 # Template file for 'linux-base'
 pkgname=linux-base
-version=2021.07.21
+version=2023.05.29
 revision=1
-build_style=meta
 short_desc="Linux kernel base dependencies"
 maintainer="Érico Nogueira <ericonr@disroot.org>"
 license="Public Domain"
@@ -16,3 +15,7 @@ case "$XBPS_TARGET_MACHINE" in
 		depends="linux-firmware-amd linux-firmware-nvidia linux-firmware-network dracut"
 		;;
 esac
+
+do_install() {
+	vinstall ${FILESDIR}/50-bootsize.postinst 0755 etc/kernel.d/post-install 50-bootsize
+}

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

* Re: [PR PATCH] [Updated] [RFC] base-files: add kernel hook for /boot freespace
  2023-05-29 15:44 [PR PATCH] [RFC] base-files: add kernel hook for /boot freespace abenson
                   ` (17 preceding siblings ...)
  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
  20 siblings, 0 replies; 22+ messages in thread
From: abenson @ 2023-07-03 23:25 UTC (permalink / raw)
  To: ml

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

There is an updated 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: 2780 bytes --]

From b7f83ad362d509ca644f541e1a6de4c2edfcef35 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 29 May 2023 13:55:46 -0500
Subject: [PATCH] linux-base: post-install hook for /boot freespace

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/linux-base/files/50-bootsize.postinst | 35 +++++++++++++++++++
 srcpkgs/linux-base/template                   |  7 ++--
 2 files changed, 40 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux-base/files/50-bootsize.postinst

diff --git a/srcpkgs/linux-base/files/50-bootsize.postinst b/srcpkgs/linux-base/files/50-bootsize.postinst
new file mode 100644
index 000000000000..39deb6cca568
--- /dev/null
+++ b/srcpkgs/linux-base/files/50-bootsize.postinst
@@ -0,0 +1,35 @@
+#!/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) ))
+
+vmlinuz=$(find /boot -maxdepth 1 -type f -name 'vmlinuz*' -printf '%s\n' | sort -r | head -n1)
+initramfs=$(find /boot -maxdepth 1 -type f -name 'initramfs*' -printf '%s\n' | sort -r | head -n1)
+totalneeded=$(( 2 * (initramfs + vmlinuz) ))
+
+# freespace for /boot is <=  2*(largest kernel + largest initrd)
+if [ $freespace -le $totalneeded ]; then
+	if [ -z "$NO_COLOR" -a -t 1 -a -n "$(tput colors)" ]; then
+		# Set output to be bold and red, if supported
+		tput setaf 1
+		tput bold
+	fi
+	cat <<-'ENDMSG'
+	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+	 * WARNING: /boot has less than 100MB available. Use `vkpurge` to ensure *
+	 * there will be sufficient space to write the next kernel and generate  *
+	 * its initrd. Your system may otherwise become unbootable.              *
+	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+	ENDMSG
+	if [ -z "$NO_COLOR" -a -t 1 -a -n "$(tput colors)" ]; then
+		# Reset output back to normal
+		tput sgr0
+	fi
+fi
diff --git a/srcpkgs/linux-base/template b/srcpkgs/linux-base/template
index 249f21fa27f2..d04e7ad12bb6 100644
--- a/srcpkgs/linux-base/template
+++ b/srcpkgs/linux-base/template
@@ -1,8 +1,7 @@
 # Template file for 'linux-base'
 pkgname=linux-base
-version=2021.07.21
+version=2023.05.29
 revision=1
-build_style=meta
 short_desc="Linux kernel base dependencies"
 maintainer="Érico Nogueira <ericonr@disroot.org>"
 license="Public Domain"
@@ -16,3 +15,7 @@ case "$XBPS_TARGET_MACHINE" in
 		depends="linux-firmware-amd linux-firmware-nvidia linux-firmware-network dracut"
 		;;
 esac
+
+do_install() {
+	vinstall ${FILESDIR}/50-bootsize.postinst 0755 etc/kernel.d/post-install 50-bootsize
+}

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

* Re: [PR PATCH] [Updated] [RFC] base-files: add kernel hook for /boot freespace
  2023-05-29 15:44 [PR PATCH] [RFC] base-files: add kernel hook for /boot freespace abenson
                   ` (18 preceding siblings ...)
  2023-07-03 23:25 ` abenson
@ 2023-07-04  2:59 ` abenson
  2023-07-30 17:49 ` [PR PATCH] [Merged]: " classabbyamp
  20 siblings, 0 replies; 22+ messages in thread
From: abenson @ 2023-07-04  2:59 UTC (permalink / raw)
  To: ml

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

There is an updated 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: 2805 bytes --]

From 33cb87ebcb78a5fdfe33c0bd041d488d3ffd4c99 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 29 May 2023 13:55:46 -0500
Subject: [PATCH] linux-base: post-install hook for /boot freespace

Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
---
 srcpkgs/linux-base/files/50-bootsize.postinst | 38 +++++++++++++++++++
 srcpkgs/linux-base/template                   |  7 +++-
 2 files changed, 43 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/linux-base/files/50-bootsize.postinst

diff --git a/srcpkgs/linux-base/files/50-bootsize.postinst b/srcpkgs/linux-base/files/50-bootsize.postinst
new file mode 100644
index 000000000000..1fe95c9511bb
--- /dev/null
+++ b/srcpkgs/linux-base/files/50-bootsize.postinst
@@ -0,0 +1,38 @@
+#!/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 * %f' /boot) ))
+
+vmlinuz=$(find /boot -maxdepth 1 -type f -name 'vmlinuz*' -printf '%s\n' | sort -n | tail -n1)
+initramfs=$(find /boot -maxdepth 1 -type f -name 'initramfs*' -printf '%s\n' | sort -n | tail -n1)
+totalneeded=$(( 2 * (initramfs + vmlinuz) ))
+
+# freespace for /boot is <=  2*(largest kernel + largest initrd)
+if [ $freespace -le $totalneeded ]; then
+	color=false
+	if [ -z "$NO_COLOR" ] && [ -t 1 ]; then
+		# Set output to be bold and red, if supported
+		color=true
+		tput setaf 1
+		tput bold
+	fi
+	cat <<-'ENDMSG'
+	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+	 * WARNING: /boot may not have enough space for the next kernel. Use     *
+	 * `vkpurge` to ensure there will be sufficient space to write the next  *
+	 * kernel and generate its initrd. Your system may otherwise become      *
+	 * unbootable.                                                           *
+	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+	ENDMSG
+	if $color; then
+		# Reset output back to normal
+		tput sgr0
+	fi
+fi
diff --git a/srcpkgs/linux-base/template b/srcpkgs/linux-base/template
index 249f21fa27f2..d04e7ad12bb6 100644
--- a/srcpkgs/linux-base/template
+++ b/srcpkgs/linux-base/template
@@ -1,8 +1,7 @@
 # Template file for 'linux-base'
 pkgname=linux-base
-version=2021.07.21
+version=2023.05.29
 revision=1
-build_style=meta
 short_desc="Linux kernel base dependencies"
 maintainer="Érico Nogueira <ericonr@disroot.org>"
 license="Public Domain"
@@ -16,3 +15,7 @@ case "$XBPS_TARGET_MACHINE" in
 		depends="linux-firmware-amd linux-firmware-nvidia linux-firmware-network dracut"
 		;;
 esac
+
+do_install() {
+	vinstall ${FILESDIR}/50-bootsize.postinst 0755 etc/kernel.d/post-install 50-bootsize
+}

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

* Re: [PR PATCH] [Merged]: [RFC] base-files: add kernel hook for /boot freespace
  2023-05-29 15:44 [PR PATCH] [RFC] base-files: add kernel hook for /boot freespace abenson
                   ` (19 preceding siblings ...)
  2023-07-04  2:59 ` abenson
@ 2023-07-30 17:49 ` classabbyamp
  20 siblings, 0 replies; 22+ messages in thread
From: classabbyamp @ 2023-07-30 17:49 UTC (permalink / raw)
  To: ml

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

There's a merged pull request on the void-packages repository

[RFC] base-files: add kernel hook for /boot freespace
https://github.com/void-linux/void-packages/pull/44137

Description:
    <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?

^ 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).