FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 09-14-2011, 12:53 AM
Alan Gauld
 
Default Looking for Linux Kernel source

Hi,
My first post here, as a very recent Ubuntu convert (10.4 LTS).
Please be gentle! :-)

I've bought Love's book on the Linux Kernel to read on my holiday next
week. I thought it would be useful to have the Kernel source to read
along with it but don't want to install it as a package, I'd rather just
have a tarball on a USB stick.


Where can I get it? Several sites pointed me to kernel.org but that site
seems to be down. Are there any mirror sites I could use? It doesn't
need to be the very latest version, any 2.3+ version will do.


I suppose I could just install the package via Synaptic but I wasn't
sure what else the package install might do to my system in the
background...


--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-14-2011, 07:33 AM
Alan Pope
 
Default Looking for Linux Kernel source

On 14 September 2011 01:53, Alan Gauld <alan.gauld@btinternet.com> wrote:
> I've bought Love's book on the Linux Kernel to read on my holiday next week.
> I thought it would be useful to have the Kernel source to read along with it
> but don't want to install it as a package, I'd rather just have a tarball on
> a USB stick.
>

The source package in the repo _contains_ a tarball you could put on a stick.

apt-get source linux-image-`uname -r`

(the uname -r will ensure it gets the kernel you're currently running)

That will download the source tarball and then unpack it in the
current directory. It also applies whatever patches the Ubuntu kernel
team add to the Ubuntu flavour of the kernel. You could run this from
a terminal on the USB stick and you're done.

> I suppose I could just install the package via Synaptic but I wasn't sure
> what else the package install might do to my system in the background...
>

It wont do anything else in the background other than grab a
compressed source tarball, a diff, a dsc file and then unzip the
tarball and apply the patches. Everything you install from that
command is contained within the current directory.

You can omit some of the steps with the '--download-only' option if
you dont want to apply the patches or unpack it. So you can unpack
later.

apt-get source --download-only linux-image-`uname -r`

Here's an example:-

alan@wopr:~$ apt-get source --download-only linux-image-`uname -r`
Reading package lists... Done
Building dependency tree
Reading state information... Done
Picking 'linux' as source package instead of 'linux-image-2.6.38-11-generic'
NOTICE: 'linux' packaging is maintained in the 'Git' version control system at:
http://kernel.ubuntu.com/git-repos/ubuntu/ubuntu-natty.git
Need to get 99.6 MB of source archives.
Get:1 http://gb.archive.ubuntu.com/ubuntu/ natty-updates/main linux
2.6.38-11.48 (dsc) [5,145 B]
Get:2 http://gb.archive.ubuntu.com/ubuntu/ natty-updates/main linux
2.6.38-11.48 (tar) [94.1 MB]
Get:3 http://gb.archive.ubuntu.com/ubuntu/ natty-updates/main linux
2.6.38-11.48 (diff) [5,428 kB]
Fetched 99.6 MB in 28s (3,470 kB/s)
Download complete and in download only mode
alan@wopr:~$ ls -l linux_2.6.38*
-rw-r--r-- 1 alan alan 5428471 2011-08-02 00:04 linux_2.6.38-11.48.diff.gz
-rw-r--r-- 1 alan alan 5145 2011-08-02 00:04 linux_2.6.38-11.48.dsc
-rw-r--r-- 1 alan alan 94143774 2011-03-21 23:05 linux_2.6.38.orig.tar.gz

Alternatively if you want 'upstream' kernel source you can grab it
from github whilst kernel.org is down.

https://github.com/torvalds/linux

Cheers,
Al.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-14-2011, 07:53 AM
Alan Gauld
 
Default Looking for Linux Kernel source

On 14/09/11 08:33, Alan Pope wrote:

The source package in the repo _contains_ a tarball you could put on a stick.

apt-get source linux-image-`uname -r`

(the uname -r will ensure it gets the kernel you're currently running)

That will download the source tarball and then unpack it in the
current directory.


Thanks.
I just used apt-get in a folder in my download area. I'll copy it to a
stick later, once I'm sure how much of it I actually need.

It may only be the kernel subfolder itself.

Thanks again,
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-14-2011, 07:57 AM
"Robert P. J. Day"
 
Default Looking for Linux Kernel source

On Wed, 14 Sep 2011, Alan Gauld wrote:

> On 14/09/11 08:33, Alan Pope wrote:
> > The source package in the repo _contains_ a tarball you could put on a
> > stick.
> >
> > apt-get source linux-image-`uname -r`
> >
> > (the uname -r will ensure it gets the kernel you're currently running)
> >
> > That will download the source tarball and then unpack it in the
> > current directory.
>
> Thanks.
> I just used apt-get in a folder in my download area. I'll copy it to a stick
> later, once I'm sure how much of it I actually need.
> It may only be the kernel subfolder itself.

if you have the disk space, i would strongly recommend cloning the
git repository since being able to poke around in the log and see the
history and rationale of changes can be terrifically useful.

rday

--

================================================== ======================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
================================================== ======================

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-14-2011, 03:26 PM
"franz.reitinger"
 
Default Looking for Linux Kernel source

Hi,
the Linux kernel sources can be installed very easily using apt (as
root)


apt-get install linux-source

If you don't know the exact name you can use apt-cache search like:
apt-cache search linux-source

/franzR

On Wed, 14 Sep 2011 01:53:12 +0100, Alan Gauld wrote:

Hi,
My first post here, as a very recent Ubuntu convert (10.4 LTS).
Please be gentle! :-)

I've bought Love's book on the Linux Kernel to read on my holiday
next week. I thought it would be useful to have the Kernel source to
read along with it but don't want to install it as a package, I'd
rather just have a tarball on a USB stick.

Where can I get it? Several sites pointed me to kernel.org but that
site seems to be down. Are there any mirror sites I could use? It
doesn't need to be the very latest version, any 2.3+ version will do.

I suppose I could just install the package via Synaptic but I wasn't
sure what else the package install might do to my system in the
background...

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/


/*
************************************************** **********

* Mail checked by Avira virus scanner (mail.htl-wels.at).
************************************************** **********
*/



--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-14-2011, 05:30 PM
Alan Gauld
 
Default Looking for Linux Kernel source

On 14/09/11 08:57, Robert P. J. Day wrote:


I just used apt-get in a folder in my download area. I'll copy it to a stick
later, once I'm sure how much of it I actually need.
It may only be the kernel subfolder itself.


if you have the disk space, i would strongly recommend cloning the
git repository since being able to poke around in the log and see the
history and rationale of changes can be terrifically useful.


I will do that when I get back but on holiday I'll only have
my (very early) eeePC netbook with a USB stick so I want to
save space. I've deleted the Documentation and arch folders
(except the x86 subfolder).

Hopefully that will cover everything in the book.

Once I get back I may well start poking about in the code myself, at
which point I'll put the full download on my desktop box.


Thanks,

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 12:01 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org