Opened 14 years ago

Closed 14 years ago

#5455 closed enhancement (fixed)

[patch] rule AddWirelessFirmwareToHaikuImage

Reported by: mmadia Owned by: bonefish
Priority: normal Milestone: R1
Component: Build System Version: R1/Development
Keywords: Cc:
Blocked By: #5479 Blocking: #5457
Platform: All

Description

This patch creates a new rule, AddWirelessFirmwareToHaikuImage in ImageRules. This rule will be used by upcoming patches for the iprowifi3945, iprowifi4965, marvell88w8363, & ralinkwifi drivers.

Attachments (1)

ImageRules-ruleAddWifiFirmwareToHaikuImage.patch (4.0 KB ) - added by mmadia 14 years ago.
updated to extract firmware archive via build_haiku_* script

Download all attachments as: .zip

Change History (11)

comment:1 by mmadia, 14 years ago

Blocking: 5457 added

comment:1 by mmadia, 14 years ago

Blocking: 5457 removed

hmmm... seems this may need to be altered a bit to account for firmware archives that are zips.

comment:2 by mmadia, 14 years ago

Blocking: 5457 added

(In #5457) Upon discussion with Colin, the notion of the settings file is no longer needed and his handled directly in the driver.

Pending any requested changes, this ticket, #5454, #5455, & #5456 can be committed.

comment:4 by mmadia, 14 years ago

This will need some refactoring, similar to http://dev.haiku-os.org/ticket/5454#comment:3

in reply to:  4 ; comment:5 by bonefish, 14 years ago

Replying to mmadia:

This will need some refactoring, similar to http://dev.haiku-os.org/ticket/5454#comment:3

Indeed, a single rule to handle all types of archives would be preferred.

Furthermore instead of unzipping the archives in the jam build system, I'd rather do that in the shell script(s). Support for gzipped tar archives would need to be added.

Finally please note that the *ToHaikuImage rules are usually just wrappers for respective *ToContainer rules. I would also do that in this case. I have the feeling that the feature might be actually needed for the net boot archive. If net boot via WIFI is possible at all that is.

in reply to:  5 ; comment:6 by mmadia, 14 years ago

Replying to bonefish:

Furthermore instead of unzipping the archives in the jam build system, I'd rather do that in the shell script(s). Support for gzipped tar archives would need to be added.

After updating the jamfiles & build/scripts to support this, I remembered that as opposed to simply extracting the archive, we need to specify if the archive contains a subdirectory and if it does to copy only the contents of that subdirectory.

Originally, Colin and I agreed to use the original firmware archives (as opposed to repackaging them), so as to prevent any chance of those companies interpreting our actions as somehow altering the software.

Some days ago, Colin mentioned that at least the intel 3945 has an internal mapping of on-disk filenames to names that the driver expects. I'll ask him if it's possible to further extend that functionality to include directory paths.

Finally please note that the *ToHaikuImage rules are usually just wrappers for respective *ToContainer rules. I would also do that in this case. I have the feeling that the feature might be actually needed for the net boot archive. If net boot via WIFI is possible at all that is.

Once I test the new changes with a .tgz, I'll submit a newticket with reference to this.

comment:7 by mmadia, 14 years ago

Blocked By: 5479 added

in reply to:  6 ; comment:8 by bonefish, 14 years ago

Replying to mmadia:

Replying to bonefish:

Furthermore instead of unzipping the archives in the jam build system, I'd rather do that in the shell script(s). Support for gzipped tar archives would need to be added.

After updating the jamfiles & build/scripts to support this, I remembered that as opposed to simply extracting the archive, we need to specify if the archive contains a subdirectory and if it does to copy only the contents of that subdirectory.

OK, that could be easily solved by adding the subdir as another argument to ExtractArchiveToContainer and passing it through to the extractFile() function in the scripts. It would just be an adjustment of the source argument in the "$cp" line.

Originally, Colin and I agreed to use the original firmware archives (as opposed to repackaging them), so as to prevent any chance of those companies interpreting our actions as somehow altering the software.

Agreed.

Some days ago, Colin mentioned that at least the intel 3945 has an internal mapping of on-disk filenames to names that the driver expects. I'll ask him if it's possible to further extend that functionality to include directory paths.

Well, as written above extracting a subdirectory is no big deal.

Finally please note that the *ToHaikuImage rules are usually just wrappers for respective *ToContainer rules. I would also do that in this case. I have the feeling that the feature might be actually needed for the net boot archive. If net boot via WIFI is possible at all that is.

Once I test the new changes with a .tgz, I'll submit a newticket with reference to this.

The patch in #5479 needs a few adjustments. Feel free to merge it with the changes for this ticket, if it saves you work.

by mmadia, 14 years ago

updated to extract firmware archive via build_haiku_* script

in reply to:  8 comment:9 by mmadia, 14 years ago

Replying to bonefish:

Replying to mmadia:

After updating the jamfiles & build/scripts to support this, I remembered that as opposed to simply extracting the archive, we need to specify if the archive contains a subdirectory and if it does to copy only the contents of that subdirectory.

OK, that could be easily solved by adding the subdir as another argument to ExtractArchiveToContainer and passing it through to the extractFile() function in the scripts. It would just be an adjustment of the source argument in the "$cp" line.

Is this patch along the lines of what you were thinking?

The patch + #5479 worked as expected in a jam -q @nightly-raw . Applying #5457 also worked as expected. Here's a snippet of the output with a debug echo statement:

Populating image ...
Extracting /haiku-src/haiku/data/system/data/firmware/iprowifi3945/iwlwifi-3945-ucode-2.14.1.5.tgz ...
/generated/x86gcc2/objects/haiku_host/x86/release/tools/fs_shell/fs_shell_command cp -f -r :/generated/x86gcc2/tmp/extract/iwlwifi-3945-ucode-2.14.1.5/. /myfs/system/data/firmware/iprowifi3945
Extracting /haiku-src/haiku/data/system/data/firmware/iprowifi4965/iwlwifi-4965-ucode-4.44.1.20.tgz ...
/generated/x86gcc2/objects/haiku_host/x86/release/tools/fs_shell/fs_shell_command cp -f -r :/generated/x86gcc2/tmp/extract/iwlwifi-4965-ucode-4.44.1.20/. /myfs/system/data/firmware/iprowifi4965
Extracting /haiku-src/haiku/data/system/data/firmware/marvell88w8363/88w8363-fw-3.6.2.2.zip ...
/generated/x86gcc2/objects/haiku_host/x86/release/tools/fs_shell/fs_shell_command cp -f -r :/generated/x86gcc2/tmp/extract//. /myfs/system/data/firmware/marvell88w8363
Extracting /haiku-src/haiku/data/system/data/firmware/ralinkwifi/RT61_Firmware_V1.2.zip ...
/generated/x86gcc2/objects/haiku_host/x86/release/tools/fs_shell/fs_shell_command cp -f -r :/generated/x86gcc2/tmp/extract/RT61_Firmware_V1.2/. /myfs/system/data/firmware/ralinkwifi
Extracting /generated/x86gcc2/download/apr-1.3.9-x86-gcc2-2009-10-18.zip ...
/generated/x86gcc2/objects/haiku_host/x86/release/tools/fs_shell/fs_shell_command cp -f -r :/generated/x86gcc2/tmp/extract//. /myfs/.

comment:10 by bonefish, 14 years ago

Resolution: fixed
Status: newclosed

Thanks! Applied in hrev35635. The patch was not correctly based, BTW -- there were two small changes in ImageRules.

Note: See TracTickets for help on using tickets.