You are not logged in.

#1 2022-08-04 19:17:08

Morta
Member
Registered: 2019-07-07
Posts: 433

Build Kernel 5.18.16 without framebuffer issue since 5.18.13

git clone https://github.com/archlinux/linux.git
git checkout 13d97fdaade94ad1e9f4853004390d4787106dd6 # Kernel 5.18.16
git revert 07186778cf645cc79e6913a28dadf445cd3e2439  # revert framebuffer issue
make 
make modules
sudo make modules_install
make bzImage
yay -S nvidia-dkms
make modules
sudo make modules_install
make bzImage
sudo cp -v arch/x86/boot/bzImage /boot/vmlinuz-linux
sudo mkinitcpio -P

breaks modules on boot and doesn't work 5.18.16 kernel doesn't work either

So somebody can say how I can compile a working 5.18.16 kernel?

Offline

#2 2022-08-05 17:49:37

Morta
Member
Registered: 2019-07-07
Posts: 433

Re: Build Kernel 5.18.16 without framebuffer issue since 5.18.13

No one?

Offline

#3 2022-08-05 18:05:40

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 132

Re: Build Kernel 5.18.16 without framebuffer issue since 5.18.13

Morta wrote:

So somebody can say how I can compile a working 5.18.16 kernel?

https://wiki.archlinux.org/title/Kernel … ild_System

Offline

#4 2022-08-05 18:39:36

Morta
Member
Registered: 2019-07-07
Posts: 433

Re: Build Kernel 5.18.16 without framebuffer issue since 5.18.13

dimich wrote:
Morta wrote:

So somebody can say how I can compile a working 5.18.16 kernel?

https://wiki.archlinux.org/title/Kernel … ild_System

I know how compile a working kernel but I can’t revert the framebuffer without breaking the whole 5.18.16 kernel

Offline

#5 2022-08-05 18:45:05

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 132

Re: Build Kernel 5.18.16 without framebuffer issue since 5.18.13

Morta wrote:

I know how compile a working kernel but I can’t revert the framebuffer without breaking the whole 5.18.16 kernel

Put your reverting patch into PKGBUILD directory and update PKGBUILD `source` and `sha256sums` with patch filename and its SHA256 sum (or set it to 'SKIP').

Offline

#6 2022-08-05 19:49:51

Morta
Member
Registered: 2019-07-07
Posts: 433

Re: Build Kernel 5.18.16 without framebuffer issue since 5.18.13

==> Starting prepare()...
patching file drivers/video/fbdev/core/fbmem.c
Reversed (or previously applied) patch detected!  Skipping patch.
2 out of 2 hunks ignored -- saving rejects to file drivers/video/fbdev/core/fbmem.c.rej
==> ERROR: A failure occurred in prepare().
    Aborting...

What means that?

Last edited by Morta (2022-08-05 20:26:15)

Offline

#7 2022-08-05 21:10:09

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 132

Re: Build Kernel 5.18.16 without framebuffer issue since 5.18.13

Morta wrote:

I didn't found a good sample

1. Export linux PKGBUILD repository as described in wiki article:

$ asp update linux
$ asp export linux

2. Download package sources:

$ cd linux
$ makepkg -o

3. Go to sources and create reverse patch for specific commit:

$ cd src/archlinux
$ git show -p -R 07186778cf645cc79e6913a28dadf445cd3e243 > ../../nofb.patch

4. Go back to PKGBUILD and edit it: add 'nofb.patch' to source list and 'SKIP' to sha256sums.

source=(
  "$_srcname::git+https://github.com/archlinux/linux?signed#tag=$_srctag"
  config         # the main kernel config file
  nofb.patch
)
...
sha256sums=('SKIP'
            '77fdfe47d8ab448787ac9cc4b73ad6d44ded735a4a001005e39301f6ddb553b4'
            'SKIP')

5. To speed up build you can also remove `htmldocs` from build function and and `"$pkgbase-docs"` from `pkgname`:

build() {
  cd $_srcname
  make all
}
...
pkgname=("$pkgbase" "$pkgbase-headers")

6. Then build packages:

$ makepkg

7. And install them:

$ sudo pacman -U linux-5.18.16.arch1-1-x86_64.pkg.tar.zst linux-headers-5.18.16.arch1-1-x86_64.pkg.tar.zst

Also it is possible to build packages without creating dedicated patch file. Instead of steps 3, 4 just go to sources and revert commit:

$ cd src/archlinux
$ git revert --no-edit 07186778cf645cc79e6913a28dadf445cd3e243

And in step 6 build packages with existing sources:

$ makepkg -e

It is little bit faster but you'll need to revert commit every time as sources re-downloaded. And probably you'll need to configure git.

Offline

#8 2022-08-05 21:28:41

loqs
Member
Registered: 2014-03-06
Posts: 15,102

Re: Build Kernel 5.18.16 without framebuffer issue since 5.18.13

Morta wrote:

No one?

https://bugzilla.kernel.org/show_bug.cgi?id=216303#c14

@dimich the commit can be reverted as part of the PKGBUILD

