burzumishi / linux-baytrail-flexx10

Install GNU/Linux on NextBook Flexx 10.1
GNU General Public License v2.0
82 stars 18 forks source link

Update PKGBUILD for new config (4.5) ; made dkms profile for wifi #5

Closed nicman23 closed 7 years ago

nicman23 commented 8 years ago

dkms.conf and the script was made with this https://wiki.debian.org/KernelDKMS

I have no way to test the sanity of it.... So please do test it before merging :)

This is (the dkms thing) mostly for debian, as arch has an package already

nicman23 commented 7 years ago

can anyone test this script for debian?

I will not merge without prior testing.

burzumishi commented 7 years ago

Yes thanks, I'll test it as soon as possible (hope tomorrow) now I'm trying to get sound in 4.8.0-rc2.

Until now, I was building the wifi driver as a staging module, I have modified "drivers/staging/Makefile" copied the "R8723AU" device line (or other) and renamed it to "RTL8723BS" and the same with "Kconfig" file, so I can select the wifi module with "menuconfig" and install it at kernel build time. In debian-based distros you can build kernel with "make deb-pkg" and all required debian packages are created. :)

Maybe I can submit a patch with wifi sources and modifications to "drivers/staging" directory, as option to this "DKMS thing".

This should work for everybody and can be done without building any module or install any package after installing the kernel.

nicman23 commented 7 years ago

ok cool. though some people would not want that as the driver is not upstreamable atm

burzumishi commented 7 years ago

Ok, I've made a standalone patch for wifi as staging module so we can choose DKMS or staging at kernel build time.

I've been testing dkms script and config file, after solving some errors I've built the module but could not create the binary package:

Building module:
cleaning build area....
make KERNELRELEASE=4.8.0-rc2-flexx10-2+ -C /lib/modules/4.8.0-rc2-flexx10-2+/build M=/var/lib/dkms/rtl8723bs-1.0/build...........................................
ERROR (dkms apport): binary package for rtl8723bs: 1.0 not found
Error!  Build of rtl8723bs.ko failed for: 4.8.0-rc2-flexx10-2+ (x86_64)
Consult the make.log in the build directory
/var/lib/dkms/rtl8723bs/1.0/build/ for more information.

I'm reading DKMS documentation to figure out whats going on, make.log file only has the make output while building (module is built without errors).

dkms_tree variable points to /var/lib/dkms instead of /usr/src as is documented in the debian wiki.

I have added "ubuntu" and "elementary" to "debian" in the first grep.

I'll post the script and config files when I'll get them working.

burzumishi commented 7 years ago

Done! It's working! (I love man-pages jejej)

File dkms.sh:

#!/bin/bash

if [ ! -z "$(cat /etc/issue | grep -i -e debian -e ubuntu -e elementary)" ] ; then
apt-get install build-essential git ; fi

if [ ! -z $(uname -r | grep ARCH) ] ; then
  echo "There is an aur package! Continue?"
  select yn in "Yes" "No"; do
      case $yn in
          Yes ) pacman -Syu base-devel git ;;
          No ) exit;;
      esac
  done
fi

git clone https://github.com/hadess/rtl8723bs.git || exit 1
mdir="/usr/src/rtl8723bs-1.0"
mkdir -p $mdir
cp dkms.conf $mdir/dkms.conf
cp -a rtl8723bs/* $mdir/
dkms add rtl8723bs/1.0 || exit 1
dkms build rtl8723bs/1.0 && dkms install rtl8723bs/1.0 || exit 1

File dkms.conf:

PACKAGE_NAME=rtl8723bs
PACKAGE_VERSION=1.0
BUILT_MODULE_NAME[0]="r8723bs"
MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build"
CLEAN="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean"
DEST_MODULE_LOCATION[0]=/extra

Optional you can add the following variables to dkms.conf:

REMAKE_INITRD=yes
AUTOINSTALL=yes

It worked like a charm now, it replaces initrd and I have to specify --force to replace my staging module previously installed.