LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware 13.37 Kernel Upgrade to 3.30-rc6 (https://www.linuxquestions.org/questions/slackware-14/slackware-13-37-kernel-upgrade-to-3-30-rc6-933528/)

pdean712 03-08-2012 10:22 PM

Slackware 13.37 Kernel Upgrade to 3.30-rc6
 
Hi Everybody, i have made a tutorial for a 13.37 Kernel Upgrade at http://2012revolution.us/doku.php?id=start , let me know what you think!!! i can help and add to the tutorial along the way, and dont be afraid to comment to the wiki! Thanks!
-Phillip

Phorize 03-08-2012 10:56 PM

Quote:

Originally Posted by pdean712 (Post 4622405)
Hi Everybody, i have made a tutorial for a 13.37 Kernel Upgrade at http://2012revolution.us/doku.php?id=start , let me know what you think!!! i can help and add to the tutorial along the way, and dont be afraid to comment to the wiki! Thanks!
-Phillip

Hi. Well done for making an effort. A couple of observations:

I'm not sure that who the target audience in terms of skill level, but if this is aimed at beginners they should be advised to verify the kernel tar ball before compiling. On overview of the stages at the beginning would also be good, as would some references and more detailed explanation of what each stage is for.

The lack of initrd implies that you are building from the huge config. You might want to address this in the guide, as it is arguably better to build from a generic config.

It's your computer so you can build the kernel where you like, but I'm wondering why you don't use /usr/src as that's where the kernel sources are by default.

pdean712 03-09-2012 01:23 PM

Thanks for your input kristizz!

repo 03-09-2012 04:35 PM

Nice work.
As kristizz said why not compile in /usr/src ?
However:
Quote:

Lets do a…
root@darkstar:~/kernel33/linux-3.3-rc6# cp -v arch/x86/boot/bzImage /boot/vmlinuz-linux3.3-rc6ro3/linux-3.3-rc6
What we just did was copy the bzImage which is your New kernel to your /boot/ directory.
This will not copy to /boot
You should use
Code:

cp -v arch/x86/boot/bzImage /boot/vmlinuz-linux3.3-rc6
Then lilo.conf will be correct
Quote:

image= /boot/vmlinuz-linux-3.3-rc6
root=/dev/sda1
label=3.3kernel
read-only
BTW, nvidia will not compile on kernel 3.3.0

You do know everybody can edit your page, right?

Kind regards

hf2046 03-09-2012 05:02 PM

Quote:

Originally Posted by pdean712 (Post 4622405)
Hi Everybody, i have made a tutorial for a 13.37 Kernel Upgrade at http://2012revolution.us/doku.php?id=start , let me know what you think!!! i can help and add to the tutorial along the way, and dont be afraid to comment to the wiki! Thanks!
-Phillip

You do not need to be root to compile a kernel.

I repeat: You do not need to be root to compile a kernel.

I do not understand why people believe this.

Please, please, please read Linux Kernel in a Nutshell. It was written by Greg Kroah-Hartman who is a kernel maintainer.

elvis4526 03-09-2012 05:46 PM

Quote:

Originally Posted by hf2046 (Post 4623032)
You do not need to be root to compile a kernel.

I repeat: You do not need to be root to compile a kernel.

I do not understand why people believe this.

Please, please, please read Linux Kernel in a Nutshell. It was written by Greg Kroah-Hartman who is a kernel maintainer.

Is it just me, or the link doesn't work?
EDIT: Sorry, it's working now. :D

Rasta420 03-09-2012 06:54 PM

all very good feedback and very valid, but with that said, thanks for the laying the foundation of a user guide for upgrades, it will only get better now that you have laid the foundation


Rasta420

salemboot 03-10-2012 09:18 AM

Root makes life easier.

wget "http://www.kernel.org/pub/linux/kernel/v3.0/testing/linux-3.3-rc6.tar.bz2" -O - | tar vxj ; cd linux*;cp /boot/config*huge ./.config;make&&make modules&&make install&&make modules_install;reboot

one line to rule them all

qweasd 03-10-2012 01:23 PM

Quote:

Originally Posted by salemboot (Post 4623436)
Root makes life easier.

wget "http://www.kernel.org/pub/linux/kernel/v3.0/testing/linux-3.3-rc6.tar.bz2" -O - | tar vxj ; cd linux*;cp /boot/config*huge ./.config;make&&make modules&&make install&&make modules_install;reboot

one line to rule them all

While it is true that root is not required to build the kernel and the official README says
Quote:

To do the actual install you have to be root, but none of the normal
build should require that. Don't take the name of root in vain.
I still side with salemboot: it is kind of easier. It also seems to be the Slackware way, judging by slackbuilds.

I have to point out, though, that skipping make oldconfig may cause you to have a bad time. In one instance I forgot to do it and still was able to boot a misconfigured kernel. Super-glitchy graphics gave away my mistake, so I fixed it, but who knows what else was broken?

Also, in my latest attempt to bring custom kernels to multiple desktops and laptops, I wrote a kernel slackbuild script. It is an amalgamation of the official Slackware scripts for kernel, modules, and firmware. You still have to configure the kernel (which is by far the hardest part), but then you can follow my very easy README and make a package which can be used to upgrade kernel/modules/firmware in one fell swoop, as simply as
Quote:

installpkg <name>
lilo
You also benefit from being able to uninstall your custom kernels cleanly and quickly. One major caveat is my refusal to deal with initrd: since I am already making my own kernel, I can easily throw in whatever it needs to boot (in my case, just ext4).

GazL 03-10-2012 03:43 PM

qweasd, looks like you're doing something very similar to me. I also have a combined kernel+modules SlackBuild script I use. I still use a separate package for firmware though. (currently the one from current)

I thought about adding a "mkinitrd' to the doinst.sh, but at the moment I still do that bit and lilo manually.

Rasta420 03-10-2012 05:54 PM

elvis, thanks for the link...just finished reading it, good info in there and was nice to hear from an official kernel developer to build in a user created directory and not in /usr/src like everyone says

Rasta420

Rasta420 03-10-2012 06:00 PM

repo,

do you know if the nvidia driver compiles on 3.2.9 kernel?

my laptop is ATI graphics and so far the 3.2.9 kernel is good to go but desktop is nvidia gts 250 and havent updated the kernel there yet

Rasta420

ThomasLMcLean 03-10-2012 10:38 PM

Good Work!

I am a newbie at Linux and am about to tackle Slackware with all new hardware and had wondered how to perform brain surgery if necessary.

I also like all of the comments! I get to learn several things at once.

T L
On the Wet Coast
Light rain and 48 F

qweasd 03-11-2012 12:37 AM

Quote:

Originally Posted by GazL (Post 4623636)
I still use a separate package for firmware though.

Starting with 144, udev looks in /lib/firmware/$(uname -r) and then /lib/firmware. So there is a very clean way to install the correct firmware without colliding with the Slackware package.

repo 03-11-2012 04:03 AM

Quote:

Originally Posted by Rasta420 (Post 4623684)
repo,

do you know if the nvidia driver compiles on 3.2.9 kernel?

my laptop is ATI graphics and so far the 3.2.9 kernel is good to go but desktop is nvidia gts 250 and havent updated the kernel there yet

Rasta420

I know it compiles on 3.2.7.
For the 3.3.0 kernel,
I found this on the net
Code:

cd /lib/modules/3.3.0-rc6-smp/
cp build/arch/x86/include/generated/asm/unistd_* source/arch/x86/include/asm/

Then rerun the nvidia installer.
Works on my system with kernel 3.3.0.
Seems to me it should work on 3.2.9 also.

Kind regards

GazL 03-11-2012 07:21 AM

Quote:

Originally Posted by qweasd (Post 4623831)
Starting with 144, udev looks in /lib/firmware/$(uname -r) and then /lib/firmware. So there is a very clean way to install the correct firmware without colliding with the Slackware package.

Ahh, I see. That's an interesting approach for those who want to leave /lib/firmware as shipped by Pat. Thanks for the tip.

I'm not really familiar with how firmware gets loaded and I didn't realise it was udev that does it - I always assumed it was the kernel itself - which has now left me wondering how systems without udev manage to do it. Might have to look into this.

PatrickDickey 08-18-2012 02:05 PM

I have a newbie question (or stupid, if you want to be honest about it). On another tutorial, the person has you move vmlinuz to the /boot directory instead of bzImage. What's the difference between the two files? What I mean is in this tutorial, you have

cp -v arch/x86/boot/bzImage /boot/vmlinuz-linux3.3-rc6, and in the other tutorial (he's compiling the 3.0 kernel), he has mv /boot/vmlinuz /boot/vmlinuz-3.0.0 I realize that he messed up and moved his 2.6.37.6 kernel to the 3.0 kernel's image. My point is that he's moving the vmlinuz file instead of the bzImage file.

The other tutorial can be found at http://standardcode.eu/blog/linux/co...slackware.html (not pushing his site, just clarifying what I'm talking about).

Have a great day:)
Patrick.

P.S. On a side note, I'm thinking that I can fix my issue with his compilation by moving the appropriate files (/usr/src/arch/x86/boot/bzImage and /usr/src/arch/x86/boot/System.map to the /boot directory).

Didier Spaier 08-18-2012 02:46 PM

"mv /boot/vmlinuz /boot/vmlinuz-3.0.0" should be a typo.

Better follow Building a Kernel from Source from Alien Bob.

PatrickDickey 08-18-2012 05:21 PM

Quote:

Originally Posted by Didier Spaier (Post 4757818)
"mv /boot/vmlinuz /boot/vmlinuz-3.0.0" should be a typo.

Better follow Building a Kernel from Source from Alien Bob.

Well, the link that I used the first time (with the typo) was the first tutorial that I found yesterday. I didn't realize that it had a typo until I found this thread today. Right now, I'm using the original poster's tutorial (converted into a shell script), and I'll see what happens. It's all in a virtual machine, so if I mess up, I'm not out anything major.

From Alien Bob's tutorial, I got my answer. bzImage is compressed, and vmlinuz is uncompressed. But, they are both the same file essentially.

So, I have another question (or two). I'm making my kernel in /root/kernel352/ (as it's the 3.5.2 version). If I need to get to the source code, do I have to point to that location, or will it automatically point there? And, if I wanted to copy the sources over to /usr/src after I'm done, what's the best way to do it? I'm figuring it's either run make mrproper in the kernel352/linux-3.5.2 directory (as I only want the source code), and copy the directory over to /usr/src, or copy the .tar file over to /usr/src and untar it there.

