Invalid module format linux

Invalid module format linux

Библиотека сайта rus-linux.net

Основные ошибки модуля

Нормальная загрузка модуля командой insmod происходит без сообщений. Но при ошибке выполнения загрузки команда выводит сообщение об ошибке — модуль в этом случае не будет загружен в состав ядра. Вот наиболее часто получаемые ошибки при неудачной загрузке модуля, и то, как их следует толковать:

insmod: can’t read ‘./params’: No such file or directory — неверно указан путь к файлу модуля (возможно, в текущем каталоге не указано ./); возможно, в указании имени файла не включено стандартное расширение файла модуля ( *.ko ), но это нужно делать обязательно.

insmod: error inserting ‘./params.ko’: -1 Operation not permitted — наиболее вероятная причина: у вас элементарно нет прав root для выполнения операций установки модулей. Другая причина того же сообщения: функция инициализации модуля возвратила ненулевое значение, нередко такое завершение планируется преднамеренно, особенно на этапах отладки модуля.

insmod: error inserting ‘./params.ko’: -1 Invalid module format — модуль скомпилирован для другой версии ядра; перекомпилируйте модуль. Это та ошибка, которая почти наверняка возникнет, когда вы перенесёте любой рабочий пример модуля на другой компьютер, и попытаетесь там загрузить модуль: совпадение реализаций разных инсталляций до уровня подверсий — почти невероятно.

insmod: error inserting ‘./params.ko’: -1 File exists — модуль с таким именем уже загружен, попытка загрузить модуль повторно.

insmod: error inserting ‘./params.ko’: -1 Invalid parameters — модуль запускается с указанным параметром, не соответствующим по типу ожидаемому для этого параметра.

Ошибка (сообщение) может возникнуть и при попытке выгрузить модуль. Более того, обратите внимание, что прототип функции выгрузки модуля void module_exit( void ) — не имеет возможности вернуть код неудачного завершения: все сообщения могут поступать только от подсистемы управления модулями операционной системы. Наиболее часто получаемые ошибки при неудачной попытке выгрузить модуль:

ERROR: Removing ‘params’: Device or resource busy — счётчик ссылок модуля ненулевой, в системе есть (возможно) модули, зависимые от данного; но не исключено и то, что вы в самом своём коде инкрементировали счётчик ссылок, не декрементировав его назад.

ERROR: Removing ‘params’: Operation not permitted — самая частая причина такого сообщения — у вас просто нет прав root на выполнение операции rmmod . Более экзотический случай появления такого сообщения: не забыли ли вы в коде модуля вообще прописать функцию выгрузки ( module_exit() )? В этом случае в списке модулей можно видеть довольно редкий квалификатор permanent (в этом случае вы создали не выгружаемый модуль, поможет только перезагрузка системы) :

Источник

Invalid module format

The Makefile is a mix of tradition format (using (CC)) and module build system format «make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules» .

The system is 1.6.18-194.el5 x86_64. The same Makefile works fine when it is used in i386 machine.

Any idea of what to look into? Thanks.

hello.c

2 Answers 2

The dmesg output tells you what is wrong:

On the x86-64 architecture, all code running in the kernel (including modules) must be compiled with a special flag, which tells the compiler to generate code which will run in the top half of the virtual address space (user mode programs run on the bottom half of the address space).

If I am reading your Makefile correctly, you are compiling the C code outside the kernel build system, and calling into the kernel build system only for the final linking. Do not do this. It is not just the memory model, there are several other flags which must be added when compiling the C source code. These flags can change with the kernel version, or even with the kernel configuration — you do not know, and you are not supposed to have to know, since the kernel build system deals with it all for you.

It is not just -mcmodel=kernel . There are many others, and getting them wrong can and will cause problems.

The fact that you are missing the correct flags is quite visible in your code:

No, this is not needed. If you need it, you are doing it wrong. Take a look at one of the flags the kernel build system passes to the C compiler:

This flags tells the C compiler to always implicitly include the linux/autoconf.h header. Since it is always implicitly included, you never have to include it manually. And since you never include it manually, its location is allowed to change — it moved to generated/autoconf.h and later to linux/kconfig.h , and who knows where else it will end up next.

The fact that it worked at all for you in 32-bit x86 is just luck. You should do it the correct way even on 32-bit.

Источник

ошибка insmod: вставка ‘./привет.ko’: -1 недопустимый формат модуля»

Я только что сделал свой первый модуль драйвера, модуль hello world после LDD3. Однако, к сожалению, столкнулся с этой ошибкой:

я делаю это на Ubuntu 11.04, и мое окружение:

Я получаю источник ядра следующим образом:

и затем я компилирую ядро

а затем я компилирую свой модуль ядра

С Файл Makefile:

и, наконец, когда я вставляю модуль:

что я нашел в dmesg:

так в чем проблема?

Я также заметил, что linux-header is -2.26.38-generic и версия исходного кода -2.26.38, это проблема? но я действительно не нашел linux-source-2.26.38-generic пакета по сети.

обновить статус : Я обнаружил, что файл / lib / moduels / $(name-r) / build/Makefile указывает на мое запущенное ядро версия:

поэтому я загружаю linux-2.6.38.2 и компилирую, но все та же ошибка.

Я также обнаружил, что есть строка в /boot / config — $(uname-r):

кто-нибудь знает, что это значит? Я не вижу его в конфигурационном файле ядра, которое я создаю.

3 ответов

ядро, из которого вы создаете свой модуль ядра и в который вы вставляете модуль, должно иметь ту же версию. Если вы не хотите заботиться об этой вещи, вы можете использовать следующий Makefile.

Теперь вы можете построить и попытаться вставить модуль.

Я предлагаю вам стать root, если это возможно, перед этой строкой

