You are not logged in.

#1 2020-02-11 08:29:16

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 645
Website

AMD SFH driver does not provide accelerometer

Hi all,

a couple of days ago, AMD published a reviewed version of the new Sensor Fusion Hub (SFH) driver for AMD Ryzen based convertibles to provide accelerometer functionality.
I successfully compiled a kernel with these patches using asp.
The driver is loaded

$ lsmod | grep amd
edac_mce_amd           32768  0
kvm_amd               110592  0
ccp                   106496  1 kvm_amd
kvm                   802816  1 kvm_amd
pinctrl_amd            32768  0
amd_sfhtp_hid          24576  0
amd_mp2_pcie           20480  1 amd_sfhtp_hid
hid                   147456  2 i2c_hid,amd_sfhtp_hid
amdgpu               5271552  20
gpu_sched              36864  1 amdgpu
i2c_algo_bit           16384  1 amdgpu
ttm                   122880  1 amdgpu
drm_kms_helper        237568  1 amdgpu
drm                   557056  9 gpu_sched,drm_kms_helper,amdgpu,ttm

and seems to handle the appropriate device

04:00.7 Non-VGA unclassified device [0000]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2/Renoir Sensor Fusion Hub [1022:15e4]
	Subsystem: Hewlett-Packard Company Raven/Raven2/Renoir Sensor Fusion Hub [103c:8496]
	Kernel driver in use: pcie_mp2_amd
	Kernel modules: amd_mp2_pcie

However no accelerometer is discovered by udev:

$ udevadm info --export-db | grep -i iio

(nothing)

What do I need to do to make the driver work?
Do I need to patch additional software?
I cannot find any documentation on that.

Update:
I just noticed that dmesg shows some call traces probably related to the driver:

[  124.954163] ------------[ cut here ]------------
[  124.954180] WARNING: CPU: 1 PID: 21 at net/mac80211/rx.c:804 ieee80211_rx_napi+0x9f8/0xa40 [mac80211]
[  124.954180] Modules linked in: fuse rfcomm cmac algif_hash algif_skcipher af_alg nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nf_conntrack bnep nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c uvcvideo btusb btrtl btbcm btintel videobuf2_vmalloc joydev videobuf2_memops bluetooth mousedev nf_tables_set videobuf2_v4l2 videobuf2_common ecdh_generic ecc nf_tables videodev nfnetlink mc snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio snd_hda_codec_hdmi snd_hda_intel rtwpci snd_intel_dspcfg rtw88 edac_mce_amd snd_hda_codec nls_iso8859_1 kvm_amd snd_hda_core nls_cp437 ccp snd_hwdep vfat mac80211 fat kvm snd_pcm snd_timer irqbypass hp_wmi cfg80211 input_leds pcspkr sparse_keymap snd wmi_bmof psmouse ucsi_acpi sp5100_tco k10temp rfkill typec_ucsi i2c_piix4 soundcore libarc4 typec tpm_crb tpm_tis ac tpm_tis_core tpm hp_accel evdev lis3lv02d i2c_scmi hp_wireless mac_hid rng_core pinctrl_amd i2c_hid acpi_cpufreq sg crypto_user amd_sfhtp_hid amd_mp2_pcie hid ip_tables x_tables ext4
[  124.954202]  crc32c_generic crc16 mbcache jbd2 dm_crypt dm_mod rtsx_pci_sdmmc mmc_core serio_raw atkbd libps2 crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel ahci libahci aesni_intel libata crypto_simd cryptd glue_helper scsi_mod xhci_pci xhci_hcd rtsx_pci wmi i8042 serio battery amdgpu gpu_sched i2c_algo_bit ttm drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm agpgart
[  124.954213] CPU: 1 PID: 21 Comm: ksoftirqd/1 Tainted: G        W         5.5.2-arch2-2-amdfh #1
[  124.954213] Hardware name: HP HP ENVY x360 Convertible 13-ag0xxx/8496, BIOS F.33 01/23/2019
[  124.954230] RIP: 0010:ieee80211_rx_napi+0x9f8/0xa40 [mac80211]
[  124.954231] Code: 89 4c 24 18 e8 b9 33 2d dc 44 8b 4c 24 18 85 c0 0f 84 52 fd ff ff 48 89 ef e8 f4 28 2d dc 31 ff e8 ed 28 2d dc e9 79 f9 ff ff <0f> 0b 48 89 ef e8 de 28 2d dc e9 6a f9 ff ff 0f b6 f1 48 c7 c7 40
[  124.954232] RSP: 0018:ffffb396c01f7d30 EFLAGS: 00010202
[  124.954233] RAX: 0000000000000080 RBX: ffff8c360a2f07c0 RCX: 0000000000000004
[  124.954234] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8c360a2f07c0
[  124.954235] RBP: ffff8c3562ebb100 R08: ffff8c35ca688580 R09: 0000000000000001
[  124.954236] R10: 000000000040a2d4 R11: 0000000000000000 R12: 0000000000000000
[  124.954236] R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000000
[  124.954237] FS:  0000000000000000(0000) GS:ffff8c360fc40000(0000) knlGS:0000000000000000
[  124.954238] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  124.954239] CR2: 00007f16d4010f38 CR3: 0000000389780000 CR4: 00000000003406e0
[  124.954240] Call Trace:
[  124.954242]  ? __switch_to_asm+0x40/0x70
[  124.954244]  ? __switch_to_asm+0x34/0x70
[  124.954246]  ? __switch_to_asm+0x40/0x70
[  124.954248]  ? __switch_to_asm+0x40/0x70
[  124.954250]  ? __switch_to_asm+0x34/0x70
[  124.954251]  ? __switch_to_asm+0x40/0x70
[  124.954265]  ieee80211_tasklet_handler+0xbc/0xd0 [mac80211]
[  124.954267]  tasklet_action_common.isra.0+0x5f/0x130
[  124.954269]  __do_softirq+0x111/0x34d
[  124.954272]  run_ksoftirqd+0x32/0x40
[  124.954273]  smpboot_thread_fn+0x19a/0x230
[  124.954275]  kthread+0xfb/0x130
[  124.954276]  ? sort_range+0x20/0x20
[  124.954277]  ? kthread_park+0x90/0x90
[  124.954279]  ret_from_fork+0x22/0x40
[  124.954282] ---[ end trace b42293793fe9a9c1 ]---