Have a great weekend.:)
Patrick.

Didier Spaier 08-18-2012 05:31 PM

I won't elaborate, but you should better follow Alien Bob's tutorial.

And remember that if you apply a guide blindly (i.e., not understanding what is the purpose and will be the effect of each and every proposed command), sooner or later expect troubles.

T3slider 08-18-2012 08:21 PM

For preparing kernel sources for permanent storage you should issue `make clean`, not `make mrproper` (see `make help` in the kernel source directory for information). If you want to move kernel sources, you can just move them -- but you will have to correct the symlinks (build and source) in /lib/modules/`uname -r`/, which should point to the top directory of the kernel sources. This allows you to build as a normal user in a home directory, for example, with the ability to relocate the sources to a proper system directory (/usr/src/linux-`uname -r`). I don't run any kernel commands as root (I build as a user and install as a user, passing DESTDIR and INSTALL_MOD_PATH where needed [again, see `make help`] and then chown/package the result as root). However, the best kernel guide remains Alien Bob's, so unless you understand what you're doing and what each command does, it is probably easier to build as root as suggested by Alien Bob.

PatrickDickey 08-18-2012 08:47 PM

Quote:

Originally Posted by Didier Spaier (Post 4757906)
I won't elaborate, but you should better follow Alien Bob's tutorial.

