You are not logged in.

#1 2017-05-07 23:34:50

nicolo
Banned
Registered: 2013-08-10
Posts: 90

[solved] Arch ABS with old kernels

This is probably a silly question, but how can I instruct the Arch Linux ABS system to build for me some older kernel version, instead of the current one, if this is possible?

Last edited by nicolo (2017-06-06 13:20:11)

Offline

#2 2017-05-07 23:53:05

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [solved] Arch ABS with old kernels

You can't. ABS just rsyncs to the current versions.

This sounds like an X-Y problem. What are you actually trying to acheive?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2017-05-08 00:08:58

nicolo
Banned
Registered: 2013-08-10
Posts: 90

Re: [solved] Arch ABS with old kernels

I see. I'm testing with different kernel versions to fix a bug that affects certain Thinkpad laptops, and I need to build a kernel older than 4.9, and wanted to use ABS. What are my options then?

Offline

#4 2017-05-08 00:17:06

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,534
Website

Re: [solved] Arch ABS with old kernels

Why do you need to build different versions to see which one is affected.  Building a kernel cant take a good while depending on your hardware - building several would be a real PITA.  If you just need to install an older version to identify which versions are/are-not affected then there is no need to build them yourself.

But in any case:
https://wiki.archlinux.org/index.php/Bisecting_bugs


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2017-05-08 00:29:41

nicolo
Banned
Registered: 2013-08-10
Posts: 90

Re: [solved] Arch ABS with old kernels

As per this message, it looks like I need access to the kernel tree itself, in order to make acpi and use "ec" tool under tools/power/acpi, or am I not understanding correctly?

Offline

#6 2017-05-08 09:14:21

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: [solved] Arch ABS with old kernels

These tools rarely change, there is a good chance that the tool you built from 4.9 source will work on 4.8 kernels from Arch repo too.

Just in case, when you will be uploading the results note that you used 4.9 tool on 4.8 kernel and ask if it makes any difference to them.

Offline

#7 2017-05-08 11:44:52

nicolo
Banned
Registered: 2013-08-10
Posts: 90

Re: [solved] Arch ABS with old kernels

I see, thanks. Just for completeness: the only other way to do it, would be to pull it from git and build the usual way, right?

Offline

#8 2017-05-08 12:16:23

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: [solved] Arch ABS with old kernels

Either git or just a 4.8 tarball from kernel.org. Much smaller download.

Offline

#9 2017-05-08 14:32:45

loqs
Member
Registered: 2014-03-06
Posts: 17,377

Re: [solved] Arch ABS with old kernels

Alternate way to get the last 4.8 release for the arch linux package

$ git clone git://git.archlinux.org/svntogit/packages.git --single-branch --branch "packages/linux"
Cloning into 'packages'...
remote: Counting objects: 4779, done.
remote: Compressing objects: 100% (2993/2993), done.
remote: Total 4779 (delta 2070), reused 4291 (delta 1766)
Receiving objects: 100% (4779/4779), 1.40 MiB | 0 bytes/s, done.
Resolving deltas: 100% (2070/2070), done. 
$ cd packages/trunk/
$ git checkout d59764443634990fb9c058e31515af5692de44ce
Note: checking out 'd59764443634990fb9c058e31515af5692de44ce'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at d597644... upgpkg: linux 4.8.13-1
$ cd ../..
$ cp -r packages/trunk/ linux

Offline

#10 2017-05-08 14:36:50

nicolo
Banned
Registered: 2013-08-10
Posts: 90

Re: [solved] Arch ABS with old kernels

Thank you, that's useful. Can I then use ABS with that, or will I need to build the traditional way?
A side question: should I just want to install from pacman an older package version, what is the way to go, if possible?

Offline

#11 2017-05-08 14:42:26

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,561

Re: [solved] Arch ABS with old kernels

I'm guessing you're thinking of the ABS as something like openSUSE's open build system. It's not. It's simply a way to obtain the PKGBUILD and related files.

Offline

#12 2017-05-08 14:50:49

loqs
Member
Registered: 2014-03-06
Posts: 17,377

Re: [solved] Arch ABS with old kernels

$ cd linux/
linux]$ ls
99-linux.hook
change-default-console-loglevel.patch
config
config.x86_64
fix_race_condition_in_packet_set_ring.diff
linux.install
linux.preset
net_handle_no_dst_on_skb_in_icmp6_send.patch
PKGBUILD

makepkg will make you the kernel package for the extra tool (ec) you could adjust the PKGBUILD or make it manually.

Last edited by loqs (2017-05-08 14:51:41)

