Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I get /etc/cups conflicts between attempted installs in Yocto?

Tags:

linux

yocto

cups

I have a recipe to compile a printer driver and have a few simple lines to run in do_install.

do_install() {
  install -d ${D}${libdir}/cups/filter
  install -m 755 ${B}/src/rastertoprinter ${D}${libdir}/cups/filter/
  install -d ${D}${sysconfdir}/cups/ppd
  install -m 755 ${B}/../rastertoprinter/printer_name.ppd ${D}${sysconfdir}/cups/ppd/
}

To compile the source I have a DEPENDS on cups and also an RDEPENDS on cups as the OS needs cups installed to print of course.

The printer driver is not publicly available so as such I've renamed it to rastertoprinter and changed my path names.

Essentially I need to simply create or ensure the directory /usr/lib/cups/filter exists, and copy the rastertoprinter program there. I also need to create or ensure the directory /etc/cups/ppd exists and copy the .ppd file into that directory.

The first two lines run fine but the 3rd throws the following errors:

file /etc/cups conflicts between attempted installs of printername-r0.corei7_64 and cups-2.2.2-r0.corei7_64
file /etc/cups/ppd conflicts between attempted installs of printername-r0.corei7_64 and cups-2.2.2-r0.corei7_64

I don't understand why both recipes can't create this directory and put stuff in it? Strangely I'm able to do the first /usr/lib/cups/filter directory though fine.

like image 930
egfconnor Avatar asked Jun 26 '17 14:06

egfconnor


1 Answers

Turns out the issue is that each file to be packaged in Yocto will also generate a %dir for each parent of each file. We don't want to own a directory that is owned by another package, so if you add this to your recipe:

DIRFILES = "1"

It will cause your package to not own parent directories of the files you package.

This will generate an rpm spec file without the %dir entries.

like image 156
Paul Knopf Avatar answered Sep 30 '22 14:09

Paul Knopf