Author Topic: ploplinux kernel & modules  (Read 15123 times)

yopo

  • Newbie
  • *
  • Posts: 16
ploplinux kernel & modules
« on: May 27, 2011, 19:37:06 PM »
First off, I'm a very happy plop user. Currently I have been using 4.1.0 to serve a squeeze nfsroot (compiled kernel and mods using a modified plop linux kernel config and 2.6.36). It is slick and works well!

Anyway, now I want to add iscsi to plop so I can use the box as an iscsi target in a squeeze chroot same as the nfsroot, living under plop. This requires a new kernel and modules. I already have compiled the modified bzImage and the kernel modules for 2.6.36 and it works great in my squeeze nfsroot.

Since plop is the base, I must modify plop's lib squashfs and replace the bzImage. This I realize, however after replacing the bzImage with my custom kernel and adding the modules to the lib.sqfs (using a different default alias i.e. 2.6.36default2 rather than 2.6.36), my modules never load (any of them).

To update plop with a custom kernel and kmods,what am I missing? Thanks ahead :)
« Last Edit: May 27, 2011, 19:51:21 PM by yopo »

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2440
  • a command shell is enough to do amazing things
Re: ploplinux kernel & modules
« Reply #1 on: May 27, 2011, 20:13:22 PM »
hi,
Since plop is the base, I must modify plop's lib squashfs and replace the bzImage. This I realize, however after replacing the bzImage with my custom kernel and adding the modules to the lib.sqfs (using a different default alias i.e. 2.6.36default2 rather than 2.6.36), my modules never load (any of them).

are you sure that the modules in lib.sqfs? did you look in the modules directory from the running ploplinux?

best regards
elmar

yopo

  • Newbie
  • *
  • Posts: 16
Re: ploplinux kernel & modules
« Reply #2 on: May 27, 2011, 20:23:31 PM »
If I understand what you are saying, yes. I have looked. They (the modules) in the resquashed lib.sqfs are in

/lib/modules/2.6.36default2/kernel/

I kept the

/lib/modules/2.6.36/kernel/

as well, just in case

I also tried just replacing the bzImage and not the original lib.sqfs; all to no avail. The kernel loads, but the modules don't.

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2440
  • a command shell is enough to do amazing things
Re: ploplinux kernel & modules
« Reply #3 on: May 27, 2011, 20:24:27 PM »
how do you try to load the module?

yopo

  • Newbie
  • *
  • Posts: 16
Re: ploplinux kernel & modules
« Reply #4 on: May 27, 2011, 20:29:40 PM »
Well in the original plop setup, I use rc.local to load a bunch of things, such as a raid array using mdadm (with the chroot on it, to a script which loads other things under the chroot such as my dlna server). The new kernel is the same as the old kernel but I added iscsi support compiled into the kernel (and a couple other things I will probably never use). For instance, with the new kernel my raid array is never mounted.

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2440
  • a command shell is enough to do amazing things
Re: ploplinux kernel & modules
« Reply #5 on: May 27, 2011, 20:31:41 PM »
i only tired to check that the modprobe command is correct ;)

whats the error message?

yopo

  • Newbie
  • *
  • Posts: 16
Re: ploplinux kernel & modules
« Reply #6 on: May 27, 2011, 20:36:25 PM »
will do

yopo

  • Newbie
  • *
  • Posts: 16
Re: ploplinux kernel & modules
« Reply #7 on: May 27, 2011, 20:51:09 PM »
 Module nfs not found
 Module ext4 not found

etc

[root@ploplinux scsi]# lsmod
Module                  Size  Used by

(this is with the new kernel and the new lib.sqfs with both the old modules and new modules in respective folders as above)
« Last Edit: May 27, 2011, 20:53:12 PM by yopo »

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2440
  • a command shell is enough to do amazing things
Re: ploplinux kernel & modules
« Reply #8 on: May 27, 2011, 20:53:10 PM »
Module nfs not found
 Module ext4 not found

etc

do a "depmod -a" and try to load a module

yopo

  • Newbie
  • *
  • Posts: 16