$sudo cp / boot / config-2.6.38-8-общий ./.config

альтернативно вы также можете использовать после make file

попробуйте использовать кросс-компиляции. Пожалуйста, посмотрите на код ниже для файла make. Помните о отступе, иначе вы можете закончить с ошибкой, такой как отсутствует сепаратор. Остановка

obj-m += hello_.o # это имя должно быть имя .файл c. Я просто использую hello, например

Я предлагаю лучший подход через кросс-компиляцию

создайте переменную для хранения имени каталога, в котором находится каталог ядра linux в моем примере, измените значение «PATH_TO_LINUX_KERNEL_DIRECTORY» в реальный путь значение Пример

/ linux Вам действительно нужно сделать это, чтобы файл make знал, где найти arm-linux-gnueabi-без этого вы, скорее всего, столкнетесь с проблемами arm-linux-gnueabi-

вы сделали все правильно, но не загрузили свою систему с ядром, которое вы скомпилировали, поэтому первым шагом является загрузка с ним. Если вы используете Ubuntu, вы можете удерживать кнопку shift во время загрузки, и вам будет предоставлен список скомпилированного ядра в вашей системе, оттуда выберите linux-source-2.6.38 а затем попробуйте построить свой модуль и установить его по-своему ,чем вы не найдете никаких проблем. Гудлак.

Источник

UNIX for Dummies Questions & Answers

insmod: Invalid module format error

I have open suse kernel kernel 3.1.0-1.2-desktop on which I used kernel source 3.1.10-1.2 downloaded from kernel.org.

The module gets built.
While loading a kernel module I am getting Invalid module format error with description «first_driver: no symbol version for module_layout»

The following are the logs:

I guess this is because of mismatching kernel versions.

Cannot I use kernel source 3.1.10-1.2-desktop on kernel 3.1.0-1.2-desktop?
Where can I get the kernel source for 3.1.0-1.2-desktop

How to resolve this issue?

Thanks Coronna for the reply.
Where can I find the suse kernel source?

fine to download the suse kernel source?

I have linux installed in vmware which is not connected to net and so I have to manually download the source.

———- Post updated 02-03-12 at 01:03 PM ———- Previous update was 02-02-12 at 08:56 PM ———-

Now I have open suse kernel kernel 3.1.0-1.2-desktop and its kernel source.

Again the module gets built.
While loading a kernel module I am getting Invalid module format error with description «first_driver: no symbol version for module_layout»

The following are the logs:

FYI I have compiled the kernel as follows:
Make mrprpoper
make menuconfig
Make
Make modules
Make modules_install
Make install

Am I missing something?
How to resolve this issue?

Источник

Invalid module format linux

So I have a bunch of modules that I added to the kernel.

I ran:
make clean
make && make modules install.
I copied arch/i686/bzImage over properly
I ran depmod -a
I ran update-modules
I tried to load the module:

# insmod /lib/modules/2.6.21-gentoo-r4/kernel/sound/core/snd.koinsmod: error inserting ‘/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/snd.ko’: -1 Invalid module format

That same error comes up as a warning during my boot sequence.

Here is my /etc/modules.autoload file.

Код:
# /etc/modules.autoload.d/kernel-2.6: kernel modules to load when system boots.
#
# Note that this file is for 2.6 kernels.
#
# Add the names of modules that you’d like to load when the system
# starts into this file, one per line. Comments begin with # and
# are ignored. Read man modules.autoload for additional details.

# For example:
# aic7xxx

nvidia
vboxdrv
snd-page-alloc
soundcore
snd
snd-timer
snd-seq-device
snd-seq-midi-event
snd-seq
snd-pcm
snd-hda-codec
snd-hda-intel

And here is my modprobe -l

Код:
# modprobe -l
/lib/modules/2.6.21-gentoo-r4/kernel/crypto/sha1.ko
/lib/modules/2.6.21-gentoo-r4/kernel/crypto/sha256.ko
/lib/modules/2.6.21-gentoo-r4/kernel/crypto/crypto_null.ko
/lib/modules/2.6.21-gentoo-r4/kernel/crypto/cbc.ko
/lib/modules/2.6.21-gentoo-r4/kernel/crypto/blowfish.ko
/lib/modules/2.6.21-gentoo-r4/kernel/crypto/pcbc.ko
/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/snd-rawmidi.ko
/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/snd.ko
/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/oss/snd-mixer-oss.ko
/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/oss/snd-pcm-oss.ko
/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/seq/snd-seq-virmidi.ko
/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/seq/snd-seq-device.ko
/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/seq/snd-seq-midi-event.ko
/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/seq/oss/snd-seq-oss.ko
/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/seq/snd-seq-midi.ko
/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/seq/snd-seq.ko
/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/snd-pcm.ko
/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/snd-page-alloc.ko
/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/snd-timer.ko
/lib/modules/2.6.21-gentoo-r4/kernel/sound/pci/hda/snd-hda-codec.ko
/lib/modules/2.6.21-gentoo-r4/kernel/sound/pci/hda/snd-hda-intel.ko
/lib/modules/2.6.21-gentoo-r4/kernel/sound/soc/snd-soc-core.ko
/lib/modules/2.6.21-gentoo-r4/kernel/sound/drivers/snd-virmidi.ko
/lib/modules/2.6.21-gentoo-r4/kernel/sound/soundcore.ko
/lib/modules/2.6.21-gentoo-r4/kernel/drivers/video/backlight/lcd.ko
/lib/modules/2.6.21-gentoo-r4/kernel/drivers/pcmcia/rsrc_nonstatic.ko
/lib/modules/2.6.21-gentoo-r4/kernel/drivers/pcmcia/yenta_socket.ko
/lib/modules/2.6.21-gentoo-r4/misc/svgalib_helper.ko
/lib/modules/2.6.21-gentoo-r4/misc/vboxdrv.ko
/lib/modules/2.6.21-gentoo-r4/video/nvidia.ko
/lib/modules/2.6.21-gentoo-r4/net/wireless/ipw3945.ko