Maybe somebody with some more kernel-experience shed some light on this.

Update:
Well, I don't seem to be the only one having this problem:
https://bugzilla.kernel.org/show_bug.cgi?id=199715#c16
Since the drivers are for testing and not yet approved for merger into the kernel, I'd say the test failed.
Let's wait for an update from AMD.

Yet another update:
Today AMD released a new version (v3) of the driver.
https://patchwork.kernel.org/project/li … ter=175589
I'll report back when the kernel has finished compiling. wink
The new driver still does not provide accelerometer functionality. sad

Last edited by schard (2020-02-21 08:49:21)

Offline

#2 2020-02-20 20:16:35

ianl
Member
From: United States
Registered: 2020-02-20
Posts: 1

Re: AMD SFH driver does not provide accelerometer

schard wrote:

Yet another update:
Today AMD released a new version (v3) of the driver.
https://patchwork.kernel.org/project/li … ter=175589
I'll report back when the kernel has finished compiling. wink
The new driver still does not provide accelerometer functionality. sad

After a few days of messing around with this on my Envy X360 15-ds0013nr, I now have auto-rotation working.

I'm running kernel 5.6.0rc2 with SFHv3 patch. I had to pass the kernel either iommu=off (which broke my wifi) or amd_iommu=off (which is working okay so far) to get things working and stop page faults. Try to boot your kernel with one of these options. If that fails, maybe try to patch against 5.6.

I'll try a build later with a stable 5.5 kernel and update.

lsmod | grep amd:

$ lsmod | grep amd
amdgpu               5492736  10
edac_mce_amd           32768  0
kvm_amd               114688  0
kvm                   823296  1 kvm_amd
gpu_sched              40960  1 amdgpu
i2c_algo_bit           16384  1 amdgpu
ttm                   122880  1 amdgpu
drm_kms_helper        241664  1 amdgpu
drm                   565248  10 gpu_sched,drm_kms_helper,amdgpu,ttm
ccp                   114688  1 kvm_amd
amd_sfhtp_hid          24576  0
amd_mp2_pcie           20480  1 amd_sfhtp_hid
hid                   147456  5 i2c_hid,hid_multitouch,hid_sensor_hub,amd_sfhtp_hid,hid_generic
pinctrl_amd            32768  11

