# gentoo-dev-sources-2.6.9 and lirc

## odborg

How do i make it work?

when i emerge lirc i get:

```

 * /usr/src/linux is a symbolic link

 * Determining the real directory of the Linux kernel source code

 * Building for Linux 2.6.9-gentoo-r1 found in /usr/src/linux

 * which outputs to /usr/src/linux

 * By not using the kernel's ability to output to an alternative

 * directory, some external module builds may fail.

 * See <insert link to user doc here>

 * Due to the 2.6 kernel build system, external module compilation

 * with a normal setup requires write access to //usr/src/linux

 * There are several ways to fix/prevent this.

 * Users can willingly let portage make this writable by doing

 * # config-kernel --allow-writable yes

 * However, this is considered a security risk!

 *

 * The prefered method is to enable Gentoo's new 'koutput' method

 * for kernel modules. See the doc

 * http://www.gentoo.org/doc/en/2.6-koutput-user.xml

 * To enable this, you'll need to run

 * # config-kernel --output-dir /var/tmp/kernel-output

 * and then install a new kernel

```

i think that i have the KBUILD environment set up correctly since emerging nvidia-kernel works fine, and compiling a kernel outputs to /var/tmp/kernel-output

Another question. The building proces also states:

```

You will have to use the lirc_serial kernel module.

```

does this mean that the lirc_i2c (which is what i need) module wont be available?

----------

## Pat-rizio

Hi odborg,

I have the same problem you have. I'm taking a look at the page:

```
http://www.gentoo.org/doc/en/2.6-koutput-user.xml
```

Just as our compilation error suggests.

But I haven't the command:

```
config-kernel
```