And remember that if you apply a guide blindly (i.e., not understanding what is the purpose and will be the effect of each and every proposed command), sooner or later expect troubles.

Totally understandable and agreed (about the not understanding the purpose and effect of each command). The only reason I ask about the copying of the sources is because depending on what tutorial you follow, they tell you to either do everything from /usr/src, or don't do anything from /usr/src. In my case, I'm going to be doing driver development (specifically one driver for a Pinnacle PCTV 80e TV Tuner), and it requires me to recompile the kernel. In doing that, from my understanding (from the linuxtv project's wiki), I need to have the kernel sources and headers available to me. So, my question still stands: Do I need to point to the location of the sources, if I don't compile them in /usr/src, or should I copy them over there? And, if I should copy them over, would it have the same effect if I copy the tar.bz2 file over and untar it, or do I need the compiled files as well (understanding that "make" compiles the source code, and creates .o files)?

All of this is also why I'm doing this in a virtual machine. Until I get everything perfected (including the understanding of what I'm doing), I don't want to trash my computer. Once I've perfected it, I'll do everything on a live system, so I can verify that everything really works (going on the theory that something might work on a virtual machine, but not in a live system--and vice versa). It's also why I'm stepping out of my comfort zone, and using Slackware. If I wanted to do this in Ubuntu (which is my distribution of choice), I'd have to jump through hoops just to get the kernel to boot. And if I wanted to do it in a Linux From Scratch system, I'd have to learn how to resolve circular dependencies and a whole bunch of other issues, just to get the base system ready for the development--let alone what I'd have to do each time I tried to compile a new kernel.

Anyhow, thanks for any information that you do provide me. And have a great day.:)
Patrick.

Didier Spaier 08-19-2012 12:52 AM

To do driver development you will among other things need to know how-to:
0) Use the linux commands (see http://tldp.org)
1) Program in the C language
2) Use Makefiles to compile, link and install C programs
3) Find you way in the kernel source tree and insert your driver in it (to begin with, read the Makefile at the root of the kernel source tree)

That needs a lot of reading and doing exercises, certainly not limited to reading and following one page tutorials.

Other than that, as you are using Slackware, again take the time to read Alien BOB's tutorial as it is adapted to Slackware.

Whether you should put the kernel source in /usr/src or elsewhere to experiment, that doesn't matter at all for Slackware are explained by Alien Bob in his tutorial.

All you have to know is that you should issue the "make" command from the root of the kernel source tree, wherever it be. "man make" to know more, and "make help" when at the root of the kernel source tree to know all the options to configure and compile the kernel.

To find your way in the Linux kernel in the perspective of writing a driver, see http://kernelnewbies.org


All times are GMT -5. The time now is 10:13 PM.