git diff
diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD
index 6b0de72..126024b 100644
--- a/trunk/PKGBUILD
+++ b/trunk/PKGBUILD
@@ -40,6 +40,8 @@ prepare() {
   echo "-$pkgrel" > localversion.10-pkgrel
   echo "${pkgbase#linux}" > localversion.20-pkgname
 
+  git revert -n 07186778cf645cc79e6913a28dadf445cd3e2439
+
   local src
   for src in "${source[@]}"; do
     src="${src%%::*}"

Offline

#9 2022-08-05 21:36:03

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 132

Re: Build Kernel 5.18.16 without framebuffer issue since 5.18.13

loqs wrote:

@dimich the commit can be reverted as part of the PKGBUILD

Indeed. I didn't think of it this way. Thank you.

Last edited by dimich (2022-08-05 21:36:32)

Offline

#10 2022-08-06 14:39:50

Morta
Member
Registered: 2019-07-07
Posts: 433

Re: Build Kernel 5.18.16 without framebuffer issue since 5.18.13

loqs wrote:
Morta wrote:

No one?

https://bugzilla.kernel.org/show_bug.cgi?id=216303#c14

@dimich the commit can be reverted as part of the PKGBUILD

git diff
diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD
index 6b0de72..126024b 100644
--- a/trunk/PKGBUILD
+++ b/trunk/PKGBUILD
@@ -40,6 +40,8 @@ prepare() {
   echo "-$pkgrel" > localversion.10-pkgrel
   echo "${pkgbase#linux}" > localversion.20-pkgname
 
+  git revert -n 07186778cf645cc79e6913a28dadf445cd3e2439
+
   local src
   for src in "${source[@]}"; do
     src="${src%%::*}"

@loqs where I have to add it in the PKGBUILD?

Offline

#11 2022-08-06 14:52:48

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,477

Re: Build Kernel 5.18.16 without framebuffer issue since 5.18.13

In the 'prepare' function above line #43 - linux 5.19.arch1-1 ...

Offline

#12 2022-08-06 14:55:34

Morta
Member
Registered: 2019-07-07
Posts: 433

Re: Build Kernel 5.18.16 without framebuffer issue since 5.18.13

dimich wrote:
Morta wrote:

I didn't found a good sample

1. Export linux PKGBUILD repository as described in wiki article:

$ asp update linux
$ asp export linux

2. Download package sources:

$ cd linux
$ makepkg -o

3. Go to sources and create reverse patch for specific commit:

$ cd src/archlinux
$ git show -p -R 07186778cf645cc79e6913a28dadf445cd3e243 > ../../nofb.patch

4. Go back to PKGBUILD and edit it: add 'nofb.patch' to source list and 'SKIP' to sha256sums.

source=(
  "$_srcname::git+https://github.com/archlinux/linux?signed#tag=$_srctag"
  config         # the main kernel config file
  nofb.patch
)
...
sha256sums=('SKIP'
            '77fdfe47d8ab448787ac9cc4b73ad6d44ded735a4a001005e39301f6ddb553b4'
            'SKIP')

5. To speed up build you can also remove `htmldocs` from build function and and `"$pkgbase-docs"` from `pkgname`:

build() {
  cd $_srcname
  make all
}
...
pkgname=("$pkgbase" "$pkgbase-headers")

6. Then build packages:

$ makepkg

7. And install them:

$ sudo pacman -U linux-5.18.16.arch1-1-x86_64.pkg.tar.zst linux-headers-5.18.16.arch1-1-x86_64.pkg.tar.zst

Also it is possible to build packages without creating dedicated patch file. Instead of steps 3, 4 just go to sources and revert commit:

$ cd src/archlinux
$ git revert --no-edit 07186778cf645cc79e6913a28dadf445cd3e243

And in step 6 build packages with existing sources:

$ makepkg -e

It is little bit faster but you'll need to revert commit every time as sources re-downloaded. And probably you'll need to configure git.

Thanks dmichi. Stay strong against invasion!

Offline

#13 2022-08-06 14:56:08

Morta
Member
Registered: 2019-07-07
Posts: 433

Re: Build Kernel 5.18.16 without framebuffer issue since 5.18.13

qinohe wrote:

In the 'prepare' function above line #43 - linux 5.19.arch1-1 ...

Thx

Offline

#14 2022-08-06 19:05:37

Morta
Member
Registered: 2019-07-07
Posts: 433

Re: Build Kernel 5.18.16 without framebuffer issue since 5.18.13

prepare() {
   git diff
   diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD
   echo "-$pkgrel" > localversion.10-pkgrel
   echo "${pkgbase#linux}" > localversion.20-pkgname
 
   git revert -n 07186778cf645cc79e6913a28dadf445cd3e2439

   local src
   for src in "${source[@]}"; do
     src="${src%%::*}"
   cd $_srcname

  # fix NFSv4 mounting issue regression - FS#73838 / FS#73860
  # https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=6f2836341d8a39e1e000572b10959347d7e61fd9
  patch -Rp1 -i ../0006_fix_NFSv4_mount_regression.diff

  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

  echo "Setting config..."
  cp ../config .config
  make olddefconfig
#  diff -u ../config .config || :
#return 1
  make -s kernelrelease > version
  echo "Prepared $pkgbase version $(<version)"
}

What is wrong? Gives me a

syntax error near unexpected token `}'

at the last line

Offline

#15 2022-08-06 19:37:26

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 132

Re: Build Kernel 5.18.16 without framebuffer issue since 5.18.13

Morta wrote:
syntax error near unexpected token `}'
for src in "${source[@]}"; do

has no `done` operator.

Also i guess it should

cd $_srcname

before git revert and other operations with sources.

Morta wrote:

Stay strong against invasion!

Thank you!

Offline

#16 2022-08-07 10:12:07

Morta
Member
Registered: 2019-07-07
Posts: 433

Re: Build Kernel 5.18.16 without framebuffer issue since 5.18.13

dimich wrote:
Morta wrote:
syntax error near unexpected token `}'
for src in "${source[@]}"; do

has no `done` operator.

Also i guess it should

cd $_srcname

before git revert and other operations with sources.

Morta wrote:

Stay strong against invasion!

Thank you!

You the man! THX!

Offline

Board footer

Powered by FluxBB