Re: ploplinux kernel & modules
« Reply #9 on: May 27, 2011, 20:54:35 PM »
[root@ploplinux scsi]# depmod -a
FATAL: Could not open /lib/modules/2.6.36default2/modules.dep.temp for writing: Read-only file system
[root@ploplinux scsi]# lsmod
Module                  Size  Used by
[root@ploplinux scsi]# modprobe cifs
FATAL: Module cifs not found.
[root@ploplinux scsi]# modprobe nfs
FATAL: Module nfs not found.
[root@ploplinux scsi]# modprobe aufs
FATAL: Module aufs not found.
[root@ploplinux scsi]# modprobe iscsi
FATAL: Module iscsi not found.
[root@ploplinux scsi]# modprobe ext4
FATAL: Module ext4 not found.

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2440
  • a command shell is enough to do amazing things
Re: ploplinux kernel & modules
« Reply #10 on: May 27, 2011, 21:05:10 PM »
run on the machine where you compiled the kernel the command "depmod -ae -r 2.6.36default2"
choose a place on your hd for the following

Code: [Select]
unsquashfs lib.sqfs
cp -avr /lib/modules/2.6.36default2 squashfs-root/modules
mksquashfs squashfs-root libnew.sqfs

i hope i have no type, i didn't check it.


yopo

  • Newbie
  • *
  • Posts: 16
Re: ploplinux kernel & modules
« Reply #11 on: May 27, 2011, 21:33:31 PM »
no good :(

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2440
  • a command shell is enough to do amazing things
Re: ploplinux kernel & modules
« Reply #12 on: May 27, 2011, 21:35:00 PM »

yopo

  • Newbie
  • *
  • Posts: 16
Re: ploplinux kernel & modules
« Reply #13 on: May 27, 2011, 21:36:04 PM »
exactly the same thing as my first modified lib.sqfs, nothing loads, I can't modprobe anything, and my raid array fails to load

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2440
  • a command shell is enough to do amazing things
Re: ploplinux kernel & modules
« Reply #14 on: May 27, 2011, 21:41:11 PM »
i sent you a message with the access data to my ftp server, upload the lib.sqfs and bzImage file. i check them

yopo

  • Newbie
  • *
  • Posts: 16
Re: ploplinux kernel & modules
« Reply #15 on: May 27, 2011, 21:42:32 PM »
I appreciate the assistance! ty

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2440
  • a command shell is enough to do amazing things
Re: ploplinux kernel & modules
« Reply #16 on: May 27, 2011, 21:45:48 PM »
its better to upload all your ploplinux files that i have a complete version of yours.

yopo

  • Newbie
  • *
  • Posts: 16
Re: ploplinux kernel & modules
« Reply #17 on: May 27, 2011, 22:04:15 PM »
I am no longer authorized to access the ftp. All the other files are default from 4.1.0 though. I've uploaded the kernel, lib.sqfs, and the kernel config.

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2440
  • a command shell is enough to do amazing things
Re: ploplinux kernel & modules
« Reply #18 on: May 27, 2011, 22:06:38 PM »
I am no longer authorized to access the ftp. All the other files are default from 4.1.0 though. I've uploaded the kernel, lib.sqfs, and the kernel config.

maybe connection lost? permission is still granted

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2440
  • a command shell is enough to do amazing things
Re: ploplinux kernel & modules
« Reply #19 on: May 27, 2011, 22:14:43 PM »
how did you compile the kernel?

yopo

  • Newbie
  • *
  • Posts: 16
Re: ploplinux kernel & modules
« Reply #20 on: May 27, 2011, 22:26:06 PM »
compressing the plop files sans the opt.sqfs...
I compiled the kernel in a debian squeeze nfsroot running from the plop box on a vm using the standard plop kernel.

I modified the original plop kconfig to my taste, used debian's makekpkg and fakeroot to generate a deb file.
« Last Edit: May 27, 2011, 22:29:16 PM by yopo »

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2440
  • a command shell is enough to do amazing things
Re: ploplinux kernel & modules
« Reply #21 on: May 27, 2011, 22:55:29 PM »
OH NOOO my last beer   :o

 
I compiled the kernel in a debian squeeze nfsroot running from the plop box on a vm using the standard plop kernel.

I modified the original plop kconfig to my taste, used debian's makekpkg and fakeroot to generate a deb file.

why so complicate?

here is a simple but detailed step by step tutorial, when your kernel has a different number then there is no risk for your system. if the kernel number is the same, then you have to edit the kernel Makefile:

boot your linux (in your case debian)
be sure that the development stuff is installed
extract the kernel in debian (i assume now 2.6.36)
copy the config.gz file from ploplinux /proc/config.gz to linux-2.6.36
cd linux-2.6.36
run "zcat config.gz >.config"
apply your patches
run "make menuconfig" and do your changes
run "make && sudo make modules_install"
grab the bzImage from "arch/x86/boot/bzImage" and copy it to "syslinux/kernel" of ploplinux
take the lib.sqfs of ploplinux and extract it "unsquashfs lib.sqfs"
change to "squashfs-root/modules"
remove the old kernel libs, they are useless when you use a new kernel
copy your new kernel modules from /lib/modules/2.6.36 to "squashfs/modules/"
remove lib.sqfs
create your new lib.sqfs "mksquashfs squashfs-root lib.sqfs"
set the permissions of lib.sqfs "chmod 644 lib.sqfs"
replace your new lib.sqfs with the old one of ploplinux

thats it :) do this step by step and it will work. its nothing special. i wrote it from my mind, maybe there are typos.

