OESF Portables Forum

Model Specific Forums => Sharp Zaurus => Zaurus - Other distros support => Topic started by: illbay on March 17, 2022, 02:16:18 am

Title: Linux From Scratch on the Zaurus
Post by: illbay on March 17, 2022, 02:16:18 am
Hi greguu,

I just wanted to thank you for all of your hard work with this. I have dug my old Zaurus SL-C3100 out of the cobwebs to use as a handy dandy learning platform for linux and programming. Not a powerful beast by todays standards but I think that will make it even more fun!!

I am very interested in Linux From Scratch (LFS) and thought your voidz project may be a good starting point to achieve a bespoke LFS system on the Zaurus.

Fingers crossed.

All the best.

Cheers
Title: Re: Linux From Scratch on the Zaurus
Post by: Varti on March 17, 2022, 04:08:18 am
Hi and welcome!

I have moved your post in a new topic, since this discussion is about a new distro. I have never heard of LFS before, it looks like a great way to learn about the internals of Linux. Voidz is currently the fastest Zaurus distro using recent 5.x kernels, and it also has the lowest memory footprint. I wonder if further optimizations will be possible; I would love to have a fast X environment running on it, but I'm afraid it would be too demanding for our devices.

Varti
Title: Re: Linux From Scratch on the Zaurus
Post by: illbay on March 17, 2022, 06:30:13 am
Hi Varti

Thanks for updating the post to a new topic. Bit of a troglodyte when it comes to this sort of thing.

I am probably being over ambitious but I do like a challenge. My inspiration comes from looking at other OS's like MorphOS or OpenBSD running on an old iBook G4 (2005) for example. Runs better than Mac OS X Tiger!! Go figure.

I agree that a modern X environment may be a hard ask for the little bugger but maybe there is some other magical graphical UI out there in the digital fairy land that will fit like a glove.

I'll let you know how I get on.

Cheers

illbay
Title: Re: Linux From Scratch on the Zaurus
Post by: illbay on March 19, 2022, 11:05:43 pm
Have installed voidz build-8 from https://github.com/greguu/voidz-packages/releases on SL-C3100 without issue.

GREAT!!

I have posted over here https://www.oesf.org/forum/index.php?topic=34937.msg298456#msg298456 regarding the missing repo which is mentioned in the install instructions.

I understand that voidz on the old Z is probably considered a long forgotten thing so this is not a surprise.

I was hoping I could just start building the packages that I need and this is where I am now. Stuck.

Voidz build-8 does not have some essential software like git or gcc for example.

I cloned the voidz-packages on another machine and then transferred to the zaurus hoping that would allow me to either binary-bootstrap or if need be bootstrap. No go, no git.

I have also installed void linux proper x86_64 in a vm and then tried doing the Build a RootFS instructions. I have a chroot problem or I am doing this completely wrong.

All I am trying to achieve is the ability to build some basic software on the zaurus under voidz. I think if the repo was active I would probably not be having these issues because the binaries that I need are probably available in there.

If someone could point me to the correct way to build binaries either on the zaurus itself under voidz without access to any repo or cross compile using the voidz-packages.git repo that would be much appreciated.

Am I having fun yet? Sort of.

I guess this is what it is all about.

Off to try something else.

Cheers

illbay
Title: Re: Linux From Scratch on the Zaurus
Post by: Varti on March 20, 2022, 06:40:53 am
Build8 indeed doesn't have neither gcc nor git, but you can find them in the older build7 repository (gcc-8.2.0_2.armv5tel-musl.xbps and git-2.18.0_1.armv5tel-musl.xbps). However I'd not recommend compiling on the Zaurus itself, because of speed and memory constraints. All the packages for Voidz have been compiled using a crosscompiler, there should be somewhere some instructions on how to do this, either on the github page or here. I have also sent an email to greguu to notify him about this thread.

Varti
Title: Re: Linux From Scratch on the Zaurus
Post by: illbay on March 20, 2022, 07:27:26 am
Thanks again Varti.

