Building nandsim for Fedora

Bruno Vernay brunovern.a at gmail.com
Tue Dec 2 07:21:51 PST 2014


On Tue, Dec 2, 2014 at 12:14 PM, Richard Weinberger <richard at nod.at> wrote:
> Am 02.12.2014 um 12:03 schrieb Bruno Vernay:
>> On Mon, Dec 1, 2014 at 8:16 PM, Richard Weinberger
>> <richard.weinberger at gmail.com> wrote:
>>> On Mon, Dec 1, 2014 at 6:23 PM, Bruno Vernay <brunovern.a at gmail.com> wrote:
>>>> Hi,
>>>>
>>>> I would like to mount a UBI  image, and for this I need "nandsim", but
>>>> it is not available on Fedora.
>>>> I can't even find a RPM for the sources.
>>>>
>>>> I would like to get the sources for nandsim, it seems that the repository is
>>>> http://git.infradead.org/linux-mtd.git/tree/HEAD:/drivers/mtd/nand
>>>>
>>>> But I am not even sure, if it is the right place to start ???
>>>
>>> nandsim is a Linux kernel module.
>>
>> So ... it means that this list is not the right place and I should go
>> to the kernel sources to find this module??
>
> The list is kind of correct. :-)
>
>> I tried to download
>> http://git.infradead.org/linux-mtd.git/blob_plain/HEAD:/drivers/mtd/nand/nandsim.c
>>  and used
>> This Makefile (http://www.cyberciti.biz/tips/compiling-linux-kernel-module.html):
>> obj-m = nandsim.o
>> KVERSION = $(shell uname -r)
>> all:
>> make -C /lib/modules/$(KVERSION)/build M=$(PWD) modules
>> clean:
>> make -C /lib/modules/$(KVERSION)/build M=$(PWD) clean
>>
>> make -C /lib/modules/3.17.3-200.fc20.x86_64/build
>> M=/home/bruno/dev/mtd-utils/reb modules
>> make[1]: Entering directory `/usr/src/kernels/3.17.3-200.fc20.x86_64'
>>   CC [M]  /home/bruno/dev/mtd-utils/reb/nandsim.o
>>   Building modules, stage 2.
>>   MODPOST 1 modules
>> WARNING: "nand_release" [/home/bruno/dev/mtd-utils/reb/nandsim.ko] undefined!
>> WARNING: "nand_scan_tail" [/home/bruno/dev/mtd-utils/reb/nandsim.ko] undefined!
>> WARNING: "nand_scan_ident" [/home/bruno/dev/mtd-utils/reb/nandsim.ko] undefined!
>>   CC      /home/bruno/dev/mtd-utils/reb/nandsim.mod.o
>>   LD [M]  /home/bruno/dev/mtd-utils/reb/nandsim.ko
>> make[1]: Leaving directory `/usr/src/kernels/3.17.3-200.fc20.x86_64'
>>
>>
>> But then:
>> sudo insmod nandsim.ko first_id_byte=0x20 second_id_byte=0x33
>> insmod: ERROR: could not insert module nandsim.ko: Unknown symbol in module
>>
>> I am stuck here.
>
> On Linux you can only use/load kernel modules which match *exactly* you kernel.
> IOW if you use the Fedora kernel you'll have to use their nandsim.ko.
> In case they don't build it you have to rebuild the kernel.

There are no sources for MTD NAND in Fedora (which is a shame, by the way):
 yum --enablerepo="*-source" whatprovides "*/drivers/mtd/nand/nand_base.c"
 Loaded plugins: langpacks, refresh-packagekit
 kcbench-data-3.9-0.1-14.fc20.noarch : Kernel sources from 3.9 to be
used by kcbench
 Repo        : fedora
 Matched from:
 Filename    : /usr/share/kcbench-data/linux-3.9/drivers/mtd/nand/nand_base.c


But there are all the header files, that should be enough to build a
kernel module.
My point is how to build just a working nandsim.ko ??
Obviously, just getting the nandsim.c is not enough.
But I would like to avoid downloading the whole infradead repo to
build one module ...

Thanks

>
> Thanks,
> //richard



-- 
Bruno VERNAY



More information about the linux-mtd mailing list