Offline

#13 2017-05-08 16:28:11

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: [solved] Arch ABS with old kernels

Old packages can be found in /var/cache/pacman/pkg and at archive.archlinux.org.

Offline

#14 2017-06-04 21:19:37

nicolo
Banned
Registered: 2013-08-10
Posts: 90

Re: [solved] Arch ABS with old kernels

Actually, this produces an error for me:

mkdir build
cd build/
git clone git://git.archlinux.org/svntogit/packages.git --single-branch --branch "packages/linux"
cd packages/trunk
git checkout d59764443634990fb9c058e31515af5692de44ce
cd ../..
cp -r packages/trunk/ linux
cd linux
makepkg -o

edit PKGBUILD to change name to custom, edit config and add file to include folder as described here

updpkgsums
makepkg -s

gives error

LD      init/built-in.o
kernel/built-in.o: In function `update_wall_time':
(.text+0x7c377): undefined reference to `____ilog2_NaN'
make: *** [Makefile:951: vmlinux] Error 1
==> ERROR: A failure occurred in build().
    Aborting...

Last edited by nicolo (2017-06-05 00:03:23)

Offline

#15 2017-06-04 21:45:07

loqs
Member
Registered: 2014-03-06
Posts: 17,377

Re: [solved] Arch ABS with old kernels

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72785
Edit:
See particularly comment 30

Last edited by loqs (2017-06-04 21:45:47)

Offline

#16 2017-06-04 22:47:31

nicolo
Banned
Registered: 2013-08-10
Posts: 90

Re: [solved] Arch ABS with old kernels

Thank you, will try to apply the patch.

Offline

#17 2017-06-05 00:48:41

nicolo
Banned
Registered: 2013-08-10
Posts: 90

Re: [solved] Arch ABS with old kernels

Unfortunately, I still get error

LD      drivers/built-in.o
==> ERROR: A failure occurred in build().
    Aborting...

if I repeat the above procedure, moreover issuing just before

updpkgsums

the command

patch -p1 < linus.patch

where the file linus.patch above and below is taken from here. Where am I wrong now ? sad

