Topic: Build ttylinux for powerPC

As a starting point for cross-compiling I decided to build ttylinux for powerPC.

I believe I have built the tools - "make powerpc" completed without obvious errors. The test script won't work as this is not a powerpc!

It is not obvious how I now build ttylinux for powerpc. I looked through the scripts and took a guess and changed "ttylinux.dist-config.sh" to say:

# XBT_TARGET_CPU="i486"     # Cross-tools tool chain.
XBT_TARGET_CPU="powerpc"     # Cross-tools tool chain.

I then ran "make dist" with the following result:

ASUS ttylinux-src-8.0 # make dist
Remove ttylinux build.
=> Removing development build directories.
=> Removing boot CD configuration.
=> Removing file system image, boot CD image.
=> Removing binary packages.
=> Removing package lists.
=> Removing build logs.
Initializing the ttylinux build.
=> Creating preliminary development build directories...
...OK
=> Creating base file system directories...
...OK
Building the ttylinux packages.
=> ttylinux project folder
=>      /home/ian/ttylinux-src-8.0
=> building ttylinux-8.0
=> with powerpc cross-building Binutils binutils-2.18
=> with powerpc cross-building GCC gcc-4.2.4
=> with GLIBC version glibc-2.7 having Linux kernel interface
=>      GLIBC interface to Linux kernel powerpc architecture
=>      GLIBC interface to Linux kernel linux-2.6.20
=> for 8 MB target file system image size
##### START cross-building packages
***** glibc-2.7
i> Source package not needed.
i> Getting configuration package cfg-glibc-2.7.tar.bz2.
i> Patching source package, above-directory.
i> Wait 1 [mindless]... OK
i> Building and installing glibc-2.7... DONE
i> Finding all installed files... OK
i> Doing some cleanup after building... done
i> Looking for manpages to compress.
...compressed 0 manpages
...done compress manpages
i> Creating files list for built package glibc-2.7.
...OK
i> Creating installable package for built package glibc-2.7.
tar: lib/ld-linux.so.2: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors
Build FAILED.
make: *** [pkgs] Error 1
ASUS ttylinux-src-8.0 #

Was I heading in the right direction?  Is there something obvious that I missed?

Just to make sure I hadn't messed up the i486 build, I pointed  "ttylinux.dist-config.sh" back to i486 and did another successful "make dist"

Thanks in advance.

Ian

Re: Build ttylinux for powerPC

ianjb:

You aren't missing anything.

ttylinux cross-tools will build a PPC cross tool chain, but ttylinux doesn't yet build for anything but x86 PC architecture. The reason for this is because I've no other target to test, and the CPU is just part of the target.

It seems like x86 is a target, but the target really is x86 pc architecture. Systems based upon other CPUs have variations in CPU and hardware architecture, so there is no general approach to building ttylinux for each other kind of CPU.

So, I'm waiting to have time to set aside for getting and working with some different target system, or for someone to work with me in loading and testing a cross-built ttylinux on some non-x86 system, real or virtual. A real system would be best. A virtual PPC system might be quit feasible, not at all difficult and very useful; I just don't have the time to explore that. I'm looking for someone else to take the lead in getting a real or virtual system up and running and doing the work of trying ttylinux on it and finding the problems. I can make the ttylinux updates and explain them as I go.

If you want to help by downloading and testing, I can (soon) start making the additions for getting ttylinux running on a specific PPC system you may have.

Re: Build ttylinux for powerPC

Douglas,

I thought it seemed a little too good to be true that you could build for another processor without some processor specific tools.

The powerpc build was an experiment. I don't really have a need for it and I don't have any powerpc hardware. As the cross-tool build script was there, I thought I would give it a try.

ARM is different matter and I will respond to that on the other thread.

Thanks for your thoughtful response.

Ian

Re: Build ttylinux for powerPC

Hi Douglas,