Relevant lspci -knn:

04:00.7 Non-VGA unclassified device [0000]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2/Renoir Sensor Fusion Hub [1022:15e4]
        Subsystem: Hewlett-Packard Company Raven/Raven2/Renoir Sensor Fusion Hub [103c:85dd]
        Kernel driver in use: pcie_mp2_amd
        Kernel modules: amd_mp2_pcie

and udvadm info

$ udevadm info --export-db | grep -i iio
P: /devices/0020:03FE:0001.0001/HID-SENSOR-200073.0.auto/iio:device0
N: iio:device0
E: DEVPATH=/devices/0020:03FE:0001.0001/HID-SENSOR-200073.0.auto/iio:device0
E: SUBSYSTEM=iio
E: DEVNAME=/dev/iio:device0
E: DEVTYPE=iio_device
E: IIO_SENSOR_PROXY_TYPE=iio-buffer-accel
E: SYSTEMD_WANTS=iio-sensor-proxy.service
E: SUBSYSTEM=iio
P: /devices/0020:03FE:0001.0002/HID-SENSOR-200076.1.auto/iio:device1
N: iio:device1
E: DEVPATH=/devices/0020:03FE:0001.0002/HID-SENSOR-200076.1.auto/iio:device1
E: SUBSYSTEM=iio
E: DEVNAME=/dev/iio:device1
E: DEVTYPE=iio_device
E: SUBSYSTEM=iio
P: /devices/0020:03FE:0001.0003/HID-SENSOR-200083.2.auto/iio:device2
N: iio:device2
E: DEVPATH=/devices/0020:03FE:0001.0003/HID-SENSOR-200083.2.auto/iio:device2
E: SUBSYSTEM=iio
E: DEVNAME=/dev/iio:device2
E: DEVTYPE=iio_device
E: SUBSYSTEM=iio

Without passing the kernel either of the above I was getting errors like these spamming journalctl:

