How to build only amd64 image?

Kernels & Hardware, configuring network, installing services

How to build only amd64 image?

Postby MrGlasspoole » 2021-02-08 19:53

First time I'm doing this and after two days of trying and Google i need help.

I found some instruction for Ubuntu:
Code: Select all
$ sudo apt-get build-dep linux
$ apt-get source linux
$ VERSION=$(uname -r)
$ cd linux-${VERSION%%-*}
$ fakeroot debian/rules clean
$ fakeroot debian/rules binary-generic
$ cd ..
$ sudo dpkg -i linux*.deb

After the download part i have:
Code: Select all
linux-4.15.0
linux_4.15.0-20.21.diff.gz
linux_4.15.0-20.21.dsc
linux_4.15.0.orig.tar.gz

And after fakeroot i have:
Code: Select all
linux-cloud-tools-4.15.0-20-generic_4.15.0-20.21_amd64.deb
linux-headers-4.15.0-20-generic_4.15.0-20.21_amd64.deb
linux-image-unsigned-4.15.0-20-generic_4.15.0-20.21_amd64.deb
linux-modules-4.15.0-20-generic_4.15.0-20.21_amd64.deb
linux-modules-extra-4.15.0-20-generic_4.15.0-20.21_amd64.deb
linux-tools-4.15.0-20-generic_4.15.0-20.21_amd64.deb

In Debian i did:
Code: Select all
$ sudo apt build-dep linux
$ apt source linux
$ fakeroot debian/rules clean
$ fakeroot debian/rules binary

But that gives me stuff like that:
Code: Select all
linux-headers-5.9.0-0.bpo.5-common_5.9.15-1~bpo10+1_all.deb
linux-headers-5.9.0-0.bpo.5-common-rt_5.9.15-1~bpo10+1_all.deb
linux-source_5.9.15-1~bpo10+1_all.deb
linux-source-5.9_5.9.15-1~bpo10+1_all.deb
linux-support-5.9.0-0.bpo.5_5.9.15-1~bpo10+1_all.deb
linux-doc_5.9.15-1~bpo10+1_all.deb
linux-doc-5.9_5.9.15-1~bpo10+1_all.deb

What i need is the amd64 image.
In Ubuntu you use
Code: Select all
fakeroot debian/rules binary-generic

But "binary-generic" does not exist in Debian?

What is the right way if you only need amd64?
And I'm right that i can build on a virtual machine and use that Kernel than on a real machine?
MrGlasspoole
 
Posts: 26
Joined: 2012-12-22 21:34

Re: How to build only amd64 image?

Postby sunrat » 2021-02-08 20:48

MrGlasspoole wrote:I found some instruction for Ubuntu:

That's your first mistake. Ubuntu instructions aren't intended to work on Debian and may be harmful.

What is the right way if you only need amd64?

Code: Select all
apt install linux-image-amd64

Or use apt to install a specific kernel version from the repos.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 3404
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: How to build only amd64 image?

Postby Head_on_a_Stick » 2021-02-08 20:50

Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13262
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: How to build only amd64 image?

Postby MrGlasspoole » 2021-02-08 21:37

sunrat wrote:That's your first mistake. Ubuntu instructions aren't intended to work on Debian and may be harmful.

As you can see, i changed it for Debian.

sunrat wrote:
Code: Select all
apt install linux-image-amd64

Or use apt to install a specific kernel version from the repos.

I know how to install a kernel. I want/need to build my own.

Head_on_a_Stick wrote:https://www.debian.org/doc/manuals/debian-kernel-handbook/

I was on that site. But i cant figure out how to build just an amd64 image.
MrGlasspoole
 
Posts: 26
Joined: 2012-12-22 21:34

Re: How to build only amd64 image?

Postby Head_on_a_Stick » 2021-02-09 20:17

MrGlasspoole wrote:I want/need to build my own.

Why? https://xyproblem.info/

MrGlasspoole wrote:i cant figure out how to build just an amd64 image.

Build it in an amd64 system.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13262
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: How to build only amd64 image?

Postby Bulkley » 2021-02-09 20:27

Is this the sort of thing you are looking for?

Creating a Custom LiveCD with Fluxbox using live-package
Bulkley
 
Posts: 6064
Joined: 2006-02-11 18:35

Re: How to build only amd64 image?

Postby stevepusser » 2021-02-09 21:22

First, your title is confusing some here. You need more than just the linux-image package: the kernel build cranks out a lot of different packages--some binary, some "all".

Your real question is "how do I tell the build system to build only architecture-dependent binary packages?"

The arch-independent "all" packages are dependencies of the amd64 packages, so most of the time they need to be built if you don't have them. If you already have them, then the "-B" argument builds only the binary arch-dependent packages. Look up the manpage for your command; for the ones I use often, such as debuild or pdebuild, a typical command is
Code: Select all
debuild -B -jauto


My pbuilder setup is a bit customized, so I use
Code: Select all
OS=debian DIST=buster ARCH=amd64 pdebuild  --debbuildopts "-B -J7"


to build with seven threads, for example.

Sbuild has a different syntax, and it builds only binaries by default, so for nine threads, it would just be
Code: Select all
sbuild  --arch=amd64 -d buster --debbuildopt=-J9
MX Linux packager and developer
User avatar
stevepusser
 
Posts: 12233
Joined: 2009-10-06 05:53

Re: How to build only amd64 image?

Postby MrGlasspoole » 2021-02-11 08:14

Head_on_a_Stick wrote:Why? https://xyproblem.info/

Does that matter why somebody wants to know how to do something?

I nee to modify a driver...

MrGlasspoole wrote:Build it in an amd64 system.

Thats what I'm doing.


@stevepusser, thanks. I will look into it when i have time.
MrGlasspoole
 
Posts: 26
Joined: 2012-12-22 21:34

Re: How to build only amd64 image?

Postby sunrat » 2021-02-11 12:34

MrGlasspoole wrote:
Head_on_a_Stick wrote:Why? https://xyproblem.info/

Does that matter why somebody wants to know how to do something?


It actually matters quite often. People regularly ask the wrong questions for the answers they seek.

I think Stevo has set you on the right path. :wink:
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 3404
Joined: 2006-08-29 09:12
Location: Melbourne, Australia


Return to System configuration

Who is online

Users browsing this forum: No registered users and 19 guests

fashionable