So, I think "no problem, I just have to emerge config-kernel..." (this is the Gentoo way, isn't it?   :Wink:  ) but the following message appears to me:

```
Calculating dependencies

!!! All ebuilds that could satisfy "config-kernel" have been masked.

!!! One of the following masked packages is required to complete your request:

- sys-kernel/config-kernel-0.3.2-r1 (masked by: package.mask)

# <latexer@gentoo.org> (11 Oct 2004)

# Broken, soon to be removed pending reworking.

- sys-kernel/config-kernel-0.3.3 (masked by: package.mask)

- sys-kernel/config-kernel-0.3.2 (masked by: package.mask)

For more information, see MASKED PACKAGES section in the emerge man page or

section 2.2 "Software Availability" in the Gentoo Handbook.

 
```

even if I launch the command:

```
 ACCEPT_KEYWORDS="~x86" emerge config-kernel 
```

Have you got the same?Last edited by Pat-rizio on Mon Nov 15, 2004 5:26 pm; edited 1 time in total

----------

## LauPro

I had the same problem. My solution: *Quote:*   

> # emerge /usr/portage/sys-kernel/config-kernel/config-kernel-0.3.3.ebuild
> 
> # config-kernel --allow-writable yes
> 
> # LIRC_OPTS="--with-x --with-driver=hauppauge --with-major=61 --with-port=none --with-irq=none" emerge lirc

 This is not a really safe solution because the 'config-kernel  --allow-writable yes' makes it posible for evil ebuilds to screw up your kernel. But when you watch out and use 'emerge -pv' before an emere there is not so much that can go wrong i think.

----------

## dsd

config-kernel is no longer needed/supported. just ignore that message. ebuilds are being migrated away from using it.

----------

## Pat-rizio

So what I have to do now:

waiting to emerge lirc, cause even this package is migrating away from using config-kernel, or it's safe even to comment the line

```
sys-kernel/config-kernel
```

 in my package.mask and emerge lirc?Last edited by Pat-rizio on Mon Nov 15, 2004 5:27 pm; edited 1 time in total

----------

## dsd

no need to unmask or install config-kernel. you can just ignore the message that comes up when you merge it and let it build. or are you saying that this message is printed and then the merge stops altogether?

----------

## LauPro

Yes, indeed. The emerge is halted after that message.

----------

## Pat-rizio

Yes, the message blocks my emerge too.Last edited by Pat-rizio on Mon Nov 15, 2004 5:27 pm; edited 1 time in total

----------

## DeadCrow

Using 2.6.9-gentoo-r1

koutput variables set:

# set |grep KBUILD

KBUILD_OUTPUT=/var/tmp/kernel-output/2.6.9-gentoo-r1

KBUILD_OUTPUT_PREFIX=/var/tmp/kernel-output

# emerge lirc

gives: (after configuring)

 * /usr/src/linux is a symbolic link

 * Determining the real directory of the Linux kernel source code

 * Building for Linux 2.6.9-gentoo-r1 found in /usr/src/linux

 * which outputs to /usr/src/linux

 * By not using the kernel's ability to output to an alternative

 * directory, some external module builds may fail.

 * See <insert link to user doc here>

 * Due to the 2.6 kernel build system, external module compilation

 * with a normal setup requires write access to //usr/src/linux

 * There are several ways to fix/prevent this.

 * Users can willingly let portage make this writable by doing

 * # config-kernel --allow-writable yes

 * However, this is considered a security risk!

 *

 * The prefered method is to enable Gentoo's new 'koutput' method

 * for kernel modules. See the doc

 * http://www.gentoo.org/doc/en/2.6-koutput-user.xml

 * To enable this, you'll need to run

 * # config-kernel --output-dir /var/tmp/kernel-output

 * and then install a new kernel

!!! ERROR: app-misc/lirc-0.7.0_pre7 failed.

!!! Function kmod_make_linux_writable, Line 207, Exitcode 0

!!! Incompatible kernel setup

!!! If you need support, post the topmost build error, NOT this status message.

----------

## Pat-rizio

Searching one solution on gentoo's forum I found only the solution posted here

https://forums.gentoo.org/viewtopic.php?t=239082&highlight=lirc+emerge

to put config-kernel in my package.unmask.

I think it works, but can anyone explain me what's the security risk to do this?

Thanks in advance for answers.

----------

## jubo

Allowing any ebuilds to write to the kernel tree might mean that some ebuild could change your kernel source, so that the next time you compile, you could *possibily* get trojaned, so as someone above said, make sure you see exactly what you are emerging, and maybe stick with the main portage tree.  Be weary of overlays where nontested ebuilds might make it in.

----------

## dsd

new lirc ebuild in portage doesnt require kmod/config-kernel

----------

## Pat-rizio

I've tried to emerge 

```
app-misc/lirc-0.7.0
```

I think it's the last lirc's version available at the moment.

It doesnt require kmod/config-kernel as dsd wrote, but my emerge failed too.

Now I post a bit of emerge output message (cause it's too long to post it all) just when some errors happened. I hope it's help.

```
sed: can't read /var/tmp/portage/lirc-0.7.0/work/lirc-0.7.0/Makefile: No such file or directory

...

include/linux/types.h:18: error: syntax error before "__kernel_dev_t"

include/linux/types.h:18: warning: type defaults to `int' in declaration of `__kernel_dev_t'

include/linux/types.h:18: warning: data definition has no type or storage class

include/linux/types.h:21: error: syntax error before "dev_t"

include/linux/types.h:21: warning: type defaults to `int' in declaration of `dev_t'

include/linux/types.h:21: warning: data definition has no type or storage class

include/linux/types.h:22: error: syntax error before "ino_t"

include/linux/types.h:22: warning: type defaults to `int' in declaration of `ino_t'

include/linux/types.h:22: warning: data definition has no type or storage class

include/linux/types.h:23: error: syntax error before "mode_t"

include/linux/types.h:23: warning: type defaults to `int' in declaration of `mode_t'

include/linux/types.h:23: warning: data definition has no type or storage class

include/linux/types.h:24: error: syntax error before "nlink_t"

include/linux/types.h:24: warning: type defaults to `int' in declaration of `nlink_t'

include/linux/types.h:24: warning: data definition has no type or storage class

...

include/linux/fs.h:789: error: storage size of `s_vfs_rename_sem' isn't known

/var/tmp/portage/lirc-0.7.0/work/lirc-0.7.0/drivers/lirc_dev/lirc_dev.c:749: error: storage size of `fops' isn't known

make[5]: *** [/var/tmp/portage/lirc-0.7.0/work/lirc-0.7.0/drivers/lirc_dev/lirc_dev.o] Error 1

make[4]: *** [_module_/var/tmp/portage/lirc-0.7.0/work/lirc-0.7.0/drivers/lirc_dev] Error 2

make[4]: Leaving directory `/usr/src/linux-2.6.9-gentoo-r1'

make[3]: *** [lirc_dev.o] Error 2

make[3]: Leaving directory `/var/tmp/portage/lirc-0.7.0/work/lirc-0.7.0/drivers/lirc_dev'

make[2]: *** [all-recursive] Error 1

make[2]: Leaving directory `/var/tmp/portage/lirc-0.7.0/work/lirc-0.7.0/drivers'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/var/tmp/portage/lirc-0.7.0/work/lirc-0.7.0'

make: *** [all] Error 2

!!! ERROR: app-misc/lirc-0.7.0 failed.

!!! Function src_compile, Line 96, Exitcode 2

!!! (no error message)

!!! If you need support, post the topmost build error, NOT this status message.

```

Have anyone got same problems?

----------

## Phlogiston

I'm not sure, but this may help.

https://forums.gentoo.org/viewtopic.php?t=186453&start=0&postdays=0&postorder=asc&highlight=

----------

## Pat-rizio

Hi Phlogiston, thanks for your answer.

Well, I tryed to install lirc running

```
./configure
```

 in the directory where I decompressed lirc sources.

Then I run 

```
make
```

 but this is the beginning of my make errors:

```
/home/pat/prg/lirc-0.7.0/drivers/lirc_dev/lirc_dev.c:28:27: linux/version.h: No such file or directory

/home/pat/prg/lirc-0.7.0/drivers/lirc_dev/lirc_dev.c:29:40: missing binary operator before token "("

In file included from include/linux/module.h:10,

                 from /home/pat/prg/lirc-0.7.0/drivers/lirc_dev/lirc_dev.c:36:

include/linux/sched.h:4:37: asm/param.h: No such file or directory

In file included from include/linux/types.h:13,

                 from include/linux/capability.h:16,

                 from include/linux/sched.h:7,

                 from include/linux/module.h:10,

                 from /home/pat/prg/lirc-0.7.0/drivers/lirc_dev/lirc_dev.c:36:

include/linux/posix_types.h:47:29: asm/posix_types.h: No such file or directory

In file included from include/linux/capability.h:16,

                 from include/linux/sched.h:7,

                 from include/linux/module.h:10,

                 from /home/pat/prg/lirc-0.7.0/drivers/lirc_dev/lirc_dev.c:36:

include/linux/types.h:14:23: asm/types.h: No such file or directory

In file included from include/linux/capability.h:16,

                 from include/linux/sched.h:7,

                 from include/linux/module.h:10,

                 from /home/pat/prg/lirc-0.7.0/drivers/lirc_dev/lirc_dev.c:36:

include/linux/types.h:18: error: syntax error before "__kernel_dev_t"

include/linux/types.h:18: warning: type defaults to `int' in declaration of `__kernel_dev_t'

include/linux/types.h:18: warning: data definition has no type or storage class

include/linux/types.h:21: error: syntax error before "dev_t"

include/linux/types.h:21: warning: type defaults to `int' in declaration of `dev_t'

include/linux/types.h:21: warning: data definition has no type or storage class

include/linux/types.h:22: error: syntax error before "ino_t"

include/linux/types.h:22: warning: type defaults to `int' in declaration of `ino_t'

include/linux/types.h:22: warning: data definition has no type or storage class

```

As I can see from first errors the compiler can't find the file 

```
linux/version.h
```

and following...

linux directory is kernel source directory?Cause if so, I haven't these files in my kernel source directory.

----------

## Phlogiston

hmm what kernel do you use? 

I had no such isues with the nitro. Btw, I'm using udev, but I don't if this has anything to do with.

Do you also use the lirc_serial module?

----------

## jvanus

I'm not sure how much this will help, but I was able to get around the lirc problem by masking =>app-misc/lirc-0.7.0_pre7.  0.7.0_pre3 was installed just fine wo/ any changes to my kernel or installing config-kernel which is masked and, as I understand,  depricated.

Not a long term solution I admit, but it lets me move on to other things for now. Best of luck.

----------

## Pat-rizio

I'm using udev too.

My kernel is gentoo-dev-sources-2.6.9-r1.

This is my lsmod output

```
Module                  Size  Used by

via686a                17440  0

i2c_sensor              4352  1 via686a

i2c_isa                 1920  0

rivafb                 47620  0

vgastate                9856  1 rivafb

via_agp                 7296  1

nvidia               4810516  12

ehci_hcd               35588  0

```

so I don't think I'm using lirc_serial... Am I wrong?

Hi jvanus, I'll try your solution when I'll arrive at home.

----------

## Pat-rizio

Thanks for your answer jvanus, but emerge failed yet...   :Rolling Eyes: 

----------

## DaWorm

I added >=app-misc/lirc-0.7.0-pre7 to the portage.mask file, and it emerged pre6.  Still don't know if it works yet, as I got busy with another project.  Should know soon.

----------

## go2sleep

You can install config-kernel like this :

cd /usr/portage/sys-kernel/config-kernel

ebuild config-kernel-0.3.3.ebuild merge

ebuild config-kernel-0.3.3.ebuild unmerge to remove it

after follow explanation here : http://www.gentoo.org/doc/en/2.6-koutput-user.xml

----------

## adi-beg

I have also the same problem when I want to emerge xine-ui. Since it depends on lirc, everything stops with this message:

```
 emerge xine-ui

Calculating dependencies ...done!

>>> emerge (1 of 7) app-misc/lirc-0.7.0_pre7 to /

>>> md5 src_uri ;-) lirc-0.7.0pre7.tar.bz2

>>> md5 src_uri ;-) 01-add-2.6-devfs-and-sysfs-to-lirc_dev.patch

