Building modules for rhel5 kernel
Build modules for kernel instead of building the whole kernel
Download the kernel rpm
$ rpm -ivh kernel-2.6.18-x.x.x.el5.src.rpm
$ cd /usr/src/redhat/SPECS/
$ rpmbuild -bp kernel-2.6.spec
will take some time but less than rebuilding the entire kernel hopefully
$ cd /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.x86_64
$ cp /boot/config-2.6.18-x.x.x.el5 .config
$ make menuconfig
Here for examplepurpose i’m taking xfs and reiserfs module hopefully it works with whatever you chose
* For xfs/reiserfs make sure to chose xfs and reiserfs as the module
$ make fs/xfs/xfs.ko
In case of error run
$ make SUBDIRS=fs/xfs/ modules
and rerun
$ make fs/xfs/xfs.ko
$ mkdir -p /lib/modules/`uname -r`/kernel/fs/xfs
Copy the module into the /lib/modules/`uname -r`/kernel/fs/xfs
$ cp fs/xfs/xfs.ko /lib/modules/`uname -r`/kernel/fs/xfs
$ make fs/reiserfs/reiserfs.ko
In case of error run
$ make SUBDIRS=fs/reiserfs/ modules
and rerun
$ make fs/reiserfs/reiserfs.ko
$ mkdir -p /lib/modules/`uname -r`/kernel/fs/reiserfs
Copy the module into the /lib/modules/`uname -r`/kernel/fs/reiserfs
$ cp fs/reiserfs/reiserfs.ko /lib/modules/`uname -r`/kernel/fs/reiserfs
Change permissions
$ chmod 744 /lib/modules/`uname -r`/kernel/fs/reiserfs/reiserfs.ko
$ chmod 744 /lib/modules/`uname -r`/kernel/fs/xfs/xfs.ko
insmod the required module
$ insmod /lib/modules/`uname -r`/kernel/fs/reiserfs/reiserfs.ko
$ insmod /lib/modules/`uname -r`/kernel/fs/xfs/xfs.ko
Make entry into /etc/modules.conf
$ echo “install reiserfs /sbin/insmod /lib/modules/2.6.18-x.x.x.el5/kernel/fs/reiserfs/reiserfs.ko ” >> /etc/modules.conf
$ echo “install xfs /sbin/insmod /lib/modules/2.6.18-x.x.x.el5/kernel/fs/xfs/xfs.ko ” >> /etc/modules.conf
$ modprobe reiserfs
$ modprobe xfs
$ depmod -a
Should be done hopefully
5 Comments »
Leave a Reply to derwynd Cancel reply
-
Recent
- Set Time Zone + Fedora 18
- Fedora 17 + Tata Photon (Huawei)
- Fedora 17: Install OpenSSH Server
- Change the default keyring password
- Error: Could not stat() command file ‘/usr/local/nagios/var/rw/nagios.cmd’!
- Gnone 3.X adding personal launcher
- Gnome 3.x Change Panel
- KDE remove autostart programs
- GPS on Linux
- Debian Squeeze change root password
- Download YouTube Videos on Linux
- Pidgin + The certificate for omega.contacts.msn.com could not be validated
-
Links
-
Archives
- April 2013 (1)
- September 2012 (2)
- August 2012 (2)
- July 2012 (2)
- November 2011 (1)
- July 2011 (1)
- April 2011 (1)
- January 2011 (1)
- November 2010 (1)
- September 2010 (2)
- July 2010 (3)
- March 2010 (1)
-
Categories
-
RSS
Entries RSS
Comments RSS
$ cp fs/xfs/xfs.ko /lib/modules/`uname -r`/kernel/fs/reiserfs
should be
reiserfs.ko instead of xfs.ko
It does not boot….
Scanning and configuring dmraid supported devices
Scanning logical volumes
Reading all physical volumes…
No Volume groups found.
Activating logical volumes
Volume group “VolGroup00” not found
Creating root device.
Mounting root filesystem.
mount: could not find filesystem ‘/dev/root’ <– Error
Setting up other filesystems.
Setting up new root fs
setuproot: moving /dev failed: No such file or directory <– Error
no fstab.sys, mounting internal defaults
setuproot: error mounting /proc: No such file or directory <– Error
setuproot: error mounting /sys: No such file or directory <– Error
Switching to new root and running init.
unmounting old /dev
unmounting old /proc
unmounting old /sys
switchroot: mount failed: No such file or directory
Kernel panic – not syncing: Attempted to kill init
Can you be more specific on the module being built ….
make SUBDIRS=xx/xxx/ modules Always results in ” make *** No rule to make target ‘modules’. stop
Around every corner there is guaranteed to be another error message to halt the proceedings 😦
My understanding is that we were making the rule here?? So how to resolve this please
In case of error run
$ make SUBDIRS=fs/xfs/ modules
and rerun
It’s been some time that I’ve tried this …
But as far as my memory goes if you run the command once more the error should go away …..
In the end just see if the xxx.ko module is present in the dir that you are trying to build and try doing a insmod on the xxx.ko
If it wrks copy the xxx.ko to the /lib/modules/`uname -r`/dir
rmmod and insmod and add line in moules.conf file.