Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: fritz3170 on November 07, 2012, 01:46:12 PM

Title: Adding X Desktop to rpiCore
Post by: fritz3170 on November 07, 2012, 01:46:12 PM
Hey guys,

i tried to install X because it seems not to be integrated in the stock version wich i downloaded
(rpiCore-20121103.img.gz)

searched the forums wich linked me to the wiki page:
hXXp://wiki.tinycorelinux.net/wiki:adding_a_desktop_to_microcore

tried out the steps but i think some packages arent compiled yet or some not provided to add
a desktop to the core system on raspberry pi because its arm.

but i found 2 topics in thi raspberry pi forum where bmarkus solved to run a gui.

can someone explain the steps to get X with rpiCore?

Thanks in advance!

fritz3170
Title: Re: Adding X Desktop to rpiCore
Post by: bmarkus on November 07, 2012, 03:50:07 PM
Work in progress. Wait a bit for extensions.
Title: Re: Adding X Desktop to rpiCore
Post by: phillip.toone on November 08, 2012, 04:25:52 PM
Hello all.  I just discovered the Raspberry Pi last week and Tiny Core just yesterday.  I am trying to build a device that will take input from two momentary switches through the GPIO and provide graphical results a monitor/TV (among other things).  I was going to use an old computer paired with a PIC Micro or an arduino to accomplish this but the Raspberry Pi looks perfect.  I suppose I could accomplish this with the official Raspbian "wheezy" but Tiny Core seems ideal.  But I am going to want to use something like FLTK or something even lighter to keep this project small, fast and simple.  Any help would be appreciated.

I just got Tiny Core running in terminal on the Raspberry Pi I got in the mail just yesterday.  Now what do I do to get some sort of graphical interface/GUI/X?
Title: Re: Adding X Desktop to rpiCore
Post by: bmarkus on November 09, 2012, 05:40:35 AM
For those eager to have piCore with X before official release I can offer a private preview using current snapshot. Let me know here or in PM if you want to have it.
Title: Re: Adding X Desktop to rpiCore
Post by: phillip.toone on November 09, 2012, 07:54:56 AM
Thanks bmarkus, I've sent you a PM.  I look forward to hearing back from you.  Maybe I can help you develop this.  I'll do my best but don't hold your breath.  I'm not really a programmer, I just play one on the internet. =)
Title: Re: Adding X Desktop to rpiCore
Post by: bmarkus on November 09, 2012, 08:27:38 AM
Thanks bmarkus, I've sent you a PM.  I look forward to hearing back from you.  Maybe I can help you develop this.  I'll do my best but don't hold your breath.  I'm not really a program, I just play one on the internet. =)

No PM received.
Title: Re: Adding X Desktop to rpiCore
Post by: phillip.toone on November 09, 2012, 08:34:47 AM
No PM received.

Thank you for letting me know.  I think it took me three tries to get this to work.
Title: Re: Adding X Desktop to rpiCore
Post by: bmarkus on November 09, 2012, 10:19:23 AM
Thanks bmarkus, I've sent you a PM.  I look forward to hearing back from you.  Maybe I can help you develop this.  I'll do my best but don't hold your breath.  I'm not really a program, I just play one on the internet. =)

Phillip,

thanks for your interest. You can help with testing, sending bug reports, create extensions and on many other ways.

Sent instructions in PM. Let us know the result.

Regards... Bela
Title: Re: Adding X Desktop to rpiCore
Post by: phillip.toone on November 09, 2012, 11:07:03 AM
Let us know the result.

Ok, since you said to let "us" know I will respond here rather than a PM.

I first cleared the contents of my 16GB SD card using RedHat Disk Utility 2.30.1.

I installed rpiCore-20121103.img.gz to the SD card with the following:

Code: [Select]
gunzip < rpiCore-20121103.img.gz | dd of=/dev/sdf bs=1M
I viewed contents of the SD card (using RedHat Disk Utility 2.30.1).  There is now a 39MB FAT32 (0x0c) partition on the SD card.

I created a 1GB ext4 (0x83) partition named tce (again using RedHat Disk Utility 2.30.1)

I mounted the partition and created a folder named "tce" on the root of this partition.

I unzipped the contents of the TC.ZIP file to the tce folder (contained ondemand, optional, firstrun, onboot.lst, xwbar.lst)

I created a 1GB Linux swap (0x82) partition (again using using RedHat Disk Utility 2.30.1)