I see that the repos still exist but maybe just have an SSL Certificate issue.

Being able to get binaries from the repo will be great.

In the meantime I was able to work out how to cross compile binaries on an x86_64 install of void linux installed on a virtual machine.

It turns out that the instructions at https://github.com/greguu/voidz-packages under Build a RootFS! was what worked. I must have suffered from a temporary brain fart when I tried before.  ;)

For any one interested, what I am going to do is probably mad but I am trying to set up voidz linux on my SL-C3100 so I can follow the instructions at Linux From Scratch here https://www.linuxfromscratch.org/lfs/view/stable/

This is more of a learning experience for me as well as an investigation in to why software these days requires so much resources to do basic things.

I love the design and utility of the Zaurus and hate to see it sitting idle.

My reason for even trying to build an entire OS on the Zaurus is this https://www.openbsd.org/zaurus.html

Quote
After the OpenBSD/cats was completed in order to benefit from a good ARM development platform, work on the Zaurus hardware started in 2004. Since the Zaurus was a fully capable machine, we didn't cross compile. All builds of Zaurus were done on the Zaurus directly.

I am obviously not the first to do this but like I said this is really a learning and investigation experience for myself.

I will post updates here if you are interested in following along and laughing.  :)

Cheers

illbay

Title: Re: Linux From Scratch on the Zaurus
Post by: Varti on March 21, 2022, 04:44:58 am
Thanks again Varti.

I see that the repos still exist but maybe just have an SSL Certificate issue.

Being able to get binaries from the repo will be great.

In the meantime I was able to work out how to cross compile binaries on an x86_64 install of void linux installed on a virtual machine.

It turns out that the instructions at https://github.com/greguu/voidz-packages under Build a RootFS! was what worked. I must have suffered from a temporary brain fart when I tried before.  ;)
The procedure seems to be quite straightforward. The most recent rootFS (build8) is already 3 years old, we really need an updated one, I'd be curious to know if a recent FS would fix the certification issues. Would you like to try to make a new voidz release yourself? Otherwise I could try it myself, I already have Void Linux on my laptop as my main (and only) OS.

Quote
I love the design and utility of the Zaurus and hate to see it sitting idle.
I couldn't agree more, too bad Sharp has not continued the line. I read that at Sharp they always saw them just as portable dictionaries, nothing more, and that they chose Linux only to differentiate them from other PDAs.

Varti
Title: Re: Linux From Scratch on the Zaurus
Post by: illbay on March 21, 2022, 06:15:42 am
Hi Varti

Quote
Would you like to try to make a new voidz release yourself?

That sounds like a great idea. I am currently having strange issues with setting up voidz build7 so it has all the required tools to start the LFS process.

Maybe a new build will help that and also maybe help others who would like to revive their Z's.

I am no expert but I have been taking a look at greguu's git repo including his commits to the original void-packages, etc. It will be a learning experience in itself going through those updates to understand what they are doing and why and see if they work for a new build.