I own and would like to eventually use ttylinux on an Apple Powerbook G4 which has a 1.67 GHz PowerPC G4 processor.  I am willing to download and test ttylinux on it for you.  I am however new to Linux, so I may not be of much help.

Re: Build ttylinux for powerPC

I'm a bit useless with this; I don't know anything about Apple systems. I'd need to know what sort of build to try for the ttylinux kernel and apps. I think the first step is just knowing how to boot something on your Powerbook, and that I don't know. If you have a way to boot a non-Apple kernel, I'll give a go at making a ttylinux kernel for it.

Re: Build ttylinux for powerPC

I installed Ubuntu on it.  It uses Yaboot bootloader.  What now?

Last edited by And (2010-06-10 04:24:25)

Re: Build ttylinux for powerPC

Short answer: if possible please email to me the PowerPC Powerbook Ubuntu kernel configuration; see below.

Long Answer:

Are you saying that you are able to boot and use Ubuntu on your Apple Powerbook G4 which has a 1.67 GHz PowerPC G4 processor? Is Ubuntu working well?

If so, and in any case anyway, I am now attempting a ttylinux build for a Powerbook G4 target. I am likely to have questions. When I get ttylinux-10.0 released you probably will like to get the source distribution and build the PowerPC ttylinux yourself.

Under Ubuntu, can you get the kernel configuration with this command:
     zcat /proc/config.gz
or
     cp /proc/config.gz .
     gunzip config.gz
     cat config
If so, please save the output and send to me. Thanks.

I will be studying yaboot to try to help in specifying how to boot ttylinux.

Does the Powerbook G4 boot from CD-ROM? (I think so.) I will see if I can get a yaboot-based PowerPC build of ttylinux assembled into an ISO image that you can download and burn to CD-ROM and boot.

Re: Build ttylinux for powerPC

Yes, I am able to boot and use the community supported PowerPC version of Ubuntu on my Apple Powerbook G4 which has a 1.67 Ghz PowerPC G4 processor.  Ubuntu works fairly well.  The only hardware issues are annoyingly slow track pad tracking and disabled keyboard lighting.  The software works as predicted.

On another note, yesterday, I burned and ran ttylinux-10 RC1 successfully and flawlessly from normal boot and "ttylinux enet" boot options on a 20" Apple iMac with a 2.4 Ghz Intel Core 2 Duo processor.  Retawq automatically connected to the internet with the second boot option, as expected.  Also, the USB keyboard works as claimed.  (Awesome!)

I am very glad to hear you're attempting a build for a Powerbook G4 target.  I don't have my G4 with me (it's at my parents' place where there is always internet, trying to be a server) but I have access to it and will do my best to answer all your questions.  I'd like to try to build PowerPC ttylinux from source myself but it might take me some time as I've never built an OS from source before.

The Powerbook G4 can boot from CD-ROM, and did, but after booting Ubuntu from CD-ROM, I installed it to the disk using the provided Ubuntu partitioner and installer and accidentally wiped OS X from the hard drive.  I don't think it can boot from USB.

A yaboot based PowerPC build of ttylinux that I could burn, boot and install is, like, my wet dream.  My goal is to install ttylinux on that Powerbook G4, leave it at home in a server setup and ssh into it from a flash disk ttylinux that I can run on any other computer.

I'll email you the G4's Ubuntu kernel configuration tonight, monitor this thread for other questions you might have, and wait for the ttylinux-10.0 source distribution.

Cheers!

Re: Build ttylinux for powerPC

ttylinux running on your iMac, this is very cool. It will be a week or so before I've complete the 10.0 release; then I'm all over the PowerPC stuff.

Re: Build ttylinux for powerPC

Well that took more than a week; I had to take time to change my host system, completely switching from a home-assembled dual athlon desktop to a shiny new laptop. Selecting a ready-made Linux distribution and getting my two monitors working right was a bother. But I digress...