Why can’t I load those bloody modules? Now that I know about that, and now that I know those modules aren’t being loaded, I suspect they may be causing a bunch of my sound issues. At least I hope so, cause then they’d be fixed.

HEY KIDS, ALWAYS REMEMBER TO DOUBLE-CHECK THAT GRUB IS LOADING THE RIGHT KERNEL. :s

Последний раз редактировалось: GivePeaceAChance (пт дек 28, 2007 9:39 pm), всего редактировалось 1 раз Вернуться к началу

desultory
Bodhisattva

Зарегистрирован: 04 ноя 2005
Сообщений: 9410

Добавлено: чт дек 27, 2007 11:31 am Заголовок сообщения:
Moved from Installing Gentoo to Kernel & Hardware.
Вернуться к началу
NeddySeagoon
Administrator

Зарегистрирован: 05 июл 2003
Сообщений: 49011
Откуда: 56N 3W

Добавлено: чт дек 27, 2007 11:47 am Заголовок сообщения:
GivePeaceAChance,

Код:
emerge -1 module-init-tools

and try again.
_________________
Regards,

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.

Вернуться к началу
GivePeaceAChance
Guru

Зарегистрирован: 26 мая 2007
Сообщений: 480

Добавлено: чт дек 27, 2007 11:57 am Заголовок сообщения:

I just installed that like you said, and ran:

Код:
# modprobe /lib/modules/2.6.21-gentoo-r4/kernel/sound/core/snd.ko
FATAL: Module /lib/modules/2.6.21_gentoo_r4/kernel/sound/core/snd.ko not found.

# insmod /lib/modules/2.6.21-gentoo-r4/kernel/sound/core/snd.ko
insmod: error inserting ‘/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/snd.ko’: -1 Invalid module format

_________________
I am not a Linux Guru, but a n00b with a lot of questions.

Вернуться к началу
NeddySeagoon
Administrator

Зарегистрирован: 05 июл 2003
Сообщений: 49011
Откуда: 56N 3W

Добавлено: чт дек 27, 2007 4:16 pm Заголовок сообщения:
GivePeaceAChance,

modprobe knows where to look for your kernel modules, hence providing a path name failed

insmod needs the full path name as you gave it but are you running a kernel called 2.6.21-gentoo-r4 ?
Trying in insert one kernels modules into another kernel will cause this sort of error.

If you want to use insmod use the command

Код:
insmod /lib/modules/`uname -r`/kernel/sound/core/snd.ko

so insmod asks the kernel for its name. I’m not sure in insmod needs the .ko extension either.

There may also be some useful information in dmesg.
_________________
Regards,

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.

Вернуться к началу
GivePeaceAChance
Guru

Зарегистрирован: 26 мая 2007
Сообщений: 480

Добавлено: пт дек 28, 2007 12:25 am Заголовок сообщения:
If I take out the .ko, and just run, I get this:
Код:
# insmod /lib/modules/`uname -r`/kernel/sound/core/sndinsmod: can’t read ‘/lib/modules/2.6.21-gentoo-r4/kernel/sound/core/snd’: No such file or directory

And the only dir in /lib/modules is 2.6.21-gentoo-r4. my kernel in /boot is kernel-2.6.21-gentoo-r4.

I tried «modprobe ipw3945» to load a module that was already loaded, and it worked fine, no output. but the second I tried «modprobe snd» I got the invalid format errors.

