Page 1 of 2

How to compile a kernel and update yaboot?

PostPosted: 12 Dec 2004, 19:07
by lenqiu
In order to get sound from my system I need to update the kernel 2.6.8 to 2.6.9 and modify a text file.

i modified the file and activated OSS, i downloaded the kernel and installed it using "rpm -ivh /pahtto/newkernel".

i restarted but my system starts up in the kernel 2.6.8....

it appears the instalation of the kernel 2.6.9 with rpm worked very well, but how can i tell the system that it must start up with the new kernel?

i must configure yaboot? also i want that macosx starts up as the default os....

please help me i really need sound feedback.....!!!!

PostPosted: 12 Dec 2004, 21:32
by StarKnight83
you need to edit /etc/yaboot.conf and add a new entry for your kernel. take a look in the /boot dir at the names of the new kernel and its initrd.img and then follow the format for the current kernel. after editting the file save it and run ybin -v and that will up date the bootloader

PostPosted: 03 Jan 2005, 05:31
by Guest
... just updated the kernel to 2.6.9 with 'yum update kernel' but it still boots into the old kernel.

at the end of the update got this message:

kernel 100% done 1/1
kernel update/installed, checking for bootloader
no bootloader found, Cannot configure kernel, continuing.
Installed: kernel 2.6.9.1.ydl.8.ppc
Transaction(s) Complete

... i already managed to hose the installation once today by messing with th e yaboot.conf file and ended up reinstalling ydl from the cd.

yep, total nebie here, would love to get it right this time and will appreciate all the help i can get. are there anywhere any explicit postinstallation tweaking tips regarding this?

i'm basically trying to make the dual g5 run quietly, heared the kernel update nowdays fixes it.

thank you in andvance

PostPosted: 03 Jan 2005, 09:24
by shane
I downloaded the kernel rpm manually then installed with rpm -Uvh kernel-2.6.9-1.ydl.8.ppc.rpm

Once you have the new kernel installed, edit /etc/yaboot.conf and change it to boot the new kernel. eg


Code: Select all
# yaboot.conf generated by anaconda
                                                                               
boot=/dev/hda9
init-message="Welcome to Yellow Dog Linux! Hit <TAB> for boot options."
partition=11
timeout=30
install=/usr/lib/yaboot/yaboot
magicboot=/usr/lib/yaboot/ofboot
delay=10
enablecdboot
                                                                               
image=/boot/vmlinux-2.6.9-1.ydl.8
        label=linux
        read-only
        initrd=/boot/initrd-2.6.9-1.ydl.8.img
        root=/dev/hda11
        append="rhgb quiet"


image and initrd are the only options you would need to change, but that is what my yaboot.conf looks like.

run mkofboot, reboot and you should be running kernel 2.6.9-1.ydl.8

PostPosted: 04 Jan 2005, 01:45
by Guest
INDEED!!! i finally got it to work last night. it's all nice and quiet now, thanks!

PostPosted: 06 Jan 2005, 02:21
by jdos2
My personal steps (learned from Slackware, 1995):
1. Get the kernel sources. I'm at 2.6.10. The GLibC with YDL is FINE for it.
2. Gunzip and untar in /usr/src, and the create a symbolic link to "linux" in that same directory.
3. Enter the linux directory and "make mrproper."

Now, I have some choices, and when I'm lazy (most of the time) I'll copy a config file from /boot that matches my running (and assumed working) kernel into my /usr/src/linux directory, as .config.

4. I usually run "make menuconfig" and flow through the options. Remember, Olde Linux Hands, that this is NOT i386 Linux, and the Kernel can be large. Compile in what you need, module what's optional, and You Are There.
5. Compile (make all)
6. Install the modules (make module_install)
7. Install the Kernel (cp vmlinux /boot)
8. Adjust yaboot.conf to include the appropriate info about your kernel- the image is, of course, /boot/vmlinux. Don't worry about an initrd, this isn't i386 and your filesystems that are needed for boot really should be compiled in anyway.
9. Run /sbin/ybin.
10. Reboot. At the second stage loader, press <Tab> and you will see your kernel image listed, assuming that you correctly entered the info in your yaboot.conf (it's really easy to make a typo; if you don't see your kernel, betcha you did)
11. Enjoy your new kernel.

Piece of cake, and really, standard practice for any Linux admin. Any admin user should be good enough at it that they can upgrade, in my opinion. Then again, I hate precompiled binaries and prefer to work with gcc 3.4.3... But the installation of the latter is rather more involved.

PostPosted: 26 Jan 2005, 08:17
by nyne
just edit your /etc/yaboot.conf file and replace all instances of 2.6.8 with the appropriate 2.6.9 entries

for example only, my yaboot.conf

image=/boot/vmlinux-2.6.9-1.ydl.8
label=linux
read-only
initrd=/boot/initrd-2.6.9-1.ydl.8.img
root=/dev/hda4
append="rhgb quiet"

