parinzee / linux-surface-overlay

Gentoo Overlay with surface kernel and other utilities from linux-surface repo.
https://Parinz.github.io/linux-surface-overlay
BSD 3-Clause "New" or "Revised" License
27 stars 3 forks source link

eselect repository enable linux-surface error: linux-surface: repository not in repositories.xml[BUG] #8

Closed LazzaroneS closed 1 year ago

LazzaroneS commented 2 years ago

Describe the bug At about 29 minutes into the video,when I typed "eselect repository enable linux-surface", the response is "error: linux-surface: repository not in repositories.xml"

To Reproduce image

Expected behavior I want to know what should I do now?

parinzee commented 2 years ago

Hey there @LazzaroneS! Sorry for the late reply. It seems that this repo has been taken off the gentoo repository list due to me having missed a few pings from the gentoo org about some issues with the packages. If you still want to I can guide you through the manual method of getting the kernel installed. Also please tell me what device you’re using.

LazzaroneS commented 1 year ago

Thanks for your time, @parinzee. I'm eager to get your help. But I'm not quite sure what hardware information I need to provide, I used all the commands I know to view device information and filtered out the following information, I hope it's the device information which you need me tell you.

Linux archiso 5.19.6-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 31 Aug 2022 22:09:40 +0000 x86_64 Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz GenuineIntel GNU/Linux
DMI: Microsoft Corporation Surface Pro 4/Surface Pro 4, BIOS 109.3748.768 05.04.2021
efi: EFI v2.70 by MSFT
efi: ACPI=0x8befe000 ACPI 2.0=0x8befe014 TPMFinalLog=0x8bebc000 SMBIOS=0x8be32000 SMBIOS 3.0=0x8be30000 MEMATTR=0x89296018 ESRT=0x8929d798

(chroot) archiso / # cat /proc/meminfo
MemTotal:        3938112 kB
MemFree:         2254824 kB
MemAvailable:    3133096 kB
Buffers:          335036 kB
Cached:           584656 kB
...

$ lspci
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers (rev 08)
00:02.0 VGA compatible controller: Intel Corporation Skylake GT2 [HD Graphics 520] (rev 07)
00:05.0 Multimedia controller: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Imaging Unit (rev 01)
00:08.0 System peripheral: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th/8th Gen Core Processor Gaussian Mixture Model
00:14.0 USB controller: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller (rev 21)
00:14.2 Signal processing controller: Intel Corporation Sunrise Point-LP Thermal subsystem (rev 21)
00:14.3 Multimedia controller: Intel Corporation CSI-2 Host Controller (rev 01)00:15.0 Signal processing controller: Intel Corporation Sunrise Point-LP Serial IO I2C Controller #0 (rev 21)
00:15.1 Signal processing controller: Intel Corporation Sunrise Point-LP Serial IO I2C Controller #1 (rev 21)
00:15.2 Signal processing controller: Intel Corporation Sunrise Point-LP Serial IO I2C Controller #2 (rev 21)
00:15.3 Signal processing controller: Intel Corporation Sunrise Point-LP Serial IO I2C Controller #3 (rev 21)
00:16.0 Communication controller: Intel Corporation Sunrise Point-LP CSME HECI #1 (rev 21)
00:16.4 Communication controller: Intel Corporation iTouch Controller (rev 21) 00:1c.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #5 (rev f1)
00:1d.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #9 (rev f1)
00:1f.0 ISA bridge: Intel Corporation Sunrise Point-LP LPC Controller (rev 21) 00:1f.2 Memory controller: Intel Corporation Sunrise Point-LP PMC (rev 21)
00:1f.3 Audio device: Intel Corporation Sunrise Point-LP HD Audio (rev 21)
01:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM951/PM951 (rev 01)
02:00.0 Ethernet controller: Marvell Technology Group Ltd. 88W8897 [AVASTAR] 802.11ac Wireless
monomycelium commented 1 year ago

I have run into the same problem as well, with neither eselect-repository nor layman unable to find the repository. I would appreciate a guide to manually prepare the kernel.

Thank you in advance.

parinzee commented 1 year ago

Hello everyone sorry for the late reply. I've been quite busy this week.

