|
发表于 2005-2-18 19:54:01
|
显示全部楼层
How I got Gentoo PPC on an IBM RS/6000 B50:
1. Followed RS6000 boot disk build instructions from Rocklinux(http://www.rocklinux.net):
Make boot disk with Kernel Image:
[code:1]
mformat a:
mcopy <Kernel-Image> a:zimage
[/code:1]
[1]Burned the live.iso image from Gentoo PPC install cdrom at gentoo.org. Note this is a root ppc linux system, and not the original iso you download. IE, the live.iso is inside the Gentoo PPC install downloaded iso.
2. Boot the RS/6000, and when Boot-Up Icons come up (Listen for a IBM boot up sound), Hit F8 to enter the Open Firmware. Prompt is a ">"; Type:
[code:1]
boot floppy:,\ZIMAGE root=/dev/scd0 load_ramdisk=1
[/code:1]
3. This will load the kernel image from your floppy... then it'll attempt to mount root image off of the cdrom. If it all works, you'll see Gentoo booting up, but with some read-only type of errors. No show stoppers tho. Login as root, <enter> for a password.
4. Because root (and /etc/) is mounted read-only, I can't setup DNS and resolv.conf file. So, below I created a ramdisk, copied /etc contents there, then over- mounted the ramdisk on top of /etc. See file:/usr/src/linux/Documentation/ramdisk.txt.
[code:1]
dd if=/dev/zero of=/dev/ram2 bs=1k count=4096
mke2fs -vm0 /dev/ram2 4096
mount /dev/ram2 /mnt
cp -prdv /etc /mnt
umount /mnt
mount /dev/ram2 /etc
[/code:1]
You may need to do this for /var too?!
5. Now we can setup networking. The B50 has an AMD PCNet32 ethernet chip. Check "dmesg" output to make sure it was detected. For some reason my eth0 device didn't have a MAC address... so I picked one out of thin air:
[code:1]
ifconfig eth0 hw ether 01:02:03:04:05:06
[/code:1]
6. Now you can continue with the regular Gentoo PPC Installation Steps to build a basic Stage1 system, which briefly are:
[code:1]
/sbin/ifconfig $IFACE $IPNUM broadcast $BCAST netmask $NMASK
/sbin/route add -net default gw $GTWAY netmask 0.0.0.0 metric 1
ping -c 2 gentoo.org && echo hurray!
fdisk /dev/sda # Create sda1 type=41, sda2 type=82, sda3 type=83
mkswap /dev/sda2 && swapon /dev/sda2
mke2fs /dev/sda3 && mount /dev/sda3 /mnt
cd /mnt && wget <URL-of-gentoo-ppc-stage1, see reference>
tar -xvjpf stage1-*.tbz2
mount -o bind /proc /mnt
cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
chroot /mnt /bin/bash
env-update
source /etc/profile
emerge rsync
[/code:1]
7. The promise of a Gentoo system is that it's highly optimized for your CPU. Edit the /etc/make.conf "nano -w FILENAME" and set below variables. These values are specific to a B50, and may be different for you. Check CPU info with "cat /proc/cpuinfo". Gcc options taken from http://www.dis.com/gnu/gcc/gcc_32.html#SEC32:
[code:1]
CFLAGS=" -O2 -pipe -mpowerpc-gpopt -mcpu=604 -mmultiple -mstring "
[/code:1]
8. Now continue on with Stage2 stuff. See Rocklinux for a guide on the Kernel options. Get fancy by copying it to /usr/src/linux/.config and running "make oldconfig" then make menuconfig:
[code:1]
cd /usr/portage
scripts/bootstrap.sh
emerge system
ln -sf /usr/share/zoneinfo/path/to/timezonefile /etc/localtime
emerge sys-kernel/ppc-sources
make menuconfig
make dep && make clean vmlinux modules modules_install
cp vmlinux System.map /boot
emerge app-admin/metalog
rc-update add metalog default
emerge sys-apps/vcron
crontab /etc/crontab
emerge vim
[/code:1]
9. Setup your mounts in /etc/fstab (/dev/sda3 is root /dev/sda2 is swap):
[code:1]
vi /etc/fstab
[/code:1]
10. Optionally Config /etc/yaboot.conf to point at your /boot/kernel and Install yaboot loader:
[code:1]
dd if=/usr/lib/yaboot/yaboot of=/dev/sda1
[/code:1]
Or if you're like me, and couldnt get yaboot to work:
[code:1]
dd if=/boot/kernel of=/dev/sda1
[/code:1]
11. Finally, reboot to OpenFirmware, and run commands:
[code:1]
setenv boot-device disk:1
setenv boot-file root=/dev/sda3
boot
[/code:1]
References:
Stage-1-PPC-1.2 tarball
http://adequat.c2a.fr/linux/howtos/rs6000
http://www.fifi.org/doc/HOWTO/en-html/IBM7248-HOWTO/
http://www.solinno.co.uk/7043-140/walkthrough/suse73inst/
http://distro.ibiblio.org/pub/Linux/distributions/yellowdog/old_releases/champion-1.2/ppc/install/CHRP/ |
|