is my "image" entry for my particular kernel..

just replace vmlinux-2.6.9.... etc with the kernel you are trying to install
cd /usr/src && ls -lrt

after you set up yaboot.conf properly. run the command 'mkofboot'

that should do it for you ( I am not 100% convinced sound will work after moving to a new kernel for a few reaons; A: artsd is a piece of garbage B: snd_powermac is the proper module that should be specified in /etc/modprobe.conf instead of the one that ships with YDL4.0... installing a new kernel does-not-fix-this)

....but I'm not so sure this

PostPosted: 01 Feb 2005, 13:48
by Caesar
I'm trying to run kernel 2.6.9-1 too but after yum update the system told me that it found no bootloader and it stopped the installation.

Tring to edit the /etc/yaboot.conf file gave no success... maybe because i running only YDL4.0 on my iBook? (no other OS)

Please help :)

PostPosted: 01 Feb 2005, 16:57
by jdos2
So you aren't running yaboot? Do you get a choice at bootup for which OS to boot to (even though you've not installed Mac OS?)

Hmmm. Without yaboot, you'll have to dd the kernel boot sectors into the first part of the boot partition.

I'd have to read up on how it's done, but that'd make the most sense to me.



EDIT: Pre-coffee language

PostPosted: 01 Feb 2005, 17:44
by StarKnight83
actually yaboot shouldve been installed no matter if theres another os or not (for kernel selection) though i believe that there is an option to skip yaboots install (not sure why youd want too) try installing yaboot ("yum install yaboot" as root) and if it says its already installed remove it and reinstall it. If your still getting flakey results you may want to consider a reinstall

PostPosted: 01 Feb 2005, 18:56
by Caesar
Yaboot is installed and working.
Here my config:

Code: Select all
# yaboot.conf generated by anaconda

boot=/dev/hda2
init-message="Welcome to Yellow Dog Linux! Hit <TAB> for boot options."
partition=5
timeout=30
install=/usr/lib/yaboot/yaboot
magicboot=/usr/lib/yaboot/ofboot
delay=10
enablecdboot

image=/vmlinux-2.6.9-1.ydl.8
        label=linux
        read-only
        initrd=/initrd-2.6.9-1.ydl.8.img
        root=/dev/hda3
        append="rhgb quiet"


But YDL is still booting with the old kernel... at least from what i can read while the iBook is booting. How to check kernel version via shell?

PostPosted: 01 Feb 2005, 19:48
by jdos2
Did you run ybin?

That'll install the new bootloader.

What's in your initrd that you need to boot with one? I'm curious. I've not looked but all the systems I've tried YDL haven't needed any modules from it, (and I don't know what they are) so I just compile everything I need into the kernel (filesystems, attached devices, &c.) and module things I *might* hook up (firewire and USB devices) and leave it at that. No initrd to worry about.

JD

PostPosted: 01 Feb 2005, 20:00
by Caesar
jdos2 wrote:Did you run ybin?

That'll install the new bootloader.

What's in your initrd that you need to boot with one? I'm curious. I've not looked but all the systems I've tried YDL haven't needed any modules from it, (and I don't know what they are) so I just compile everything I need into the kernel (filesystems, attached devices, &c.) and module things I *might* hook up (firewire and USB devices) and leave it at that. No initrd to worry about.

JD


Mhh.... :oops:
What is ybin? :D
Really... i new to all this.... but i'm trying my best :roll:

PostPosted: 01 Feb 2005, 20:33
by jdos2
/sbin/ybin is the yaboot loader installer. You change your config in /etc/yaboot.conf and then run /sbin/ybin to "make it so." Give it a try. It'll tell you if there are errors installing your new kernel.

JD

PostPosted: 01 Feb 2005, 21:39
by Caesar
jdos2 wrote:/sbin/ybin is the yaboot loader installer. You change your config in /etc/yaboot.conf and then run /sbin/ybin to "make it so." Give it a try. It'll tell you if there are errors installing your new kernel.


JD first of all thanks for your help :)

Running ybin as-it-is no error are reported.
Launching it with the --debub option i get this output:
Code: Select all
[root@ibook]# /sbin/ybin --debug
ybin: DEBUG: ofboot set to `/pci@f2000000/mac-io@17/ata-4@1f000/disk@0:2'
ybin: DEBUG: OS=2
ybin: DEBUG: /bin/sh /usr/lib/yaboot/ofboot 2 bootyaboot 10  0 yaboot GNU l /pci@f2000000/mac-io@17/ata-4@1f000/disk@0:2 ,\\yaboot     cd CDROM c cd: ,\\:tbxi
ybin: DEBUG: set magicboot to /tmp/ofboot.oi3167
ybin: DEBUG: boot-device=/pci@f2000000/mac-io@17/ata-4@1f000/disk@0:2,\\:tbxi


Still no way to get the new kernel runnig. Any idea?