Nodejs in Porteus KIosk

New features which should be implemented in Porteus Kiosk Edition and the kiosk wizard.
Post Reply
Dollynho
White ninja
White ninja
Posts: 9
Joined: 29 Aug 2018, 20:34
Distribution: Porteus KIosk

Nodejs in Porteus KIosk

Post#1 by Dollynho » 29 Aug 2018, 22:22

Have a simple way to add nodejs 8/10~ in porteus kiosk? I'm trying to download (the latest) everytime when reboot the system and install... but need tar... I dont find a xzm module of node

User avatar
fanthom
Site Admin
Site Admin
Posts: 5136
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Nodejs in Porteus KIosk

Post#2 by fanthom » 30 Aug 2018, 07:11

No plans for adding nodejs by default.

You need to create xzm module first (may try to use some .deb. or .rpm or slckware package) and then modify the ISO:
http://porteus-kiosk.org/kiosk-customization.html

since this is 'user modification to the ISO' we will not support it.

If you need a help then you could query customized builds service:
http://porteus-kiosk.org/builds.html
Please add [Solved] to your thread title if the solution was found.

roby
White ninja
White ninja
Posts: 5
Joined: 27 Jan 2019, 20:27
Distribution: Kiosk

Re: Nodejs in Porteus KIosk

Post#3 by roby » 27 Jan 2019, 20:39

This is actually quite simple. It's taken me about 15 minutes to get it working...

Create Node as a xzm package...
* Download the latest version of Node as a .deb file. I got mine from here: https://deb.nodesource.com/node_10.x/po ... /n/nodejs/ Make sure that you get the ARM64 version
* Copy the deb onto a Ubuntu machine. I used Xenial, any recent version will do
* You'll need mksquashfs. Install it using

Code: Select all

sudo apt-get install squashfs-tools
* Extract the contents of the deb using

Code: Select all

ar x nodejs_....deb
* You'll end up with several files. The data.tar.xz is the interesting one
* Extract the contents of data.tar.xz using

Code: Select all

tar -xJf data.tar.xz
* Create a directory called squashfs-root. Move the usr directory that was extracted from data.tar.xz into this squashfs-root directory
* Create a xzm file using

Code: Select all

mksquashfs squashfs-root/ node_10.x.xzm -comp xz -b 256K -Xbcj x86 -noappend
Add it to Porteus
* Extract the iso as described on the Porteus website
* Copy node_10.x.xzm into the xzm subfolder
* Repack the iso as described on the Porteus website

Done.

roby
White ninja
White ninja
Posts: 5
Joined: 27 Jan 2019, 20:27
Distribution: Kiosk

Nodejs in Porteus KIosk

Post#4 by roby » 12 May 2019, 22:28

Update: The above instructions seem to prevent /dev/cdrom working in Porteus kiosk.

The solution appears to be copying only the node binary, rather than the complete contents of the Deb package. No idea why this is the case.

* Extract the data.tar.xz as described above
* mkdir --parents squashfs-root/usr/bin
* cp usr/bin/node squashfs-root/usr/bin/node
* Create the xzm file as described above

codinghusi
White ninja
White ninja
Posts: 11
Joined: 27 Aug 2019, 20:06
Distribution: Porteus Kiosk

Nodejs in Porteus KIosk

Post#5 by codinghusi » 03 Sep 2019, 18:12

roby wrote:
27 Jan 2019, 20:39
Make sure that you get the ARM64 version
It should be AMD64 :)

I had also to copy only the /usr/bin folder.
Made a small script to automate that. (No warranty for anything)

Code: Select all

#!/bin/bash

mkdir tmp
cd tmp
ar x ../$1
tar -xJf data.tar.xz
mkdir --parents squashfs-root/usr
mv usr/bin squashfs-root/usr/bin
mksquashfs squashfs-root/ $2.xzm -comp xz -b 1M -Xbcj x86 -noappend
cd ..
mv tmp/$2.xzm $2.xzm
rm -rf tmp
How it works:
Create a file with the content above. For example "makemodule.sh"
Then make it runnable with

Code: Select all

chmod +x makemodule.sh
Now you need to download a AMD64 package from https://deb.nodesource.com/node_10.x/po ... /n/nodejs/
I put it into the same folder where my script is located.
In the last step you need to run this command. First argument is the deb-package you downloaded and the second is the name of the output file (.xzm will be appended)

Code: Select all

sudo ./makemodule.sh nodejs_10.0.0-1nodesource1_amd64.deb 009-nodejs
Have Fun :D

Post Reply