diff --git a/include/linux/log2.h b/include/linux/log2.h
index ef3d4f6..c373295 100644
--- a/include/linux/log2.h
+++ b/include/linux/log2.h
@@ -16,12 +16,6 @@
 #include <linux/bitops.h>
 
 /*
- * deal with unrepresentable constant logarithms
- */
-extern __attribute__((const, noreturn))
-int ____ilog2_NaN(void);
-
-/*
  * non-constant log of base 2 calculators
  * - the arch may override these in asm/bitops.h if they can be implemented
  *   more efficiently than using fls() and fls64()
@@ -85,7 +79,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
 #define ilog2(n)				\
 (						\
 	__builtin_constant_p(n) ? (		\
-		(n) < 1 ? ____ilog2_NaN() :	\
+		(n) < 2 ? 0 :			\
 		(n) & (1ULL << 63) ? 63 :	\
 		(n) & (1ULL << 62) ? 62 :	\
 		(n) & (1ULL << 61) ? 61 :	\
@@ -148,10 +142,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
 		(n) & (1ULL <<  4) ?  4 :	\
 		(n) & (1ULL <<  3) ?  3 :	\
 		(n) & (1ULL <<  2) ?  2 :	\
-		(n) & (1ULL <<  1) ?  1 :	\
-		(n) & (1ULL <<  0) ?  0 :	\
-		____ilog2_NaN()			\
-				   ) :		\
+		1 ) :				\
 	(sizeof(n) <= 4) ?			\
 	__ilog2_u32(n) :			\
 	__ilog2_u64(n)				\
diff --git a/tools/include/linux/log2.h b/tools/include/linux/log2.h
index 4144666..d5677d3 100644
--- a/tools/include/linux/log2.h
+++ b/tools/include/linux/log2.h
@@ -13,12 +13,6 @@
 #define _TOOLS_LINUX_LOG2_H
 
 /*
- * deal with unrepresentable constant logarithms
- */
-extern __attribute__((const, noreturn))
-int ____ilog2_NaN(void);
-
-/*
  * non-constant log of base 2 calculators
  * - the arch may override these in asm/bitops.h if they can be implemented
  *   more efficiently than using fls() and fls64()
@@ -78,7 +72,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
 #define ilog2(n)				\
 (						\
 	__builtin_constant_p(n) ? (		\
-		(n) < 1 ? ____ilog2_NaN() :	\
+		(n) < 2 ? 0 :			\
 		(n) & (1ULL << 63) ? 63 :	\
 		(n) & (1ULL << 62) ? 62 :	\
 		(n) & (1ULL << 61) ? 61 :	\
@@ -141,10 +135,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
 		(n) & (1ULL <<  4) ?  4 :	\
 		(n) & (1ULL <<  3) ?  3 :	\
 		(n) & (1ULL <<  2) ?  2 :	\
-		(n) & (1ULL <<  1) ?  1 :	\
-		(n) & (1ULL <<  0) ?  0 :	\
-		____ilog2_NaN()			\
-				   ) :		\
+		1 ) :				\
 	(sizeof(n) <= 4) ?			\
 	__ilog2_u32(n) :			\
 	__ilog2_u64(n)				\
generated by cgit v1.1 at 2017-06-04 22:21:48 +0000

Offline

#18 2017-06-05 07:44:06

loqs
Member
Registered: 2014-03-06
Posts: 17,377

Re: [solved] Arch ABS with old kernels

$ cd src/linux-4.8/
$ patch -p1 -i ~/Downloads/474c90156c8dcc2fa815e6716cc9394d7930cb9c.patch
patching file include/linux/log2.h
patching file tools/include/linux/log2.h
$ cd ../..
$ makepkg -e
==> Making package: linux 4.8.13-1 (Mon  5 Jun 08:16:12 UTC 2017)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting build()...
....
==> Finished making: linux 4.8.13-1 (Mon  5 Jun 08:34:05 UTC 2017)

Can not replicate here possibly unclean src dir or one of the config changes you need exposes another issue with gcc7.

Offline

#19 2017-06-05 11:53:44

nicolo
Banned
Registered: 2013-08-10
Posts: 90

Re: [solved] Arch ABS with old kernels

I see; can you also compile with these?

CONFIG_STANDALONE=n
CONFIG_ACPI_CUSTOM_DSDT=y
CONFIG_ACPI_CUSTOM_DSDT_FILE="DSDT.hex"

Offline

#20 2017-06-05 13:25:16

loqs
Member
Registered: 2014-03-06
Posts: 17,377

Re: [solved] Arch ABS with old kernels

  CC      drivers/acpi/tables.o
In file included from ././include/linux/kconfig.h:4:0,
                 from <command-line>:0:
./include/generated/autoconf.h:1586:38: fatal error: DSDT.hex: No such file or directory
 #define CONFIG_ACPI_CUSTOM_DSDT_FILE "DSDT.hex"
                                      ^~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:289: drivers/acpi/tables.o] Error 1

If DSDT.hex is not placed in src/linux-4.8/drivers/acpi/ with file in place kernel builds successfully.

Offline

#21 2017-06-05 13:52:51

nicolo
Banned
Registered: 2013-08-10
Posts: 90

Re: [solved] Arch ABS with old kernels

Are you saying that you can compile correctly with the above configurations and the file in src/linux-4.8/drivers/acpi/ ?
I was simply putting it in include folder, and my error did not talk about it. I will try again soon.

Offline

#22 2017-06-05 14:12:06

nicolo
Banned
Registered: 2013-08-10
Posts: 90

Re: [solved] Arch ABS with old kernels

Trying again now; the only other interaction that I had is I answered 'yes' to
'The next patch would create the file include/crypto/ghash.h,
which already exists!  Assume -R?'

Offline

#23 2017-06-05 14:45:07

nicolo
Banned
Registered: 2013-08-10
Posts: 90

Re: [solved] Arch ABS with old kernels

and still get the error

...
LD      drivers/built-in.o
==> ERROR: A failure occurred in build().
    Aborting...

(starting from clean source, namely mkdir build)

Offline

#24 2017-06-05 17:12:12

loqs
Member
Registered: 2014-03-06
Posts: 17,377

Re: [solved] Arch ABS with old kernels

Please post the full output of makepkg use a pastebin if the output is too big to fit in code tags.
Please include the exact commands you used and the contents of any files that were modified (such as PKGBUILD,  config,  patches)
Post #22 would seem to indicate an attempt to apply the same command twice but without context I can not certain or attempt to determine why that happened.

Offline

#25 2017-06-05 18:05:48

nicolo
Banned
Registered: 2013-08-10
Posts: 90

Re: [solved] Arch ABS with old kernels

What is the command to redirect the output of makepkg to a file, while still being able to answer its questions? I was trying with tee but it doesn't seem to work.
(by the way thanks for helping)

Last edited by nicolo (2017-06-05 18:06:15)

Offline

Board footer

Powered by FluxBB