>>> Unpacking source...

>>> Unpacking lirc-0.7.0pre7.tar.bz2 to /var/tmp/portage/lirc-0.7.0_pre7/work

>>> Unpacking 01-add-2.6-devfs-and-sysfs-to-lirc_dev.patch to /var/tmp/portage/lirc-0.7.0_pre7/work

unpack 01-add-2.6-devfs-and-sysfs-to-lirc_dev.patch: file format not recognized. Ignoring.

 * Applying 01-add-2.6-devfs-and-sysfs-to-lirc_dev.patch ...              [ ok ] * Applying lirc-0.7.0_pre7-configure.patch ...                           [ ok ]>>> Source unpacked.

 * econf: updating /var/tmp/portage/lirc-0.7.0_pre7/work/lirc-0.7.0pre7/config.guess with /usr/share/gnuconfig/config.guess

 * econf: updating /var/tmp/portage/lirc-0.7.0_pre7/work/lirc-0.7.0pre7/config.sub with /usr/share/gnuconfig/config.sub

./configure --prefix=/usr --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-manage-devices --localstatedir=/var --with-syslog=LOG_DAEMON --enable-sandboxed --with-driver=serial --with-port=0x3f8 --with-irq=4

creating cache ./config.cache

checking for a BSD compatible install... /bin/install -c