Feb 20 00:00:00 pony kernel: amd_iommu_report_page_fault: 174 callbacks suppressed
Feb 20 00:00:00 pony kernel: pcie_mp2_amd 0000:04:00.7: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000c address=0xcc202000 flags=0x0020]
Feb 20 00:00:00 pony kernel: pcie_mp2_amd 0000:04:00.7: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000c address=0xcc200000 flags=0x0020]
Feb 20 00:00:00 pony kernel: pcie_mp2_amd 0000:04:00.7: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000c address=0xcc201000 flags=0x0020]
Feb 20 00:00:00 pony kernel: pcie_mp2_amd 0000:04:00.7: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000c address=0xcc202000 flags=0x0020]
Feb 20 00:00:00 pony kernel: pcie_mp2_amd 0000:04:00.7: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000c address=0xcc200000 flags=0x0020]
Feb 20 00:00:00 pony kernel: pcie_mp2_amd 0000:04:00.7: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000c address=0xcc201000 flags=0x0020]
Feb 20 00:00:00 pony kernel: pcie_mp2_amd 0000:04:00.7: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000c address=0xcc200000 flags=0x0020]
Feb 20 00:00:00 pony kernel: pcie_mp2_amd 0000:04:00.7: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000c address=0xcc201000 flags=0x0020]
Feb 20 00:00:00 pony kernel: pcie_mp2_amd 0000:04:00.7: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000c address=0xcc202000 flags=0x0020]
Feb 20 00:00:00 pony kernel: pcie_mp2_amd 0000:04:00.7: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000c address=0xcc200000 flags=0x0020]
Feb 20 00:00:04 pony kernel: amd_iommu_report_page_fault: 164 callbacks suppressed
Feb 20 00:00:04 pony kernel: AMD-Vi: Event logged [IO_PAGE_FAULT device=04:00.7 domain=0x000c address=0xcc202000 flags=0x0020]
Feb 20 00:00:04 pony kernel: AMD-Vi: Event logged [IO_PAGE_FAULT device=04:00.7 domain=0x000c address=0xcc200000 flags=0x0020]
Feb 20 00:00:04 pony kernel: AMD-Vi: Event logged [IO_PAGE_FAULT device=04:00.7 domain=0x000c address=0xcc201000 flags=0x0020]
Feb 20 00:00:04 pony kernel: AMD-Vi: Event logged [IO_PAGE_FAULT device=04:00.7 domain=0x000c address=0xcc202000 flags=0x0020]
Feb 20 00:00:04 pony kernel: AMD-Vi: Event logged [IO_PAGE_FAULT device=04:00.7 domain=0x000c address=0xcc200000 flags=0x0020]
Feb 20 00:00:04 pony kernel: AMD-Vi: Event logged [IO_PAGE_FAULT device=04:00.7 domain=0x000c address=0xcc201000 flags=0x0020]
Feb 20 00:00:04 pony kernel: AMD-Vi: Event logged [IO_PAGE_FAULT device=04:00.7 domain=0x000c address=0xcc200000 flags=0x0020]
Feb 20 00:00:04 pony kernel: AMD-Vi: Event logged [IO_PAGE_FAULT device=04:00.7 domain=0x000c address=0xcc201000 flags=0x0020]
Feb 20 00:00:05 pony kernel: AMD-Vi: Event logged [IO_PAGE_FAULT device=04:00.7 domain=0x000c address=0xcc202000 flags=0x0020]
Feb 20 00:00:05 pony kernel: AMD-Vi: Event logged [IO_PAGE_FAULT device=04:00.7 domain=0x000c address=0xcc200000 flags=0x0020]
Feb 20 00:00:05 pony kernel: amd_iommu_report_page_fault: 172 callbacks suppressed
Feb 20 00:00:05 pony kernel: pcie_mp2_amd 0000:04:00.7: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000c address=0xcc200000 flags=0x0020]
Feb 20 00:00:05 pony kernel: pcie_mp2_amd 0000:04:00.7: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000c address=0xcc201000 flags=0x0020]
Feb 20 00:00:05 pony kernel: pcie_mp2_amd 0000:04:00.7: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000c address=0xcc202000 flags=0x0020]
Feb 20 00:00:05 pony kernel: pcie_mp2_amd 0000:04:00.7: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000c address=0xcc200000 flags=0x0020]
Feb 20 00:00:05 pony kernel: pcie_mp2_amd 0000:04:00.7: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000c address=0xcc201000 flags=0x0020]
Feb 20 00:00:05 pony kernel: pcie_mp2_amd 0000:04:00.7: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000c address=0xcc202000 flags=0x0020]
Feb 20 00:00:05 pony kernel: pcie_mp2_amd 0000:04:00.7: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000c address=0xcc200000 flags=0x0020]
Feb 20 00:00:05 pony kernel: pcie_mp2_amd 0000:04:00.7: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000c address=0xcc201000 flags=0x0020]
Feb 20 00:00:05 pony kernel: pcie_mp2_amd 0000:04:00.7: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000c address=0xcc202000 flags=0x0020]
Feb 20 00:00:05 pony kernel: pcie_mp2_amd 0000:04:00.7: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000c address=0xcc200000 flags=0x0020]
Feb 20 00:00:09 pony kernel: amd_iommu_report_page_fault: 162 callbacks suppressed

Offline

#3 2020-02-21 08:01:05

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 645
Website

Re: AMD SFH driver does not provide accelerometer

Thank you for sharing.
I tried it again with linux-5.6.0-rc2:

5.6.0-rc2-1-sfh
04:00.7 Non-VGA unclassified device [0000]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2/Renoir Sensor Fusion Hub [1022:15e4]
	Subsystem: Hewlett-Packard Company Raven/Raven2/Renoir Sensor Fusion Hub [103c:8496]
	Kernel driver in use: pcie_mp2_amd
	Kernel modules: amd_mp2_pcie
udevadm info --export-db | grep -i iio
(nothing)

I used this PKGBUILD

# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Richard Neumann (schard) <mail at richard dash neumann period de>

