Bug#574116: hw-detect: Should look for firmware packages on CD and DVD too
When building a custom CD with firmware packages on the CD, and
symlinked from firmware/ to ../pool/non-free/, the packages are not
found by debian-installer. In fact, as far as I can see, there is no
way to put the firmware packages on a custom CD and get d-i to find
I believe it should be possible to create a custom CD with the
firmware packages included, and propose to change hw-detect to make
sure it is able to find firmware packages on the CD. To avoid
cluttering the root, I propose to put such firmware debs in a
firmware/ subdirectory on the CD, and populate it with symlinks to the
debs in the APT repository on the CD. See
<URL: http://lists.debian.org/debian-cd/2010/03/msg00023.html > for a
description on how to do this using debian-cd.
If the deb include a license question displayed using debconf, the
question will still be presented when the deb is installed into
/target/, so the machine will not be set up to use non-free firmware
without notification. The non-free section of the mirror will not be
enabled automatically, so any updates to the firmware will not be
This untested patch should implement my proposed change.
* Copy files using cp -aL to make sure not to copy symlinks but the
files pointed to by the symlinks.
* Add code to first check /cdrom/firmware/ for debs, and the look for
individual firmware files and debs and udebs on other media. Move
code to check debs and udebs to a new function to avoid copying
code. Not sure if it should look for udebs too.
--- check-missing-firmware.sh (revision 62653)
+++ check-missing-firmware.sh (working copy)
@@ -91,7 +91,7 @@
log "copying loose file $file from '$(dirname $f)' to '$target'"
mkdir -p "$target"
rm -f "$target/$file"
- cp -a "$f" "$target" || true
+ cp -aL "$f" "$target" || true
@@ -150,15 +150,37 @@
if echo "$1" | grep -q '\.deb$'; then
# cache deb for installation into /target later
mkdir -p /var/cache/firmware/
- cp -a "$1" /var/cache/firmware/ || true
+ cp -aL "$1" /var/cache/firmware/ || true
udpkg --unpack "/var/cache/firmware/$(basename "$1")"
udpkg --unpack "$1"
+ echo "$files" | sed -e 's/ /\n/g' >/tmp/grepfor
+ for filename in $@; do
+ if [ -f "$filename" ]; then
+ if check_deb_arch "$filename" && list_deb_firmware "$filename" | grep -qf /tmp/grepfor; then
+ log "installing firmware package $filename"
+ install_firmware_pkg "$filename" || true
+ rm -f /tmp/grepfor
while check_missing && ask_load_firmware; do
- # first, look for loose firmware files on the media.
+ # First, check if the firmware debs are available on the
+ # installation CD. This does not use anna because debs can
+ # have arbitrary dependencies, which anna might try to
b+ # install.
+ if [ -d /cdrom/firmware ]; then
+ check_for_firmware /cdrom/firmware/*.deb
+ # second, look for loose firmware files on the media.
if mountmedia; then
for file in $files; do
@@ -170,16 +192,7 @@
# This does not use anna because debs can have arbitrary
# dependencies, which anna might try to install.
if mountmedia driver; then
- echo "$files" | sed -e 's/ /\n/g' >/tmp/grepfor
- for filename in /media/*.deb /media/*.udeb /media/*.ude /media/firmware/*.deb /media/firmware/*.udeb /media/firmware/*.ude; do
- if [ -f "$filename" ]; then
- if check_deb_arch "$filename" && list_deb_firmware "$filename" | grep -qf /tmp/grepfor; then
- log "installing firmware package $filename"
- install_firmware_pkg "$filename" || true
- rm -f /tmp/grepfor
+ check_for_firmware /media/*.deb /media/*.udeb /media/*.ude /media/firmware/*.deb /media/firmware/*.udeb /media/firmware/*.ude
umount /media || true