checking whether build environment is sane... yes

checking for mawk... no

checking for gawk... gawk

checking whether make sets ${MAKE}... yes

checking for gcc... gcc

checking whether the C compiler (gcc -O2 -march=pentium3 -fomit-frame-pointer -pipe -Wall ) works... yes

checking whether the C compiler (gcc -O2 -march=pentium3 -fomit-frame-pointer -pipe -Wall ) is a cross-compiler... no

checking whether we are using GNU C... yes

checking whether gcc accepts -g... yes

checking for style of include used by make... GNU

checking dependency style of gcc... gcc3

checking for a BSD compatible install... /bin/install -c

checking whether make sets ${MAKE}... (cached) yes

checking for mknod... /bin/mknod

checking for mkfifo... /bin/mkfifo

checking for depmod... /sbin/depmod

checking whether ln -s works... yes

checking for Cygwin environment... no

checking for mingw32 environment... no

checking how to run the C preprocessor... gcc -E

checking host system type... i686-pc-linux-gnu

checking build system type... i686-pc-linux-gnu

checking for ld used by GCC... /usr/i686-pc-linux-gnu/bin/ld

checking if the linker (/usr/i686-pc-linux-gnu/bin/ld) is GNU ld... yes

checking for /usr/i686-pc-linux-gnu/bin/ld option to reload object files... -r

checking for BSD-compatible nm... /usr/bin/nm -B

checking how to recognise dependant libraries... pass_all

checking for object suffix... o

checking for executable suffix... no

checking command to parse /usr/bin/nm -B output... ok

checking for dlfcn.h... yes

checking for ranlib... ranlib

checking for strip... strip

checking for objdir... .libs

checking for gcc option to produce PIC... -fPIC

checking if gcc PIC flag -fPIC works... yes

checking if gcc static flag -static works... yes

checking if gcc supports -c -o file.o... yes

checking if gcc supports -c -o file.lo... yes

checking if gcc supports -fno-rtti -fno-exceptions... yes

checking whether the linker (/usr/i686-pc-linux-gnu/bin/ld) supports shared libraries... yes

checking how to hardcode library paths into programs... immediate

checking whether stripping libraries is possible... yes

checking dynamic linker characteristics... GNU/Linux ld.so

checking if libtool supports shared libraries... yes

checking whether to build shared libraries... yes

checking whether to build static libraries... yes

checking whether -lc should be explicitly linked in... no

creating libtool