pkgbase=linux-sfh
pkgver=5.6.0rc2
pkgrel=1
pkgdesc='Linux with experimental AMD Sensor Fusion Hub (SFH) drivers'
_srctag=v${pkgver%.*}-${pkgver##*.}
url="https://git.archlinux.org/linux.git/log/?h=$_srctag"
arch=(x86_64)
license=(GPL2)
makedepends=(
  bc kmod libelf
  xmlto python-sphinx python-sphinx_rtd_theme graphviz imagemagick
  git
)
options=('!strip')
_srcname=linux-5.6-rc2
source=(
  "$_srcname.tar.gz::https://git.kernel.org/torvalds/t/linux-5.6-rc2.tar.gz"
  "amd-sfh-v3.patch::https://patchwork.kernel.org/series/240125/mbox/"
  config         # the main kernel config file
)
validpgpkeys=(
  'ABAF11C65A2970B130ABE3C479BE3E4300411886'  # Linus Torvalds
  '647F28654894E3BD457199BE38DBBDC86092693E'  # Greg Kroah-Hartman
  '8218F88849AAC522E94CF470A5E9288C4FA415FA'  # Jan Alexander Steffens (heftig)
)
sha256sums=('37cbd2341d7d27188ae2de4c676bf614d1d55b42467e36187189e5b21bd26dac'
            '37c9f1d81d504ff78a0759723020341aa87367bb7cdc98550c67923b10f7823f'
            '64013428da9a5fafff29f29250789d6fac17faaa3137ef924ed6c7583cad6ccd')

export KBUILD_BUILD_HOST=archlinux
export KBUILD_BUILD_USER=$pkgbase
export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})"

prepare() {
  cd $_srcname

  echo "Setting version..."
  scripts/setlocalversion --save-scmversion
  echo "-$pkgrel" > localversion.10-pkgrel
  echo "${pkgbase#linux}" > localversion.20-pkgname

  local src
  for src in "${source[@]}"; do
    src="${src%%::*}"
    src="${src##*/}"
    [[ $src = *.patch ]] || continue
    echo "Applying patch $src..."
    patch -Np1 < "../$src"
  done

  # Remove malformed SFH documentation.
  rm -f Documentation/hid/amd-sfh-hid.rst

  echo "Setting config..."
  cp ../config .config
  make olddefconfig

  make -s kernelrelease > version
  echo "Prepared $pkgbase version $(<version)"
}

build() {
  cd $_srcname
  make bzImage modules htmldocs
}

_package() {
  pkgdesc="The $pkgdesc kernel and modules"
  depends=(coreutils kmod initramfs)
  optdepends=('crda: to set the correct wireless channels of your country'
              'linux-firmware: firmware images needed for some devices')

  cd $_srcname
  local kernver="$(<version)"
  local modulesdir="$pkgdir/usr/lib/modules/$kernver"

  echo "Installing boot image..."
  # systemd expects to find the kernel here to allow hibernation
  # https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344
  install -Dm644 "$(make -s image_name)" "$modulesdir/vmlinuz"

  # Used by mkinitcpio to name the kernel
  echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase"

  echo "Installing modules..."
  make INSTALL_MOD_PATH="$pkgdir/usr" modules_install

  # remove build and source links
  rm "$modulesdir"/{source,build}

  echo "Fixing permissions..."
  chmod -Rc u=rwX,go=rX "$pkgdir"
}

