Re: Can add new module without upgrade the kernel?
Sorry, I did not write a subject. On Monday, 30 March 2015, Woody Wu <narkewoody@gmail.com> wrote:
Hi,
I have a kernel already run on production, but I then realized that I need to add one or two driver to it. But I hope I can avoid to upgrade the kernel image for those already running products, I hope I can only extend the kernel by add the driver modules to the root file system. Is that possible? The current kernel has already compiled with the loadable modules options, but for the drivers that I want now the old config is 'no'.
Thanks in advance. -woody
-- Sent from Gmail Mobile
-- Sent from Gmail Mobile
On Mon, Mar 30, 2015 at 02:05:33PM +0800, Woody Wu wrote:
Sorry, I did not write a subject.
On Monday, 30 March 2015, Woody Wu <narkewoody@gmail.com> wrote:
Hi,
I have a kernel already run on production, but I then realized that I need to add one or two driver to it. But I hope I can avoid to upgrade the kernel image for those already running products, I hope I can only extend the kernel by add the driver modules to the root file system. Is that possible? The current kernel has already compiled with the loadable modules options, but for the drivers that I want now the old config is 'no'.
Thanks in advance. -woody
-- Sent from Gmail Mobile
-- Sent from Gmail Mobile
Sure you can, just compile them as "M" then install into your rootfs, or compile them as external modules. ref: https://www.kernel.org/doc/Documentation/kbuild/modules.txt -- Adam Lee http://adam8157.info
On Monday, 30 March 2015, Adam Lee <adam8157@gmail.com> wrote:
On Mon, Mar 30, 2015 at 02:05:33PM +0800, Woody Wu wrote:
Sorry, I did not write a subject.
On Monday, 30 March 2015, Woody Wu <narkewoody@gmail.com <javascript:;>> wrote:
Hi,
I have a kernel already run on production, but I then realized that I need to add one or two driver to it. But I hope I can avoid to upgrade the kernel image for those already running products, I hope I can only extend the kernel by add the driver modules to the root file system. Is that possible? The current kernel has already compiled with the loadable modules options, but for the drivers that I want now the old config is 'no'.
Thanks in advance. -woody
-- Sent from Gmail Mobile
-- Sent from Gmail Mobile
Sure you can, just compile them as "M" then install into your rootfs, or compile them as external modules.
ref: https://www.kernel.org/doc/Documentation/kbuild/modules.txt
-- Adam Lee http://adam8157.info
Thanks and glad to know that. Just be curious, it means, in kernel building, select a driver as M or as EMPTY will put no influence on the resulted kernel image at all, is it right? Previously, I always thought, when I choice a driver as module, I was not only creating a module itself, but also force the kernel create some kind of a stub in it's image. Now it seems my thoughts is wrong. -- Sent from Gmail Mobile
On Mon, Mar 30, 2015 at 05:35:23PM +0800, Woody Wu wrote:
Thanks and glad to know that. Just be curious, it means, in kernel building, select a driver as M or as EMPTY will put no influence on the resulted kernel image at all, is it right?
Not right if that driver depends on some other things.
Previously, I always thought, when I choice a driver as module, I was not only creating a module itself, but also force the kernel create some kind of a stub in it's image. Now it seems my thoughts is wrong.
You were right at the most of times, but it could be inserted at the most of times too, not that picky. Also you still could extract its dependencies(if there are) out and compile them as external modules. -- Adam Lee http://adam8157.info
On Monday, 30 March 2015, Adam Lee <adam8157@gmail.com> wrote:
On Mon, Mar 30, 2015 at 05:35:23PM +0800, Woody Wu wrote:
Thanks and glad to know that. Just be curious, it means, in kernel building, select a driver as M or as EMPTY will put no influence on the resulted kernel image at all, is it right?
Not right if that driver depends on some other things.
Assume I had check the dependency and build all the modules that a module is depend.
Previously, I always thought, when I choice a driver as module, I was not only creating a module itself, but also force the kernel create some kind of a stub in it's image. Now it seems my thoughts is wrong.
You were right at the most of times, but it could be inserted at the most of times too, not that picky.
Understood, it's really good news.
Also you still could extract its dependencies(if there are) out and compile them as external modules.
For this part I dont get what exactly it mean.
-- Adam Lee http://adam8157.info
-- Sent from Gmail Mobile
Unfortunately I failed in 'modprobe'. FFC3 3.1.0-ffc3mb-00050-g5874787 # pwd /lib/modules/3.1.0-ffc3mb-00050-g5874787 FFC3 3.1.0-ffc3mb-00050-g5874787 # modprobe tun modprobe: can't load module tun (net/tun.ko): invalid module format FFC3 3.1.0-ffc3mb-00050-g5874787 # modinfo net/tun.ko filename: net/tun.ko license: GPL author: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com> description: Universal TUN/TAP device driver alias: devname:net/tun depends: vermagic: 3.1.0-ffc3mb-00050-g5874787 -ffc3mb-00055-g4c6394f-dirty mod_unload ARMv5 Can you help to give a clue? Thanks in advance! -woody On 30 March 2015 at 17:45, Adam Lee <adam8157@gmail.com> wrote:
On Mon, Mar 30, 2015 at 05:35:23PM +0800, Woody Wu wrote:
Thanks and glad to know that. Just be curious, it means, in kernel building, select a driver as M or as EMPTY will put no influence on the resulted kernel image at all, is it right?
Not right if that driver depends on some other things.
Previously, I always thought, when I choice a driver as module, I was not only creating a module itself, but also force the kernel create some kind of a stub in it's image. Now it seems my thoughts is wrong.
You were right at the most of times, but it could be inserted at the most of times too, not that picky. Also you still could extract its dependencies(if there are) out and compile them as external modules.
-- Adam Lee http://adam8157.info
-- Life is the only flaw in an otherwise perfect nonexistence -- Schopenhauer woody public key at http://subkeys.pgp.net:11371 (narkewoody@gmail.com)
On Mon, Mar 30, 2015 at 10:58:12PM +0800, Woody Wu wrote:
Unfortunately I failed in 'modprobe'.
FFC3 3.1.0-ffc3mb-00050-g5874787 # pwd /lib/modules/3.1.0-ffc3mb-00050-g5874787 FFC3 3.1.0-ffc3mb-00050-g5874787 # modprobe tun modprobe: can't load module tun (net/tun.ko): invalid module format
FFC3 3.1.0-ffc3mb-00050-g5874787 # modinfo net/tun.ko filename: net/tun.ko license: GPL author: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com> description: Universal TUN/TAP device driver alias: devname:net/tun depends: vermagic: 3.1.0-ffc3mb-00050-g5874787 -ffc3mb-00055-g4c6394f-dirty mod_unload ARMv5
Can you help to give a clue? Thanks in advance!
Please work with the vendor that is forcing you to use such an old and obsolete kernel version, they are the only ones that can help you out here. Also look in your kernel log, it will show errors when loading modules as to what went wrong. good luck, greg k-h
On 30 March 2015 at 23:17, Greg KH <greg@kroah.com> wrote:
On Mon, Mar 30, 2015 at 10:58:12PM +0800, Woody Wu wrote:
Unfortunately I failed in 'modprobe'.
FFC3 3.1.0-ffc3mb-00050-g5874787 # pwd /lib/modules/3.1.0-ffc3mb-00050-g5874787 FFC3 3.1.0-ffc3mb-00050-g5874787 # modprobe tun modprobe: can't load module tun (net/tun.ko): invalid module format
FFC3 3.1.0-ffc3mb-00050-g5874787 # modinfo net/tun.ko filename: net/tun.ko license: GPL author: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com> description: Universal TUN/TAP device driver alias: devname:net/tun depends: vermagic: 3.1.0-ffc3mb-00050-g5874787 -ffc3mb-00055-g4c6394f-dirty mod_unload ARMv5
Can you help to give a clue? Thanks in advance!
Please work with the vendor that is forcing you to use such an old and obsolete kernel version, they are the only ones that can help you out here.
I was the vendor :( I ported the kernel 2 years ago for my embedded device.
Also look in your kernel log, it will show errors when loading modules as to what went wrong.
good luck,
greg k-h
-- Life is the only flaw in an otherwise perfect nonexistence -- Schopenhauer woody public key at http://subkeys.pgp.net:11371 (narkewoody@gmail.com)
On 31 March 2015 at 01:18, <Valdis.Kletnieks@vt.edu> wrote:
On Mon, 30 Mar 2015 22:58:12 +0800, Woody Wu said:
FFC3 3.1.0-ffc3mb-00050-g5874787 # pwd
Wow. Git bisect gone incredibly wrong? How did you end up running *that* kernel?
Hi, Guys I found out the problem, it's my fault. My change of the scripts/setlocalversion has a bug, that messed up the version-magic of the resulted modules and the version-magic has incorrect format, so modprobe refuse to load them. Now it's fixed. Thanks! -- Life is the only flaw in an otherwise perfect nonexistence -- Schopenhauer woody public key at http://subkeys.pgp.net:11371 (narkewoody@gmail.com)
participants (5)
-
Adam Lee -
Greg KH -
Sudip Mukherjee -
Valdis.Kletnieks@vt.edu -
Woody Wu