LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-28-2011, 05:28 AM   #1
Phorize
Member
 
Registered: Sep 2005
Location: UK
Distribution: Slackware
Posts: 226

Rep: Reputation: 29
Building linux-firmware package with Pat's slackbuild script


Hi All. I am running a custom 3.0.4 kernel and would like to add the latest binary blobs to enable my rtl8192se card to work. I can do this by dumping the binaries in the /lib/firmware directory, but would prefer to create a proper package using the latest firmware package from the kernel.org git repo (or at least the last one that got mirrored before the kernel.org got taken down).

This is the slackbuild from current:

Code:
#!/bin/sh

# Copyright 2008, 2009  Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-kernel-firmware

VERSION=${VERSION:-2.6.38.7}
ARCH=${ARCH:-noarch}
BUILD=${BUILD:-1}

rm -rf $PKG
mkdir -p $TMP $PKG
echo "Using /usr/src/linux-2.6.38.7/"
echo "Make sure this is *ready*..."
mkdir -p $PKG/lib/firmware
( cd /usr/src/linux-2.6.38.7 && make firmware_install INSTALL_FW_PATH=$PKG/lib/firmware )
cp -a /usr/src/linux-2.6.38.7/firmware/WHENCE $PKG/lib/firmware

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $TMP/kernel-firmware-${VERSION}-noarch-$BUILD.txz
Obviously I will need to change the script to go to /usr/src/linux-3.0.4 but this doesn't include the binary blobs which are packaged separately. I propose to unpack the latest firmware into the /usr/src/linux-3.0.4/firmware and then run the script before doing upgradepkg kernel-firmware-3.0.4. I just wanted to check that this made sense before doing it! Incidentally, /usr/src/linux-3.0.4/firmware/README.AddingFirmware discusses adding firmware but advises against adding arbitrary firmware to the /lib/firmware directory-I am working on the assumption that this is intended for kernel developers and does not have implications for end users.

Thoughts appreciated.
 
Old 09-28-2011, 05:43 AM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
I think that you would be safe to just install the package from -current

Thu Aug 25 09:10:45 UTC 2011
a/kernel-firmware-20110814git-noarch-1.txz: Upgraded.
Fetch the latest kernel firmware from git -- the stuff in the kernel sources
is somewhat stale.

ftp://ftp.osuosl.org/pub/slackware/s...t-noarch-1.txz
 
Old 09-28-2011, 11:55 AM   #3
Phorize
Member
 
Registered: Sep 2005
Location: UK
Distribution: Slackware
Posts: 226

Original Poster
Rep: Reputation: 29
Quote:
Originally Posted by andrewthomas View Post
I think that you would be safe to just install the package from -current

Thu Aug 25 09:10:45 UTC 2011
a/kernel-firmware-20110814git-noarch-1.txz: Upgraded.
Fetch the latest kernel firmware from git -- the stuff in the kernel sources
is somewhat stale.

ftp://ftp.osuosl.org/pub/slackware/s...t-noarch-1.txz
Thanks for your reply. I unpacked the package in current and it doesn't include the firmware for my card-the rt8192se is only supported from 3.0 onwards. I am going to need to either build the package myself or just dump the binaries in manually. I would prefer to build a package because it is "nicer". That said, I don't know how the firmware finds its way into the package usually. Is this just a matter or patching the source with the firmware package from git and then running the slackbuild from /?
 
Old 09-28-2011, 12:42 PM   #4
Phorize
Member
 
Registered: Sep 2005
Location: UK
Distribution: Slackware
Posts: 226

Original Poster
Rep: Reputation: 29
Ok, so I have merged the latest firmware into the /usr/src/linux-3.0.4/firmware, removed the 2.6.27.6 firmware package, ran the kernel-firmware.Slackbuild script and installed the resultant package. I have examined the package, it it seems that although make has run recursively into some of the directories in /usr/src/linux-3.0.4 firmware, it hasn't done all of them, including rtlwifi, which is the one that I want!

Any thoughts on what amendments I can make to the script to ensure that all of the firmware is packaged-I have a newbie hunch that make can't deal with the binary blobs, for obvious reasons. Any comments on this being the case are particularly welcomed!
 
Old 09-28-2011, 01:33 PM   #5
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
I took this firmware package

ftp.osuosl.org/pub/gentoo/distfiles/linux-firmware-20110818.tar.bz2

and built this kernel-firmware package with it

http://dl.dropbox.com/u/27872107/ker...t-noarch-1.txz

it has does contain the firmware that you want.


