waltligon / orangefs

Official repository for PVFS/OrangeFS
Other
62 stars 7 forks source link

OrangeFS kernel module does not build on Debian 9 #73

Closed yosoyjay closed 5 years ago

yosoyjay commented 5 years ago

I hope this is the correct place for this, the links to the mailing list in the docs are down: http://www.beowulf-underground.org/mailman/listinfo/pvfs2-users http://www.pvfs.org/support/

I'm following the guide for building the kernel module here. This is required because Debian 9 (kernel 4.9.0) does not include the required upstream modules.

The server builds fine, but building of the kernel module (make kmod) fails with important bits being:

  CC [M]  /home/axiom/orangefs/orangefs-2.9.7/src/kernel/linux-2.6/pvfs2-utils.o
/home/axiom/orangefs/orangefs-2.9.7/src/kernel/linux-2.6/pvfs2-utils.c: In function ‘copy_attributes_to_inode’:
/home/axiom/orangefs/orangefs-2.9.7/src/kernel/linux-2.6/pvfs2-utils.c:143:28: error: ‘PAGE_CACHE_SHIFT’ undeclared (first use in this function)
         inode->i_blkbits = PAGE_CACHE_SHIFT;
                            ^~~~~~~~~~~~~~~~
/home/axiom/orangefs/orangefs-2.9.7/src/kernel/linux-2.6/pvfs2-utils.c:143:28: note: each undeclared identifier is reported only once for each function it appears in
/home/axiom/orangefs/orangefs-2.9.7/src/kernel/linux-2.6/pvfs2-utils.c:194:30: error: ‘PAGE_CACHE_SIZE’ undeclared (first use in this function)
             inode->i_bytes = PAGE_CACHE_SIZE;
                              ^~~~~~~~~~~~~~~
/home/axiom/orangefs/orangefs-2.9.7/src/kernel/linux-2.6/pvfs2-utils.c: In function ‘pvfs2_inode_removexattr’:
/home/axiom/orangefs/orangefs-2.9.7/src/kernel/linux-2.6/pvfs2-utils.c:1088:25: error: ‘XATTR_REPLACE’ undeclared (first use in this function)
             if (flags & XATTR_REPLACE)
                         ^~~~~~~~~~~~~
scripts/Makefile.build:301: recipe for target '/home/axiom/orangefs/orangefs-2.9.7/src/kernel/linux-2.6/pvfs2-utils.o' failed
make[3]: *** [/home/axiom/orangefs/orangefs-2.9.7/src/kernel/linux-2.6/pvfs2-utils.o] Error 1
Makefile:1528: recipe for target '_module_/home/axiom/orangefs/orangefs-2.9.7/src/kernel/linux-2.6' failed
make[2]: *** [_module_/home/axiom/orangefs/orangefs-2.9.7/src/kernel/linux-2.6] Error 2
Makefile:99: recipe for target 'default' failed
make[1]: *** [default] Error 2
Makefile:895: recipe for target 'just_kmod' failed
make: *** [just_kmod] Error 2

The PAGE_CACHE_* can easily be fixed with a find and replace, but I couldn't find a solution for the undefined XATTR_REPLACE.

Context: Using orangefs-2.9.7 with this basic config:

$./configure --with-kernel=/usr/src/linux-source-4.9 --prefix=/opt/orangefs

on this:

$ uname -a
Linux fakehostname 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 GNU/Linux

Any guidance is appreciated.

xPSUzSBHotUOHS6G8nkoScBq commented 5 years ago

It should be possible to obtain the kernel source Debian uses and compile the upstream OrangeFS module from it. Probably the vanilla 4.9 would work, but it would be best to use the same source. The following describes how to obtain the source used for a Debian package.

https://wiki.debian.org/BuildingTutorial

The following is Ubuntu focused and a few years old, but it should be a good starting point.

https://askubuntu.com/questions/515407/how-recipe-to-build-only-one-kernel-module

Ideally you could submit a feature request to Debian that results in them enabling the upstream kernel module, but I don't suppose that would affect the current stable release.

hubcapsc commented 5 years ago

It should be possible, easy even, to compile a vanilla 4.9 kernel if needed... I wrote out these steps using my Fedora workstation, debian's package names are almost certainly a little different.

To compile the vanilla kernel module on a particular version/distro...

I have this version of Fedora: 4.19.6-300.fc29.x86_64

I have the kernel-devel package, which is Fedora's name for the package that provides kernel headers and makefiles sufficient to build modules against their kernel package. kernel-devel is why I have a directory called /lib/modules/4.19.6-300.fc29.x86_64/build.

I have the linux sources cloned into my home directory.

git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux

Linus tags all the releases, so using git log I searched for the commit that was tagged "Linux 4.19" and did a hard reset to that commit ID: git reset --hard 84df9525

cd /empty/directory cp /home/hubcap/linux/fs/orangefs/.c . cp /home/hubcap/linux/fs/orangefs/.h . cp /home/hubcap/linux/fs/orangefs/Makefile .

make -C /lib/modules/4.19.6-300.fc29.x86_64/build M=$PWD

This produced an orangefs.ko file that should be able to be loaded with insmod.

On Fri, Dec 14, 2018 at 9:59 AM Martin Brandenburg notifications@github.com wrote:

It should be possible to obtain the kernel source Debian uses and compile the upstream OrangeFS module from it. Probably the vanilla 4.9 would work, but it would be best to use the same source. The following describes how to obtain the source used for a Debian package.

https://wiki.debian.org/BuildingTutorial

The following is Ubuntu focused and a few years old, but it should be a good starting point.

https://askubuntu.com/questions/515407/how-recipe-to-build-only-one-kernel-module

Ideally you could submit a feature request to Debian that results in them enabling the upstream kernel module, but I don't suppose that would affect the current stable release.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/waltligon/orangefs/issues/73#issuecomment-447350051, or mute the thread https://github.com/notifications/unsubscribe-auth/AFYsW3bgZR-IG2KUK2UK2SUuPQxZh4Z3ks5u47y3gaJpZM4ZSvwG .

yosoyjay commented 5 years ago

Ah, yes, of course I could just compile from the source.

This ended up being simple once I remembered to enable the orangefs module (CONFIG_ORANGE_FS=m) in the .config file.

Thanks for the help!