WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Adding some kernel modules  (Read 1707 times)

Offline destroyedlolo

  • Jr. Member
  • **
  • Posts: 50
    • destroyedlolo's website
Adding some kernel modules
« on: February 27, 2023, 12:57:27 PM »
Hello,

Some kernel modules are missing for my usage (mostly CONFIG_AMIGA_PARTITION and CONFIG_AFFS_FS).
I would like to create a new extension only containing these modules but I need some guide line.

I found kernel source at http://tinycorelinux.net/13.x/x86/release/src/kernel/.

1/ I guess linux-5.15.10-patched.txz is already patched kernel source, so don't need to apply any other patch, right ?

2/ to create a .tcz extension for them, can I use this procedure ?

Is so, does modules loaded automatically or should I do something ?

Thanks

Offline GNUser

  • Hero Member
  • *****
  • Posts: 1345
Re: Adding some kernel modules
« Reply #1 on: February 27, 2023, 01:18:43 PM »
Hi destroedlolo.

1. Correct. If you use the patched kernel source, no need to apply any other patches.

2. You can follow that procedure but, by TCL convention,  /lib/modules/<VERSION>  is for kernel modules that ship with the base system. If this extension is for your own use, no problem. If you are going to submit the extension, it is preferable to use the  /usr/local/lib/modules/<VERSION>  directory instead.

3. By default, the kernel modules will not be loaded automatically when your extension loads. After loading your extension, you can load the kernel modules manually with  sudo modprobe <module_name>  or, if you really want the modules to be loaded automatically when the extension loads, include a startup script in your extension. Startup scripts are run as root and go in  /usr/local/tce.installed/<extension_name>  . Take a look in your running system's  /usr/local/tce.installed  directory for examples of startup scripts. Yours would probably need only a  modprobe  command.

Hope that helps.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10959
Re: Adding some kernel modules
« Reply #2 on: February 27, 2023, 11:19:35 PM »
Filesystem modules are usually autoloaded when you try to mount (maybe only with a specified type? I don't remember exactly), but partition types would probably need manual modprobing before trying to mount anything.
The only barriers that can stop you are the ones you create yourself.

Offline destroyedlolo

  • Jr. Member
  • **
  • Posts: 50
    • destroyedlolo's website
Re: Adding some kernel modules
« Reply #3 on: February 28, 2023, 09:46:01 AM »
Thanks for your reply.

2 additional questions came :

1/ I need CONFIG_SCSI_AIC79XX and CONFIG_SCSI_AIC7XXX as well. They are marked as loadable module 'm' in configuration file took from the same place as the kernel source above ... but I don't have any loadable modules on my installation : does it mean I need to add an additional tcz ?

2/ AMIGA partitionning seems not be a loadable module. Is any way to add it without having to create a full new kernel ?
It not, which procedure I have to follow ?

Thanks

Laurent

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11213
Re: Adding some kernel modules
« Reply #4 on: February 28, 2023, 11:54:15 AM »
Hi destroyedlolo
I think this is what you are looking fore:
Code: [Select]
/usr/local/lib/modules/5.15.10-tinycore/kernel/drivers/scsi/aic7xxx/aic79xx.ko.gz
/usr/local/lib/modules/5.15.10-tinycore/kernel/drivers/scsi/aic7xxx/aic7xxx.ko.gz
Found here:
http://tinycorelinux.net/13.x/x86/tcz/scsi-5.15.10-tinycore.tcz.list

Offline destroyedlolo

  • Jr. Member
  • **
  • Posts: 50
    • destroyedlolo's website
Re: Adding some kernel modules
« Reply #5 on: March 04, 2023, 04:52:25 AM »
Thanks for the link to AIC* module.
Unfortunately, I haven't found a way to include Amiga partitioning as a module. Consequently, I'm on way to build a new kernel  8)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11213
Re: Adding some kernel modules
« Reply #6 on: March 04, 2023, 06:13:46 AM »
Hi destroyedlolo
I just took a look at a source directory on my machine and found
this for  AMIGA_PARTITION:
Quote
config AMIGA_PARTITION
   bool "Amiga partition table support" if PARTITION_ADVANCED
   default y if (AMIGA || AFFS_FS=y)
   help
     Say Y here if you would like to use hard disks under Linux which
     were partitioned under AmigaOS.
Found here:  linux-4.19.10/block/partitions/Kconfig
So Module is not a choice, only Yes or No.

In addition, even though it can be built as a module, the  AFFS_FS  description says this:
Quote
 ... Say Y
     if you want to be able to read and write files from and to an Amiga
     FFS partition on your hard drive. ...
Found here:  linux-4.19.10/fs/affs/Kconfig
So if you set  CONFIG_AFFS_FS  to  Yes  using  make menuconfig  that will
set  CONFIG_AMIGA_PARTITION  to Yes for you.

Do not edit the config file directly. Some settings interact, as is the case here.

Offline destroyedlolo

  • Jr. Member
  • **
  • Posts: 50
    • destroyedlolo's website
Re: Adding some kernel modules
« Reply #7 on: March 04, 2023, 12:31:16 PM »
As I need to rebuild the kernel, I'll put them inside, as there is no added value to add them "loadable on demand".

As Gentoo user on my other machines, I have the habit of kernel compilation but my only concern is the way TCL will load it : I hope the wiki is still applicable.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11213
Re: Adding some kernel modules
« Reply #8 on: March 04, 2023, 01:56:19 PM »
Hi destroyedlolo
config AMIGA_PARTITION  can only be built in.
config AFFS_FS  has to be built in  " ... if you want to be able to read and write files from and to an Amiga FFS partition on your hard drive ... ".

Offline destroyedlolo

  • Jr. Member
  • **
  • Posts: 50
    • destroyedlolo's website
Re: Adding some kernel modules
« Reply #9 on: March 09, 2023, 12:51:14 PM »
So, it's working well : I'm able to read my disk.
Thanks