Merge branch 'main' of ssh.marcbarbier.fr:Marc/chibraxos
This commit is contained in:
+1
-1
@@ -6,4 +6,4 @@ fi
|
|||||||
|
|
||||||
CFLAGS=""
|
CFLAGS=""
|
||||||
|
|
||||||
gcc osLoader.c -o init
|
gcc osLoader.c -o init --static
|
||||||
|
|||||||
@@ -2,8 +2,24 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
//Chemin exacte de node (a changer aprés la creation d'un gestionnaire de packets)
|
//Chemin exacte de node (a changer aprés la creation d'un gestionnaire de packets)
|
||||||
#define NODE "/usr/local/bin/node"
|
#define NODE "/usr/local/bin/node"
|
||||||
|
#define BUN "/usr/bin/bun"
|
||||||
#define INIT "/core/index.js"
|
#define INIT "/core/index.js"
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
printf("Booting \n");
|
||||||
|
if(access(NODE, F_OK) == 0) {
|
||||||
|
printf("Starting Nodejs\n");
|
||||||
|
sleep(2);
|
||||||
execl(NODE, NODE, INIT, NULL);
|
execl(NODE, NODE, INIT, NULL);
|
||||||
}
|
}
|
||||||
|
else if(access(BUN, F_OK) == 0) {
|
||||||
|
printf("Starting bun\n");
|
||||||
|
sleep(2);
|
||||||
|
execl(BUN, BUN, "run", INIT, NULL);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
printf("JS binary not found\n");
|
||||||
|
while(1);
|
||||||
|
}
|
||||||
|
sleep(5);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user