You are not logged in.

#1 2013-05-20 19:02:02

Roberth
Member
From: The Pale Blue Dot
Registered: 2007-01-12
Posts: 894

Issues with r8168 PKGBUILD

Hello, I use the linux-pf kernel and I need the r8168 driver, and the PKGBUILD in AUR, is outdated, so I decided to try to make my own quick and dirty one by modifying the one in community repo made for ARCH-kernel, but I am stuck when I try to run makepkg, I just get this:

roberth@magda ~/AUR/r8168-pf $ makepkg
==> Making package: r8168-pf 8.035.00-1 (Mon May 20 20:55:06 CEST 2013)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found r8168-8.035.00.tar.bz2
  -> Found linux-3.8.patch
==> Validating source files with sha256sums...
    r8168-8.035.00.tar.bz2 ... Passed
    linux-3.8.patch ... Passed
==> Extracting sources...
  -> Extracting r8168-8.035.00.tar.bz2 with bsdtar
==> Removing existing pkg/ directory...
==> Starting build()...
patching file src/r8168_n.c
make: Entering directory `/usr/src/linux-3.9.2-pf'
  CC [M]  /home/roberth/AUR/r8168-pf/src/r8168-8.035.00/src/r8168_n.o
  LD [M]  /home/roberth/AUR/r8168-pf/src/r8168-8.035.00/src/r8168.o
  Building modules, stage 2.
  MODPOST 1 modules
  LD [M]  /home/roberth/AUR/r8168-pf/src/r8168-8.035.00/src/r8168.ko
make: Leaving directory `/usr/src/linux-3.9.2-pf'
==> Entering fakeroot environment...
==> Starting package()...
==> Kernel = 3.9.2-pf
install: cannot stat ‘src/r8168-8.035.00/src/r8168.ko’: No such file or directory
==> ERROR: A failure occurred in package().
    Aborting...

PKGBUILD:

pkgname=r8168-pf
pkgver=8.035.00
pkgrel=1
pkgdesc="A kernel module for Realtek 8168 network cards"
url="http://www.realtek.com.tw"
license=("GPL")
arch=('i686' 'x86_64')
depends=('glibc' 'linux')
makedepends=()
conflicts=('r8168')
source=(http://r8168.googlecode.com/files/r8168-$pkgver.tar.bz2
        linux-3.8.patch)
install=r8168-pf.install

build() {
        _kernver=$(pacman -Q linux | cut -d . -f 2 | cut -f 1 -d -)
        KERNEL_RELEASE=$(cat /usr/lib/modules/extramodules-3.$_kernver-pf/version)

        cd "r8168-$pkgver"

        patch -Np1 -i "$srcdir/linux-3.8.patch"

        # avoid using the Makefile directly -- it doesn't understand
        # any kernel but the current.
        make -C /usr/lib/modules/$KERNEL_RELEASE/build \
                        SUBDIRS="$srcdir/r8168-$pkgver/src" \
                        EXTRA_CFLAGS="-DCONFIG_R8168_NAPI -DCONFIG_R8168_VLAN" \
                        modules
}

package() {
        _kernver=$(pacman -Q linux | cut -d . -f 2 | cut -f 1 -d -)
        depends=("linux>=3.${_kernver}" "linux<3.$(expr ${_kernver} + 1)")
        KERNEL_VERSION=$(cat /usr/lib/modules/extramodules-3.$_kernver-pf/version)
        msg "Kernel = $KERNEL_VERSION"

        cd "r8168-$pkgver"
        install -Dm644 src/r8168-8.035.00/src/r8168.ko "$pkgdir/usr/lib/modules/extramodules-3.$_kernver-pf/r8168.ko"
        find "r8168" -name '*.ko' -exec gzip -9 {} +

        sed -i "s|extramodules-.*-ARCH|extramodules-3.$_kernver-pf|" "$startdir/r8168-pf.install"
}

sha256sums=('b904d31fc9bd6c97cc34479a0eba0e3a9bba5351a43b56dd5fff6b7dc1a5df73'
            'fcf49d6147a7db3e739e6798b41230c13403cdba8ef8db93e7691c4c1e4617c3')

r8168-pf.install:

rebuild_module_dependencies() {
        EXTRAMODULES='extramodules-3.9-pf'
        depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
}

post_install() {
  rebuild_module_dependencies
        echo '>>> The module r8168 conflicts with r8169. You can blacklist it with:'
        echo '>>>  `echo "blacklist r8169" > /etc/modprobe.d/r8169_blacklist.conf`'
}
post_upgrade() {
        rebuild_module_dependencies
}

post_remove() {
        rebuild_module_dependencies
}

Can't spot my error.... Anybody who can?


Use the Source, Luke!

Offline

#2 2013-05-20 19:33:13

Roberth
Member
From: The Pale Blue Dot
Registered: 2007-01-12
Posts: 894

Re: Issues with r8168 PKGBUILD

Well I found out, need to change to

        install -Dm644 src/r8168-8.035.00/src/r8168.ko "$pkgdir/usr/lib/modules/extramodules-3.$_kernver-pf/r8168.ko"

to

        install -Dm644 src/r8168.ko "$pkgdir/usr/lib/modules/extramodules-3.$_kernver-pf/r8168.ko"

But...

find: `r8168': No such file or directory

I dont understand what it is looking after...


Use the Source, Luke!

Offline

#3 2013-05-20 19:47:47

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Issues with r8168 PKGBUILD

You know that there are numerous r8168 packages in the AUR.  There is even one for pf, but it is out of date.  Still you could look over that PKGBUILD and compare it with something like the r8168-ck PKGBUILD, and see how it is done in those instances.


Edit: Is there some feature of the PF kernel that you use that might prevent you from testing this with the offical kernel from the repos?  That might be the easiest way to determine at least whether the thing works or not.

Last edited by WonderWoofy (2013-05-20 19:48:33)

Offline

#4 2013-05-20 20:04:55

Roberth
Member
From: The Pale Blue Dot
Registered: 2007-01-12
Posts: 894

Re: Issues with r8168 PKGBUILD

Well, you said something i oddly haven't thought off, I just took the r8168-ck pkgbuild and change all the places where it said ck to pf, and it worked! Thanks.

Well I didn't think off that either, but oh well now that it's done.


Use the Source, Luke!

Offline

#5 2013-05-20 20:15:58

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Issues with r8168 PKGBUILD

So I'd love to hear back on whether the module is an improvement... update us when you get a minute.

Offline

Board footer

Powered by FluxBB