Bug#574158: firmware licenses never displayed
tags 574158 + patch thanks What about just running the preinst in d-i after unpacking the firmware deb to ask the license question, and remove the firmware if the preinst return an error, presumably because the license was not accepted? Here is an untested draft patch implementing this idea. I believe it would work for firmware-ipw2100, and probably other firmware package requiring the license to be accepted before being used. Packages rejecting preseeding of the license question will probably try (and fail) to ask the same question when the firmware is installed into /target/, but I am not sure that is a problem with the firmware packages we have today. Not quite happy with the removal code, but did not come up with a better approach than parsing the md5sum file, as udpkg do not support removing packages and I found no stored information on which files belong to which packages. Index: check-missing-firmware.sh === --- check-missing-firmware.sh (revision 63252) +++ check-missing-firmware.sh (working copy) @@ -146,12 +146,35 @@ [ $arch = all ] || [ $arch = $(udpkg --print-architecture) ] } +# Remove non-accepted firmware package +remove_pkg() { + pkgname=$1 + # Remove all files listed in /var/lib/dpkg/info/$pkgname.md5sum + for file in $(cut -d -f 2- /var/lib/dpkg/info/$pkgname.md5sum) ; do + rm /$file + done +} + install_firmware_pkg () { if echo $1 | grep -q '\.deb$'; then # cache deb for installation into /target later mkdir -p /var/cache/firmware/ cp -aL $1 /var/cache/firmware/ || true - udpkg --unpack /var/cache/firmware/$(basename $1) + filename=$(basename $1) + pkgname=$(echo $filename |cut -d_ -f1) + udpkg --unpack /var/cache/firmware/$pkgname + if [ -f /var/lib/dpkg/info/$pkgname.preinst ] ; then + # Run preinst script to see if the firmware + # license is accepted Exit code of preinst + # decide if the package should be installed or + # not. + if /var/lib/dpkg/info/$pkgname.preinst ; then + : + else + remove_pkg $pkgname + rm /var/cache/firmware/$filename + fi + fi else udpkg --unpack $1 fi Happy hacking, -- Petter Reinholdtsen -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#574158: firmware licenses never displayed
Package: hw-detect Severity: important firmware-ipw2100 has a license prompt that is supposed to be displayed to the user. If this firmware is loaded by d-i from media supplied by the user, this prompt is never actually displayed. In #504668, it's claimed that the license's FAQ allows this, which is the only reason I have not made this bug serious, yet. Conversely, in #449235, decisions seem to be made assuming that d-i will display the firmware prompt. I see three approaches to fixing this bug: 1. Change the post-base-installer hook to not install firmware debs with dpkg -i. It needs to use apt for debconf frontend proxying to work. One approach might be to move this to a pkgsel hook, and use the already available firmware debs to prepopulate /var/cache/apt/archives, so they don't have to be downloaded again. Only problem with this approach is it fails if the user, in apt-setup, chooses not to use non-free, or even chooses to install without a network mirror. In this case, the installed system might end up without firmware needed to boot. 2. Rip the debconf frontend proxy setup code out of debconf-apt-progress, and adapt so it can be used with dpkg -i. Or hack debconf-apt-progress to support running dpkg -i. 3. Provide some way for firmware debs to communicate to d-i that they have a license the user needs to see, and have check-missing-firmware display these licenses before the firmware is ever used. This is probably the most general approach, as it will allow us to support firmware where it's a hard requirement that the user sees the license. (Which may already be the case, depending on which lawyers you ask?) One way would be to add a header to the firmware deb: License-Agreement: /usr/share/doc/firmware-ipw2x00/copyright -- see shy jo signature.asc Description: Digital signature
Bug#574158: firmware licenses never displayed
On Tuesday 16 March 2010, Joey Hess wrote: 3. Provide some way for firmware debs to communicate to d-i that they have a license the user needs to see, and have check-missing-firmware display these licenses before the firmware is ever used. This is the option that I have had in the back of my mind for some time. I think for really structural support of firmware, we could repackage it like we do for kernel modules and include meta data (partially? automatically generated) about the deb something was taken from + licence requirements. That would also allow to e.g. skip old versions of firmware. My personal opinion is that it should actually be quite OK to include non-free firmware *udebs* on (CD) images as long as - the licence in no way limits distribution; - we never allow use of any non-free firmware without explicit ack by the user. The *debs* should IMO always be either downloaded from a mirror (using standard apt-install) with fallback support for installing them from an external medium. Under those conditions I think the project might be persuaded to accept inclusion of firmware in D-I images and on CDs. We should of course keep support for loading firmware that does not match these criteria from external media. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org