Kernel-fråga, linux-headers

Frågor om LiveCDn samt installation och uppgradering av Ubuntu och dess varianter
Användarvisningsbild
cthulhu
Inlägg: 789
Blev medlem: 05 jan 2009, 14:11
OS: Debian

Kernel-fråga, linux-headers

Inlägg av cthulhu »

Jag uppgraderade just till kernel .30, och skulle installera en alsa-driver (alsa-driver-linuxant.4362) för att få igång mitt modem, då får jag följande output:

Kod: Markera allt

rm -f .depend *.o snd.map*
rm -f /*.ver
rm -f modules/*.o modules/*.ko
rm -f *~ out.txt *.orig *.rej .#* .gdb_history
rm -f doc/*~
rm -f config.cache config.log config.status Makefile.conf
rm -f utils/alsa-driver.spec
rm -f `find alsa-kernel -name "*~"`
rm -f `find alsa-kernel -name "*.orig"`
rm -f `find alsa-kernel -name "*.rej"`
rm -f `find alsa-kernel -name ".#*"`
rm -f `find alsa-kernel -name "out.txt"`
rm -f `find . -name "Module.markers"`
rm -f `find . -name "modules.order"`
rm -rf autom4te.cache
rm -f alsa-kernel/include/version.h
rm -f include/sound
rm -fr .tmp_versions
rm -f Module.symvers
find . -name "*.in" -a ! -name "configure.in" | sed 's/.in$//g' | xargs rm -f
rm -fr builds
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for ranlib... ranlib
checking for a BSD-compatible install... /usr/bin/install -c
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking whether time.h and sys/time.h may both be included... yes
checking whether gcc needs -traditional... no
checking for current directory... /usr/lib/alsa-driver-linuxant
checking cross compile... 
checking for directory with kernel source... ./configure: line 4710: cd: /usr/src/linux: No such file or directory
/usr/src/linux
checking for directory with kernel build... 
checking for kernel linux/version.h... no
The file /include/linux/version.h does not exist.
Please install the package with full kernel sources for your distribution
or use --with-kernel=dir option to specify another directory with kernel
sources (default is /usr/src/linux).
Det intressanta är väl det sista:

Kod: Markera allt

checking for current directory... /usr/lib/alsa-driver-linuxant
checking cross compile... 
checking for directory with kernel source... ./configure: line 4710: cd: /usr/src/linux: No such file or directory
/usr/src/linux
checking for directory with kernel build... 
checking for kernel linux/version.h... no
The file /include/linux/version.h does not exist.
Please install the package with full kernel sources for your distribution
or use --with-kernel=dir option to specify another directory with kernel
sources (default is /usr/src/linux).
Måste man alltså ha källkoden till kärnan för att installera denna drivrutinen? Är det säkert att låta den få tillgång till det?
Och var hittar jag den efterfrågade källkoden?
Har sett gammla paket som heter saker som linux-header, kan det vara det?
Användarvisningsbild
bbauto
Inlägg: 1594
Blev medlem: 11 dec 2006, 17:58
OS: Ubuntu
Utgåva: 22.10 Kinetic Kudu
Ort: Bromölla

Re: Kernel-fråga, linux-headers

Inlägg av bbauto »

Börja med att installera "build-essential" från System->Administration->Pakethanteraren synaptic
eller från Program->Tillbehör->Terminalen

Kod: Markera allt

sudo apt-get install build-essential
Användarvisningsbild
philip5
HC-IRCare
Inlägg: 1099
Blev medlem: 21 feb 2009, 14:32
OS: Kubuntu
Utgåva: 23.10 Mantic Minotaur
Ort: Uppsala
Kontakt:

Re: Kernel-fråga, linux-headers

Inlägg av philip5 »

Kort svar på frågan är: Ja man måste ha headers.

Man måste nästan alltid ha kernel headers när man bygger moduler för att moduler anropar i sig så klart saker i kärnan. Undantaget kan vara moduler som byggs för att ligga i user space men de är då sådana och inget man själv väljer.

Headers behöver däremot inte betyda att man behöver all källkod utan headerfiler räcker allt som oftast.

[Red] la till sista stycket men så hann lars skriva nästan samma sak.
Senast redigerad av 2 philip5, redigerad totalt 14 gång.
-------------------------------------------------------------
Min PPA för Ubuntu: http://launchpad.net/~philip5
Twitter: http://twitter.com/philip_johnsson
IRC: Philip5 @ freenode.net #ubuntu-se #kubuntu-se
Lars
Inlägg: 6191
Blev medlem: 14 jan 2007, 19:31
OS: Ubuntu
Utgåva: 22.10 Kinetic Kudu
Ort: Stockholm

Re: Kernel-fråga, linux-headers

Inlägg av Lars »

Källkoden finns i paketet linux-source, men det borde räcka med linux-headers-generic
Användarvisningsbild
webaake
Inlägg: 3962
Blev medlem: 09 maj 2007, 09:46
OS: Xubuntu
Utgåva: 22.04 Jammy Jellyfish LTS

Re: Kernel-fråga, linux-headers

Inlägg av webaake »

sudo apt-get install linux-headers-($uname -r)

Kan göra susen?
Xubuntu på flera maskiner. Men inte Unity!
Mer Terminalanvändande i Ubuntu vore bra. Och Xfce. Och Mate.
Användarvisningsbild
cthulhu
Inlägg: 789
Blev medlem: 05 jan 2009, 14:11
OS: Debian

Re: Kernel-fråga, linux-headers

Inlägg av cthulhu »

Är header-filerna arkitekturspecifika?
Såg nu att det finns en -common och så står det att man skall kompletera med sin egen arkitektur.

så här står det om linux-headers-2.6.30-bpo.1-common
This package provides the architecture-specific common kernel header files for Linux kernel version 2.6.30-bpo.1, generally used for building out-of-tree kernel modules. To obtain a complete set of headers you also need to install the linux-headers-2.6.30-bpo.1-(flavour) package, matching the flavour of the kernel you intend the build for.
men jag kan inte se några i386-filer, men jag ser andra, typ alpha mm.
(bör kanske nämna att jag kör debian...)
Lars
Inlägg: 6191
Blev medlem: 14 jan 2007, 19:31
OS: Ubuntu
Utgåva: 22.10 Kinetic Kudu
Ort: Stockholm

Re: Kernel-fråga, linux-headers

Inlägg av Lars »

linux-headers-2.6.30-bpo.1-486 eller linux-headers-2.6.30-bpo.1-686 borde väl fungera, se http://packages.debian.org/search?searc ... 2.6.30-bpo
Användarvisningsbild
Barre
Inlägg: 2298
Blev medlem: 13 dec 2006, 10:23
OS: Ubuntu
Ort: Stockholm
Kontakt:

Re: Kernel-fråga, linux-headers

Inlägg av Barre »

webaake skrev:sudo apt-get install-($uname -r)

Kan göra susen?
Dollartecknet kom lite tokigt.

Kod: Markera allt

echo linux-headers-$(uname -r)
så bör det vara
Användarvisningsbild
SlamsornasKung
Inlägg: 886
Blev medlem: 27 jun 2009, 19:23
OS: Ubuntu
Utgåva: 22.04 Jammy Jellyfish LTS
Ort: 08

Re: Kernel-fråga, linux-headers

Inlägg av SlamsornasKung »

Råkade ut för ett samma sak som du för ett tag sedan, lyckligtvis finns Google, och jag hittade följande guide: http://www.cyberciti.biz/faq/howto-inst ... s-package/

Till och med ett blåbär som jag lyckades!
HP NC2400 - Ubuntu 10.04 • Fujitsu Siemens AmiloM7400 - Arch Linux • HP/Compaq Mini 110C - Ubuntu 10.04
CryingFreeman skrev:[…] Ubuntu är och förblir en meritokrati, inget demokratiskt experiment där alla får säga vad som helst till vem som helst, hur som helst.
Användarvisningsbild
webaake
Inlägg: 3962
Blev medlem: 09 maj 2007, 09:46
OS: Xubuntu
Utgåva: 22.04 Jammy Jellyfish LTS

Re: Kernel-fråga, linux-headers

Inlägg av webaake »

echo linux-headers-$(uname -r)
Oj, där slant mina fingrar!
Förresten; uname -r borde väl plocka med allt efter 2.6.30 ?
Xubuntu på flera maskiner. Men inte Unity!
Mer Terminalanvändande i Ubuntu vore bra. Och Xfce. Och Mate.
Användarvisningsbild
cthulhu
Inlägg: 789
Blev medlem: 05 jan 2009, 14:11
OS: Debian

Re: Kernel-fråga, linux-headers

Inlägg av cthulhu »

tackar för alla svar. Just det där med uname kan jag nog inte köra för jag har inget internet på den datorn, (just därför jag gick över till debian), tror jag har laddat ner rätt filer:

linux-headers-2.6.30-bpo.1-686_2.6.30-6~bpo50+1_i386.deb
linux-headers-2.6.30-bpo.1-common_2.6.30-6~bpo50+1_i386.deb
Användarvisningsbild
cthulhu
Inlägg: 789
Blev medlem: 05 jan 2009, 14:11
OS: Debian

Re: Kernel-fråga, linux-headers

Inlägg av cthulhu »

Installerade filerna och när jag skulle installera alsa-driver får jag följande:

Kod: Markera allt

vandelay@art:~/Desktop$ sudo dpkg -i alsa-driver-linuxant_1.0.20.3_all.deb 
(Läser databasen ... 111919 filer och kataloger installerade.)
Förbereder att ersätta alsa-driver-linuxant 1.0.20.3 (med alsa-driver-linuxant_1.0.20.3_all.deb) ...
Packar upp ersättande alsa-driver-linuxant ...
Ställer in alsa-driver-linuxant (1.0.20.3) ...
Building modules for the 2.6.30-bpo.1-686 kernel, please wait... done.
ERROR: Build failed. Please review the build log at /tmp/alsa-driver-linuxant.5490.log
dpkg: fel vid hantering av alsa-driver-linuxant (--install):
 underprocess post-installation script gav felkod 2
Fel uppstod vid hantering:
 alsa-driver-linuxant
Sedan testade jag att göra det en gång till (i brist på förståelse för vad som händer) och fick detta:

Kod: Markera allt

vandelay@art:~/Desktop$ sudo dpkg -i alsa-driver-linuxant_1.0.20.3_all.deb 
(Läser databasen ... 111919 filer och kataloger installerade.)
Förbereder att ersätta alsa-driver-linuxant 1.0.20.3 (med alsa-driver-linuxant_1.0.20.3_all.deb) ...
FATAL: Module snd_hda_intel not found.
FATAL: Error running install command for snd_hda_intel
FATAL: Module snd_hda_codec_conexant not found.
FATAL: Error running install command for snd_hda_codec_conexant
FATAL: Module snd_pcm_oss not found.
FATAL: Module snd_seq_midi not found.
Packar upp ersättande alsa-driver-linuxant ...
Ställer in alsa-driver-linuxant (1.0.20.3) ...
Building modules for the 2.6.30-bpo.1-686 kernel, please wait... done.
ERROR: Build failed. Please review the build log at /tmp/alsa-driver-linuxant.9267.log
dpkg: fel vid hantering av alsa-driver-linuxant (--install):
 underprocess post-installation script gav felkod 2
Fel uppstod vid hantering:
 alsa-driver-linuxant
Sedan fick jag ominswtallera kernel 26.30 för att få tillbaka ljudet på datorn. Vågar inte försöka igen förens jag vet vad som är fel.

log-filen som skapades efter första försöket var denna:

Kod: Markera allt

rm -f .depend *.o snd.map*
rm -f /*.ver
rm -f modules/*.o modules/*.ko
rm -f *~ out.txt *.orig *.rej .#* .gdb_history
rm -f doc/*~
rm -f config.cache config.log config.status Makefile.conf
rm -f utils/alsa-driver.spec
rm -f `find alsa-kernel -name "*~"`
rm -f `find alsa-kernel -name "*.orig"`
rm -f `find alsa-kernel -name "*.rej"`
rm -f `find alsa-kernel -name ".#*"`
rm -f `find alsa-kernel -name "out.txt"`
rm -f `find . -name "Module.markers"`
rm -f `find . -name "modules.order"`
rm -rf autom4te.cache
rm -f alsa-kernel/include/version.h
rm -f include/sound
rm -fr .tmp_versions
rm -f Module.symvers
find . -name "*.in" -a ! -name "configure.in" | sed 's/.in$//g' | xargs rm -f
rm -fr builds
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for ranlib... ranlib
checking for a BSD-compatible install... /usr/bin/install -c
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking whether time.h and sys/time.h may both be included... yes
checking whether gcc needs -traditional... no
checking for current directory... /usr/lib/alsa-driver-linuxant
checking cross compile... 
checking for directory with kernel source... /lib/modules/2.6.30-bpo.1-686/source
checking for directory with kernel build... /lib/modules/2.6.30-bpo.1-686/build
checking for kernel linux/version.h... yes
checking for kernel linux/autoconf.h... yes
checking for kernel version... 2.6.30-bpo.1-686
checking for GCC version... ./configure: eval: line 5073: syntax error near unexpected token `)'
./configure: eval: line 5073: `my_compiler_version=4.3.2-1.1)'
Kernel compiler: gcc 4.3.2 (Debian 4.3.2-1.1)  Used compiler: gcc (Debian 4.3.2-1.1) 4.3.2
./configure: line 5098: test: too many arguments
./configure: line 5103: test: too many arguments
checking for built-in ALSA... no
checking for existing ALSA module... yes
checking for Red Hat kernel... auto
checking for Red Hat kernel... no
checking for SUSE kernel... auto
checking for SUSE kernel... no
checking for updating alsa-kernel version.h... yes
checking for CONFIG_EXPERIMENTAL... yes
checking for directory to store kernel modules... /lib/modules/2.6.30-bpo.1-686/kernel/sound
checking for verbose procfs... on
checking for verbose printk... on
checking for debug level... none
checking for ISA support in kernel... yes
checking for processor type... i686
checking for ISA DMA API... yes
checking for kernel linux/config.h... no
Creating <linux/config.h>...
checking for deprecated linux/config.h... checking to modify of kernel linux/kmod.h... no
checking for kernel linux/utsrelease.h... yes
checking for kernel linux/compiler.h... yes
checking for kernel linux/pm.h... yes
checking for kernel linux/spinlock.h... yes
checking for kernel linux/irq.h... yes
checking for kernel linux/threads.h... yes
checking for kernel linux/rwsem.h... yes
checking for kernel linux/gameport.h... yes
checking for kernel media/v4l2-dev.h... yes
checking for kernel linux/devfs_fs_kernel.h... no
Creating a dummy <linux/devfs_fs_kernel.h>...
checking for kernel linux/highmem.h... yes
checking for kernel linux/workqueue.h... yes
checking for kernel linux/dma-mapping.h... yes
checking for kernel asm/hw_irq.h... yes
checking for kernel linux/device.h... yes
checking for kernel linux/platform_device.h... yes
checking for kernel linux/isa.h... yes
checking for kernel linux/jiffies.h... yes
checking for kernel linux/compat.h... yes
checking for kernel linux/log2.h... yes
checking for kernel linux/adb.h... yes
checking for kernel linux/cuda.h... yes
checking for kernel linux/pmu.h... yes
checking for kernel linux/io.h... yes
checking for kernel linux/moduleparam.h... yes
checking for kernel linux/syscalls.h... yes
checking for kernel linux/firmware.h... yes
checking for kernel linux/err.h... yes
checking for kernel linux/bitmap.h... yes
checking for kernel linux/mutex.h... yes
checking for kernel linux/pm_qos_params.h... yes
checking for kernel linux/kthread.h... yes
checking for kernel asm/irq_regs.h... yes
checking for kernel linux/seq_file.h... yes
checking for kernel linux/debugfs.h... yes
checking for kernel linux/gpio.h... yes
checking for kernel module symbol versions... yes
checking for has ioport support... yes
checking for PCI support in kernel... yes
checking for I2C driver in kernel... module
checking for I2C_POWERMAC in kernel... unknown
checking for firmware loader... yes
checking for input subsystem in kernel... yes
checking for pc-speaker platform in kernel... yes
checking for SMP... yes
checking for Video device support in kernel... yes
checking for ISA PnP driver in kernel... yes
checking for PnP driver in kernel... yes
checking for Kernel ISA-PnP support... yes
checking for strlcpy... yes
checking for snprintf... yes
checking for vsnprintf... yes
checking for scnprintf... yes
checking for sscanf... yes
checking for vmalloc_to_page... yes
checking for old kmod... no
checking for PDE... yes
checking for usb_endpoint_dir_in and related functions... yes
checking for usb_endpoint_xfer_control... yes
checking for pci_set_consistent_dma_mask... yes
checking for pci_dev_present... yes
checking for fmode_t... yes
checking for hrtimer_get_expires... yes
checking for msleep... yes
checking for msleep_interrupt... yes
checking for msecs_to_jiffies... yes
checking for tty->count is the atomic type... no
checking for video_get_drvdata... yes
checking for video_drvdata... yes
checking for V4L1 layer... yes
checking for V4L2 layer... yes
checking for io_remap_pfn_range... yes
checking for kcalloc... yes
checking for kstrdup... yes
checking for kstrndup... yes
checking for kzalloc... yes
checking for create_workqueue with flags... no
checking for pci_ioremap_bar... yes
checking for saved_config_space in pci_dev... yes
checking for new pci_save_state... yes
checking for register_sound_special_device... yes
checking for driver extra-version... 
checking for driver version... 1.0.20
checking for dynamic minor numbers... no
checking for sequencer support... yes
checking for OSS/Free emulation... yes
checking for OSS PCM plugin system inclusion... yes
checking for RTC support... no
checking for HPET support... yes
checking for Procfs support... yes
checking for USB support... yes
checking for class_simple... no
checking for old driver suspend/resume callbacks... no
checking for removal of page-reservation for nopage/mmap... no
checking for nested class_device... no
checking for new IRQ handler... yes
checking for gfp_t... yes
checking for GFP_DMA32... yes
checking for page_to_pfn... yes
checking for bool... yes
checking for PnP suspend/resume... yes
checking for device_create_drvdata... no
checking for new unlocked/compat_ioctl... yes
checking for builtin _Bool support... yes
checking for x86-compatible PC... no
checking for High-Res timers... yes
checking for kernel PCMCIA
checking for PCMCIA support... yes
checking for PC9800 support in kernel... no
checking for parallel port support... yes
checking for power management... yes
checking for CONFIG_HAS_DMA... yes
checking for cards to compile driver for... all
checking for additonal options to compile driver for... all
configure: creating ./config.status
config.status: creating version
config.status: creating Makefile.conf
config.status: WARNING:  Makefile.conf.in seems to ignore the --datarootdir setting
config.status: creating snddevices
config.status: creating utils/alsa-driver.spec
config.status: creating utils/buildrpm
config.status: creating toplevel.config
config.status: creating utils/alsasound
config.status: creating utils/alsasound.posix
config.status: creating include/pci_ids_compat.h
config.status: creating include/i2c-id_compat.h
config.status: creating include/config.h
config.status: creating include/config1.h
config.status: creating include/version.h
config.status: creating include/autoconf-extra.h
Hacking autoconf.h...
if [ ! -d include/sound -a ! -L include/sound ]; then \
	  ln -sf ../alsa-kernel/include include/sound ; \
	fi
cp -pvf include/version.h include/sound/version.h
"include/version.h" -> "include/sound/version.h"
make dep
make[1]: Entering directory `/usr/lib/alsa-driver-linuxant'
#@for d in acore i2c drivers isa synth pci aoa soc usb pcmcia misc; do if ! make -C $d prepare; then exit 1; fi; done
make[1]: Leaving directory `/usr/lib/alsa-driver-linuxant'
make -C /lib/modules/2.6.30-bpo.1-686/source SUBDIRS=/usr/lib/alsa-driver-linuxant  CPP="gcc -E" CC="gcc" modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.30-bpo.1-common'

  ERROR: Kernel configuration is invalid.
         include/linux/autoconf.h or include/config/auto.conf are missing.
         Run 'make oldconfig && make prepare' on kernel src to fix it.


  WARNING: Symbol version dump /usr/src/linux-headers-2.6.30-bpo.1-common/Module.symvers
           is missing; modules will have no dependencies and modversions.

find: "/usr/src/linux-headers-2.6.30-bpo.1-common/alsa-kernel/": Filen eller katalogen finns inte
find: "/usr/src/linux-headers-2.6.30-bpo.1-common/alsa-kernel/": Filen eller katalogen finns inte
find: "/usr/src/linux-headers-2.6.30-bpo.1-common/alsa-kernel/": Filen eller katalogen finns inte
  Building modules, stage 2.
/usr/src/linux-headers-2.6.30-bpo.1-common/scripts/Makefile.modpost:43: include/config/auto.conf: Filen eller katalogen finns inte
find: "/usr/src/linux-headers-2.6.30-bpo.1-common/alsa-kernel/": Filen eller katalogen finns inte
find: "/usr/src/linux-headers-2.6.30-bpo.1-common/alsa-kernel/": Filen eller katalogen finns inte
find: "/usr/src/linux-headers-2.6.30-bpo.1-common/alsa-kernel/": Filen eller katalogen finns inte
make[2]: *** Ingen regel för att skapa målet "include/config/auto.conf".  Stannar.
make[1]: *** [modules] Fel 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.30-bpo.1-common'
make: *** [compile] Fel 2
Det är väl det sista som är av intresse:

Kod: Markera allt

ERROR: Kernel configuration is invalid.
         include/linux/autoconf.h or include/config/auto.conf are missing.
         Run 'make oldconfig && make prepare' on kernel src to fix it.


  WARNING: Symbol version dump /usr/src/linux-headers-2.6.30-bpo.1-common/Module.symvers
           is missing; modules will have no dependencies and modversions.

find: "/usr/src/linux-headers-2.6.30-bpo.1-common/alsa-kernel/": Filen eller katalogen finns inte
find: "/usr/src/linux-headers-2.6.30-bpo.1-common/alsa-kernel/": Filen eller katalogen finns inte
find: "/usr/src/linux-headers-2.6.30-bpo.1-common/alsa-kernel/": Filen eller katalogen finns inte
  Building modules, stage 2.
/usr/src/linux-headers-2.6.30-bpo.1-common/scripts/Makefile.modpost:43: include/config/auto.conf: Filen eller katalogen finns inte
find: "/usr/src/linux-headers-2.6.30-bpo.1-common/alsa-kernel/": Filen eller katalogen finns inte
find: "/usr/src/linux-headers-2.6.30-bpo.1-common/alsa-kernel/": Filen eller katalogen finns inte
find: "/usr/src/linux-headers-2.6.30-bpo.1-common/alsa-kernel/": Filen eller katalogen finns inte
make[2]: *** Ingen regel för att skapa målet "include/config/auto.conf".  Stannar.
make[1]: *** [modules] Fel 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.30-bpo.1-common'
make: *** [compile] Fel 2
Vad är "make oldconfig && make prepare" för något? Vad gör "&&"?
Skriv svar

Återgå till "Installation och uppgradering"