I've built a 32-bit PPC cross-tool chain and used it to make a Linux kernel for my old nubus-based Performa 6116. Then, after re-installing MacOS 7.5.1, I put my old MkLinux DR3 on an external drive and that all worked fine. So I tried to substitute my kernel, but there is no evidence that the MkLinux boot loader is loading my kernel. I'm wanting to try miBoot, but I can't get anything onto the Performa that MacOS recognises as .sea or .sit and I can't seam to find an old StuffIt Expander. But I digress again... Blah blah.

So I'll let that activity bake in the back of my mind a while, and switch to making a PowerPC live CD that uses yaboot. That's something for which I don't have a machine to boot. So if I can get a bootable ISO built I'll rely on And and anyone else to give it a try and tell me how it doesn't work. With luck I'll have something in a week or so.

Re: Build ttylinux for powerPC

Anyone willing to give this a try?

Download this file: http://ttylinux.org/Test/bootcd-powerpc-11.1.iso.gz

Then gunzip it and burn the image to disk and try booting it in a PowerPC Macintosh. With luck you'll get an experimental, but working, ttylinux-11.1

I don't have a way to boot this, so I rely upon you guys to tell me all the cool ways it doesn't work.

12

Re: Build ttylinux for powerPC

I'll try it as soon as I can!  =D

Re: Build ttylinux for powerPC

I'm 99% positive it won't boot. If you can get to the OF prompt maybe you can try "boot cd:,/ppc/vmlinux" and see the kernel boot. I think I put the kernel in /ppc ...

I am using a newly donated, old and very broken-down PowerBook G4 and qemu-system-ppc but I cannot make a CD that boots. Very frustrating. I downloaded an Arch Linux PPC image and that boots. I don't know what I'm doing wrong. Maybe you can't make a Macintosh bootable in x86 Linux.

Later, I will put up a new ISO image. It will be my best try at a bootable PPC ISO. I will put a short bash script that makes the ISO image from the same directory structure in the image, so if you mount the image and run this remastering script it will make a new bootable PPC ISO image. Maybe running that on a Linux PPC will make the image work. At least someone else can look at the image creation process and give it a try. Unless I find how to make a bootable PPC ISO image frm an x86 system, this might be the only way I can release a PPC system.

If anyone has experience making a bootable PPC ISO image from an x86 system, please let me know how you did it, even it is if for qemu.

Re: Build ttylinux for powerPC

Download is: http://ttylinux.org/Test/bootcd-powerpc-11.1.iso.gz

When I boot this I get the OpenFirmware prompt, so I type "boot cd:" and I get yaboot complaining that the file system is unknown or corrupt; it cannot find yaboot.conf. Then I type to yaboot's boot prompt:
     cd:0,/boot/vmlinux initrd=/boot/initrd root=/dev/ram0 ramdisk_size=8192
and the kernel boots, but yaboot doesn't get the initrd into memeory for the kernel and the kernel dies in the ass when it looks for a root file system.



Something you can do with qemu-system-ppc: Gunzip and mount the ISO image file. Let's say you mounted the ISO image file at /mnt, then go to the directory above, which would be the root directory in this case. Run the qemu shell script in the top-level directory in the ISO image; this shell script doesn't know where you mounted, so that is an argument to the script.

     $ mount -o loop bootcd-powerpc-11.1.iso /mnt
     $ cd /
     $ mnt/ppc-qemu.sh mnt



Something you can try with a PPC  Linux: Remaster the ISO image to see if you get a bootable ISO. Gunzip and mount the ISO image file. Let's say you mounted the ISO image file at /mnt, then go to the directory above, which would be the root directory in this case. Run the remastering shell script in the top-level directory in the ISO image; this shell script doesn't know where you mounted, so that is an argument to the script.

     $ mount -o loop bootcd-powerpc-11.1.iso /mnt
     $ cd /
     $ mnt/ppc-remaster.sh mnt ttylinux-ppc.iso