I installed the SD card into the Raspberry Pi and was booted into the CLI

I typed startx at the command line and received the following response

Quote
-sh: startx: not found

I typed the following:

Code: [Select]
ls /mnt
and received the following response:

Quote
mmcblk0p1/ mmcblk0p2/
Title: Re: Adding X Desktop to rpiCore
Post by: bmarkus on November 09, 2012, 11:14:29 AM
Are extensions installed? Try mc for checking and look at the /usr/local/tce.installed dir.
Title: Re: Adding X Desktop to rpiCore
Post by: phillip.toone on November 09, 2012, 11:19:10 AM
Try mc for checking and look at the /usr/local/tce.installed dir.

I typed

Code: [Select]
mc
at the command line and got

Quote
-sh: mc: not found

I typed

Code: [Select]
ls /usr/local/tce.installed/
at the command line and got nothing in response (directory exists but is empty).
Title: Re: Adding X Desktop to rpiCore
Post by: bmarkus on November 09, 2012, 11:24:30 AM
For some reason extensions not loaded

Type

ls -l /etc/sysconfig

and check tcedir which is a symlink to used tce directory

Is the new partion, mmcblk0p2 mounted? If not, can you mount it? Is tce der with the expected structure?
Title: Re: Adding X Desktop to rpiCore
Post by: phillip.toone on November 09, 2012, 11:31:57 AM
ls -l /etc/sysconfig

Yes the link tcedir is pointing at /mnt/mmcblk0p2/tce

I'm not sure how to assess the contents of the link.  The following

Code: [Select]
cd /mnt/mmcblk0p2/
yields

Quote
-sh: cd: can't cd to mmcblk0p2/

(note, I am an ubuntu user and I am used thing automatically mounting to /media when I plug them in)
Title: Re: Adding X Desktop to rpiCore
Post by: bmarkus on November 09, 2012, 11:38:04 AM
Try:

sudo mount /mnt/mmcblk0p2
ls /mnt/mmcblk0p2
ls /mnt/mmcblk0p2/tce
ls /mnt/mmcblk0p2/tce/optional

At the last command you must see extensions inside.

Try to install mc:

tce-load -i mc

What happenes?



Title: Re: Adding X Desktop to rpiCore
Post by: phillip.toone on November 09, 2012, 11:52:18 AM
tce-load -i mc

I rebooted the device and typed

Code: [Select]
tce-load -i mc
but nothing happens.

The contents of tce partition are mounted correctly but are only viewable as su

Code: [Select]
sudo ls /mnt/mmcblk0p2/tce/optional
Title: Re: Adding X Desktop to rpiCore
Post by: bmarkus on November 09, 2012, 11:57:39 AM
Hm..... I have a report on successful installation based on same instructions and file. Anyhow, I will make an image of my working 4G card to make installation simple. Will do it a bit later after family programs.
Title: Re: Adding X Desktop to rpiCore
Post by: bmarkus on November 09, 2012, 01:22:59 PM
Pictures sent by Ken, GPSFun running piCore:

