• How to load a kernel module when packaging?

    From clay stan@21:1/5 to All on Wed Sep 15 12:00:02 2021
    Andrey Rahmatullin <wrar@debian.org> 于2021年9月15日周三 下午5:47写道:

    On Wed, Sep 15, 2021 at 05:26:42PM +0800, clay stan wrote:
    I'm packaging a package. This package requires the kernel to load the
    zram module to use it.
    How can I implement it?
    One option is documenting it in a README.Debian.

    The way I can think of is to use "modporbe -r zram" in postinst to
    load the module during installation,
    I don't think this is a good idea. Also modprobe only works until a
    reboot. Also -r is "unload".

    or add a module-load.d conf file
    [1] https://manpages.debian.org/unstable/systemd/modules-load.d.5.en.html
    This can work, and I see a lot of packages in Debian already doing this,
    but is loading the zram module enough for you or do you also need some configuration for it?

    loading the zram module when package installed is enough for me.

    Thanks!


    --
    WBR, wRAR

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From clay stan@21:1/5 to All on Wed Sep 15 11:30:02 2021
    Hey,

    I'm packaging a package. This package requires the kernel to load the
    zram module to use it.
    How can I implement it?

    The way I can think of is to use "modporbe -r zram" in postinst to
    load the module during installation, or add a module-load.d conf file
    [1] https://manpages.debian.org/unstable/systemd/modules-load.d.5.en.html

    or is there any other recommended way?

    Thanks,
    Clay Stan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrey Rahmatullin@21:1/5 to clay stan on Wed Sep 15 12:00:04 2021
    On Wed, Sep 15, 2021 at 05:26:42PM +0800, clay stan wrote:
    I'm packaging a package. This package requires the kernel to load the
    zram module to use it.
    How can I implement it?
    One option is documenting it in a README.Debian.

    The way I can think of is to use "modporbe -r zram" in postinst to
    load the module during installation,
    I don't think this is a good idea. Also modprobe only works until a
    reboot. Also -r is "unload".

    or add a module-load.d conf file
    [1] https://manpages.debian.org/unstable/systemd/modules-load.d.5.en.html
    This can work, and I see a lot of packages in Debian already doing this,
    but is loading the zram module enough for you or do you also need some configuration for it?

    --
    WBR, wRAR

    -----BEGIN PGP SIGNATURE-----

    iQJhBAABCgBLFiEEolIP6gqGcKZh3YxVM2L3AxpJkuEFAmFBwTAtFIAAAAAAFQAP cGthLWFkZHJlc3NAZ251cGcub3Jnd3JhckBkZWJpYW4ub3JnAAoJEDNi9wMaSZLh VyIP/RLCUIL+BFUutbNkrWBGMBqknBtREqYcn7rn7vJ1Pi8JdmN9xNRqH40f0qSP r0Ps7JW16SRKF5rXlAbhwtdBBvn8uEscex/7DTyM7utk0khPTbNuaOp4DF+zBQTj M03ngg3XW4bplNHxfy6TIp7T7s2uKAR08SjgzJZsaOwPt8KS5MXvIo9ufwzE7c46 vjdhkJPrU4zEu+BrTzglRPSLwCFiMTzhcVnLvLMQeumJzmwW2//4oLtGNnO+XUeq egZYX6phjtAwXQPYCn/AFN0V7SaWJQ5NJnkS5rBLtLjdQlrhibYS42BVN4zRLh6m 70vYiBmTbs2YHw8BjZF0sSGWTn2BeVzMdp+EbklL5OEA7IJ4k0lmfsET5BA39U1S AxLYrdteP1mBYGf79HX4wbS6qESfreCGZ4jX/M2ihAx78aJNjwfvV2mcnjohQGDY 9MY0qpQLGTaHmXlYp1C4iP0akJ982gOtvlDWtgJ/jg+tYJ02QMaR0u5QhB2tNN4+ 0ylo4cvE2aPzmjvXu1axpcIPuVaesARFTBl177fDk2VhJovY4IIFSVHMp6W5/lc9 LpMsAO19EHakLQ6TJRsG8JiXmajMorFvmWYjai2m3fLoiAjcIAMhL8/+lU4FiJ6Q +vYrp4g9AlJSOEOodioMWUdjtbTsKYZV3s1aXNLcCcIo1dHt
    =EKrJ
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Adam Borowski@21:1/5 to clay stan on Wed Sep 15 17:40:02 2021
    On Wed, Sep 15, 2021 at 05:57:36PM +0800, clay stan wrote:
    Andrey Rahmatullin <wrar@debian.org> 于2021年9月15日周三 下午5:47写道:
    On Wed, Sep 15, 2021 at 05:26:42PM +0800, clay stan wrote:
    I'm packaging a package. This package requires the kernel to load the zram module to use it.

    or add a module-load.d conf file
    [1] https://manpages.debian.org/unstable/systemd/modules-load.d.5.en.html
    This can work, and I see a lot of packages in Debian already doing this, but is loading the zram module enough for you or do you also need some configuration for it?

    loading the zram module when package installed is enough for me.

    Please use /etc/modules which works everywhere instead of some NIH.

    On the other hand, if you're doing a runtime check, please make sure
    you accept built-in modules, eg by checking -d /sys/module/zswap rather
    than /proc/modules.


    Meow!
    --
    ⢀⣴⠾⠻⢶⣦⠀
    ⣾⠁⢠⠒⠀⣿⡁ If you ponder doing what Jesus did, remember than flipping tables
    ⢿⡄⠘⠷⠚⠋⠀ and chasing people with a whip is a prime choice. ⠈⠳⣄⠀⠀⠀⠀

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)