Now burn the new ISO image file, ttylinux-ppc.iso, to a CD-ROM and see if it boots on your PPC system.



There's two things I know:

1. yaboot isn't happy with the ISO file system and can't do its job.
    I'm stuck for now. Maybe an x86 system cannot make a proper
    bootable PPC ISO image.

2. Using qemu, I get a misbehaving kernel. That I can work on;
     I will be working on the kernel configuration for the next few
     weeks. If someone can tell me why everything I type when I
     try to login is shown as fuzzy blocks, that would be nice.

15

Re: Build ttylinux for powerPC

I'll try the PPC remastering this weekend when my Powerbook G4 is brought to me.  Thanks in advance for the efforts!  I can't wait to give it a shot.

Last edited by And (2010-03-30 10:03:06)

Re: Build ttylinux for powerPC

I've found the causes of the two problems of no clock device and fuzzy blocks when typing. I'll upload a decent qemu-working build by Friday. Hopefully the remaster operation will make a bootable CD.

Re: Build ttylinux for powerPC

I've removed the worst part of those errors and now I can run it in qemu-system-ppc and login and do stuff. After I fix the ttylinux boot scripts and see that they are doing everything right I'll upload the fixed-up build onto the main page as a release. I'll give a go at getting the network device up. Please see my earlier post for running qemu and running the remaster script.

The download now is http://ttylinux.org/Test/ttylinux-powerpc-11.1.iso.gz

Last edited by douglas (2010-03-30 22:10:42)

18

Re: Build ttylinux for powerPC

Awesome.

Re: Build ttylinux for powerPC

Oops. I got anxious. Don't look for a PowerPC download in the previously reported place. Refresh your browser on http://ttylinux.org/.

20

Re: Build ttylinux for powerPC

From Ubuntu 9.10, I downloaded ttylinux-powerpc-11.1.iso.gz, decompressed it, mounted it with "sudo mount -o loop ttylinux-powerpc-11.1.iso /mnt", then ran powerpc-remaster.sh from /mnt with "sudo mnt/powerpc-remaster.sh mnt ttylinux-ppc.iso."  The script outputted:

Using POWER000.SH;1 for  /powerpc-qemu.sh (powerpc-remaster.sh)
CHRP boot partition 1
PReP boot partition 2 is "boot/yaboot"
55.25% done, estimate finish Sun May 16 03:17:26 2010
Total extents actually written (inc HFS) = 8918
(Size of ISO volume = 8157, HFS extra = 761)
Total translation table size: 0
Total rockridge attributes bytes: 2891
Total directory bytes: 10240
Path table size(bytes): 72
Max brk space used 12000
9068 extents written (17 MB)

Then, I burned ttylinux-ppc.iso to a CD and tried to boot it with Yaboot 1.3.13.  It doesn't boot automatically from stage 1 Yaboot.  The screen just flashes black and returns to the prior boot selection screen.  From stage 2 Yaboot, I tried booting it with "cd:0,/boot/vmlinux initrd=/boot/initrd root=/dev/ram0 ramdisk_size=8192" like you suggested, and it started loading, but eventually stopped with:

[other stuff...]
no filesystem could mount root: tried: ext3 ext2 ext4 vfat msdos iso9660 [etc...]
kernel panic -net syncing: VFS: unable to mount root on unknown-block(1,0)
call trace:
[something about partitions]

If you want a more detailed error report I'd be glad to copy it all down, but I only get 180 seconds at a time unless I can find the error dump somewhere...

So it sounds like I'm having the same problems you were having...?

Also, it might be too late, but I couldn't find the Ubuntu kernel configuration in /proc but did find two configuration files in /boot.  I'll email you the files.

Last edited by And (2010-05-16 03:33:30)

Re: Build ttylinux for powerPC

I got the kernel config files, thanks; they will help me make a reasonable ttylinux PowerPC kernel config.

It will take me a day or so to remember what I was doing and where I'm at with it. And I won't be doing much of anything with this on the evenings the Suns play the Lakers, so maybe I'll have something by this Tuesday.