Once I have something that works I will post under Zaurus Void Linux Support (https://www.oesf.org/forum/index.php?board=205.0)?

illbay
Title: Re: Linux From Scratch on the Zaurus
Post by: Varti on March 21, 2022, 09:08:23 am
Thanks for taking time to look into this. I have received an answer from greguu, he's glad to hear that there's still interest on voidz! Please post any update on the general Voidz subforum. We can host here the rootfs at the same path where the others are stored.

Varti
Title: Re: Linux From Scratch on the Zaurus
Post by: Varti on March 22, 2022, 05:45:25 am
Greguu has answered me again with some more details: a new build would fix the certification issue, but we'd need to re-base the current xbps-src git and then patch again a voidz build together and compile it. This is not very complicated, most is already documented in the official docs, but it can take a while as many packages need fixing or patching. These changes which greguu made are all in the commits on his github as reference.

Instead of rebuilding, the certificate can be extracted from a current void package (ca-certificates) as well, or the SSL_NO_VERIFY_PEER workaround can be used as well.

A new kernel build and a new rootfs are planned, but it will take a while as the Zaurus Cxx00 has to be moved to Device Tree, this will need quite a lot of patches. He said that he'd welcome a new rootfs maintainer.

Varti
Title: Re: Linux From Scratch on the Zaurus
Post by: illbay on March 23, 2022, 03:21:53 am
So far I have started with a fresh clone of void-packages from the official git repo.

I then copied greguu's zaurus packages across into the new srcpkgs tree including linux4.19-zaurus and followed the instructions detailed by greguu to build a new rootfs.

Some of the patches did not work out of the box so I had to patch files manually, no biggy.

For the most part the build worked up until gettext-0.21_4 when building pkg zaurus-base.

Getting an error like:

Quote
configure.ac:25: error: AC_INIT should be called with package and version arguments

This appears to be a problem with M4, autom4te, aclocal and autoreconf. I have done a search and the problem appears to be very common but still haven't worked out a way to get past it yet.

As far as becoming a rootfs maintainer, this is probably out of my league at present. As I said I wanted to go through the LFS book to learn more about this stuff but haven't quite got there yet. I wouldn't like to let people down.

I am happy to continue with trying to build a new rootfs and document my learnings and help out any way I can.

I am not familiar with github or git but I will create a github account and document my findings there if that is of any help to greguu or anyone else interested.

I am very surprised how far the rootfs build process actually got without too much baby sitting. I wonder if it will just work once I get it to build. I would not have been able to get this far without greguu's patches and instructions so big thanks to him.

Cheers

illbay
Title: Re: Linux From Scratch on the Zaurus
Post by: Varti on March 24, 2022, 06:13:03 am
Forwarding greguu's answer:

It could be just a simple issue on the Void host install, missing some dependencies or a toolchain configuration issue. What I noticed in the past, if you try to compile an old xbps-src tree on a fresh void installation, you will get issues as the library dependencies are not in sync. Compiling the old xbps-src tree from my voidz will only reliably work on an older Void install host. Void is a rolling distribution, so hard to go back in time, I do not recommend even trying.

On a new git clone from xbps-src you need to re-base, that can take a bit of time and patience as a lot would have changed in 3 years.

Varti
Title: Re: Linux From Scratch on the Zaurus
Post by: greguu on March 25, 2022, 02:12:50 am
Thanks Varti.

illbay, if you want to try to build void linux for armv5tel again, based on a fresh git clone of xbps-src, I am happy to assist, but I have limited resources at the moment. The 5.0 kernel should work fine with a new rootfs. Check the commits I did on my github. I basically used Busybox where possible to reduce memory footprint and had to tweak a few other apps to compile for armv5tel, but that was 3 years ago. It may be much more of a challenge today.

Varti, I guess there are some other armv5tel distributions out there that are still active ? I have not looked recently, but it may be worth investigating if we cloud jump ship from ALARM to another one, for pre-built binary packages. Status of OE is unclear, I have lost track of ant and others since the freenode debacle.

I may find more time later this year.

Cheers!
Title: Re: Linux From Scratch on the Zaurus
Post by: illbay on March 25, 2022, 03:05:17 am
Thanks Varti and greguu

What you say makes sense and also gives me some clues as to how to proceed.

This is not an important or urgent project, just something I fell into and would like to give a try. Peoples time is precious expecially in these strange days.

No fear, I will persevere and see how I go.

On a side note, I am not active at all on social media let alone forums but a big thank you to Varti who, from what I have seen, always makes people welcome and is super active and positive.

A pleasure to be here really.

Cheers

illbay
Title: Re: Linux From Scratch on the Zaurus
Post by: illbay on March 28, 2022, 06:16:15 pm
I have decided to stick with build 7 of voidz because it looks like everything I need is available and the repo is up and running.

The only problem I am having is busybox. While busybox is great for this type of machine due to its low resource requirements, it appears that some of the commands it supplies are no good for building an OS. Missing switches, etc.

I am now in the process of removing busybox and replacing it with the full gnu packages. I did do this already and ended up with an unbootable machine. Something  to do with symlinks, init and runit I think. Being more careful and methodical this time around.

Hopefully I will be able to start the LFS process soon.

illbay
Title: Re: Linux From Scratch on the Zaurus
Post by: greguu on April 09, 2022, 05:05:58 am
The voidz rootfs depends on busybox-zaurus to boot etc, you can not remove busybox-zaurus without breaking voidz.
However, you can replace some of the tools provided via busybox, with their "full version" by building and then installing the corresponding package.
This will have to be on top of the standard rootfs, eg on top of busybox-zaurus.
See the commit for busybox-zaurus to see what it covers : https://github.com/greguu/voidz-packages/commit/7d03a16c9955d9c67711bee8f14fc70d74936717
Title: Re: Linux From Scratch on the Zaurus
Post by: greguu on April 09, 2022, 05:54:51 am
by the way, from what I found :

"ARMv5 users can look to Debian and derivatives for continuing support for their devices."
https://archlinuxarm.org/forum/viewtopic.php?f=3&t=15721

 It may be worth to setup a Debian armv5 rootfs instead, the voidz 5 kernel would be fine I guess.
Title: Re: Linux From Scratch on the Zaurus
Post by: illbay on April 10, 2022, 06:39:04 pm
Thanks greguu

I have been able to get around the busybox thing and then hit another problem with a bug in the armv5 version of perl that was installed on voidz so had to recompile a newer version of that.

Many cycles later and lots of hacking I decided to give the full version of LFS a miss as it clearly does not take into account the arm architecture.

I haven't given up though, found another version of LFS called CLFS (https://clfs.org/view/clfs-embedded/arm/ (https://clfs.org/view/clfs-embedded/arm/)) which looks like it might work on the zaurus. In the process of compiling GCC. I think this is day 3, hahaha....

In my travels I came across something interesting called the Yocto Project. Has anyone had any experience with this specifically for the Zaurus?

I see a contribution from a Richard Purdie for the zaurus called zaurusd (https://git.yoctoproject.org/zaurusd/ (https://git.yoctoproject.org/zaurusd/)) which looks promising.

From what I understand, if the Yocto Project can handle armv5te then you should be able to cross compile a complete custom linux distribution at will. In the process of getting my head around how it all works.

Cheers

illbay
Title: Re: Linux From Scratch on the Zaurus
Post by: greguu on April 12, 2022, 03:53:46 am
Thanks greguu

I have been able to get around the busybox thing and then hit another problem with a bug in the armv5 version of perl that was installed on voidz so had to recompile a newer version of that.

Many cycles later and lots of hacking I decided to give the full version of LFS a miss as it clearly does not take into account the arm architecture.

I haven't given up though, found another version of LFS called CLFS (https://clfs.org/view/clfs-embedded/arm/ (https://clfs.org/view/clfs-embedded/arm/)) which looks like it might work on the zaurus. In the process of compiling GCC. I think this is day 3, hahaha....

In my travels I came across something interesting called the Yocto Project. Has anyone had any experience with this specifically for the Zaurus?

I see a contribution from a Richard Purdie for the zaurus called zaurusd (https://git.yoctoproject.org/zaurusd/ (https://git.yoctoproject.org/zaurusd/)) which looks promising.

From what I understand, if the Yocto Project can handle armv5te then you should be able to cross compile a complete custom linux distribution at will. In the process of getting my head around how it all works.

Cheers

illbay

Hi illbay,

yes, Yocto, formerly OE had even Zaurus support, but I am not sure how well it is maintained today in regards to armv5tel.

From personal experience, if you like to built from scratch and if you are really keen, you could try gentoo.
They still maintain a stage3-armv5tel-openrc rootfs it seems. Check their servers.

You can use the Void Linux kernel and kexecboot kernel to boot the rootfs, I am sure.
But you will need a large CF card or drive to hold all the src and dl data for the compilation stage.
There are posts here on OESF on how to swap the internal drive.
Once you got a large drive, 8GB or more, then install the gentoo rootfs.

Then bootstrap from the stage3, but make sure you have a ethernet connection (CF recommended) and
setup ccache and distcc alongside another x86-64 host ideally running a recent gentoo or arch.
This is should be all documented on the excellent gentoo manuals and wiki.

The Zaurus can be configured to just do the preprocessing and the x86-64 will do the actual gcc compilation work.
This will be still much slower than pure cross-compiling, but it will work.
You will learn also a lot on the way on how to set up your linux / gnu system.

Cheers,
Greguu
Title: Re: Linux From Scratch on the Zaurus
Post by: miskinis on April 12, 2022, 08:52:57 am
Hello!

I have just started using this forum again, after many years, and starting to "catch up" on things.

It is nice to heard that someone is working on a new Zaurus distro, and I also share the feelings behind some of the statements regarding the "fun" that someone posted about, speaking about their use of a C-1000 for LINUX, after "dusting off the cobwebs".

I somewhat recently acquired a C-750, but I used to primarily use an SL-6000.

I do not see any reason why an X environment, which is "speedy" can not be achieved, but of course that term is subjective.  In the past, I used PDAXROM, PDAXQTROM, and even tried a myriad of X servers on the Zaurus.  At one point I ran a full JAVA 2 on an SL-5500 before acquiring an SL-6000, and it was quite slow concerning Java 2 (also known as "swing"), but it did function, and at the time, I believe I was using the OpenZaurus OS.

Anyway, for the next week or so, I hope to catch up, to check out "void LINUX", and possibly what has been done in the LFS domain as well.  I am finding that many of the websites, and files are no longer available, so for the time-being I am "stuck" with the Cacko installed on the C-750. :)

Best Wishes, John
Title: Re: Linux From Scratch on the Zaurus
Post by: illbay on April 14, 2022, 06:10:14 pm
Thanks again greguu.

I stumbled upon this website https://vminko.org/gentoo_manuals/zaurus_c1000 (https://vminko.org/gentoo_manuals/zaurus_c1000)when looking for something. I had a quick look but noticed the dates and assumed it was a long forgotten thing. But no, as you say ARMv5tel is alive and well here https://www.gentoo.org/downloads/ (https://www.gentoo.org/downloads/) which is great!!

I don't know anything about ccache or distcc but will do soon. Anything to speed things up a bit would be great. As I said I am (still) compiling gcc-6.2.0 on my poor SL-C3100. It did break with an error and the time then was:

real    9121m54.611s
user    1436m24.087s
sys     287m7.737s

I fixed the error and set it going again. That was 2 days ago I think.

I understood that this would be a problem but things are getting a bit ridiculous.  :) gcc is a tough ask by any means so I shouldn't complain.

It is looking like armv5 is slowly disappearing from many projects support. Understandable I guess seeing it's age and what is available today. I still like the zaurus and its form factor though and intend to get some more life out of it if I can.

Hello again John. Yes X on the zaurus is ok with me. I have been taking a look at what is useable with the frame buffer directly. Early days. So much to learn. Any luck with the files on the website I mentioned above (same as other post)? If you scroll down you will find mirrors of some sites that the site owner has stored.

Cheers

illbay
Title: Re: Linux From Scratch on the Zaurus
Post by: greguu on April 15, 2022, 03:47:53 am
...in general, running a full Xorg server on Zaurus today, will not be a pleasant experience.
The best performance you can get out of a Zaurus will be by using pure console mode and the odd application using DirectFB or fbdev.
For graphical browsing, you may try the fbdev or SDL backend option via netsurf browser.
You can get SDL apps use DirectFB or fbdev without Xorg, such as games like doom etc, links browser and other apps.
There are some threads exploring these options, somewhere buried in this form...

Personally, I may find some time to build a new voidz or gentoo rootfs and kernel, but rest assured, this will not yield in more usability per se, just more up to date packages.

It's great so see some recent interest in the platform again. If you like to contribute, please share your success and failures.
Title: Re: Linux From Scratch on the Zaurus
Post by: Varti on April 15, 2022, 04:32:59 am
Anyway, for the next week or so, I hope to catch up, to check out "void LINUX", and possibly what has been done in the LFS domain as well.  I am finding that many of the websites, and files are no longer available, so for the time-being I am "stuck" with the Cacko installed on the C-750. :)
For the missing websites it is usually worth to check if there's a mirror of them on archive.org, I have found many lost sites and files there. If you agree, we could open a new thread with a list of the websites you need, and we keep the list updated with all the infos we'll find. I'll host all the recovered sites here, while Elsix is being rebuilt.