Код:
# Aliases extracted from modules themselves.
alias sha1-generic sha1
alias sha256-generic sha256
alias compress_null crypto_null
alias digest_null crypto_null
alias cipher_null crypto_null
alias char-major-116-* snd
alias sound-service-?-0 snd_mixer_oss
alias sound-service-?-3 snd_pcm_oss
alias sound-service-?-12 snd_pcm_oss
alias sound-service-?-1 snd_seq_oss
alias sound-service-?-8 snd_seq_oss
alias pci:v00008086d00002668sv*sd*bc*sc*i* snd_hda_intel
alias pci:v00008086d000027D8sv*sd*bc*sc*i* snd_hda_intel
alias pci:v00008086d0000269Asv*sd*bc*sc*i* snd_hda_intel
alias pci:v00008086d0000284Bsv*sd*bc*sc*i* snd_hda_intel
alias pci:v00008086d0000293Esv*sd*bc*sc*i* snd_hda_intel
alias pci:v00008086d0000293Fsv*sd*bc*sc*i* snd_hda_intel
alias pci:v00001002d0000437Bsv*sd*bc*sc*i* snd_hda_intel
alias pci:v00001002d00004383sv*sd*bc*sc*i* snd_hda_intel
alias pci:v00001002d0000793Bsv*sd*bc*sc*i* snd_hda_intel
alias pci:v00001002d00007919sv*sd*bc*sc*i* snd_hda_intel
alias pci:v00001106d00003288sv*sd*bc*sc*i* snd_hda_intel
alias pci:v00001039d00007502sv*sd*bc*sc*i* snd_hda_intel
alias pci:v000010B9d00005461sv*sd*bc*sc*i* snd_hda_intel
alias pci:v000010DEd0000026Csv*sd*bc*sc*i* snd_hda_intel
alias pci:v000010DEd00000371sv*sd*bc*sc*i* snd_hda_intel
alias pci:v000010DEd000003E4sv*sd*bc*sc*i* snd_hda_intel
alias pci:v000010DEd000003F0sv*sd*bc*sc*i* snd_hda_intel
alias pci:v000010DEd0000044Asv*sd*bc*sc*i* snd_hda_intel
alias pci:v000010DEd0000044Bsv*sd*bc*sc*i* snd_hda_intel
alias pci:v000010DEd0000055Csv*sd*bc*sc*i* snd_hda_intel
alias pci:v000010DEd0000055Dsv*sd*bc*sc*i* snd_hda_intel
alias char-major-14-* soundcore
alias pci:v0000104Cd0000AC13sv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC1Asv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC12sv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC15sv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC1Esv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC17sv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC19sv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC1Csv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC1Dsv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC1Fsv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC51sv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC1Bsv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC52sv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC56sv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC55sv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC54sv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC41sv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd00008011sv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC42sv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC44sv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC46sv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC16sv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC50sv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd00008031sv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd00008036sv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd00008039sv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC8Esv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC8Dsv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC49sv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC47sv*sd*bc06sc07i00* yenta_socket
alias pci:v0000104Cd0000AC48sv*sd*bc06sc07i00* yenta_socket
alias pci:v00001524d00001411sv*sd*bc06sc07i00* yenta_socket
alias pci:v00001524d00001412sv*sd*bc06sc07i00* yenta_socket
alias pci:v00001524d00001421sv*sd*bc06sc07i00* yenta_socket
alias pci:v00001524d00001422sv*sd*bc06sc07i00* yenta_socket
alias pci:v00001524d00001211sv*sd*bc06sc07i00* yenta_socket
alias pci:v00001524d00001225sv*sd*bc06sc07i00* yenta_socket
alias pci:v00001524d00001410sv*sd*bc06sc07i00* yenta_socket
alias pci:v00001524d00001420sv*sd*bc06sc07i00* yenta_socket
alias pci:v00001180d00000465sv*sd*bc06sc07i00* yenta_socket
alias pci:v00001180d00000466sv*sd*bc06sc07i00* yenta_socket
alias pci:v00001180d00000475sv*sd*bc06sc07i00* yenta_socket
alias pci:v00001180d00000476sv*sd*bc06sc07i00* yenta_socket
alias pci:v00001180d00000478sv*sd*bc06sc07i00* yenta_socket
alias pci:v00001179d0000060Asv*sd*bc06sc07i00* yenta_socket
alias pci:v00001179d0000060Fsv*sd*bc06sc07i00* yenta_socket
alias pci:v00001179d00000617sv*sd*bc06sc07i00* yenta_socket
alias pci:v00001217d*sv*sd*bc06sc07i00* yenta_socket
alias pci:v*d*sv*sd*bc06sc07i00* yenta_socket
alias char-major-195-* nvidia
alias pci:v000010DEd*sv*sd*bc03sc00i00* nvidia
alias pci:v000010DEd*sv*sd*bc03sc02i00* nvidia
alias pci:v00008086d00004222sv*sd*bc*sc*i* ipw3945
alias pci:v00008086d00004227sv*sd*bc*sc*i* ipw3945

Here’s some output that might be relevant in dmesg. Can you tell me any other output I should be looking for in dmesg?

Код:
snd_page_alloc: exports duplicate symbol snd_dma_alloc_pages (owned by kernel)
soundcore: exports duplicate symbol sound_class (owned by kernel)
soundcore: exports duplicate symbol sound_class (owned by kernel)
snd: exports duplicate symbol snd_major (owned by kernel)
soundcore: exports duplicate symbol sound_class (owned by kernel)
snd: exports duplicate symbol snd_major (owned by kernel)
snd_timer: exports duplicate symbol snd_timer_open (owned by kernel)
soundcore: exports duplicate symbol sound_class (owned by kernel)
snd: exports duplicate symbol snd_major (owned by kernel)
snd_seq_device: exports duplicate symbol snd_seq_device_load_drivers (owned by kernel)
soundcore: exports duplicate symbol sound_class (owned by kernel)
snd: exports duplicate symbol snd_major (owned by kernel)
snd_seq_device: exports duplicate symbol snd_seq_device_load_drivers (owned by kernel)
snd_timer: exports duplicate symbol snd_timer_open (owned by kernel)
snd_seq: exports duplicate symbol snd_use_lock_sync_helper (owned by kernel)
snd_seq_midi_event: exports duplicate symbol snd_midi_event_new (owned by kernel)
soundcore: exports duplicate symbol sound_class (owned by kernel)
snd: exports duplicate symbol snd_major (owned by kernel)
snd_seq_device: exports duplicate symbol snd_seq_device_load_drivers (owned by kernel)
snd_timer: exports duplicate symbol snd_timer_open (owned by kernel)
snd_seq: exports duplicate symbol snd_use_lock_sync_helper (owned by kernel)
snd_page_alloc: exports duplicate symbol snd_dma_alloc_pages (owned by kernel)
soundcore: exports duplicate symbol sound_class (owned by kernel)
snd: exports duplicate symbol snd_major (owned by kernel)
snd_timer: exports duplicate symbol snd_timer_open (owned by kernel)
snd_pcm: exports duplicate symbol snd_pcm_new_stream (owned by kernel)
snd_page_alloc: exports duplicate symbol snd_dma_alloc_pages (owned by kernel)
soundcore: exports duplicate symbol sound_class (owned by kernel)
snd: exports duplicate symbol snd_major (owned by kernel)
snd_timer: exports duplicate symbol snd_timer_open (owned by kernel)
snd_pcm: exports duplicate symbol snd_pcm_new_stream (owned by kernel)
snd_hda_codec: exports duplicate symbol snd_hda_codec_read (owned by kernel)
snd_page_alloc: exports duplicate symbol snd_dma_alloc_pages (owned by kernel)
soundcore: exports duplicate symbol sound_class (owned by kernel)
snd: exports duplicate symbol snd_major (owned by kernel)
snd_timer: exports duplicate symbol snd_timer_open (owned by kernel)
snd_pcm: exports duplicate symbol snd_pcm_new_stream (owned by kernel)
snd_hda_codec: exports duplicate symbol snd_hda_codec_read (owned by kernel)
kobject_add failed for snd_hda_intel with -EEXIST, don’t try to register things with the same name in the same directory.