It seems to me that I still do not have the correct combination of
=> yabout and hfs configuration
=> file organization in the ISO image
=> mkisofs command in the remaster script

It sort of seems like the stage 2 boot couldn't get the initrd to the kernel i.e., yaboot can't read/interpret the ISO file system to get the initrd into memory for the kernel. But this is a guess on my part.

Re: Build ttylinux for powerPC

OK, I'm mostly caught-up, back to where I was.

The boot problem I have is that the CD-ROM I make doesn't boot on my old broken-down donated PowerBook G4 with a bad hard drive and cracked screen. So I boot into Open Firmware by holding down these keys when I power on: CMD-OPT-O-F  And then I am at the Open Firmware prompt and I boot yaboot on the CD-ROM like this:

     0 > boot cd:,\boot\yaboot

Now I get the ttylinux-configured yaboot and I simply hit enter and it loads the initrd and boots ttylinux. I can see the kernel has a few issues, the hwclock being one of them, but it boots just fine. I can log in as root and startup eth0 and use retawq, etc.

So I thought that I am failing to make a Mac-bootable ISO image, and the remaster script running on a PPC Linux would make an ISO image that would automatically boot its yaboot after it is burned to CD-ROM. It seems the remastered ISO image doesn't automatically boot. Or there is something wrong in the mkisofs command that makes the ISO image not Mac-bootable, or it is booting to yaboot and it is confused, because when I manually boot yaboot from OF it seems correct and boot ttylinux OK.

I'm confusered about it.

I uploaded the latest ttylinux powerpc image; you might want to try this:
ttylinux.org/Test/ttylinux-powerpc-11.2.iso.gz

Re: Build ttylinux for powerPC

To boot the ISO image in qemu, with this command:

     $ qemu-system-ppc -boot order=d -cdrom img/ttylinux-powerpc-11.2.iso

I need to have the yabbot.conf file in the top-level directory on in the ISO image. Without the yaboot.conf file in the top-level ISO image directory the qemu OF or yaboot complains that it cannot find yaboot.conf.

Perhaps the remastered ISO image has the same problem on a Mac. The latest ttylinux powerpc image at the link in the previous post has yaboot.conf in both locations. Please try the remaster script and burning the new image to CD-ROM and try booting that. Thanks.

24

Re: Build ttylinux for powerPC

Once remastered, both ttylinux-powerpc-11.1.iso and ttylinux-powerpc-11.2.iso boot from the open firmware prompt with "0 > boot cd:,\boot\yaboot".  I was hyped to see ttylinux work beautifully as ever on my Powerbook!  The Yaboot stage 2 screen is sexy.

Unfortunately, I ran powerpc-remaster.sh from Ubuntu on my Powerbook again, and burned it to a DVD and it didn't seem to affect the (open firmware free) Yaboot stage one or two boot behavior.  From stage one, the boot from CD option seems to take a little longer to return to the stage one boot prompt.  From stage two, with the suggested "cd:0,/boot/vmlinux initrd=/boot/initrd root=/dev/ram0 ramdisk_size=8192", it starts to boot but gives a similar error.  I'll post the complete error tomorrow.

Personally, I don't mind booting ttylinux from the open firmware prompt.  Maybe tomorrow I'll try to install it to the hard drive.

Last edited by And (2010-05-18 03:29:49)

25

Re: Build ttylinux for powerPC

Ok, so I've been tying to install ttylinux to my hard drive and the powerpc image doesn't seem to have filesys.gz on it.  Is there some obvious reason why?  I tried manual installation but I need that file there too.  Should I just make another image with that file added to it (copied from the i686 image or something)?  I doubt it because there is obviously some file system being used since ttylinux boots, right?  Is the file system intended to be used replaced by hfsmap, initrd or ofboot.b?

Last edited by And (2010-05-21 11:17:10)