Code:
linux-firmware-20110818/rtlwifi/
[lxde@slack-asus rtlwifi]$ ls -al
total 280
drwxr-xr-x  2 lxde lxde   4096 Sep 28 13:19 .
drwxr-xr-x 54 lxde lxde   4096 Sep 28 13:19 ..
-rw-r--r--  1 lxde lxde  13540 Aug 17 10:55 rtl8192cfw.bin
-rw-r--r--  1 lxde lxde  16014 Aug 17 10:55 rtl8192cufw.bin
-rw-r--r--  1 lxde lxde  20526 Aug 17 10:55 rtl8192defw.bin
-rw-r--r--  1 lxde lxde  88856 Aug 17 10:55 rtl8192sefw.bin
-rw-r--r--  1 lxde lxde 129304 Aug 17 10:55 rtl8712u.bin
 
Old 09-28-2011, 02:00 PM   #6
Phorize
Member
 
Registered: Sep 2005
Location: UK
Distribution: Slackware
Posts: 226

Original Poster
Rep: Reputation: 29
Quote:
Originally Posted by andrewthomas View Post
I took this firmware package

ftp.osuosl.org/pub/gentoo/distfiles/linux-firmware-20110818.tar.bz2

and built this kernel-firmware package with it

http://dl.dropbox.com/u/27872107/ker...t-noarch-1.txz

it has does contain the firmware that you want.


Code:
linux-firmware-20110818/rtlwifi/
[lxde@slack-asus rtlwifi]$ ls -al
total 280
drwxr-xr-x  2 lxde lxde   4096 Sep 28 13:19 .
drwxr-xr-x 54 lxde lxde   4096 Sep 28 13:19 ..
-rw-r--r--  1 lxde lxde  13540 Aug 17 10:55 rtl8192cfw.bin
-rw-r--r--  1 lxde lxde  16014 Aug 17 10:55 rtl8192cufw.bin
-rw-r--r--  1 lxde lxde  20526 Aug 17 10:55 rtl8192defw.bin
-rw-r--r--  1 lxde lxde  88856 Aug 17 10:55 rtl8192sefw.bin
-rw-r--r--  1 lxde lxde 129304 Aug 17 10:55 rtl8712u.bin
Thank you for replying and sharing your pkg. I would like to build my own. Can you tell me how you build yours. The only ways I know are to use a slackbuild or setting make install targets to a build directory where I can run makepkg. As the git package doesn't have a makefile, how do you configure your package to install to the correct directories?
 
Old 09-28-2011, 02:37 PM   #7
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
I just downloaded the firmware file from:

http://ftp.osuosl.org/pub/gentoo/dis...110818.tar.bz2

and put it in a directory with the slackbuild and a slack-desc file.


Here is the slackbuild that I made for it.

Code:
#!/bin/sh

# Copyright 2011  Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


PKGNAM=kernel-firmware
VERSION=${VERSION:-$(date +%Y%m%d)git}
ARCH=noarch
BUILD=${BUILD:-1}

CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-$PKGNAM

rm -rf $PKG
mkdir -p $TMP $PKG

cd $PKG
tar xvf $CWD/linux-firmware-20110818.tar.bz2
chown -R root:root .
mkdir -p lib
mv linux-firmware-20110818 lib/firmware

# Install documentation link:
mkdir -p $PKG/usr/doc
( cd $PKG/usr/doc
  ln -sf /lib/firmware kernel-firmware-$VERSION
)

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
 
1 members found this post helpful.
Old 10-05-2011, 02:47 AM   #8
Phorize
Member
 
Registered: Sep 2005
Location: UK
Distribution: Slackware
Posts: 226

Original Poster
Rep: Reputation: 29
Quote:
Originally Posted by andrewthomas View Post
I just downloaded the firmware file from:

http://ftp.osuosl.org/pub/gentoo/dis...110818.tar.bz2

and put it in a directory with the slackbuild and a slack-desc file.


Here is the slackbuild that I made for it.

Code:
#!/bin/sh

# Copyright 2011  Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


PKGNAM=kernel-firmware
VERSION=${VERSION:-$(date +%Y%m%d)git}
ARCH=noarch
BUILD=${BUILD:-1}

CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-$PKGNAM

rm -rf $PKG
mkdir -p $TMP $PKG

cd $PKG
tar xvf $CWD/linux-firmware-20110818.tar.bz2
chown -R root:root .
mkdir -p lib
mv linux-firmware-20110818 lib/firmware

# Install documentation link:
mkdir -p $PKG/usr/doc
( cd $PKG/usr/doc
  ln -sf /lib/firmware kernel-firmware-$VERSION
)

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
All sorted, thanks for the help!
 
Old 10-05-2011, 05:54 AM   #9
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
You're welcome.

Glad to be of help.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Where to file a bug report for the linux-firmware package MALDATA Arch 1 05-24-2011 06:53 AM
[SOLVED] ORBit2 Slackbuild fails when building 32 bit package on current multilib damgar Slackware 4 04-10-2010 02:26 PM
building from slackbuild script konfigure Slackware 2 03-21-2009 09:59 AM
Compiling qt and KDE 3.5.5 using Pat,s Slackbuild Harp00 Slackware 3 10-13-2006 04:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration