-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnode-fix.sh
executable file
·49 lines (46 loc) · 1.17 KB
/
node-fix.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
#
# SPDX-License-Identifier: CDDL-1.0
#
# {{{ CDDL HEADER
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
# }}}
#
# Copyright 2024 Peter Tribble
#
cat > mvios.js <<EOF
var counter = 1;
var os = require('os');
var http = require('http');
http.createServer(function (request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello from MVI\n\n");
response.write("Request " + counter + "\n\n");
response.end(JSON.stringify(os.cpus()));
counter++;
}).listen(8000);
EOF
#
# we don't need all of this
#
rm -fr usr/versions/node-v18/include
rm -fr usr/versions/node-v18/share
# node is pure 64-bit
rm -f usr/lib/libgcc_s.*
rm -f usr/lib/libstdc++.so*
#
# modify MRSIZE
# the node binary itself is 107M, lib is about 12M
#
TSIZE=${MRSIZE/M/}
TSIZE=$((TSIZE+120))
export MRSIZE=${TSIZE}M