@LazzaroneS that information will do, thanks! So the idea is that we will be compiling the kernel so you can go ahead and emerge the latest kernel sources like you would in a normal gentoo installation (see here for more info https://wiki.gentoo.org/wiki/Handbook:AMD64/Full/Installation#Installing_the_sources). After that we will be patching the sources with the linux-surface patches. To do that, clone the repo down:

cd /usr/src/ && git clone https://github.com/linux-surface/linux-surface.git

then cd into the kernel folder (cd linux) and then depending on what version you're using, apply the patches for those version by doing:

for i in ~/linux-surface/patches/[VERSION]/*.patch; do patch -p1 < $i; done

After that you can go ahead and configure the kernel as I did in the video. Finally download my kernel config (like in the video) and run the make menuconfig. However since the config is a bit old, you may have to manually update some parts of it. I don't specifically know what options you will be presented with, but I am happy to assist everyone.

PS: After you've manually updated some parts of the kernel ensure that these options are selected:

Processor type and features --->
  [*] EFI runtime service support
  [*]   EFI stub support

Device Drivers --->
  <*> NVM Express block device
  [*] Network device support --->
    [*] Wireless LAN --->
      [*] Marvell devices
        [M] Marvell WiFi-Ex Driver
          [M] Marvell WiFi-Ex Driver for PCIE 8766/8897/8997
  [*] USB support --->
    <*> xHCI HCD (USB 3.0) support
monomycelium commented 1 year ago
stupid questions I have some questions (and errors): 1. In your [other guide](https://github.com/parinzee/Gentoo-Surface), you told us to enter this (replace `gentoo-sources` with `surface-sources` in the video) to get the latest kernel sources: ``` echo sys-kernel/gentoo-sources ~amd64 >> /etc/portage/package.accept_keywords ``` However, `/etc/portage/package.accept_keywords` is now a directory. Should I treat it like a config directory and echo `sys-kernel/gentoo-sources ~amd64` into a file instead? I really hope to get my hands on kernel 6.0.0 on my Surface. 2. In my frustration, I have removed the `linux-5.15.69` directory in `/usr/src` in hopes of reinstalling it (since I was not sure how to use `emerge` to do it), and lookie lookie: there was a [guide for that](https://wiki.gentoo.org/wiki/Kernel/Removal). Now, I cannot fetch kernel sources using emerge anymore: command | log ---|--- `emerge sys-kernel/gentoo-sources` | [emerge1.log](https://github.com/parinzee/linux-surface-overlay/files/9738148/emerge1.log) `emerge --info '=sys-kernel/gentoo-sources-5.15.69::gentoo'` | [emerge2.log](https://github.com/parinzee/linux-surface-overlay/files/9738149/emerge2.log) `emerge -pqv '=sys-kernel/gentoo-sources-5.15.69::gentoo'` | [emerge3.log](https://github.com/parinzee/linux-surface-overlay/files/9738150/emerge3.log) `/var/tmp/portage/sys-kernel/gentoo-sources-5.15.69/temp/build.log` | [emerge4.log](https://github.com/parinzee/linux-surface-overlay/files/9738151/emerge4.log) `/var/tmp/portage/sys-kernel/gentoo-sources-5.15.69/temp/environment` | [emerge5.log](https://github.com/parinzee/linux-surface-overlay/files/9738152/emerge5.log) --- Me being impatient (and giving up on Gentoo every now and then), I decided to roll with kernel 5.19 ``` cd /usr/src git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git --branch linux-5.19.y ``` Then, I applied the patches: ``` cd linux for i in ../linux-surface/patches/5.19/*.patch; do patch -p1 < $i; done ``` I'm moving on now.

update

sorry for those stupid questions. after actually switching to gentoo as a daily driver on another device, every command makes sense now. i'm trying again right now on my surface since i'm in love with gentoo. one question: if i do this, can i use kernel 6.0?


resolution

I've got my Surface running Gentoo with kernel 6.0.9! Thanks for your support, @parinzee!

         -/oyddmdhs+:.                 ay@surface
     -odNMMMMMMMMNNmhy+-`              ----------
   -yNMMMMMMMMMMMNNNmmdhy+-            OS: Gentoo 2.9 x86_64
 `omMMMMMMMMMMMMNmdmmmmddhhy/`         Host: Surface Pro 124000000000000000000000D:0B:08F:5C:09P:38S:01E:0
 omMMMMMMMMMMMNhhyyyohmdddhhhdo`       Kernel: 6.0.9-gentoo
.ydMMMMMMMMMMdhs++so/smdddhhhhdm+`     Uptime: 3 mins
 oyhdmNMMMMMMMNdyooydmddddhhhhyhNd.    Packages: 351 (emerge)
  :oyhhdNNMMMMMMMNNNmmdddhhhhhyymMh    Shell: bash 5.1.16
    .:+sydNMMMMMNNNmmmdddhhhhhhmMmy    Resolution: 2736x1824
       /mMMMMMMNNNmmmdddhhhhhmMNhs:    Terminal: /dev/pts/0
    `oNMMMMMMMNNNmmmddddhhdmMNhs+`     CPU: Intel Core i5-7300U (4) @ 3.5 GHz
  `sNMMMMMMMMNNNmmmdddddmNMmhs/.       Memory: 70.60 MiB / 3.76 GiB (1%)
 /NMMMMMMMMNNNNmmmdddmNMNdso:`         Disk (/): 8.02 GiB / 111 GiB (7%)
+MMMMMMMNNNNNmmmmdmNMNdso/-            Disk (/home): 8.02 GiB / 111 GiB (7%)
yMMNNNNNNNmmmmmNNMmhs+/-`              Locale: en_SG.utf8
/hMMNNNNNNNNMNdhs++/-`    
`/ohdmmddhys+++/:.`                    ████████████████████████
  `-//////:--.                         ████████████████████████
LazzaroneS commented 1 year ago

Thanks you, @parinzee. Your recent reply helped me with my compilation, and despite some stumbling, I have managed to boot from the freshly installed environment, Really appreciate! Just can't connect to the internet, I don't know if it's because I encountered some problems while patching, I'll post it for you to see:

(chroot) archiso /usr/src/linux # for i in ../linux-surface/patches/5.9/*.patch; do patch -p1 < $i; done

can't find file to patch at input line 46
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From d93b56bac7f6c758169c8c31a223a5bf897e997c Mon Sep 17 00:00:00 2001
|From: Tsuchiya Yuto <kitakar@gmail.com>
|Date: Sun, 18 Oct 2020 16:42:44 +0900
|Subject: [PATCH] (surface3-oemb) add DMI matches for Surface 3 with broken DMI
| table
|
|On some Surface 3, the DMI table gets corrupted for unknown reasons
|and breaks existing DMI matching used for device-specific quirks.
|
|This commit adds the (broken) DMI data into dmi_system_id tables used
|for quirks so that each driver can enable quirks even on the affected
|systems.
|
|On affected systems, DMI data will look like this:
|    $ grep . /sys/devices/virtual/dmi/id/{bios_vendor,board_name,board_vendor,\
|    chassis_vendor,product_name,sys_vendor}
|    /sys/devices/virtual/dmi/id/bios_vendor:American Megatrends Inc.
|    /sys/devices/virtual/dmi/id/board_name:OEMB
|    /sys/devices/virtual/dmi/id/board_vendor:OEMB
|    /sys/devices/virtual/dmi/id/chassis_vendor:OEMB
|    /sys/devices/virtual/dmi/id/product_name:OEMB
|    /sys/devices/virtual/dmi/id/sys_vendor:OEMB
|
|Expected:
|    $ grep . /sys/devices/virtual/dmi/id/{bios_vendor,board_name,board_vendor,\
|    chassis_vendor,product_name,sys_vendor}
|    /sys/devices/virtual/dmi/id/bios_vendor:American Megatrends Inc.
|    /sys/devices/virtual/dmi/id/board_name:Surface 3
|    /sys/devices/virtual/dmi/id/board_vendor:Microsoft Corporation
|    /sys/devices/virtual/dmi/id/chassis_vendor:Microsoft Corporation
|    /sys/devices/virtual/dmi/id/product_name:Surface 3
|    /sys/devices/virtual/dmi/id/sys_vendor:Microsoft Corporation
|
|Signed-off-by: Tsuchiya Yuto <kitakar@gmail.com>
|Patchset: surface3-oemb
|---
| drivers/platform/x86/surface3-wmi.c               | 7 +++++++
| sound/soc/codecs/rt5645.c                         | 9 +++++++++
| sound/soc/intel/common/soc-acpi-intel-cht-match.c | 8 ++++++++
| 3 files changed, 24 insertions(+)
|
|diff --git a/drivers/platform/x86/surface3-wmi.c b/drivers/platform/x86/surface3-wmi.c
|index 130b6f52a600..801083aa56d6 100644
|--- a/drivers/platform/x86/surface3-wmi.c
|+++ b/drivers/platform/x86/surface3-wmi.c
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
patching file sound/soc/codecs/rt5645.c
Hunk #1 succeeded at 3735 (offset 48 lines).
patching file sound/soc/intel/common/soc-acpi-intel-cht-match.c
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file sound/soc/intel/common/soc-acpi-intel-cht-match.c.rej
patching file drivers/net/wireless/marvell/mwifiex/pcie.c
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
3 out of 3 hunks ignored -- saving rejects to file drivers/net/wireless/marvell/mwifiex/pcie.c.rej
patching file drivers/net/wireless/marvell/mwifiex/pcie.h
Hunk #1 FAILED at 391.
1 out of 1 hunk FAILED -- saving rejects to file drivers/net/wireless/marvell/mwifiex/pcie.h.rej
patching file drivers/net/wireless/marvell/mwifiex/Makefile
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]

Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file drivers/net/wireless/marvell/mwifiex/Makefile.rej
patching file drivers/net/wireless/marvell/mwifiex/pcie.c
Reversed (or previously applied) patch detected!  Assume -R? [n] Apply anyway? [n]
Skipping patch.
2 out of 2 hunks ignored -- saving rejects to file drivers/net/wireless/marvell/mwifiex/pcie.c.rej
patching file drivers/net/wireless/marvell/mwifiex/pcie.h
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file drivers/net/wireless/marvell/mwifiex/pcie.h.rej
The next patch would create the file drivers/net/wireless/marvell/mwifiex/pcie_quirks.c,
which already exists!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored
The next patch would create the file drivers/net/wireless/marvell/mwifiex/pcie_quirks.h,
which already exists!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored
patching file drivers/net/wireless/marvell/mwifiex/pcie.c
Hunk #1 FAILED at 380.
1 out of 1 hunk FAILED -- saving rejects to file drivers/net/wireless/marvell/mwifiex/pcie.c.rej
patching file drivers/net/wireless/marvell/mwifiex/pcie_quirks.c
Hunk #1 FAILED at 21.
Hunk #2 FAILED at 30.
Hunk #3 FAILED at 39.
Hunk #4 FAILED at 47.
Hunk #5 FAILED at 55.
Hunk #6 FAILED at 63.
Hunk #7 FAILED at 71.
Hunk #8 FAILED at 79.
Hunk #9 FAILED at 111.
9 out of 9 hunks FAILED -- saving rejects to file drivers/net/wireless/marvell/mwifiex/pcie_quirks.c.rej
patching file drivers/net/wireless/marvell/mwifiex/pcie_quirks.h
Hunk #1 FAILED at 6.
1 out of 1 hunk FAILED -- saving rejects to file drivers/net/wireless/marvell/mwifiex/pcie_quirks.h.rej
patching file drivers/net/wireless/marvell/mwifiex/pcie.c
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file drivers/net/wireless/marvell/mwifiex/pcie.c.rej
patching file drivers/net/wireless/marvell/mwifiex/pcie_quirks.c
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
4 out of 4 hunks ignored -- saving rejects to file drivers/net/wireless/marvell/mwifiex/pcie_quirks.c.rej
patching file drivers/net/wireless/marvell/mwifiex/pcie_quirks.h
Hunk #1 FAILED at 7.
1 out of 1 hunk FAILED -- saving rejects to file drivers/net/wireless/marvell/mwifiex/pcie_quirks.h.rej
patching file drivers/net/wireless/marvell/mwifiex/pcie_quirks.c
Hunk #1 succeeded at 101 with fuzz 2 (offset 1 line).
patching file drivers/net/wireless/marvell/mwifiex/main.c
Hunk #1 succeeded at 1513 with fuzz 2 (offset 44 lines).
patching file drivers/net/wireless/marvell/mwifiex/main.c
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
2 out of 2 hunks ignored -- saving rejects to file drivers/net/wireless/marvell/mwifiex/main.c.rej
patching file drivers/net/wireless/marvell/mwifiex/pcie.c
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
4 out of 4 hunks ignored -- saving rejects to file drivers/net/wireless/marvell/mwifiex/pcie.c.rej
patching file drivers/net/wireless/marvell/mwifiex/pcie.c
Hunk #1 succeeded at 182 with fuzz 2 (offset 148 lines).
Hunk #2 FAILED at 2796.
1 out of 2 hunks FAILED -- saving rejects to file drivers/net/wireless/marvell/mwifiex/pcie.c.rej
patching file drivers/net/wireless/marvell/mwifiex/pcie.c
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
2 out of 2 hunks ignored -- saving rejects to file drivers/net/wireless/marvell/mwifiex/pcie.c.rej
patching file drivers/net/wireless/marvell/mwifiex/pcie_quirks.c
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
9 out of 9 hunks ignored -- saving rejects to file drivers/net/wireless/marvell/mwifiex/pcie_quirks.c.rej
patching file drivers/net/wireless/marvell/mwifiex/pcie_quirks.h
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file drivers/net/wireless/marvell/mwifiex/pcie_quirks.h.rej
patching file drivers/net/wireless/marvell/mwifiex/cfg80211.c
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
2 out of 2 hunks ignored -- saving rejects to file drivers/net/wireless/marvell/mwifiex/cfg80211.c.rej
patching file drivers/net/wireless/marvell/mwifiex/cfg80211.c
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file drivers/net/wireless/marvell/mwifiex/cfg80211.c.rej
patching file drivers/net/wireless/marvell/mwifiex/sta_cmd.c
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file drivers/net/wireless/marvell/mwifiex/sta_cmd.c.rej
patching file drivers/misc/mei/init.c
Hunk #1 FAILED at 302.
1 out of 1 hunk FAILED -- saving rejects to file drivers/misc/mei/init.c.rej
patching file drivers/misc/mei/hw-me-regs.h
Hunk #1 FAILED at 92.
1 out of 1 hunk FAILED -- saving rejects to file drivers/misc/mei/hw-me-regs.h.rej
patching file drivers/misc/mei/pci-me.c
Hunk #1 FAILED at 96.
... // Some else are omitted here
1 out of 1 hunk ignored
patching file drivers/hid/hid-multitouch.c
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
11 out of 11 hunks ignored -- saving rejects to file drivers/hid/hid-multitouch.c.rej

This time it was mainly based on the handbook content to configure the kernel, system, and bootloader, Now I will continue to follow your video and try some more.

Looking forward to seeing your reply again!

LazzaroneS commented 1 year ago

Failed to compile

I found that many of the Surface-specific drivers need to be configured in the .config file, so I tried to recompile the kernel using the .config file you (@parinzee ) provided, and it failed to compile

(chroot) archiso /usr/src/linux # make -j3 &&  make modules_install
  CC      scripts/mod/devicetable-offsets.s
  DESCEND objtool
In file included from scripts/mod/devicetable-offsets.c:3:
./include/linux/mod_devicetable.h:920:8: error: redefinition of ‘struct ssam_device_id’
  920 | struct ssam_device_id {
      |        ^~~~~~~~~~~~~~
./include/linux/mod_devicetable.h:864:8: note: originally defined here
  864 | struct ssam_device_id {
      |        ^~~~~~~~~~~~~~
./include/linux/mod_devicetable.h:938:8: error: redefinition of ‘struct ssam_device_id’
  938 | struct ssam_device_id {
      |        ^~~~~~~~~~~~~~
./include/linux/mod_devicetable.h:920:8: note: originally defined here
  920 | struct ssam_device_id {
      |        ^~~~~~~~~~~~~~
./include/linux/mod_devicetable.h:956:8: error: redefinition of ‘struct ssam_device_id’
  956 | struct ssam_device_id {
      |        ^~~~~~~~~~~~~~
./include/linux/mod_devicetable.h:938:8: note: originally defined here
  938 | struct ssam_device_id {
      |        ^~~~~~~~~~~~~~
make[1]: *** [scripts/Makefile.build:117: scripts/mod/devicetable-offsets.s] Error 1
make: *** [Makefile:1204: prepare0] Error 2
make: *** Waiting for unfinished jobs....
parinzee commented 1 year ago

Hmmm. I think the reason it failed to compile was the because the surface-patchset and gentoo patchset probably overlap on somethings. However from the log you provided, I'm not sure which file has failed to patch. If that patch doesn't relate to your device I think you can remove it.

parinzee commented 1 year ago

For now, I'll attempt to find a version that doesn't overlap with the patchset for you @LazzaroneS!

And congratulations on getting the install to work! It took me over 2 weeks and 10 tries to get mine working for the first time lol (and the internet didn't even worked)

LazzaroneS commented 1 year ago

Hahaha, I didn't expect a master like Parin to have such an experience. Facing problems head-on, day in and day out, learning like @parinzee.

Your friendly help has given me great encouragement, I find I like open source communities more than before. 😃 Thank you again for your time!