WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Remastering - how to handle modules?  (Read 3291 times)

Offline TaoTePuh

  • Full Member
  • ***
  • Posts: 172
Remastering - how to handle modules?
« on: March 27, 2011, 05:27:35 PM »
I built a new kernel and modules from the original (patched) TC kernel sources. For the modules, I thought I could just copy all modules over the "old" by doing the following:

1.) extract the "old" tinycore.gz to /tmp/extract as described in http://wiki.tinycorelinux.com/Remastering
2.) install (all) modules/firmware by:
sudo make INSTALL_MOD_PATH=/tmp/extract modules_install firmware_install
3.) depmod by
sudo depmod -b /tmp/extract 2.6.29.1-tinycore
4.) then pack it up as described in http://wiki.tinycorelinux.com/Remastering

Okay, this new tinycore.gz is bigger than the original cause it includes all firmware and modules ...  but it does not work as expected:

At boot time I get the following message:

Code: [Select]
Failed to open /dev/ramzswap0: No such file or directory
swapon: can't stat '/dev/ramzswap0' No such file or directory

I also find in dmesg many messages like:

Code: [Select]
intel_agp: Unknown symbol agp_bridge
intel_agp: Unknown symbol agp_free_key
intel_agp: Unknown symbol agp_generic_destroy_pages
intel_agp: Unknown symbol global_cache_flush
intel_agp: Unknown symbol agp_rebind_memory
...

or

Code: [Select]
ipw2200: Unknown symbol libipw_change_mtu
ipw2200: Unknown symbol libipw_rx_mgt
ipw2200: Unknown symbol libipw_is_valid_channel
ipw2200: Unknown symbol cfg80211_wext_giwname
...

What did I do wrong?
« Last Edit: March 27, 2011, 05:38:36 PM by TaoTePuh »

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Remastering - how to handle modules?
« Reply #1 on: March 27, 2011, 08:14:37 PM »
There is no ramzswap support in 2.6.29.1-tinycore
Looks like you might have mixed up 2 different versions.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Arslan S.

  • Hero Member
  • *****
  • Posts: 825
Re: Remastering - how to handle modules?
« Reply #2 on: March 28, 2011, 12:55:02 AM »
you need to compile ramzswap module and install it too
http://code.google.com/p/compcache/

there is a script sorter.sh which separates base modules and others into extensions
http://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/3.x/release/src/kernel/

also remove old modules before installing new ones
« Last Edit: March 28, 2011, 01:00:55 AM by Arslan S. »

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Remastering - how to handle modules?
« Reply #3 on: March 28, 2011, 01:08:19 AM »
also remove old modules before installing new ones

Using different kernel uname they could happily coexist   ;)
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline TaoTePuh

  • Full Member
  • ***
  • Posts: 172
Re: Remastering - how to handle modules?
« Reply #4 on: March 28, 2011, 06:01:11 AM »
There is no ramzswap support in 2.6.29.1-tinycore
Looks like you might have mixed up 2 different versions.

Sorry, this is a "copy & paste error" (Guttenberg error) - taken the command from the Wiki-How-To. In fact, I've done the following:

sudo depmod -b /tmp/extract 2.6.33.3-tinycore

Offline TaoTePuh

  • Full Member
  • ***
  • Posts: 172
Re: Remastering - how to handle modules?
« Reply #5 on: March 28, 2011, 10:18:00 PM »
Thanks, Arslan, for your hints!

you need to compile ramzswap module and install it too
http://code.google.com/p/compcache/

That worked, but I am surprised because my module is different from the TC version. Is this normal?

Code: [Select]
tc@box:/mnt/sda3/tmp_kernel/tmp2$ ls -l ramzswap*
-rw-r--r-- 1 tc staff 18736 2010-04-27 13:21 ramzswap.ko-org
-rw-r--r-- 1 tc staff 18320 2011-03-29 05:38 ramzswap.ko-tao

there is a script sorter.sh which separates base modules and others into extensions
http://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/3.x/release/src/kernel/
also remove old modules before installing new ones

Wow, cool script!
My tinycore.gz is now only 100 kB larger than the original TC version and all the above messages about unknown symbols are gone ...