Varti
Title: Re: Linux From Scratch on the Zaurus
Post by: illbay on April 15, 2022, 08:02:11 pm
I am happy to report that my little Zaurus SL-C3100 just finished compiling gcc-6.2.0 - Static, including mpfr-3.1.4, gmp-6.1.1 and mpc-1.0.3 with the following settings:

gcc-6.2.0/configure \
  --prefix=${CLFS}/cross-tools \
  --build=${CLFS_HOST} \
  --host=${CLFS_HOST} \
  --target=${CLFS_TARGET} \
  --with-sysroot=${CLFS}/cross-tools/${CLFS_TARGET} \
  --disable-nls \
  --disable-shared \
  --without-headers \
  --with-newlib \
  --disable-decimal-float \
  --disable-libgomp \
  --disable-libmudflap \
  --disable-libssp \
  --disable-libatomic \
  --disable-libquadmath \
  --disable-threads \
  --enable-languages=c \
  --disable-multilib \
  --with-mpfr-include=$(pwd)/../gcc-6.2.0/mpfr/src \
  --with-mpfr-lib=$(pwd)/mpfr/src/.libs \
  --with-arch=${CLFS_ARM_ARCH} \
  --with-float=${CLFS_FLOAT} \
  --with-fpu=${CLFS_FPU}