_________________
I am not a Linux Guru, but a n00b with a lot of questions.

Вернуться к началу
ctgmao
n00b

Зарегистрирован: 27 дек 2007
Сообщений: 32

Добавлено: пт дек 28, 2007 1:33 am Заголовок сообщения:
Hello
Код:
emerge -C alsa-driver
Код:
ls / lib / modules / `uname-r` /

Make sure has a folder alsa-driver, if you delete.

This way you will be using alsa kernel.

Вернуться к началу
GivePeaceAChance
Guru

Зарегистрирован: 26 мая 2007
Сообщений: 480

Добавлено: пт дек 28, 2007 2:38 am Заголовок сообщения:
I am not using alsa-driver. I made sure to compile alsa support into the kernel.
_________________
I am not a Linux Guru, but a n00b with a lot of questions.
Вернуться к началу
ctgmao
n00b

Зарегистрирован: 27 дек 2007
Сообщений: 32

Добавлено: пт дек 28, 2007 3:01 am Заголовок сообщения:
Ok

I talked about the alsa-driver because I had this problem using kernel 2.6.23. I had this problem because I had installed the alsa-driver.

This message kernel says that there is another driver installed with the same name but elsewhere.

For example in my case:

I had the snd_hda_intel folder / lib/modules/2.6.23-gentoo-r3/kernel/drivers/sound / and also had / lib/modules/2.6.23-gentoo-r3/alsa-driver /.

You compiles its driver, as audio module?

Вернуться к началу
GivePeaceAChance
Guru

Зарегистрирован: 26 мая 2007
Сообщений: 480

Добавлено: пт дек 28, 2007 3:12 am Заголовок сообщения:
/lib/modules/2.6.21-gentoo-r4/
Код:
build modules.ccwmap modules.isapnpmap modules.symbols video
kernel modules.dep modules.ofmap modules.usbmap
misc modules.ieee1394map modules.pcimap net
modules.alias modules.inputmap modules.seriomap source

_________________
I am not a Linux Guru, but a n00b with a lot of questions.

Вернуться к началу
GivePeaceAChance
Guru

Зарегистрирован: 26 мая 2007
Сообщений: 480

Добавлено: пт дек 28, 2007 7:23 am Заголовок сообщения:
Hi,

Where is the list that tells what modules should be loaded at boot? Because I’ve commented out all the modules except for nvidia and vboxusers in my /etc/modules.autoload.d/kernel-2.6 and I’ve even changed all the erroring modules to .bak files, and I still get the Warning messages in my boot process. There is no kernel-2.4 folder/file for modules — I deleted it to avoid confusion. So where are these errors coming from?
_________________
I am not a Linux Guru, but a n00b with a lot of questions.

Вернуться к началу
NeddySeagoon
Administrator

Зарегистрирован: 05 июл 2003
Сообщений: 49011
Откуда: 56N 3W

Добавлено: пт дек 28, 2007 11:34 am Заголовок сообщения:
GivePeaceAChance,

There are three ways of building ALSA and your dmesg

Код:
snd_page_alloc: exports duplicate symbol snd_dma_alloc_pages (owned by kernel)
soundcore: exports duplicate symbol sound_class (owned by kernel)

says you have used at least two of them at the same time.

The methods are emerge alsa-drivers . don’t do that.
Built into the kernel by selecting
Built as modules by selecting

Do the following

Код:
emerge -C alsa-drivers

it will fail if alsa-drivers is not installed. Thats ok,
Now remake and reinstall your kernel and its modules starting with

Код:
cd /usr/src/linux
make clean

This will ensure you have at most one set of ALSA installed. If your kernel ALSA is set to attempts to load the modules wil fail.
Thats OK as the code is included in the bzImage file.
_________________
Regards,

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.

Вернуться к началу
PaulBredbury
Watchman

Зарегистрирован: 14 июл 2005
Сообщений: 7310

Добавлено: пт дек 28, 2007 11:40 am Заголовок сообщения:
See wiki.
Код:
make clean bzImage modules modules_install

People make every mistake imaginable, with those options.

Вернуться к началу
GivePeaceAChance
Guru

Зарегистрирован: 26 мая 2007
Сообщений: 480

Добавлено: пт дек 28, 2007 12:10 pm Заголовок сообщения:
^^ In reply to Paul:

I’m going through the howto now, and I’m curious about this part:

Цитата:
Next, re-emerge any packages which provide kernel modules in /lib/modules/, e.g.:
rm -f /lib/modules/*/

How am I supposed to know which packages I’ve emerged make modules? I haven’t been keeping track up til now, so how do I know which ones to re-emerge?
_________________
I am not a Linux Guru, but a n00b with a lot of questions.

Вернуться к началу
PaulBredbury
Watchman

Зарегистрирован: 14 июл 2005
Сообщений: 7310

Добавлено: пт дек 28, 2007 12:23 pm Заголовок сообщения:
Read the next line, re module-rebuild.

Very few apps create kernel modules, so it’s easy to keep track of manually in your kernel recompilation script.

Вернуться к началу
NeddySeagoon
Administrator

Зарегистрирован: 05 июл 2003
Сообщений: 49011
Откуда: 56N 3W

Добавлено: пт дек 28, 2007 12:24 pm Заголовок сообщения:
GivePeaceAChance,

That remove command is badly broken and should not be used.

Код:
rm -f /lib/modules/*/