(http://www.hasix.org/tc/IMG_1170_1.JPG)

(http://www.hasix.org/tc/IMG_1171_1.JPG)
Title: Re: Adding X Desktop to rpiCore
Post by: fritz3170 on November 09, 2012, 01:51:58 PM
Hey guys!

Big thx bmarkus for your support, i got it up and running now too!

so happy and speechless :D

going to play around a little bit and i am willing to test, help and support in any way that great project!


@phillip.toone
just an idea, could it be that something gone wrong while partitioning or copy the files to the sd card?

i have pretty little know how on linux but it worked by the first try.

just try it another time or wait until someone shares his RAW img to flash directly the desktop version.

(http://upit.de.gg/TinyCoreRaspberryPiGUI.JPG)
Title: Re: Adding X Desktop to rpiCore
Post by: phillip.toone on November 09, 2012, 02:00:56 PM
i have pretty little know how on linux but it worked by the first try.

I use linux every day.  :-[
Title: Re: Adding X Desktop to rpiCore
Post by: fritz3170 on November 09, 2012, 02:13:07 PM
I use linux every day.  :-[

okay, i used linux too sometimes but very graphical and 'nooby'
try it out another time, maybe just something gone wrong.



the next step for me will be to bring it up running a graphical web browser

maybe i should learn something about compiling extensions for TC  :D
Title: Re: Adding X Desktop to rpiCore
Post by: bmarkus on November 09, 2012, 02:27:28 PM

the next step for me will be to bring it up running a graphical web browser

maybe i should learn something about compiling extensions for TC  :D

Well, most graphical browsers depend on GTK2 which is not available yet. Fastest solution is to get Dillo3 built which is based on Fltk. It must be built statically as require different Fltk version than in the base.

Extensions can be built on the same way as for x86, check WIKI. Only difference is you can't use Intel specific compiler options of course. It is on my todo list but you are welcome to do it :)

piCore toolchain is OK, I'm using it to build extensions native in piCore.
Title: Re: Adding X Desktop to rpiCore
Post by: bmarkus on November 09, 2012, 02:29:51 PM
phillip.toone@

I'm uploading a dd image. Will PM when ready for download.
Title: Re: Adding X Desktop to rpiCore
Post by: phillip.toone on November 09, 2012, 02:37:21 PM
Well, most graphical browsers depend on GTK2 which is not available yet. Fastest solution is to get Dillo3 built which is based on Fltk. It must be built statically as require different Fltk version than in the base.

Now that you brought it up I'll ask a related question.  My first project and motivation to use rpiCore is to create an application that will take information from momentary switches connected to pins on the GPIO of the Raspberry Pi and display graphical results.  I haven't done any graphical programming since I was learning BASIC as an 8-10 years old kid on my parent's IBM PCjr.  I've been aware of Qt and GTK+ for some time now.  I just learned about FLTK a few days ago.  Yesterday I discovered pygame and I am learning how to use it now.

Any recommendations about what I should be using?  Maybe pygame isn't the best think for me to use?  Let me know.  I plan to have the Raspberry Pi boot directly into my app and run full screen without any options to boot any other programs so I shouldn't even need a windows manager.  Thanks for all you help and I look forward to your opinions on this.
Title: Re: Adding X Desktop to rpiCore
Post by: Lee on November 09, 2012, 02:50:07 PM
tce-load -i mc

The contents of tce partition are mounted correctly but are only viewable as su

Code: [Select]
sudo ls /mnt/mmcblk0p2/tce/optional

I don't have a Pi and haven't tried the Pi Core but for a few minutes in a vm so just tell me if I'm off the mark, but shouldn't the tce directory be visible to, even owned by, user tc?


@ fritz3170: Nice job with the Legos.  :)

Title: Re: Adding X Desktop to rpiCore
Post by: phillip.toone on November 09, 2012, 02:53:35 PM
shouldn't the tce directory be visible to, even owned by, user tc?

I wondered that as well.  Also interesting to note that when I do:

Code: [Select]
sudo tce-load -i mc
I get:

Quote
Don't run this as root.
Title: Re: Adding X Desktop to rpiCore
Post by: Rich on November 09, 2012, 03:07:12 PM
Hi phillip.toone
You could try:
Code: [Select]
sudo chown tc:staff /mnt/mmcblk0p2/tce
sudo chmod 775 /mnt/mmcblk0p2/tce
and see if you can load the extension then.
Title: Re: Adding X Desktop to rpiCore
Post by: phillip.toone on November 09, 2012, 03:10:49 PM
Hi phillip.toone
You could try:
Code: [Select]
sudo chown tc:staff /mnt/mmcblk0p2/tce
sudo chmod 775 /mnt/mmcblk0p2/tce
and see if you can load the extension then.

Thanks Rich, I just tried that but I still nothing happens when I

Code: [Select]
tce-load -i mc
Maybe it would help to explain what this tce-load command is supposed to be doing.  Maybe there is something obvious that I am missing.  I don't understand tce or mc.
Title: Re: Adding X Desktop to rpiCore
Post by: Rich on November 09, 2012, 03:35:41 PM
Hi phillip.toone
Those two command should have changed the ownership and permissions of the  /mnt/mmcblk0p2/tce
directory making them accessible to you. Come to think of it, that probably should have been:
Code: [Select]
sudo chown -R tc:staff /mnt/mmcblk0p2/tce
sudo chmod -R 775 /mnt/mmcblk0p2/tce
Run the two commands listed and then see if:
Code: [Select]
ls /mnt/mmcblk0p2/tce/optionalreturns anything. You should see mc.tcz in the list.
Extensions are stored in tce/optional/.
mc (Midnight Commander) is a simple file manager.
tce-load -i is used to load a local extension.

Title: Re: Adding X Desktop to rpiCore
Post by: phillip.toone on November 09, 2012, 03:47:31 PM
Code: [Select]
sudo chmod -R 775 /mnt/mmcblk0p2/tce

That didn't work but this did:

Code: [Select]
sudo chmod -R 777 /mnt/mmcblk0p2/tce
so now I use:

Code: [Select]
tce-load -i mc
and I have a working Midnight Commander.  :)

So now I need to still install x.  I'm just going to try installing each of these packages and see if they work.  Maybe there is one that is the parent of the others?
Title: Re: Adding X Desktop to rpiCore
Post by: Rich on November 09, 2012, 04:19:32 PM
Hi phillip.toone
Quote
That didn't work but this did:
Quote
sudo chmod -R 777 /mnt/mmcblk0p2/tce
That suggests that maybe you are not logged in as user  tc, but at least you made some progress.
Title: Re: Adding X Desktop to rpiCore
Post by: bmarkus on November 09, 2012, 06:30:08 PM
phillip.toone@

Uploaded image of my SD card, it must work. Download info sent in PM.

sudo tce-load -i mc

is my fault, no need of sudo. It simly install mc and it's dependecies from /tce/optional if for some reason not installed (mounted) but available.

TC loads extensions from /tce/optional listed in /tce/onboot.lst plus their dependensies recursively in ...dep files

Title: Re: Adding X Desktop to rpiCore
Post by: phillip.toone on November 15, 2012, 10:30:45 AM
Uploaded image of my SD card, it must work. Download info sent in PM.

Thanks bmarkus.  The download file was huge (piCore-X-001.img.xz = 1.9 GB) and the image file (piCore-X-001.img = 3.7GB) was even bigger.  It took a long time to extract the file and write it to my SD card.  But it works!  I assume there will be a smaller download of this available in the future.

My experience:  WOW!  This thing is lightning fast!  Does this OS reside in ram like Puppy?  It is super fast like puppy is on a decent computer.  (I found puppy to be to slow on the Raspberry Pi.)
Title: Re: Adding X Desktop to rpiCore
Post by: bmarkus on November 15, 2012, 11:06:15 AM
SD card image was a one to one copy of my card and not a regular distribution image. Of course normal downloads will be different.

No idea how Puppy works.

piCore base runs in RAM, but extensions are mounted from the SD card. Maybe X parts loaded to RAM, can't check it now, see /tce/copy2fs.lst if exist.


Title: Re: Adding X Desktop to rpiCore
Post by: hlavery on November 16, 2012, 07:12:42 PM
@bmarkus...did you compile Xorg using the curaga scripts and src (changed for arm), or download files from some distro? I am trying to get X on allwinner a10, but downloading the Debian versions via import just abort on a call to busybox mktemp as Debian Xorg seem to expect Gnu mktemp options and so abort  Busybox vs. Gnu mktemp seems to be an old problem, looking through the archives, but I don't see a definitive solution.  Thanks.
Title: Re: Adding X Desktop to rpiCore
Post by: bmarkus on November 17, 2012, 04:31:09 AM
@slavery

Do not know Curaga's script and src. Downloaded Xorg 7.6 source from www.x.org and built. It works, just final testing tcz's. There were no issues building it native but it takes time due to many dependencies and configure options and also due to slow QEMU environment. Regarding config, as no accelerated video available only fb, I built it without MESA, so no GL at the moment but it is fine.

Building libs, apps, drivers no any special config parameter used. For Xserver I can share the cinfig pars if you need.

BTW I built tcz's with protos and libs before proceeding to have RAM otherwise I gout out of mem even with large swap.
Title: Re: Adding X Desktop to rpiCore
Post by: curaga on November 17, 2012, 09:08:51 AM
Those would be in the usual place:

ftp://ftp.nluug.nl/pub/metalab/distributions/tinycorelinux/4.x/x86/tcz/src/Xorg-7.6
Title: Re: Adding X Desktop to rpiCore
Post by: hlavery on November 17, 2012, 11:13:20 AM
@bmarkus...It would be helpful if you could send me your compilation configuration via messages.

 I think that even if I managed to get the Debian X system to start that it is so bloated that the end result would not be much like Tinycore.  I will give the curaga scripts a try now, at least once I buy a bigger SD card.  i would rather compile in hardware in Core (which now works for me on the Miniand Hackberry) but need more room to do so.