-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgo.sh
More file actions
executable file
·64 lines (44 loc) · 1.07 KB
/
go.sh
File metadata and controls
executable file
·64 lines (44 loc) · 1.07 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
shopt -s lastpipe
version="$(uname -r)"
kernel=/boot/vmlinuz-${version}
initrd=rblinux-initrd-$(git log -1 --format=%h).img
append='edd=off init=/init HOME=/home rw vga=792'
ruby -e 'puts RUBY_VERSION[0..2]' | read ruby_version
if dpkg -p libssl3
then
ssl_version=3
else
ssl_version=1.1
fi
mkdir cache -p
pushd cache
apt-get download libc6 linux-image-${version}
# framebuffer
apt-get download kmod libzstd1 liblzma5 libssl${ssl_version}
apt-get download coreutils util-linux libselinux1 libpcre2-8-0
apt-get download v86d libx86-1
# bash
apt-get download bash libtinfo6
# ruby
apt-get download ruby${ruby_version} libruby${ruby_version} zlib1g libgmp10 libcrypt1
# unpack
for deb in *.deb
do
echo "extracting ${deb}"
dpkg-deb -x "${deb}" ../initrd
done
popd
pushd initrd
pushd usr/bin
ln -sfv ruby${ruby_version} ruby
popd
echo "building initrd ${initrd}"
find . | cpio -o -H newc > "../${initrd}"
popd
echo "booting..."
qemu-system-x86_64 \
-kernel "initrd/${kernel}" \
-initrd "${initrd}" \
-append "${append}" \
-enable-kvm -m 4G $*