checking for ANSI C header files... yes

checking whether time.h and sys/time.h may both be included... yes

checking for fcntl.h... yes

checking for limits.h... yes

checking for sys/ioctl.h... yes

checking for sys/time.h... yes

checking for syslog.h... yes

checking for unistd.h... yes

checking for working const... yes

checking for inline... inline

checking for off_t... yes

checking for pid_t... yes

checking for size_t... yes

checking whether struct tm is in sys/time.h or time.h... time.h

checking return type of signal handlers... void

checking for vprintf... yes

checking for gethostname... yes

checking for gettimeofday... yes

checking for mkfifo... yes

checking for select... yes

checking for socket... yes

checking for strdup... yes

checking for strerror... yes

checking for strtoul... yes

checking for snprintf... yes

checking for strsep... yes

checking for vsyslog... yes

checking for daemon... yes

checking for forkpty... no

checking for forkpty in -lutil... yes

checking for vga.h... yes

checking for vgagl.h... yes

checking for vga_init in -lvga... yes

checking for gl_setcontextvga in -lvgagl... yes

checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/include

checking for dnet_ntoa in -ldnet... no

checking for dnet_ntoa in -ldnet_stub... no

checking for gethostbyname... yes

checking for connect... yes

checking for remove... yes

checking for shmat... yes

checking for IceConnectionNumber in -lICE... yes

checking for getopt_long... yes

checking for mktemp... yes

checking for Linux kernel sources... /usr/src/linux/

checking for which drivers can be installed on this system...

checking for caraca_init in -lcaraca_client... no

checking for ir_strerror in -lirman... no

checking for ir_strerror in -lirman_sw... no

checking for portaudio.h... no

checking for alsa/asoundlib.h... yes

checking for snd_pcm_open in -lasound... yes

updating cache ./config.cache

creating ./config.status

creating Makefile

creating drivers/Makefile

creating drivers/lirc_serial/Makefile

creating drivers/lirc_sir/Makefile

creating drivers/lirc_parallel/Makefile

creating drivers/lirc_i2c/Makefile

creating drivers/lirc_gpio/Makefile

creating drivers/lirc_dev/Makefile

creating drivers/lirc_it87/Makefile

creating drivers/lirc_bt829/Makefile

creating drivers/lirc_atiusb/Makefile

creating drivers/lirc_mceusb/Makefile

creating drivers/lirc_sasem/Makefile

creating daemons/Makefile

creating tools/Makefile

creating doc/Makefile

creating doc/man/Makefile

creating config.h

You will have to use the lirc_serial kernel module.

Now enter 'make' and 'make install' to compile and install the package.

 * /usr/src/linux is a symbolic link

 * Determining the real directory of the Linux kernel source code

 * Building for Linux 2.6.9-gentoo-r13 found in /usr/src/linux

 * which outputs to /usr/src/linux

 * By not using the kernel's ability to output to an alternative

 * directory, some external module builds may fail.

 * See <insert link to user doc here>

 * Due to the 2.6 kernel build system, external module compilation

 * with a normal setup requires write access to //usr/src/linux

 * There are several ways to fix/prevent this.

 * Users can willingly let portage make this writable by doing

 * # config-kernel --allow-writable yes

 * However, this is considered a security risk!

 *

 * The prefered method is to enable Gentoo's new 'koutput' method

 * for kernel modules. See the doc

 * http://www.gentoo.org/doc/en/2.6-koutput-user.xml

 * To enable this, you'll need to run

 * # config-kernel --output-dir /var/tmp/kernel-output

 * and then install a new kernel

!!! ERROR: app-misc/lirc-0.7.0_pre7 failed.

!!! Function kmod_make_linux_writable, Line 214, Exitcode 0

!!! Incompatible kernel setup

!!! If you need support, post the topmost build error, NOT this status message.

```

Two questions:

1. Why do I need lirc when I only want to use xine-ui to view video on my computer? Lirc should be an option, not a dependences.

2. Since config-kernel er obsolete, how can I work around this?

Happy New Year!

----------

## dsd

taking lirc out of your use flags should do the trick

----------

## adi-beg

I found why I had a problem. I had lirc in my USE. This

```
#USE="-lirc" emerge xine-ui
```

solves everything.

I still have a lot to learn...

----------

## drescherjm

I had these problems about 6 months ago. At that point I found the only solution was to download the source and build it myself outside of portage. But now lirc 0.7.0-r1 compiles and runs fine with my hauppage card (at lest the last time I checked...)

----------

