nodejs from source
This commit is contained in:
@@ -1,32 +1,40 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
sudo umount rootfs/proc -R
|
# 2> /dev/null veut dire que l'on veut pas voire les erreurs
|
||||||
sudo rm -rf rootfs/
|
sudo umount rootfs/proc -R 2> /dev/null
|
||||||
sudo rm root.iso
|
sudo rm -rf rootfs/ 2> /dev/null
|
||||||
sudo rm chibrax.tar.gz
|
sudo rm root.iso 2> /dev/null
|
||||||
|
sudo rm chibrax.tar.gz 2> /dev/null
|
||||||
mkdir -p rootfs/
|
mkdir -p rootfs/
|
||||||
mkdir -p rootfs/boot
|
mkdir -p rootfs/boot
|
||||||
mkdir -p rootfs/chibrax
|
mkdir -p rootfs/chibrax
|
||||||
|
|
||||||
#installation de node & de grub
|
#installation de grub
|
||||||
sudo pacstrap rootfs coreutils nodejs grub sed
|
sudo pacstrap rootfs coreutils grub sed
|
||||||
|
|
||||||
|
echo "construction de Nodejs"
|
||||||
|
chmod +x ./nodejs/build.sh
|
||||||
|
cd nodejs && ./build.sh || exit 1 && cd -
|
||||||
|
echo "done"
|
||||||
|
|
||||||
chmod +x ./chibraxLoader/build.sh
|
chmod +x ./chibraxLoader/build.sh
|
||||||
cd chibraxLoader && ./build.sh && cd -
|
cd chibraxLoader && ./build.sh && cd -
|
||||||
sudo cp chibraxLoader/init rootfs/bin/
|
sudo cp chibraxLoader/init rootfs/bin/ || exit 1
|
||||||
|
|
||||||
cd kernel && ./from_current.sh && cd -
|
cd kernel && ./from_current.sh && cd -
|
||||||
sudo cp kernel/src/vmlinuz rootfs/boot
|
sudo cp kernel/src/vmlinuz rootfs/boot || exit 1
|
||||||
|
|
||||||
echo "Cloning the firmware"
|
echo "Cloning the firmware"
|
||||||
git clone https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
|
# on masque les erreurs si le depot est deja clone
|
||||||
|
git clone https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git 2> /dev/null
|
||||||
cd linux-firmware && git pull && cd -
|
cd linux-firmware && git pull && cd -
|
||||||
sudo mkdir -p rootfs/usr/lib/firmware
|
sudo mkdir -p rootfs/usr/lib/firmware
|
||||||
sudo cp linux-firmware/* rootfs/usr/lib/firmware/ -r
|
sudo cp linux-firmware/* rootfs/usr/lib/firmware/ -r || exit 1
|
||||||
|
|
||||||
echo "rebuilding C++ hooks"
|
|
||||||
./clibs.sh
|
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|
||||||
sudo cp rootfs\ overrides/* rootfs/ -r
|
echo "rebuilding C++ hooks"
|
||||||
|
./clibs.sh || exit 1
|
||||||
|
echo "done"
|
||||||
|
|
||||||
|
sudo cp rootfs\ overrides/* rootfs/ -r || exit 1
|
||||||
|
|
||||||
sudo rm rootfs/var/cache -rf
|
sudo rm rootfs/var/cache -rf
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#define ERR 1
|
#include <stdio.h>
|
||||||
|
//Chemin exacte de node (a changer aprés la creation d'un gestionnaire de packets)
|
||||||
#define node "/bin/node"
|
#define node "/usr/local/bin/node"
|
||||||
#define chibrax "/chibrax/index.js"
|
#define chibrax "/chibrax/index.js"
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
return execl(node, node, chibrax);
|
execl(node, node, chibrax);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
node node_modules/node-gyp/bin/node-gyp.js configure
|
node node_modules/node-gyp/bin/node-gyp.js configure
|
||||||
node node_modules/node-gyp/bin/node-gyp.js build
|
sudo node node_modules/node-gyp/bin/node-gyp.js build
|
||||||
|
|
||||||
cp build/Release/syscall.node rootfs\ overrides/chibrax/syscall.node
|
cp build/Release/syscall.node rootfs\ overrides/chibrax/syscall.node
|
||||||
@@ -41,6 +41,12 @@ echo "coping rootfs"
|
|||||||
cp rootfs/* $CHIBRAX_MOUNT_POINT -r
|
cp rootfs/* $CHIBRAX_MOUNT_POINT -r
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|
||||||
|
echo "removing arch's grub hooks"
|
||||||
|
rm rootfs/etc/grub.d/10_linux
|
||||||
|
rm rootfs/etc/grub.d/20_linux_xen
|
||||||
|
#celui sert a rien tant qu'on ne supporte pas l'uefi
|
||||||
|
rm rootfs/etc/grub.d/30_uefi-firmware
|
||||||
|
|
||||||
echo "installing grub"
|
echo "installing grub"
|
||||||
arch-chroot $CHIBRAX_MOUNT_POINT grub-install --target=i386-pc ${LOOP_ROOT} --modules=part_msdos
|
arch-chroot $CHIBRAX_MOUNT_POINT grub-install --target=i386-pc ${LOOP_ROOT} --modules=part_msdos
|
||||||
arch-chroot $CHIBRAX_MOUNT_POINT grub-mkconfig -o /boot/grub/grub.cfg
|
arch-chroot $CHIBRAX_MOUNT_POINT grub-mkconfig -o /boot/grub/grub.cfg
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
if [ -f /bin/pacman ] # btw
|
if [ -f /bin/pacman ] # btw
|
||||||
then
|
then
|
||||||
sudo pacman -S python gcc make bc
|
sudo pacman -S python gcc make bc unzip wget sudo binutils nasm
|
||||||
else if [ -f /bin/apt ] #deb / ubuntu
|
else if [ -f /bin/apt ] #deb / ubuntu
|
||||||
then
|
then
|
||||||
sudo apt-get install python3 g++ make
|
sudo apt-get install python3 g++ make bc unzip wget sudo
|
||||||
else if [ -f /bin/dnf ] #fedora
|
else if [ -f /bin/dnf ] #fedora
|
||||||
then
|
then
|
||||||
sudo dnf install python3 gcc-c++ make bc
|
sudo dnf install python3 gcc-c++ make bc unzip wget sudo
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
src
|
||||||
Executable
+24
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ "$EUID" = 0 ]
|
||||||
|
then echo "Please don't run this as root"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
VERSION=17.1.0
|
||||||
|
|
||||||
|
if [ ! -f src ]
|
||||||
|
then
|
||||||
|
mkdir src -p
|
||||||
|
cd src
|
||||||
|
curl https://github.com/nodejs/node/archive/refs/tags/v$VERSION.zip -L --output $VERSION.zip || exit 1
|
||||||
|
unzip $VERSION.zip || exit 1
|
||||||
|
cd -
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd src/node-$VERSION
|
||||||
|
./configure || exit 1
|
||||||
|
make -j$(nproc) || exit 1
|
||||||
|
cd -
|
||||||
|
|
||||||
|
sudo src/node-$VERSION/tools/install.py install $(pwd)/../rootfs || exit 1
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
let environment = {
|
let environment = {
|
||||||
path: ["/usr/bin", "/usr/lib/sheebr"],
|
path: ["/usr/bin", "/usr/lib/sheebr", "/usr/local/bin"],
|
||||||
ls_color: JSON.stringify({
|
ls_color: JSON.stringify({
|
||||||
di: [01, 34],
|
di: [01, 34],
|
||||||
ln: [01, 36],
|
ln: [01, 36],
|
||||||
|
|||||||
Reference in New Issue
Block a user