Total times:

1st run (compile error in ubsan.c - line 1472 changed to xloc.file == (const char*)'\0')

real    9121m54.611s
user    1436m24.087s
sys     287m7.737s

2nd run

real    2009m22.416s
user    666m5.417s
sys     75m4.632s

TOTAL

real   185.52 hours (7 days, 17.52 hours)
user   35.03 hours
sys   6.03 hours


Not bad at all really!!  :o

illbay ;)

EDIT 6/6/22 - Oopsy on the total calculations for user and sys. Corrected above. Added the raw data for reference and confirmation.
Title: Re: Linux From Scratch on the Zaurus
Post by: miskinis on April 16, 2022, 06:05:16 pm
Wow... I am just skimming some posts now, but I will return. :)
Title: Re: Linux From Scratch on the Zaurus
Post by: illbay on May 07, 2022, 08:09:44 pm
Still here!!

Moving house, losing hair rapidly.

If I ever find all my stuff again I will continue where I left off.

Cheers

illbay
Title: Re: Linux From Scratch on the Zaurus
Post by: greguu on May 20, 2022, 02:38:08 am
Still here!!

Moving house, losing hair rapidly.

If I ever find all my stuff again I will continue where I left off.

Cheers

illbay

 ;D Same here, including the hair loss  8)
Title: Re: Linux From Scratch on the Zaurus
Post by: illbay on May 13, 2023, 09:11:04 pm
Lets try that again....

Interesting topic here:

https://www.oesf.org/forum/index.php?topic=36793.0

Obsolescence policy exists everywhere it seems.....

Not to worry, there's always NetBSD.  ;D

To work.....brb

illbay