It removes all modules from all installed kernels that were provided by most but not all packages that install kernel modules.

Working down the list
video/nvidia is nvidia-drivers
fs/fuse is file system in user space
misc/> is cdemu, ndiswrapper and vmware-modules
If you have installed any of those, you need to reinstall them.

The /*/ causes the command to operate on all your module directories, so it breaks all your previously installed kernels. Its unlikely you want that.
_________________
Regards,

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.

Вернуться к началу
PaulBredbury
Watchman

Зарегистрирован: 14 июл 2005
Сообщений: 7310

Добавлено: пт дек 28, 2007 12:39 pm Заголовок сообщения:
NeddySeagoon писал(а):
should not be used.

It’s OK for the target audience of the document, who I have to assume aren’t complete idiots.

It seems to be obvious to people that, if a kernel module is missing (e.g. nvidia), they should re-emerge the nvidia package. But, on the other hand, if the kernel module is present but «stale», they will fill the forums with duplicate «Invalid Module Error! WTF??» threads.

Вернуться к началу
NeddySeagoon
Administrator

Зарегистрирован: 05 июл 2003
Сообщений: 49011
Откуда: 56N 3W

Добавлено: пт дек 28, 2007 12:51 pm Заголовок сообщения:
PaulBredbury,

. that gives rise to a whole new class of problems . like . I emerged nvidia-drivers and it still won’t load . because the user didn’t point /usr/src/linux to the kernel they wanted to build against.
_________________
Regards,

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.

Вернуться к началу
PaulBredbury
Watchman

Зарегистрирован: 14 июл 2005
Сообщений: 7310

Добавлено: пт дек 28, 2007 1:17 pm Заголовок сообщения:
NeddySeagoon писал(а):
didn’t point /usr/src/linux

Well, the wiki article does say to use ln , and does include checks, later in the doc.

It’s impossible to write a document containing step-by-step instructions, when the users are such idiots that they can’t follow step-by-step instructions without making every mistake imaginable.

The normal viewer of my doc will be someone who can’t get ALSA working. So it tries to get one kernel version working with ALSA, whilst reducing complexity. It doesn’t destroy the other kernels — they will still boot. The other kernels will almost certainly not have ALSA working in them anyway, so what use are they?

The doc is already too complex — witness the number of ALSA threads where they actually post all the info I describe at the bottom of the doc — practically no-one. Too much effort for the poor souls, obviously.

Вернуться к началу
NeddySeagoon
Administrator

Зарегистрирован: 05 июл 2003
Сообщений: 49011
Откуда: 56N 3W

Добавлено: пт дек 28, 2007 3:34 pm Заголовок сообщения:
PaulBredbury,

From the perspective you just outlined . I agree.
_________________
Regards,

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.

Вернуться к началу
GivePeaceAChance
Guru

Зарегистрирован: 26 мая 2007
Сообщений: 480

Добавлено: пт дек 28, 2007 7:29 pm Заголовок сообщения:
OK, looks like I’m a complete idiot then. SoI guess I’m going to take a few steps back to /etc/modules.d/alsa to save myself, and anyone else who is helping me (a big thank you, btw), some trouble.

The first thing I did on this webpage is:
emerge alsa-lib
emerge alsa-utils

Код:
modprobe snd-hda-intel ; modprobe snd-pcm-oss ; modprobe snd-mixer-oss ; modprobe snd-seq-oss

but it failed miserably with the «Invalid module format» errors.

The nex tthing I did on that page was straight up copy the following and add it to the end of /etc/modules.conf. I’m an idiot, so I don’t know if I need to, but they said to do so, so I did it.

Код:
# ALSA portion
alias char-major-116 snd
alias snd-card-0 snd-hda-intel
# module options should go here

# OSS/Free portion
alias char-major-14 soundcore
alias sound-slot-0 snd-card-0

# card #1
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss

Here is my resulting modules.conf file:

Код:
### This file is automatically generated by modules-update
#
# Please do not edit this file directly. If you want to change or add
# anything please take a look at the files in /etc/modules.d and read
# the manpage for modules-update(8).
#

### modules-update: start processing /etc/modules.d/aliases
# Aliases to tell insmod/modprobe which modules to use

# Uncomment the network protocols you don’t want loaded:
# alias net-pf-1 off # Unix
# alias net-pf-2 off # IPv4
# alias net-pf-3 off # Amateur Radio AX.25
# alias net-pf-4 off # IPX
# alias net-pf-5 off # DDP / appletalk
# alias net-pf-6 off # Amateur Radio NET/ROM
# alias net-pf-9 off # X.25
# alias net-pf-10 off # IPv6
# alias net-pf-11 off # ROSE / Amateur Radio X.25 PLP
# alias net-pf-19 off # Acorn Econet

alias char-major-10-175 agpgart
alias char-major-10-200 tun
alias char-major-81 bttv
alias char-major-108 ppp_generic
alias /dev/ppp ppp_generic
alias tty-ldisc-3 ppp_async
alias tty-ldisc-14 ppp_synctty
alias ppp-compress-21 bsd_comp
alias ppp-compress-24 ppp_deflate
alias ppp-compress-26 ppp_deflate

# Crypto modules (see http://www.kerneli.org/)
alias loop-xfer-gen-0 loop_gen
alias loop-xfer-3 loop_fish2
alias loop-xfer-gen-10 loop_gen
alias cipher-2 des
alias cipher-3 fish2
alias cipher-4 blowfish
alias cipher-6 idea
alias cipher-7 serp6f
alias cipher-8 mars6
alias cipher-11 rc62
alias cipher-15 dfc2
alias cipher-16 rijndael
alias cipher-17 rc5

# Support for i2c and lm_sensors
alias char-major-89 i2c-dev

### modules-update: end processing /etc/modules.d/aliases

### modules-update: start processing /etc/modules.d/alsa
# Alsa kernel modules’ configuration file.

# ALSA portion
# OSS/Free portion

##
## IMPORTANT:
## You need to customise this section for your specific sound card(s)
## and then run `update-modules’ command.
## Read alsa-driver’s INSTALL file in /usr/share/doc for more info.
##
## ALSA portion
## alias snd-card-0 snd-interwave
## alias snd-card-1 snd-ens1371
## OSS/Free portion
## alias sound-slot-0 snd-card-0
## alias sound-slot-1 snd-card-1
##

# OSS/Free portion — card #1
## OSS/Free portion — card #2
## alias sound-service-1-0 snd-mixer-oss
## alias sound-service-1-3 snd-pcm-oss
## alias sound-service-1-12 snd-pcm-oss

alias /dev/mixer snd-mixer-oss
alias /dev/dsp snd-pcm-oss
alias /dev/midi snd-seq-oss

# Set this to the correct number of cards.
# — BEGIN: Generated by ALSACONF, do not edit. —
# — ALSACONF version 1.0.14rc2 —
alias snd-card-0 snd-hda-intel
alias sound-slot-0 snd-hda-intel
# — END: Generated by ALSACONF, do not edit. —

options snd-hda-intel model=toshiba
### modules-update: end processing /etc/modules.d/alsa

### modules-update: start processing /etc/modules.d/i386
alias parport_lowlevel parport_pc
alias char-major-10-144 nvram
alias binfmt-0064 binfmt_aout
alias char-major-10-135 rtc

### modules-update: end processing /etc/modules.d/i386

### modules-update: start processing /etc/modules.d/ipw3945
# modules.d configuration file for IPW3945
# For more information please read:
# README.ipw3945

# Configurable module parameters
# ——————————
# antenna: select antenna (1=Main, 2=Aux, default 0 [both])
# disable: manually disable the radio (default 0 [radio on])
# associate: auto associate when scanning (default 0 off)
# auto_create: auto create adhoc network (default 1 on)
# led: enable led control (default 1 on)
# debug: debug output mask
# channel: channel to limit associate to (default 0 [ANY])
# rtap_iface: create the rtap interface (1 — create, default 0)
# mode: network mode (0=BSS,1=IBSS,2=Monitor)

### modules-update: end processing /etc/modules.d/ipw3945

### modules-update: start processing /etc/modules.d/ipw3945d
install ipw3945 /sbin/modprobe —ignore-install ipw3945; sleep 0.5; /etc/init.d/ipw3945d start
remove ipw3945 /etc/init.d/ipw3945d stop; /sbin/modprobe -r —ignore-remove ipw3945

### modules-update: end processing /etc/modules.d/ipw3945d

### modules-update: start processing /etc/modules.d/nvidia
# Nvidia drivers support
alias char-major-195 nvidia
alias /dev/nvidiactl char-major-195

# To tweak the driver the following options can be used, note that
# you should be careful, as it could cause instability!! For more
# options see /usr/share/doc/nvidia-drivers-100.14.09/README.gz
#
# To enable Side Band Adressing: NVreg_EnableAGPSBA=1
#
# To enable Fast Writes: NVreg_EnableAGPFW=1
#
# To enable both for instance, uncomment following line:
#
#options nvidia NVreg_EnableAGPSBA=1 NVreg_EnableAGPFW=1
# If you have a mobile chip, you may need to enable this option
# if you have hard lockups when starting X.
#
# See: Appendix I. Configuring your laptop
# In /usr/share/doc/nvidia-drivers-100.14.09/README.gz for full details
#
# Choose the appropriate value for NVreg_Mobile from the table:
# Value Meaning
# ———- —————————————————
# 0xFFFFFFFF let the kernel module autodetect the correct value
# 1 Dell laptops
# 2 non-Compal Toshiba laptops
# 3 all other laptops
# 4 Compal Toshiba laptops
# 5 Gateway laptops
#
#options nvidia NVreg_SoftEDIDs=0 NVreg_Mobile=3

# . SECURITY WARNING .
# DO NOT MODIFY OR REMOVE THE DEVICE FILE RELATED OPTIONS UNLESS YOU KNOW
# WHAT YOU ARE DOING.
# ONLY ADD TRUSTED USERS TO THE VIDEO GROUP, THESE USERS MAY BE ABLE TO CRASH,
# COMPROMISE, OR IRREPARABLY DAMAGE THE MACHINE.
options nvidia NVreg_DeviceFileMode=432 NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=27 NVreg_ModifyDeviceFiles=1

### modules-update: end processing /etc/modules.d/nvidia

### modules-update: start processing /etc/modules.d/svgalib_helper
# modules.d configuration file for SVGALIB_HELPER

# Configurable module parameters
# ——————————
# debug: Debug output level.
# all_devices: Give access to all PCI devices, regardless of class.

probeall /dev/svga svgalib_helper

### modules-update: end processing /etc/modules.d/svgalib_helper

#COPIED AND PASTED FROM:
#http://bugtrack.alsa-project.org/main/index.php/Matrix:Module-hda-intel

# ALSA portion
alias char-major-116 snd
alias snd-card-0 snd-hda-intel
# module options should go here

# OSS/Free portion
alias char-major-14 soundcore
alias sound-slot-0 snd-card-0

# card #1
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss

I then went BACK to the ALSA gentoo howto, and I’m at the point where it is not necessary to run alsaconf. I’ll continue on my way and simply run update-modules.

After that, I ran:

Код:
make clean bzImage modules modules_install

Am I doing OK up to this point, because the next part may require some questions since I don’t know how to use module-rebuild.

i.e. Do I remove the kernels with the rm command listed, then run module-rebuild?
i.e. How do I use it to make my life easy? Do I simply go : module-rebuild -X add [category] and go through EVERY category in the portage tree?
_________________
I am not a Linux Guru, but a n00b with a lot of questions.

Вернуться к началу
NeddySeagoon
Administrator

Зарегистрирован: 05 июл 2003
Сообщений: 49011
Откуда: 56N 3W

Добавлено: пт дек 28, 2007 8:40 pm Заголовок сообщения:
GivePeaceAChance,

The problem I have with helping you right now is that I don’t know where you are.
You must not edit modules.conf. Its auto generated from /etc/modules.d/* every boot on Gentoo.

snd-alsa-hda is a difficult module to make make work because thare are lots of slightly different pieces of hardware that it covers.
The differences are ensuring you have a recent enough snd-intel-hda for your hardware and you load the module with the right options.

Start with a nice clean kernel tree and rip out alsa-drivers, even if its not installed. Do

Код:
emerge -C alsa-driver
cd /usr/src/linux
make clean

Ignore errors from emerge -C alsa-driver.

Next, configure your kernel for kernel ALSA with OSS support, to be made as modules.

Код:
Under Sound —>
Advanced Linux Sound Architecture —>
Open Sound System —>
Open Sound System (DEPRECATED)

make sure OSS is off.
Inside Advanced Linux Sound Architecture —> set

Код:
│ │ Advanced Linux Sound Architecture │ │
│ │ Sequencer support │ │
│ │ Sequencer dummy client │ │
│ │ OSS Mixer API │ │
│ │ OSS PCM (digital audio) API │ │
│ │ [*] OSS PCM (digital audio) API — Include plugin system │ │
│ │ [*] OSS Sequencer API │ │
│ │ RTC Timer support │ │
│ │ [*] Use RTC as default sequencer timer │ │
│ │ [ ] Dynamic device file minor numbers │ │
│ │ [*] Support old ALSA API

Under Generic devices —> ensure everything is off
Under PCI devices —> Choose

Код:
Intel HD Audio

Set everything else off unless you have more sound cards.

Now build your kernel, install and boot into it. Check that the time and date shown in uname -a is the new kernel build time.
Until you are in your new kernel do not proceed.

Код:
modprobe -l -t sound

should list your sound modules.

Next install all the supporting things by following the Gentoo ALSA Guide
DO *not* emerge alsa-driver. It should detect your kernel alsa and refuse anyway. Do everything else the guide suggests except that step.

Add your normal user to the audio group, log out and back in to pick up the new group membership
If you are very lucky, thats it, you unmute your Master and PCM, push the sliders up and you have sound.
Do not unmute any other controls until this works.

Since you have snd-intel-hda, it probably won’t work. Check that your system has /dev/snd and /dev/sound and that the files in them are owned by root and in group audio.

The last step is to fiddle with module options. You do that with the routine

Код:
modprobe -r snd-intel-hda
modprobe snd-intel-hda

Test the sound, with a simple command line player. I like

Код:
mplayer -ao alsa /path/to/sound/file

You will find some options in

Код:
less /usr/src/linux/Documentation/sound/alsa/ALSA-Configuration.txt

Its a big file but you are only interested in the Intel HDA section.

When you find the right option, you can make it be used at startup by including it in /etc/modules.d/alsa

Any problems, stop at the error, tell us what you did, what you think should have happened, what actually happened and provide any error messages from the screen or dmesg verbatim.
_________________
Regards,

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.

Вернуться к началу
GivePeaceAChance
Guru

Зарегистрирован: 26 мая 2007
Сообщений: 480

Добавлено: пт дек 28, 2007 9:39 pm Заголовок сообщения:
Цитата:
Now build your kernel, install and boot into it. Check that the time and date shown in uname -a is the new kernel build time.
Until you are in your new kernel do not proceed.

Well ****. Maybe I’m too stupid to learn linux. Shit. ****. I did what you suggested, checked uname -a, and it kept giving me Aug 14, when I originally set up gentoo. This puzzled me. Sooooo, over to grub’s menu.lst. Lo and behold! I THOUGHT it was loading kernel-2.6.21-gentoo-r4, but it was loading vmlinux-2.6.21-gentoo-r4. So I changed this, prayed for the best, and **** yeah, no error messages, and the kernels load properly. ****ing dumbshit I am.

Well, as long as I didn’t make you guys upset with my stupidity, all I can say is, *hopefully* I’m all the more wiser. (big question mark on that one, but we’ll hope for the best).
_________________
I am not a Linux Guru, but a n00b with a lot of questions.

Вернуться к началу
NeddySeagoon
Administrator

Зарегистрирован: 05 июл 2003
Сообщений: 49011
Откуда: 56N 3W

Добавлено: пт дек 28, 2007 10:23 pm Заголовок сообщения:
GivePeaceAChance,

There are many ways to mess up a kernel install. When you have done it once, you learn that command and apply it as a sanity check, every time.
Its a lesson there is only one way to learn and there is no shame in learning.
_________________
Regards,

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.

Вернуться к началу
Список форумов: Gentoo Forums Kernel & Hardware Часовой пояс: GMT
Страница 1 из 1
Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете голосовать в опросах

Copyright 2001-2021 Gentoo Foundation, Inc. Designed by Kyle Manna © 2003; Style derived from original subSilver theme. | Hosting by Gossamer Threads Inc. © | Powered by phpBB 2.0.23-gentoo-p11 © 2001, 2002 phpBB Group
Privacy Policy

Источник

Читайте также:  После обновления до windows 10 не отключается ноутбук
Оцените статью