summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Millan <rmh@debian.org>2015-10-03 14:08:49 +0200
committerDamien Zammit <damien@zamaudio.com>2023-06-23 23:33:50 +1000
commit491606754a770058b91ba4e027cba58404e44198 (patch)
treebe02e0ab5c2ab50279a620f9c13ffa5061f9ecdb
parent5d56467db276577f33578bbc0fac73c0d534fef7 (diff)
* Add postinst with debconf templates to automatically configure Linux nr_hugepages. * Add bug-script to librumpdev-pci0 to include lspci output in bug reports.
-rw-r--r--debian/changelog4
-rw-r--r--debian/control6
-rw-r--r--debian/librumpdev-pci0.bug-script5
-rw-r--r--debian/librumpdev-pci0.config.linux13
-rw-r--r--debian/librumpdev-pci0.postinst.linux41
-rw-r--r--debian/librumpdev-pci0.postrm.linux20
-rw-r--r--debian/librumpdev-pci0.templates.linux28
7 files changed, 116 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index a96b06a6..2c723ba1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,10 @@ rumpkernel (0~20150715-2) UNRELEASED; urgency=medium
* Fix copyright years for buildrump.sh/brlib/libnetconfig/dhcp_main.c.
* Restructure and document patches to ease upstream integration
* Split library packages.
+ * Add postinst with debconf templates to automatically configure Linux
+ nr_hugepages.
+ * Add bug-script to librumpdev-pci0 to include lspci output in bug
+ reports.
-- Robert Millan <rmh@debian.org> Mon, 07 Sep 2015 23:28:35 +0200
diff --git a/debian/control b/debian/control
index e3460f73..f5721ac8 100644
--- a/debian/control
+++ b/debian/control
@@ -107,7 +107,11 @@ Description: Rump PCI device library (development files)
Package: librumpdev-pci0
Section: libs
Architecture: linux-any hurd-any
-Depends: ${shlibs:Depends}, ${misc:Depends}, librump0 (= ${binary:Version})
+Depends: ${shlibs:Depends}, ${misc:Depends}, librump0 (= ${binary:Version}),
+ sysfsutils [linux-any],
+Recommends:
+# lspci is used by librumpdev-pci0.bug-script
+ pciutils,
Description: Rump PCI device library (runtime)
Rump kernels provide free, portable, componentized, kernel quality drivers
such as file systems, POSIX system call handlers, PCI device drivers, a
diff --git a/debian/librumpdev-pci0.bug-script b/debian/librumpdev-pci0.bug-script
new file mode 100644
index 00000000..bb8f0279
--- /dev/null
+++ b/debian/librumpdev-pci0.bug-script
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+lspci -nnk >&3
+
+exit 0
diff --git a/debian/librumpdev-pci0.config.linux b/debian/librumpdev-pci0.config.linux
new file mode 100644
index 00000000..208403ee
--- /dev/null
+++ b/debian/librumpdev-pci0.config.linux
@@ -0,0 +1,13 @@
+#!/bin/sh
+set -e
+
+. /usr/share/debconf/confmodule
+
+db_input high librumpdev-pci0/hugepages || true
+db_get librumpdev-pci0/hugepages
+
+if [ "$RET" = "true" ] ; then
+ db_input high librumpdev-pci0/nr_hugepages || true
+fi
+
+db_go
diff --git a/debian/librumpdev-pci0.postinst.linux b/debian/librumpdev-pci0.postinst.linux
new file mode 100644
index 00000000..01b8c9de
--- /dev/null
+++ b/debian/librumpdev-pci0.postinst.linux
@@ -0,0 +1,41 @@
+#!/bin/sh
+set -e
+
+case "$1" in
+ configure)
+ . /usr/share/debconf/confmodule
+
+ db_get librumpdev-pci0/hugepages
+ if [ "$RET" = "true" ] ; then
+ db_get librumpdev-pci0/nr_hugepages
+ NR_HUGEPAGES="$RET"
+ cat > /etc/sysfs.d/rump_hugepages.conf <<EOF
+#
+# AUTOMATICALLY GENERATED BY librumpdev-pci0 postinst. DO NOT EDIT.
+#
+# This setting can be changed with:
+#
+# dpkg-reconfigure librumpdev-pci0
+#
+kernel/mm/hugepages/hugepages-2048kB/nr_hugepages = $NR_HUGEPAGES
+EOF
+ else
+ rm -f /etc/sysfs.d/rump_hugepages.conf
+ fi
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/librumpdev-pci0.postrm.linux b/debian/librumpdev-pci0.postrm.linux
new file mode 100644
index 00000000..03cb1404
--- /dev/null
+++ b/debian/librumpdev-pci0.postrm.linux
@@ -0,0 +1,20 @@
+#!/bin/sh
+set -e
+
+case "$1" in
+ purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ rm -f /etc/sysfs.d/rump_hugepages.conf
+ ;;
+
+ *)
+ echo "postrm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/librumpdev-pci0.templates.linux b/debian/librumpdev-pci0.templates.linux
new file mode 100644
index 00000000..9aaa21f9
--- /dev/null
+++ b/debian/librumpdev-pci0.templates.linux
@@ -0,0 +1,28 @@
+Template: librumpdev-pci0/hugepages
+Type: boolean
+Default: true
+Description: Automatically configure hugepages?
+ Rump drivers for PCI devices need spare hugepages in order to obtain
+ access to DMA-safe (i.e. physically-contigous) memory. A detailed
+ explanation is available at:
+ .
+ https://github.com/rumpkernel/wiki/wiki/Howto%3A-Accessing-PCI-devices-from-userspace
+ .
+ If you plan on using Rump drivers for PCI devices, you can either
+ configure them manually or have this script automatically configure
+ them for you.
+
+Template: librumpdev-pci0/nr_hugepages
+Type: string
+Default: 64
+Description: Number of hugepages available to userland:
+ From this menu you can define the number of hugepages that you wish
+ to make available to userland applications (a reasonable default value
+ has been selected for you).
+ .
+ Note: If you see errors like:
+ .
+ "iwn0: could not allocate TX ring DMA memory"
+ .
+ when trying to use Rump PCI drivers, it's possible that you need to set
+ a large value here.