Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: Canuma on October 28, 2015, 07:56:25 PM
-
I am pretty new to tinycore linux and i am still in progress of finding out how stuff works. So far i was able to set up a basic system. For my project however, i need java. The only hint i found so far is http://forum.tinycorelinux.net/index.php/topic,16261.msg96676.html#msg96676 (http://forum.tinycorelinux.net/index.php/topic,16261.msg96676.html#msg96676)
However, i am not quite sure how to do that.
Question:
Am I right to assume there is no ready to run java tcz?
If so, could someone provide a short step by step guide how to install the jdk? How can i build my own tcz? (It is stated in the link above, that I should not use /opt, but instead build a tcz)
Sorry if this was answered elswhere...
-
Hi Canuma
A tcz is a directory tree packed into a squash file system. There's a Wiki entry on extension building:
http://wiki.tinycorelinux.net/wiki:creating_extensions
-
I think I got java working in piCore 5 just by copying the JavaVM stuff across.
It was a long time ago now.
If I remember right I just copied the raspbian java directories across, took a bit of path sorting but it did work.
If I knew how to do tcz it would have helped, it's on my very long list.
-
If I knew how to do tcz it would have helped, it's on my very long list.
See http://wiki.tinycorelinux.net/wiki:extension_for_settings
and partly
http://wiki.tinycorelinux.net/wiki:creating_extensions
-
Thank you so much guys.
Java works now like a charme. In case somebody else find it usefull, here is what i did:
* download jdk (Linux ARM v6/v7 Hard Float ABI) http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html (http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
* transfered it to my box via scp
* install squashfs-tools
* make extension directory mkdir -p /home/tc/extension/usr/local/java
* extract tar xvzf jdk-8u65-linux-arm32-vfp-hflt.tar.gz -C /home/tc/extension/usr/local/java/
* make an assign file in /etc/profile.d/ (I used nano, course you might do it even with echo) sudo nano /etc/profile.d/java.sh
* insert and save: export JAVA_HOME=/usr/local/java/jdk1.8.0_65/
export PATH=$PATH:$JAVA_HOME/bin
* add /etc/profile.d to filetool.lst (again, i like nano... ;-) )
nano /opt/.filetool.lst
* insert and save:
etc/profile.d
* make jdk1.8.0_65.tcz
sudo -s
cd /home/tc/extension
mksquashfs extension/ jdk1.8.0_65.tcz
* now copy jdk1.8.0_65.tcz to your tce/optional folder and add it to your onboot.lst (path is probably different for you, so no code, but i guess you might know how to copy stuff)
* before you backup, you want to safe the jdk1.8.0_65.tcz elsewhere and finally rm extension folder, jdk-8u65-linux-arm32-vfp-hflt.tar.gz and jdk1.8.0_65.tcz
*now backup
and reboot
*test if everything works as expected: java -version
*it should say java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) Client VM (build 25.65-b01, mixed mode)
-
Thanks Canuma,
You should put in the tcz repository.
Does that have the FX stuff?
I have not checked for a while, I thought it was taken out from version 8.33.
I had to use Raspbian with JavaFx for one project, piCore with Java should be smaller and more reliable.
JavaFX can be used for non x11 GUI's and is GPU accelerated.
Regards
Gavin
-
Looks to be someone already does nightly builds of OpenJFX
http://108.61.191.178/
Not sure yet which one will work with your tcz or the difference between the three versions.
-
Thanks Canuma,
I used your clearly explained method of making a .tcz to make one for websocketd.
Compresses the 5Mb file to 1.9MB, added it to bootlist, still got a <20sec boot,
filetool.sh -b is much quicker as I am not backing up the websocket binary as well.
I will figure out how to make a md5 file later.
I can now go back a read the corebook and understand it a bit more:)
Regards
Gavin
-
Hi gavinmc42
I will figure out how to make a md5 file later.
md5sum ExtensionName.tcz > ExtensionName.tcz.md5.txt
Replace ExtensionName with the name of your extension.
-
Thanks,
md5sum is in busybox, so comes standard.
Still only know or use a fraction of those commands.
Hmm eject - no cdrom on my Pi , guess that won't work;)
For USB CDROM drives?
-
Hi gavinmc42
Hmm eject - no cdrom on my Pi , guess that won't work;)
For USB CDROM drives?
tc@box:~/guilib/grabber/grabber-1.1$ eject --help
BusyBox v1.19.3 (2011-10-30 01:47:29 UTC) multi-call binary.
Usage: eject [-t] [-T] [DEVICE]
Eject DEVICE or default /dev/cdrom
-t Close tray
-T Open/close tray (toggle)
tc@box:~/guilib/grabber/grabber-1.1$
For a list of the available busybox commands, just enter busybox in a terminal.
-
Was joking ;D
-
@gavinmc42
Glad it helped :-)
Unfortunatelly i am not sure about JavaFX, but you may try it with the port you mentioned.
For sharing the tcz, i am not comfortable with that, i guess it should be polished a bit more (for example, the env script should probably also go into the tcz, also there is certainly lot of other stuff to be taken care of)
Besides, java is a real hog. The tcz is huge and it would be great to actually remove stuff i don't need. But for now, it serves its purpose.
-
Might not be of any relevance, but I had to use this (in addition to what was mentioned by Canuma in reply #4) for some apps with Java 7 on x86:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JAVA_HOME/jre/lib/i386/
-
Hi Canuma,
Java + JFX is a hog, not sure having these beasts fits the Tiny Core philosophy.
500+MB? compressed tcz ?MB. Boot time?
Works on Raspbian, but that is a 4GB+ OS so Java is only a small part.
Can do some interesting stuff out of the box, I did this real quick.
https://www.raspberrypi.org/forums/viewtopic.php?f=81&t=104117&p=730773#p730773
Java + FX does work right now on Raspbian, needs some work which you have done to get it going on PiCore.
Yep Misalf, sorting out the PATH stuff is most of the work to get it running.
Still haven't found anything small that does the same accelerated stuff as easy yet.
The fact that Oracle has backed away from FX on ARM worries me a little.
But it still would be easier to backup a 600MB OS than a 4GB+ one.
Been looking at Ubuntu Snappy and Win10 IoT, they are around 500MB, but no GUIs.
Currently I'm thinking piCore plus some sort of native non X11 WebKit/WebGL for UI's.
There has been some work recently getting OpenGL to work on Pi's.
Processing 3 does work, slowly, it is a layer on top of Java.
If I need to do something quick or refactor the above project then PiCore + JFX will be worth another look.
When I get spare time :o I may look at how hard it is to get Netbeans talking to piCore+Java.
Thinking about Pi 2 and Quad cores and future models it makes more sense to look at Go plus something like OpenGLxx.
A language that can handle parallel processes without heavy lifting. Go is a 32MB tcz + a GUI library ?MB
Regards
Gavin
-
Gavin, your quest for size takes very strange turns. Basic X is less than 5mb compressed. Then you look at beasts like Java and Go ;)
-
Hi Curaga,
I need to know everything :-\
So I can make the best choice, speed, size, ease of use etc.
I used Raspbian + JavaFX because it just worked, boots straight to video with overlay dials.
For ALM it is not the best choice, large to backup etc, there is no version control on it.
Been a bunch of kernel/OS/Java mods since I did it and that was just a few months ago :'(
Actually started looking at the Raspbian Wayland/Weston stuff yesterday.
Think I will go that way instead of using X11.
Wonder if tcl/tk will run on Wayland?
It is about getting max bang for buck from the RPi's.
With Linux PCBs down to $9, going to need all the tricks I can learn to stay in the embedded electronics area.
The hardware is so cheap, it is now all about software.
I trend towards scripting languages because I can modify equipment code on the fly as long as it is connected to a network.
Regards
Gavin
-
Bang for the buck or low-powered hardware means you should avoid scripting, and use a compiled language. It's true C is not very fashionable right now, but it's far from becoming like COBOL.
-
Hi Curaga,
16MHz Arduino or 700Mhz Pi B+?
Need ethernet? I reach for Pi.
Scripting on Pi is normally at a higher level, no compiler needed. GCC is not lightweight.
I am behind a Uni firewall so installing dependencies is a pain. TinyC?
Luajit or micropython work fast enough so far.
Could use this to improve the python software loop jitters http://abyz.co.uk/rpi/pigpio/
In fact, thanks to your info in this post I now know how to tcz the pigpio daemon.
If I need high speed controlled I/O I normally use PSoC's controlled via the i2c on the Pi.
Or 32bit 50MHz Pic32MX's using UECIDE, similar to the Arduino tools.
Will get around to bare metal coding on the Pi 2. I think I can use one or more of the ARM cores to do Realtime stuff.
Hence Golang as a step to learning multicore coding.
Learning and mastering a little shell scripting, awk and sed etc is also very useful on the resume 8)
Regards
Gavin
-
16MHz Arduino or 700Mhz Pi B+?
Need ethernet? I reach for Pi.
...
If I need high speed controlled I/O I normally use PSoC's controlled via the i2c on the Pi.
Or 32bit 50MHz Pic32MX's using UECIDE, similar to the Arduino tools.
There are cipKIT boards compatible with Arduino on source code level and also can work with many Aurduino shields built on PIC32 processors, so they ara much faster and capable, see
http://chipkit.net/
Good point is that you can buy a preprogrammed PIC32 with Arduino compatible boot loader in a hobbiest friendly DIP package to make your own chipKIT adding few passive components, no XTAL needed. It is supported by Majenko's UECIDE.
There is another from Australia, MicroMite II. It is a small PIC32 board running MICROMITE BASIC. While I'm not a big fun of BASIC I have to admit, it is really a fantastic board. BASIC supports all PIC32 peripherals, interrupt routines, LCD and TFT display, 1-wire IC's, ultrasonic distance meter, humidity sensors, etc. with built-in functions. You can make an application just in few lines. Also you need just a terminal to program, no PICKIT3 or simi8lar device needed. Community is active as well as MICROMIRE BASIC actively develeoped. Additionally MICROMITE BASIC is opensource and available, you can add your own function. Source code compiles in MPLAB-X without issues, my first trial resulted a working code. Start with the author's Geoff site:
http://geoffg.net/micromite.html
These boards can be connected to Raspberry Pi easily via I2C or serial and also you can manage to download code to the boards via the RPi remotely.
BTW I'm planning to port MicroPython to this MicroMite II board.
-
Drool, dribble, micropython on Pic32.
Been using them for years instead of Arduinos.
Dip28 package, easy to breadboard and make pcbs for.
Been needing an excuse to move from MX250 to MX270.
Linux is new for me. Micros + C compiling is old hat.
Don't forget Pinguino's
http://www.pinguino.cc/
Micropython on PIC32MZxxx, ethernet, can etc?
Come on Microchip, give me a $2 IoT MZxxx 28pin dip chip with 2MB + ethernet :'(
-
Well, I have seen Microchip MZ demo running Linux :)
-
Very slowly? Tinycore?
Hmm microchip direct, about $10, $8 in volume?
Think I will stick with the Pi's
Or this
http://makezine.com/2015/09/24/the-9-computer-is-shipping-today/
Hope these guys can make enough.