I want to build UFS module: ufs.ko (in order to mount my FreeNAS (BSD) partition)
I followed the instructions in these 2 links
http://oz123.github.io/writings/2012-11-26-enable-ufs-write-support-debian/
http://blog.drenet.net/enabling-ufs-rw-support-in-ubuntu-12-04-lts
But it seems BPI-M3 Debian Jessie 8 disabled that module, I cannot compile it.
Any help will be really appreciated.
-Jack
I can build it successfully with these steps:
Download BPI-M3 kernel source code from https://github.com/BPI-SINOVOIP/BPI-M3-bsp
by either
git clone https://github.com/BPI-SINOVOIP/BPI-M3-bsp.git
or
download BPI-M3-bsp-master.zip and unzip it
mkdir ufs
cd ufs
move BPI-M3-bsp-master folder into ufs
cp -v /usr/src/linux-headers-3.4.109-sunxi/Module.symvers .
cp -v /boot/config-3.4.109-sunxi .
cd BPI-M3-bsp-master
./build.sh — choose 1 (actually, it does not matter to choose other option)
cp linux-sunxi/.config ~/ufs/
cd linux-sunxi
make O=~/ufs prepare — most probably will ask you to run “make mrproper”
make mrproper
make O=~/ufs prepare — this time, no complain
make O=~/ufs outputmakefile
make O=~/ufs archprepare
make O=~/ufs modules SUBDIRS=scripts
make O=~/ufs modules SUBDIRS=fs/ufs ----output like:
CC [M] fs/ufs/balloc.o
CC [M] fs/ufs/cylinder.o
CC [M] fs/ufs/dir.o
CC [M] fs/ufs/file.o
CC [M] fs/ufs/ialloc.o
CC [M] fs/ufs/inode.o
CC [M] fs/ufs/namei.o
CC [M] fs/ufs/super.o
CC [M] fs/ufs/symlink.o
CC [M] fs/ufs/truncate.o
CC [M] fs/ufs/util.o
LD [M] fs/ufs/ufs.o
Building modules, stage 2.
MODPOST 1 modules
WARNING: “__gnu_mcount_nc” [fs/ufs/ufs.ko] undefined!
WARNING: “kmem_cache_alloc_trace” [fs/ufs/ufs.ko] undefined!
CC fs/ufs/ufs.mod.o
LD [M] fs/ufs/ufs.ko
cd …/… – back to top folder : ~/ufs
sudo modinfo fs/ufs/ufs.ko ---- you will see:
filename: /home/jzhang18/ufs/fs/ufs/ufs.ko
license: GPL
srcversion: 034C8B7C93A761904B8400E
depends:
vermagic: 3.4.39-BPI-M3-Kernel SMP preempt mod_unload modversions ARMv7 p2v8
When I load ufs.ko, I still have some issue. because even ufs.ko match the kernel version, but each function inside ufs.ko does not match the kernel requirement
The only way to eliminate that issue is – to get exact 3.4.39-BPI-M3-Kernel source code, not BPI-M3-bsp-master. But I don’t know where to get it.
-Jack