From df0e3d48974aa64a44199f7492c95686c083d62b Mon Sep 17 00:00:00 2001 From: Andrew Benson 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 <