Offline Arslan S.

  • Hero Member
  • *****
  • Posts: 825
Re: Remastering - how to handle modules?
« Reply #6 on: March 28, 2011, 11:47:12 PM »
you can strip modules to reduce size,

run this before gzipping modules
Code: [Select]
find lib/modules -type f -exec strip --strip-unneeded {} \;

Offline Arslan S.

  • Hero Member
  • *****
  • Posts: 825
Re: Remastering - how to handle modules?
« Reply #7 on: March 28, 2011, 11:50:36 PM »
also remove old modules before installing new ones

Using different kernel uname they could happily coexist   ;)

yea they can coexist but to reduce size original modules can be safely removed

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Remastering - how to handle modules?
« Reply #8 on: March 29, 2011, 12:37:14 AM »
Agreed, and with TC in default mode that size reduction could translate to a considerable reduction of memory usage.

However, there can be various scenarios where the option of being able to switch between kernels and their respective module trees might be preferable, particularly when intending to boot TC with different hardware configurations.

 
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline TaoTePuh

  • Full Member
  • ***
  • Posts: 172
Re: Remastering - how to handle modules?
« Reply #9 on: March 30, 2011, 11:08:13 AM »
you can strip modules to reduce size,

run this before gzipping modules
Code: [Select]
find lib/modules -type f -exec strip --strip-unneeded {} \;

Thanks. I will use it for the next run, but before, some new questions:

1.) What are the common options for zipping the modules? In the "Remastering how to", i saw something like "gzip -2" for zipping the whole tinycore.gz ...

2.) I have compare the original tinycore.gz with my one (builded with original config) and found some differences:

a.) The complete directory "drivers/pci/hotplug" is missing in the original :
Code: [Select]
$ ls -l lib/modules/2.6.33.3-tinycore/kernel/drivers/pci/hotplug
total 104
-rw-r--r-- 1 root root  3390 2011-03-29 19:28 acpiphp_ibm.ko.gz
-rw-r--r-- 1 root root  9335 2011-03-29 19:28 acpiphp.ko.gz
-rw-r--r-- 1 root root 24550 2011-03-29 19:28 cpqphp.ko.gz
-rw-r--r-- 1 root root  1888 2011-03-29 19:28 fakephp.ko.gz
-rw-r--r-- 1 root root 35538 2011-03-29 19:28 ibmphp.ko.gz
-rw-r--r-- 1 root root  6903 2011-03-29 19:28 pci_hotplug.ko.gz
-rw-r--r-- 1 root root 13883 2011-03-29 19:28 shpchp.ko.gz

b.) The file "thinkpad_acpi.ko.gz" is missing in the original:
Code: [Select]
$ ls -l lib/modules/2.6.33.3-tinycore/kernel/drivers/platform/x86/thinkpad_acpi.ko.gz
-rw-r--r-- 1 root root 32125 2011-03-30 19:01 lib/modules/2.6.33.3-tinycore/kernel/drivers/platform/x86/thinkpad_acpi.ko.gz

c.) the complete directory "drivers/ssb" is in the original but not in my tree
Code: [Select]
tc@box$ ls -l lib/modules/2.6.33.3-tinycore/kernel/drivers/ssb/
-rw-r--r-- 1 root root 17494 2011-03-30 18:47 ssb.ko.gz

I do not know what this ssb is and whether it is relevant.


Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10962
Re: Remastering - how to handle modules?
« Reply #10 on: March 30, 2011, 11:20:39 AM »
1) gzip -2 and advdef -z4, just like the main image

2) these were some gradual after-release changes and thus not reflected in the sorter script. pci-hotplug and thinkpad-acpi are now extensions, ssb is now in base. edit: ssb is in the wireless extension in the current sorter.sh output.
« Last Edit: March 30, 2011, 11:22:50 AM by curaga »
The only barriers that can stop you are the ones you create yourself.

Offline TaoTePuh

  • Full Member
  • ***
  • Posts: 172
Re: Remastering - how to handle modules?
« Reply #11 on: March 30, 2011, 01:40:12 PM »
Thanks for the explanation!