Re: [PATCH] firmware loading support

2008-06-24 Thread Christian Perrier
Quoting Joey Hess ([EMAIL PROTECTED]):
 Christian Perrier wrote:
  Quoting Joey Hess ([EMAIL PROTECTED]):
  
   Maybe Checking for firmware... ?
  
  Checking and installing needed firmware?
 
 I don't like the needing for some reason. Also, checking for?


Well, for sure that's a tricky one..:-)

Installing firmware... is maybe the best, after all (as said
already, when there is no firmware, it will anyway just blink quickly.




signature.asc
Description: Digital signature


Re: [PATCH] firmware loading support

2008-06-23 Thread Christian Perrier
Quoting Joey Hess ([EMAIL PROTECTED]):

This is great work, Joey. Making firmware-mandatory hardware work with
D-I would be a giant step. So, despite this breaking again the slow
progress in localization (about 25 complete langs as of now), I warmly
applause.


Comments on templates (very nitpicking, indeed):

 diff --git a/packages/hw-detect/debian/hw-detect.templates 
 b/packages/hw-detect/debian/hw-detect.templates
 index 5301467..cf31ef3 100644
 --- a/packages/hw-detect/debian/hw-detect.templates
 +++ b/packages/hw-detect/debian/hw-detect.templates
 @@ -67,9 +67,20 @@ Default: false
  # :sl2:
  _Description: Load missing drivers from removable media?
   A driver for your hardware is not available. You may need
 - to load drivers from removable media, such as a driver floppy.
 + to load drivers from removable media, such as a USB stick, or driver floppy.

Here you mention or driver floppy


   If you have such media available now, insert it, and continue.
  
 +Template: hw-detect/load_firmware
 +Type: boolean
 +Default: false
 +# :sl2:
 +_Description: Load missing firmware from removable media?
 + Some of your hardware needs firmware files to operate. The firmware
 + can be loaded from removable media, such as a USB stick or floppy.

And here just or floppy. I think that last wording is slightly the
best of the two.


 + If you have such media available now, insert it, and continue.

That sentence could be factorized out in its own paragraph


 + .
 + The missing firmware files are: ${FILES}
 +

Missing sentence dot?  (that's debatable: should a dot come after a
list of files? I'd say yes)



 diff --git a/packages/hw-detect/debian/hw-detect.templates 
 b/packages/hw-detect/debian/hw-detect.templates
 index cf31ef3..a06b928 100644
 --- a/packages/hw-detect/debian/hw-detect.templates
 +++ b/packages/hw-detect/debian/hw-detect.templates
 @@ -81,6 +81,11 @@ _Description: Load missing firmware from removable media?
   .
   The missing firmware files are: ${FILES}
  
 +Template: base-installer/progress/hw-detect
 +Type: text
 +# :sl1:
 +_Description: Installing firmware...
 +

Move to sublevel 2? Is that progress text shown on *any* default install?






signature.asc
Description: Digital signature


Re: [PATCH] firmware loading support

2008-06-23 Thread Frans Pop
On Monday 23 June 2008, Joey Hess wrote:
 Frans Pop wrote:
  0003: Having the two loops looks broken
  In so far that the second loop is likely to copy files that were
  already installed in the first loop.

 If you're referring to the two loops in post-base-installer (and not in

Yes, 0003 refers to the patch number. /me thought that'd be obvious :-/

 check-missing-firmware), it's true that the firmware from debs is
 copied over a second time after they are installed. I didn't see a good
 (simple) way to tell this case from the cases where the firmware in
 d-i's /lib/firmware is provided by udebs or as unpackaged files.

You may want to at least do them the other way around then: first copy 
from /lib/firmware, then overwrite with contents from .deb.
Or keep the current order, but first check if a file already exists in the 
second loop (assuming that a certain firmware file has a fixed name).
Adding a README with files added 'manually' by d-i might be an idea too.

Eventually I think we should prefer installing the firmware from a deb in 
the archive and then only add anything from the d-i environment that's 
not already covered that way.


signature.asc
Description: This is a digitally signed message part.


Re: [PATCH] firmware loading support

2008-06-23 Thread Joey Hess
Christian Perrier wrote:
  diff --git a/packages/hw-detect/debian/hw-detect.templates 
  b/packages/hw-detect/debian/hw-detect.templates
  index 5301467..cf31ef3 100644
  --- a/packages/hw-detect/debian/hw-detect.templates
  +++ b/packages/hw-detect/debian/hw-detect.templates
  @@ -67,9 +67,20 @@ Default: false
   # :sl2:
   _Description: Load missing drivers from removable media?
A driver for your hardware is not available. You may need
  - to load drivers from removable media, such as a driver floppy.
  + to load drivers from removable media, such as a USB stick, or driver 
  floppy.
 
 Here you mention or driver floppy
 
 
If you have such media available now, insert it, and continue.
   
  +Template: hw-detect/load_firmware
  +Type: boolean
  +Default: false
  +# :sl2:
  +_Description: Load missing firmware from removable media?
  + Some of your hardware needs firmware files to operate. The firmware
  + can be loaded from removable media, such as a USB stick or floppy.
 
 And here just or floppy. I think that last wording is slightly the
 best of the two.

We use the driver floppy wording elsewhere (cdrom-detect,
floppy/*-drivers.img, disk label files). In the load_firmware
prompt, what's being prompted for is not, strictly speaking a driver
floppy, but a floppy with some firmware on it.

  + If you have such media available now, insert it, and continue.
 
 That sentence could be factorized out in its own paragraph

Done in both places.

  + .
  + The missing firmware files are: ${FILES}
  +
 
 Missing sentence dot?  (that's debatable: should a dot come after a
 list of files? I'd say yes)

I think it would just confuse things by looking like either an extra dot
stuck at the end of a filename, or a reference to the current working
directory.

`grep ': ${' */debian/*templates` finds similar constructs w/o trailing
dots.

  diff --git a/packages/hw-detect/debian/hw-detect.templates 
  b/packages/hw-detect/debian/hw-detect.templates
  index cf31ef3..a06b928 100644
  --- a/packages/hw-detect/debian/hw-detect.templates
  +++ b/packages/hw-detect/debian/hw-detect.templates
  @@ -81,6 +81,11 @@ _Description: Load missing firmware from removable media?
.
The missing firmware files are: ${FILES}
   
  +Template: base-installer/progress/hw-detect
  +Type: text
  +# :sl1:
  +_Description: Installing firmware...
  +
 
 Move to sublevel 2? Is that progress text shown on *any* default install?

It'll be shown very briefly on all installs currently. I'd like to
find a better wording for it, that doesn't imply there *is* firmware to
install.

(I considered only enabling the hook if firmware was installed by
check-missing-firmware, but firmware can also be installed manually, or
provided in a repacked image like tbm does for the nslu2; this hook can
also handle installing such firmware.)

Maybe Checking for firmware... ?

-- 
see shy jo


signature.asc
Description: Digital signature


Re: [PATCH] firmware loading support

2008-06-23 Thread Christian Perrier
Quoting Joey Hess ([EMAIL PROTECTED]):

 Maybe Checking for firmware... ?

Checking and installing needed firmware?



signature.asc
Description: Digital signature


Re: [PATCH] firmware loading support

2008-06-23 Thread Joey Hess
Christian Perrier wrote:
 Quoting Joey Hess ([EMAIL PROTECTED]):
 
  Maybe Checking for firmware... ?
 
 Checking and installing needed firmware?

I don't like the needing for some reason. Also, checking for?

-- 
see shy jo


signature.asc
Description: Digital signature


Re: [PATCH] firmware loading support

2008-06-23 Thread Geert Stappers
Op 23-06-2008 om 19:50 schreef Joey Hess:
 Christian Perrier wrote:
  Quoting Joey Hess ([EMAIL PROTECTED]):
  
   Maybe Checking for firmware... ?
  
  Checking and installing needed firmware?
 
 I don't like the needing for some reason. Also, checking for?


Handling firmware or Now handling the firmware part

handling as in luggage handling at the airport


Just my two cents
Geert Stappers


P.S.
Inspired by the subject line: Loading firmware


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



[PATCH] firmware loading support

2008-06-22 Thread Joey Hess
Here's an initial attempt at support for loading missing firmware from
removable media. Completly untested.

It supports media with the firmware provided in any of three ways:

1. in udebs
2. In debs, which are then installed into d-i as udebs, and are also stored 
   and installed into /target later to provide the firmware to the
   running system too. Also, if debs are used, apt-setup is changed to
   default to using non-free, so that apt can upgrade these debs later.
3. Plain firmware files without any packaging. A list of the files is
   provided so that users can go find the firmware and provide it this
   way as a fallback.

I anticipate we'll create and distribute images containing debs of 
all the relevant firmware from non-free. TBD

-- 
see shy jo
From d4e4660e415a02944d98395e8547ebcca1b141b7 Mon Sep 17 00:00:00 2001
From: Joey Hess [EMAIL PROTECTED]
Date: Sun, 22 Jun 2008 14:12:03 -0400
Subject: [PATCH] Add a modified copy of udev's firmware.agent, that records to /tmp/missing-firmware.

---
 packages/hw-detect/Makefile |3 +++
 packages/hw-detect/debian/changelog |2 ++
 packages/hw-detect/firmware.agent   |   30 ++
 3 files changed, 35 insertions(+), 0 deletions(-)
 create mode 100755 packages/hw-detect/firmware.agent

diff --git a/packages/hw-detect/Makefile b/packages/hw-detect/Makefile
index 1b0ce1a..c5071e8 100644
--- a/packages/hw-detect/Makefile
+++ b/packages/hw-detect/Makefile
@@ -16,6 +16,7 @@ CFLAGS_ARCH = -DCPU_TEXT='$(DEB_HOST_ARCH)'
 bindir=$(DESTDIR)/bin/
 hpdir=$(DESTDIR)/etc/hotplug.d
 udevdir=$(DESTDIR)/etc/udev/rules.d
+udevlibdir=$(DESTDIR)/lib/udev
 didir=$(DESTDIR)/lib/debian-installer.d
 fidir=$(DESTDIR)/usr/lib/finish-install.d
 sharedir=$(DESTDIR)/usr/share/hw-detect/
@@ -40,6 +41,8 @@ ifeq ($(DEB_HOST_ARCH_OS),linux)
 	$(INSTALL) sysfs-update-devnames.sh $(bindir)/sysfs-update-devnames
 	$(INSTALL) -d $(udevdir)
 	$(INSTALL_DATA) net-hotplug.rules $(udevdir)/010_net-hotplug.rules
+	$(INSTALL) -d $(udevlibdir)
+	$(INSTALL) firmware.agent $(udevlibdir)
 	$(INSTALL) -d $(hpdir)/net
 	$(INSTALL) net-hotplug.sh $(hpdir)/net/hw-detect.hotplug
 	$(INSTALL) -d $(fidir)
diff --git a/packages/hw-detect/debian/changelog b/packages/hw-detect/debian/changelog
index 96b71a6..eb0dbd9 100644
--- a/packages/hw-detect/debian/changelog
+++ b/packages/hw-detect/debian/changelog
@@ -3,6 +3,8 @@ hw-detect (1.64) UNRELEASED; urgency=low
   * floppy-retriever renamed to media-retriever.
   * Change wording of question since drivers can now be loaded from other
 media than floppies.
+  * Add a modified copy of udev's firmware.agent, that records to
+/tmp/missing-firmware.
 
  -- Joey Hess [EMAIL PROTECTED]  Fri, 20 Jun 2008 16:42:06 -0400
 
diff --git a/packages/hw-detect/firmware.agent b/packages/hw-detect/firmware.agent
new file mode 100755
index 000..53a2ea2
--- /dev/null
+++ b/packages/hw-detect/firmware.agent
@@ -0,0 +1,30 @@
+#!/bin/sh -e
+#
+# firmware loader agent
+#
+
+cd /lib/udev/
+. ./hotplug.functions
+
+if [ ! -e /sys/$DEVPATH/loading ]; then
+mesg /sys/$DEVPATH/ does not exist
+exit 1
+fi
+
+for DIR in $FIRMWARE_DIRS; do
+[ -e $DIR/$FIRMWARE ] || continue
+echo 1  /sys/$DEVPATH/loading
+cat $DIR/$FIRMWARE  /sys/$DEVPATH/data
+echo 0  /sys/$DEVPATH/loading
+exit 0
+done
+
+# modification for d-i
+echo $PHYSDEVDRIVER $FIRMWARE /tmp/missing-firmware
+
+# the firmware was not found
+echo -1  /sys/$DEVPATH/loading
+
+debug_mesg Cannot find the $FIRMWARE firmware
+exit 1
+
-- 
1.5.5.4

From 129b651ec9587db5290241d4b062e4d88ba51dc1 Mon Sep 17 00:00:00 2001
From: Joey Hess [EMAIL PROTECTED]
Date: Sun, 22 Jun 2008 15:06:05 -0400
Subject: [PATCH] Add check-missing-firmware.

---
 packages/hw-detect/Makefile   |1 +
 packages/hw-detect/debian/changelog   |1 +
 packages/hw-detect/debian/hw-detect.templates |   13 -
 packages/hw-detect/hw-detect.sh   |2 ++
 4 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/packages/hw-detect/Makefile b/packages/hw-detect/Makefile
index c5071e8..b30d227 100644
--- a/packages/hw-detect/Makefile
+++ b/packages/hw-detect/Makefile
@@ -43,6 +43,7 @@ ifeq ($(DEB_HOST_ARCH_OS),linux)
 	$(INSTALL_DATA) net-hotplug.rules $(udevdir)/010_net-hotplug.rules
 	$(INSTALL) -d $(udevlibdir)
 	$(INSTALL) firmware.agent $(udevlibdir)
+	$(INSTALL) check-missing-firmware.sh $(bindir)/check-missing-firmware
 	$(INSTALL) -d $(hpdir)/net
 	$(INSTALL) net-hotplug.sh $(hpdir)/net/hw-detect.hotplug
 	$(INSTALL) -d $(fidir)
diff --git a/packages/hw-detect/debian/changelog b/packages/hw-detect/debian/changelog
index eb0dbd9..bb29613 100644
--- a/packages/hw-detect/debian/changelog
+++ b/packages/hw-detect/debian/changelog
@@ -5,6 +5,7 @@ hw-detect (1.64) UNRELEASED; urgency=low
 media than floppies.
   * Add a modified copy of udev's firmware.agent, that records to
 /tmp/missing-firmware.
+  * Add check-missing-firmware.
 
  

Re: [PATCH] firmware loading support

2008-06-22 Thread Frans Pop
On Monday 23 June 2008, Joey Hess wrote:
 Here's an initial attempt at support for loading missing firmware from
 removable media. Completly untested.

0001: How do you know which version of the udev script you get?
Either package can now overwrite the version from the other at build time.
Also, I think we should try to just get the modified version into 
udev-udeb eventually.

0003: Having the two loops looks broken
In so far that the second loop is likely to copy files that were already 
installed in the first loop.


signature.asc
Description: This is a digitally signed message part.


Re: [PATCH] firmware loading support

2008-06-22 Thread Joey Hess
Frans Pop wrote:
 On Monday 23 June 2008, Joey Hess wrote:
  Here's an initial attempt at support for loading missing firmware from
  removable media. Completly untested.
 
 0001: How do you know which version of the udev script you get?

I was assuming we're remove it from udev-udeb. Putting the modified one
there would also be ok.

 0003: Having the two loops looks broken
 In so far that the second loop is likely to copy files that were already 
 installed in the first loop.

The second loop is (supposed to) loop over $files, which will only be
the names of firmware files the kernel has requested, not udebs/debs.

(Typo fix attached.)

-- 
see shy jo
From f6ddf1c66a7420bdf8f42a45dc019ad228f8e311 Mon Sep 17 00:00:00 2001
From: Joey Hess [EMAIL PROTECTED]
Date: Sun, 22 Jun 2008 21:50:22 -0400
Subject: [PATCH] typo fix

---
 packages/hw-detect/check-missing-firmware.sh |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/packages/hw-detect/check-missing-firmware.sh b/packages/hw-detect/check-missing-firmware.sh
index 5e079ba..ab49df3 100755
--- a/packages/hw-detect/check-missing-firmware.sh
+++ b/packages/hw-detect/check-missing-firmware.sh
@@ -59,7 +59,7 @@ while read_log  ask_load_firmware; do
 
 	# also look for loose firmware files on the media
 	if mountmedia; then
-		for file in $(files); do
+		for file in $files; do
 			if [ -e /media/$file ]; then
 mkdir -p /lib/firmware
 rm -f /lib/firmware/$file
@@ -70,7 +70,7 @@ while read_log  ask_load_firmware; do
 	fi
 
 	# remove and reload modules so they see the new firmware
-	for module in $(modules); do
+	for module in $modules; do
 		modprobe -r $module || true
 		modprobe $module || true
 	done
-- 
1.5.5.4



signature.asc
Description: Digital signature


Re: [PATCH] firmware loading support

2008-06-22 Thread Joey Hess
Frans Pop wrote:
 0003: Having the two loops looks broken
 In so far that the second loop is likely to copy files that were already 
 installed in the first loop.

If you're referring to the two loops in post-base-installer (and not in
check-missing-firmware), it's true that the firmware from debs is
copied over a second time after they are installed. I didn't see a good
(simple) way to tell this case from the cases where the firmware in
d-i's /lib/firmware is provided by udebs or as unpackaged files.

-- 
see shy jo


signature.asc
Description: Digital signature