Author Topic: Compiling Programs On The Sl-c3000  (Read 7105 times)

Terrence

  • Newbie
  • *
  • Posts: 7
    • View Profile
Compiling Programs On The Sl-c3000
« on: April 06, 2005, 03:08:01 pm »
I have been installing all of my favorite software on my SL-C3000 and
I have run into a snag. When running make to install LaTeX it complained
that my version of gawk was broken and that I should install a newer
one. This I did. The problem is that hdd1, which contains /bin is a read
only filesystem and my new version of gawk is in /usr/local/bin
I changed my .bashrc file so that /usr/local/bin appears before /bin in
the PATH and so `which gawk' returns:
/usr/local/bin/gawk
This is fine, but I don't think that `make' is seeing the new one since
I am still getting the same error. Is there any way that I can tell `make'
to use the newer one?

Something unrelated to my problem but that may be helpful to those of
you who are compiling  things for your Zaurus SL-C3000 is that some of the
librarires in /lib  don't have all of the necessary simbolic links. For example,
libdl.so.2 exists, but there is no libdl.so linking to it. So that when I
try to compile certain programs it doesn't find the library. I fixed this
by simply:
ln -s /lib/libdl.so.2 /usr/lib/libdl.so
and then ldconfig -v
So if you find errors saying that the compiler can't find certain functions
and you know that the correct libraries are there, it may be that there
isn't the proper simbolic links set up. The read only nature of the root
filesystem makes correcting these problems a little annoying.

And one last thing: The /tmp directory is, by default, way too small for
compiling large projects. It is only 1 mb and you will get errors saying
that the disk is full in the middle of compiling stuff. The fix that I use is
to bind an additional tmpfs to it with:

mount tmpfs /tmp -t tmpfs -o size=8m

to add an extra 8mb to the space.
« Last Edit: April 06, 2005, 03:25:01 pm by Terrence »

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Compiling Programs On The Sl-c3000
« Reply #1 on: April 07, 2005, 06:10:34 am »
Quote
I have been installing all of my favorite software on my SL-C3000 and
I have run into a snag. When running make to install LaTeX it complained
that my version of gawk was broken and that I should install a newer
one. This I did. The problem is that hdd1, which contains /bin is a read
only filesystem and my new version of gawk is in /usr/local/bin
I changed my .bashrc file so that /usr/local/bin appears before /bin in
the PATH and so `which gawk' returns:
/usr/local/bin/gawk
This is fine, but I don't think that `make' is seeing the new one since
I am still getting the same error. Is there any way that I can tell `make'
to use the newer one?

Something unrelated to my problem but that may be helpful to those of
you who are compiling  things for your Zaurus SL-C3000 is that some of the
librarires in /lib  don't have all of the necessary simbolic links. For example,
libdl.so.2 exists, but there is no libdl.so linking to it. So that when I
try to compile certain programs it doesn't find the library. I fixed this
by simply:
ln -s /lib/libdl.so.2 /usr/lib/libdl.so
and then ldconfig -v
So if you find errors saying that the compiler can't find certain functions
and you know that the correct libraries are there, it may be that there
isn't the proper simbolic links set up. The read only nature of the root
filesystem makes correcting these problems a little annoying.

And one last thing: The /tmp directory is, by default, way too small for
compiling large projects. It is only 1 mb and you will get errors saying
that the disk is full in the middle of compiling stuff. The fix that I use is
to bind an additional tmpfs to it with:

mount tmpfs /tmp -t tmpfs -o size=8m

to add an extra 8mb to the space.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=73838\"][{POST_SNAPBACK}][/a][/div]

Nice info. Thanks. I am about to get started to compile stuff too so this info is useful.

For your problem, you could just remount the root filesystem as rw, copy gawk to /bin and remount it back to ro
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

Terrence

  • Newbie
  • *
  • Posts: 7
    • View Profile
Compiling Programs On The Sl-c3000
« Reply #2 on: April 07, 2005, 12:04:28 pm »
Quote
Nice info. Thanks. I am about to get started to compile stuff too so this info is useful.

For your problem, you could just remount the root filesystem as rw, copy gawk to /bin and remount it back to ro
[div align=\"right\"][a href=\"index.php?act=findpost&pid=73954\"][{POST_SNAPBACK}][/a][/div]

Well that doesn't work since the root filesystem can't be unmounted. It will
say that it is busy. However, perhaps one could restart in single user mode
and do it that way.  I have found a software method of solving the problem
by going into the Makefile and setting AWK=/usr/local/bin/gawk and it seems
to work. I had to change several of the makefiles down the directory tree
though.

All said, I am really starting to love this little zaurus. It really is just like a
full sized laptop. I have a couple more questions that someone may be
able to help with though:

1) How do I create an ipk package file when I have successfully compiled
something so that I can let other people use that rather than spend the
hours it has taken me to modify the source code and makefiles.

2) What is the equivalent of x11 on this machine so that I can tell the
software to use the gui.

USB Storage:
One more hint: If you are connecting your zaurus to your other linux
box via a usb cable you will need the following info:
First you connect the usb cable. The zaurus will give you two messages
it will first say `AlertUSBStorage'. Just click `Yes' here. Then it will say
`AlertUSBStorageConnection', here you have to unplug the usb from the
zaurus, then click `ok' and then plug the usb back into the zaurus. Then
you will get a screen indicating that it is communicating with your pc.
It is crazy that it needs this kludge, it is like the old TV that
you had to bang your fist on the side to get a clear picture - but whatever
works I guess.
On the pc you will need to type `dmesg' to find out what device has been
assigned to the zaurus. It will be a usb mass storage device. If you have
ever used flash cards or usb digital cameras on your pc then you will
have all of the necessary kernel modules already running on your pc
and should have no problem (otherwise you will need to `modprobe usbstorage').
So once you have the correct device assignment you can mount the
zaurus by (for example with /dev/sda):
mount -t vfat /dev/sda /mnt/zaurus
if you wanted to mount it on /mnt/zaurus (which you should create first).
Then, and this is IMPORTANT, you should always transfer files to the
zaurus by copying them to the Documents directory. In other words
if I wanted to copy a file `foo' to the zaurus I would type
cp foo /mnt/zaurus/Documents/
The reason is that if you copy it straight to /mnt/zaurus you may run
into a problem that I ran into when I first naively tried it. Also make
sure that you unmount BEFORE disconnecting the usb cable and
wait until the umount completes (which may take some time if it has
to finish copying the files). The reason for these things is that hdd3 on
the zaurus is a vfat system (which you may want to reformat to an ext2
by mkfs.ext2, but then you won't be able to mount on a windows pc).
So I didn't do the above and ended up corrupting the FAT table on hdd3.
So I had to reboot into single user mode (the manual tells how to do this
by taking out the battery and performing some acrobatic gymnastics with
the keyboard and the battery) then I formatted /dev/hda3 by
mkdosfs /dev/hda3
followed by a reboot and reinstalling all my stuff. argh. So the moral is,
be carefull when transferring files and don't rush things.

There are many other things I could say, but it is hard to remember exactly
what kludges you used over the course of about 20 hours. If I have to use them
more than once I will mention them. (for example the coreutils preinstalled
doesn't contain many of the programs that compiling with make sometimes
requires, like cmp and comm and ed. So I had to find them or else change the
source code to use something else, like sed).

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Compiling Programs On The Sl-c3000
« Reply #3 on: April 07, 2005, 12:11:37 pm »
mount -o remount,rw /dev/root /

careful now!
« Last Edit: April 07, 2005, 12:11:53 pm by iamasmith »
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

Stubear

  • Hero Member
  • *****
  • Posts: 1164
    • View Profile
    • http://
Compiling Programs On The Sl-c3000
« Reply #4 on: April 07, 2005, 12:49:08 pm »
Quote
Quote
Nice info. Thanks. I am about to get started to compile stuff too so this info is useful.

For your problem, you could just remount the root filesystem as rw, copy gawk to /bin and remount it back to ro
[div align=\"right\"][a href=\"index.php?act=findpost&pid=73954\"][{POST_SNAPBACK}][/a][/div]

Well that doesn't work since the root filesystem can't be unmounted. It will
say that it is busy. However, perhaps one could restart in single user mode
and do it that way.  I have found a software method of solving the problem
by going into the Makefile and setting AWK=/usr/local/bin/gawk and it seems
to work. I had to change several of the makefiles down the directory tree
though.

The key word here is remount. Yes you can't unmount the root file system but you can remount it using the command iamasmith supplied above.

Quote
All said, I am really starting to love this little zaurus. It really is just like a
full sized laptop. I have a couple more questions that someone may be
able to help with though:

1) How do I create an ipk package file when I have successfully compiled
something so that I can let other people use that rather than spend the
hours it has taken me to modify the source code and makefiles.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=74039\"][{POST_SNAPBACK}][/a][/div]

The ipks are just renamed gzip tarballs that contain 3 files, data.tar.gz, control.tar.gz and debian-binary. You can unpack an ipk by using
Code: [Select]
tar xzf package.ipk if you use a real OS, or by renaming the ipk to package.tgz if you use Winzip on that other OS

The data.tar.gz contains all the files that you want to have installed on your Z, while control.tar.gz contains at the minimum a control file that has info about the application and occasionally some scripts named pre-inst.sh, post-inst.sh, pre-remove.sh and post-remove.sh (you don't need to have them all just the ones that do what you need doing for installing/removing the ipk)

debian-binary is a text file that contains "2.0" (without the quotes) - sorry I have no idea what its for

I generally create one off ipks by hand, but if I'm making an ipk for a package on a regular basis then I use a script to package it.

Hope this helps

Stu
SL-C1000, Hand converted to English with Japanese Input
Running X apps via X/Qt
iRiver USB host cable; Diatec P-Cord usb power cable (extendable); Acro's Reel Cable USB (A to A, B, Mini-B,  & Mini-B 8pin); GreenHouse 1Gb PicoDrive+; 2x256Mb Hagiwara SD cards; 128Mb Transcend CF card; 512Mb PQI CF card; AmbiCom WL1100C-CF 11B WLAN card

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Compiling Programs On The Sl-c3000
« Reply #5 on: April 07, 2005, 12:58:35 pm »
Oh, yes and I forgot to mention.. don't go overboard with this. you only have 5Mb in the rootfs on a 3000 and most of that's taken up with Kernel modules etc.
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Compiling Programs On The Sl-c3000
« Reply #6 on: April 07, 2005, 06:33:18 pm »
The debian file is optional. I build my ipk files without it and everything works fine. Although, I read somewhere that it was only required for real debian systems so if you want it to be compatible for more system you should add it.
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

melee

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
    • http://
Compiling Programs On The Sl-c3000
« Reply #7 on: April 17, 2005, 10:02:10 am »
2)
Quote
What is the equivalent of x11 on this machine so that I can tell the
software to use the gui.

Hi

Don't know anything about cacko ROM, but unless they have completely re-engineered everything, as far as I am aware there is no "X11" server, programs write to the screen frame buffer directly for speed and reduction of overhead

regards

Melee.
C860 - with Sharp ROM
1GB SD and 2 GB & 256MB CF
WiFi, Bluetooth and Sharp CF camera cards
Ubuntu 6.06
(WinXP if I really have to)