patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: Alyssa Ross <hi@alyssa.is>
To: devel@spectrum-os.org
Subject: [PATCH 1/2] Busybox modprobe is banned
Date: Mon, 21 Mar 2022 14:01:06 +0000	[thread overview]
Message-ID: <20220321140107.1043654-1-hi@alyssa.is> (raw)

Trying to use modprobe from Busybox has caused nothing but problems.
The latest issue is that it doesn't implement softdep at all.

rootfs.ext4 before: 509M
rootfs.ext4 after: 513M

Thanks-to: Puck Meerburg <puck@puckipedia.com>
---
 host/initramfs/default.nix |  8 +++++++-
 host/rootfs/default.nix    | 10 ++++++++--
 vm/app/catgirl/default.nix | 15 +++++++++++++--
 vm/app/lynx/default.nix    | 15 +++++++++++++--
 vm/sys/net/default.nix     | 15 +++++++++++++--
 5 files changed, 54 insertions(+), 9 deletions(-)

diff --git a/host/initramfs/default.nix b/host/initramfs/default.nix
index b207ace..5ce198a 100644
--- a/host/initramfs/default.nix
+++ b/host/initramfs/default.nix
@@ -16,7 +16,7 @@ let
   linux = rootfs.kernel;
 
   packages = [
-    pkgsStatic.mdevd pkgsStatic.execline
+    pkgsStatic.execline pkgsStatic.kmod pkgsStatic.mdevd
 
     (pkgsStatic.cryptsetup.override {
       programs = {
@@ -29,7 +29,13 @@ let
     (busybox.override {
       enableStatic = true;
       extraConfig = ''
+        CONFIG_DEPMOD n
         CONFIG_FINDFS n
+        CONFIG_INSMOD n
+        CONFIG_LSMOD n
+        CONFIG_MODINFO n
+        CONFIG_MODPROBE n
+        CONFIG_RMMOD n
       '';
     })
   ];
diff --git a/host/rootfs/default.nix b/host/rootfs/default.nix
index b9fabee..2f2c368 100644
--- a/host/rootfs/default.nix
+++ b/host/rootfs/default.nix
@@ -4,7 +4,7 @@
 { pkgs ? import <nixpkgs> {} }: pkgs.pkgsStatic.callPackage (
 
 { lib, stdenv, runCommand, writeReferencesToFile, s6-rc, tar2ext4
-, busybox, cloud-hypervisor, cryptsetup, execline, jq, mdevd, s6
+, busybox, cloud-hypervisor, cryptsetup, execline, jq, kmod, mdevd, s6
 , s6-linux-utils, s6-portable-utils, socat, util-linuxMinimal, xorg
 }:
 
@@ -20,7 +20,7 @@ let
   foot = pkgsGui.foot.override { allowPgo = false; };
 
   packages = [
-    cloud-hypervisor execline jq mdevd s6 s6-linux-utils
+    cloud-hypervisor execline jq kmod mdevd s6 s6-linux-utils
     s6-portable-utils s6-rc socat start-vm
 
     (cryptsetup.override {
@@ -33,8 +33,14 @@ let
 
     (busybox.override {
       extraConfig = ''
+        CONFIG_DEPMOD n
         CONFIG_FINDFS n
         CONFIG_INIT n
+        CONFIG_INSMOD n
+        CONFIG_LSMOD n
+        CONFIG_MODINFO n
+        CONFIG_MODPROBE n
+        CONFIG_RMMOD n
       '';
     })
   ] ++ (with pkgsGui; [ foot westonLite ]);
diff --git a/vm/app/catgirl/default.nix b/vm/app/catgirl/default.nix
index ed897eb..716e7dd 100644
--- a/vm/app/catgirl/default.nix
+++ b/vm/app/catgirl/default.nix
@@ -9,7 +9,7 @@ pkgs.pkgsStatic.callPackage (
 
 { lib, stdenv, runCommand, writeReferencesToFile, buildPackages
 , s6-rc, tar2ext4
-, busybox, cacert, catgirl, execline, mdevd, s6, s6-linux-utils
+, busybox, cacert, catgirl, execline, kmod, mdevd, s6, s6-linux-utils
 , s6-portable-utils
 }:
 
@@ -17,7 +17,18 @@ let
   inherit (lib) cleanSource cleanSourceWith concatMapStringsSep;
 
   packages = [
-    busybox catgirl execline mdevd s6 s6-linux-utils s6-portable-utils s6-rc
+    catgirl execline kmod mdevd s6 s6-linux-utils s6-portable-utils s6-rc
+
+    (busybox.override {
+      extraConfig = ''
+        CONFIG_DEPMOD n
+        CONFIG_INSMOD n
+        CONFIG_LSMOD n
+        CONFIG_MODINFO n
+        CONFIG_MODPROBE n
+        CONFIG_RMMOD n
+      '';
+    })
   ];
 
   packagesSysroot = runCommand "packages-sysroot" {
diff --git a/vm/app/lynx/default.nix b/vm/app/lynx/default.nix
index 90fda0f..72bff7f 100644
--- a/vm/app/lynx/default.nix
+++ b/vm/app/lynx/default.nix
@@ -9,7 +9,7 @@ pkgs.pkgsStatic.callPackage (
 
 { lib, stdenv, runCommand, writeReferencesToFile, buildPackages
 , s6-rc, tar2ext4
-, busybox, cacert, execline, lynx, mdevd, s6, s6-linux-utils
+, busybox, cacert, execline, kmod, lynx, mdevd, s6, s6-linux-utils
 , s6-portable-utils
 }:
 
@@ -17,7 +17,18 @@ let
   inherit (lib) cleanSource cleanSourceWith concatMapStringsSep;
 
   packages = [
-    busybox execline lynx mdevd s6 s6-linux-utils s6-portable-utils s6-rc
+    execline kmod lynx mdevd s6 s6-linux-utils s6-portable-utils s6-rc
+
+    (busybox.override {
+      extraConfig = ''
+        CONFIG_DEPMOD n
+        CONFIG_INSMOD n
+        CONFIG_LSMOD n
+        CONFIG_MODINFO n
+        CONFIG_MODPROBE n
+        CONFIG_RMMOD n
+      '';
+    })
   ];
 
   packagesSysroot = runCommand "packages-sysroot" {
diff --git a/vm/sys/net/default.nix b/vm/sys/net/default.nix
index a9e1fdc..62a13bb 100644
--- a/vm/sys/net/default.nix
+++ b/vm/sys/net/default.nix
@@ -9,7 +9,7 @@ pkgs.pkgsStatic.callPackage (
 
 { lib, stdenv, runCommand, writeReferencesToFile, buildPackages
 , s6-rc, tar2ext4, xorg
-, busybox, connmanMinimal, dbus, execline, mdevd, nftables, s6
+, busybox, connmanMinimal, dbus, execline, kmod, mdevd, nftables, s6
 , s6-linux-utils, s6-portable-utils
 }:
 
@@ -19,9 +19,20 @@ let
   connman = connmanMinimal;
 
   packages = [
-    busybox connman dbus execline mdevd s6 s6-linux-utils
+    connman dbus execline kmod mdevd s6 s6-linux-utils
     s6-portable-utils s6-rc
 
+    (busybox.override {
+      extraConfig = ''
+        CONFIG_DEPMOD n
+        CONFIG_INSMOD n
+        CONFIG_LSMOD n
+        CONFIG_MODINFO n
+        CONFIG_MODPROBE n
+        CONFIG_RMMOD n
+      '';
+    })
+
     (nftables.override { withCli = false; })
   ];
 
-- 
2.35.1


             reply	other threads:[~2022-03-21 14:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-21 14:01 Alyssa Ross [this message]
2022-03-21 14:01 ` [PATCH 2/2] host/rootfs: remove unnecessary modprobes Alyssa Ross
2022-03-22  8:36   ` Alyssa Ross
2022-03-22  8:54 ` [PATCH 1/2] Busybox modprobe is banned Alyssa Ross

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=20220321140107.1043654-1-hi@alyssa.is \
    --to=hi@alyssa.is \
    --cc=devel@spectrum-os.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.
Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

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