_package-headers() {
  pkgdesc="Headers and scripts for building modules for the $pkgdesc kernel"

  cd $_srcname
  local builddir="$pkgdir/usr/lib/modules/$(<version)/build"

  echo "Installing build files..."
  install -Dt "$builddir" -m644 .config Makefile Module.symvers System.map \
    localversion.* version vmlinux
  install -Dt "$builddir/kernel" -m644 kernel/Makefile
  install -Dt "$builddir/arch/x86" -m644 arch/x86/Makefile
  cp -t "$builddir" -a scripts

  # add objtool for external module building and enabled VALIDATION_STACK option
  install -Dt "$builddir/tools/objtool" tools/objtool/objtool

  # add xfs and shmem for aufs building
  mkdir -p "$builddir"/{fs/xfs,mm}

  echo "Installing headers..."
  cp -t "$builddir" -a include
  cp -t "$builddir/arch/x86" -a arch/x86/include
  install -Dt "$builddir/arch/x86/kernel" -m644 arch/x86/kernel/asm-offsets.s

  install -Dt "$builddir/drivers/md" -m644 drivers/md/*.h
  install -Dt "$builddir/net/mac80211" -m644 net/mac80211/*.h

  # http://bugs.archlinux.org/task/13146
  install -Dt "$builddir/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h

  # http://bugs.archlinux.org/task/20402
  install -Dt "$builddir/drivers/media/usb/dvb-usb" -m644 drivers/media/usb/dvb-usb/*.h
  install -Dt "$builddir/drivers/media/dvb-frontends" -m644 drivers/media/dvb-frontends/*.h
  install -Dt "$builddir/drivers/media/tuners" -m644 drivers/media/tuners/*.h

  echo "Installing KConfig files..."
  find . -name 'Kconfig*' -exec install -Dm644 {} "$builddir/{}" \;

  echo "Removing unneeded architectures..."
  local arch
  for arch in "$builddir"/arch/*/; do
    [[ $arch = */x86/ ]] && continue
    echo "Removing $(basename "$arch")"
    rm -r "$arch"
  done

  echo "Removing documentation..."
  rm -r "$builddir/Documentation"

  echo "Removing broken symlinks..."
  find -L "$builddir" -type l -printf 'Removing %P\n' -delete

  echo "Removing loose objects..."
  find "$builddir" -type f -name '*.o' -printf 'Removing %P\n' -delete

  echo "Stripping build tools..."
  local file
  while read -rd '' file; do
    case "$(file -bi "$file")" in
      application/x-sharedlib\;*)      # Libraries (.so)
        strip -v $STRIP_SHARED "$file" ;;
      application/x-archive\;*)        # Libraries (.a)
        strip -v $STRIP_STATIC "$file" ;;
      application/x-executable\;*)     # Binaries
        strip -v $STRIP_BINARIES "$file" ;;
      application/x-pie-executable\;*) # Relocatable binaries
        strip -v $STRIP_SHARED "$file" ;;
    esac
  done < <(find "$builddir" -type f -perm -u+x ! -name vmlinux -print0)

  echo "Adding symlink..."
  mkdir -p "$pkgdir/usr/src"
  ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase"

  echo "Fixing permissions..."
  chmod -Rc u=rwX,go=rX "$pkgdir"
}

_package-docs() {
  pkgdesc="Documentation for the $pkgdesc kernel"

  cd $_srcname
  local builddir="$pkgdir/usr/lib/modules/$(<version)/build"

  echo "Installing documentation..."
  local src dst
  while read -rd '' src; do
    dst="${src#Documentation/}"
    dst="$builddir/Documentation/${dst#output/}"
    install -Dm644 "$src" "$dst"
  done < <(find Documentation -name '.*' -prune -o ! -type d -print0)

  echo "Adding symlink..."
  mkdir -p "$pkgdir/usr/share/doc"
  ln -sr "$builddir/Documentation" "$pkgdir/usr/share/doc/$pkgbase"

  echo "Fixing permissions..."
  chmod -Rc u=rwX,go=rX "$pkgdir"
}

pkgname=("$pkgbase" "$pkgbase-headers" "$pkgbase-docs")
for _p in "${pkgname[@]}"; do
  eval "package_$_p() {
    $(declare -f "_package${_p#$pkgbase}")
    _package${_p#$pkgbase}
  }"
done

# vim:set ts=8 sts=2 sw=2 et:

And this kernel config: http://ix.io/2chJ

Would you like to share your kernel config and your PKGBUILD as well?
Maybe there's something that I'm missing, or my 13" model just has some slightly different hardware, that is not yet supported.

PS:

$ cat /proc/cmdline 
root=UUID=835654de-1137-4c83-be10-4cf7d6879a32 rw initrd=\amd-ucode.img initrd=\initramfs-linux-sfh.img init=/usr/lib/systemd/systemd cryptdevice=UUID=28e49560-1d78-414d-9b2e-382646e87aaf:root amd_iommu=off

Last edited by schard (2020-02-21 11:25:59)

Offline

Board footer

Powered by FluxBB