OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Compiling Programs On The Sl-c3000, how to replace hardwired binaries?
Terrence
post Apr 6 2005, 11:08 AM
Post #1





Group: Members
Posts: 7
Joined: 6-April 05
Member No.: 6,801



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.
Go to the top of the page
 
+Quote Post
Meanie
post Apr 7 2005, 02:10 AM
Post #2





Group: Members
Posts: 2,808
Joined: 21-March 05
From: Sydney, Australia
Member No.: 6,686



QUOTE(Terrence @ Apr 7 2005, 05:08 AM)
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.
*


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
Go to the top of the page
 
+Quote Post
Terrence
post Apr 7 2005, 08:04 AM
Post #3





Group: Members
Posts: 7
Joined: 6-April 05
Member No.: 6,801



QUOTE(Meanie @ Apr 7 2005, 02:10 AM)
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
*


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).
Go to the top of the page
 
+Quote Post
iamasmith
post Apr 7 2005, 08:11 AM
Post #4





Group: Members
Posts: 1,248
Joined: 6-July 04
Member No.: 3,928



mount -o remount,rw /dev/root /

careful now!
Go to the top of the page
 
+Quote Post
Stubear
post Apr 7 2005, 08:49 AM
Post #5





Group: Members
Posts: 1,164
Joined: 17-December 03
From: Melbourne, AUSTRALIA
Member No.: 1,219



QUOTE(Terrence @ Apr 8 2005, 01:04 AM)
QUOTE(Meanie @ Apr 7 2005, 02:10 AM)

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
*


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.
*


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
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 wink.gif

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
Go to the top of the page
 
+Quote Post
iamasmith
post Apr 7 2005, 08:58 AM
Post #6





Group: Members
Posts: 1,248
Joined: 6-July 04
Member No.: 3,928



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.
Go to the top of the page
 
+Quote Post
Meanie
post Apr 7 2005, 02:33 PM
Post #7





Group: Members
Posts: 2,808
Joined: 21-March 05
From: Sydney, Australia
Member No.: 6,686



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.
Go to the top of the page
 
+Quote Post
melee
post Apr 17 2005, 06:02 AM
Post #8





Group: Members
Posts: 69
Joined: 17-March 05
Member No.: 6,651



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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 22nd July 2014 - 01:21 PM