regards
elmar

yopo

  • Newbie
  • *
  • Posts: 16
Re: ploplinux kernel & modules
« Reply #22 on: May 27, 2011, 23:06:37 PM »
That is pretty much what I did, and it works fine on the nfsroot. I don't have another machine with linux on it atm. Seeing as you've spent some time with me on this and it IS your last beer. I get the hint. But, the only difference was I made and installed from a deb. idk... same steps, I just wanted a package... idk... copying the modules so long as they are linked should work in the new squashfs... so ya... edit my kconfig make... samer kernel, ugh again... even though it works, fun

I don't see why using makekpkg would be problematic, especially when it works, and I did end up copying directly from the modules folder.

Well, here's to starting over from scratch.

Thanks again

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2440
  • a command shell is enough to do amazing things
Re: ploplinux kernel & modules
« Reply #23 on: May 27, 2011, 23:13:19 PM »
i would prefer to compile and install on the local machine. the local system is not affected except the install to /lib/modules/[kernel]

yopo

  • Newbie
  • *
  • Posts: 16
Re: ploplinux kernel & modules
« Reply #24 on: May 28, 2011, 00:14:47 AM »
wits end,

I did that verbatim, per your steps, to no avail. It ended up exactly the same as previous attempts. Stick a fork in me...

I will stick my fs up there
« Last Edit: May 28, 2011, 00:17:11 AM by yopo »

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2440
  • a command shell is enough to do amazing things
Re: ploplinux kernel & modules
« Reply #25 on: May 28, 2011, 00:16:40 AM »
upload all files that are required for your kernel, i try it by my self

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2440
  • a command shell is enough to do amazing things
Re: ploplinux kernel & modules
« Reply #26 on: May 28, 2011, 00:34:33 AM »
i compile now the first kernel i found on my primary work pc (an absolutely extended version of linux based on the public ploplinux) and compile the kernel with your config. drinking some hard stuff, eating a pizza and waiting for the compiled kernel:)

yopo

  • Newbie
  • *
  • Posts: 16
Re: ploplinux kernel & modules
« Reply #27 on: May 28, 2011, 00:49:36 AM »
living the life eh, and on a Friday night!

ur a champ man :) I'll soon join you in having lost my sobriety.

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2440
  • a command shell is enough to do amazing things
Re: ploplinux kernel & modules
« Reply #28 on: May 28, 2011, 01:06:29 AM »
compile completed

i did everything as i wrote above (i think so)

created a boot device

everything works as expected.

the proof isofile is on the ftp

:)

yopo

  • Newbie
  • *
  • Posts: 16
Re: ploplinux kernel & modules
« Reply #29 on: May 28, 2011, 01:24:18 AM »
damn, I'm stumped... will try

did try: wow I am stumped... though it is 2.6.38, I don't think it should make any difference...

Anyway, thanks for doing the legwork man!

I have to make this work myself this weekend. I am so stumped.
« Last Edit: May 28, 2011, 01:48:56 AM by yopo »