Compare commits
10 Commits
2ee68a9d92
...
9bc6ab076c
Author | SHA1 | Date |
---|---|---|
|
9bc6ab076c | 2 weeks ago |
|
acbbdd8f3d | 2 weeks ago |
|
2312c185cc | 2 weeks ago |
|
ae17c43314 | 2 weeks ago |
|
36f05c26e4 | 2 weeks ago |
|
dbc610e54e | 2 weeks ago |
|
a28697d7b5 | 2 weeks ago |
|
edc3224d75 | 2 weeks ago |
|
049f638d20 | 2 weeks ago |
|
25f8283931 | 2 weeks ago |
@ -1,2 +1,2 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
unshare -rnm ./init.sh
|
unshare -rnmpf --mount-proc ./init.sh
|
||||||
|
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# LEdoian's absurdly simple initrd generator (ad-hoc arc)
|
||||||
|
|
||||||
|
here="$(dirname "$0")"
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
outdir="$1"
|
||||||
|
|
||||||
|
mkdir "$outdir/initrd"
|
||||||
|
cp "$here/init" "$outdir/initrd/"
|
||||||
|
|
||||||
|
busybox="$(which busybox)"
|
||||||
|
cp "$busybox" "$outdir/initrd/busybox"
|
||||||
|
|
||||||
|
# TODO: get kernel version from /boot/vmlinuz-linux (which we use)
|
||||||
|
kver="$(uname -r)"
|
||||||
|
zstdcat /usr/lib/modules/$kver/kernel/drivers/net/ethernet/intel/e1000/e1000.ko.zst > "$outdir/initrd/e1000.ko"
|
||||||
|
|
||||||
|
pushd "$outdir/initrd"
|
||||||
|
find . | cpio -o -H newc > ../initrd.img
|
||||||
|
popd
|
@ -0,0 +1,13 @@
|
|||||||
|
#!/busybox ash
|
||||||
|
|
||||||
|
/busybox echo START
|
||||||
|
#/busybox mdev -s
|
||||||
|
# we know the modules, lol :-)
|
||||||
|
/busybox insmod /e1000.ko
|
||||||
|
/busybox ip link set lo up
|
||||||
|
/busybox ip addr add 2a01:4f8:c0c:36b8:ff01:8000:0:3/128 dev eth0
|
||||||
|
/busybox ip addr add fe80:ff01:8000::3 dev eth0 scope link
|
||||||
|
/busybox ip link set eth0 up
|
||||||
|
/busybox ip route add default via fe80:ff01:8000::2 dev eth0
|
||||||
|
|
||||||
|
/busybox ash
|
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
arch=x86_64
|
||||||
|
kernel=/boot/vmlinuz-linux
|
||||||
|
initrd_dir="$1"
|
||||||
|
sockpath="$2"
|
||||||
|
shift 2
|
||||||
|
qemu-system-"$arch" -m 1G -nic tap,id=net0,ifname=tap-vm1,script=no,downscript=no -kernel "$kernel" -initrd "$initrd_dir/initrd.img" -chardev socket,id=sock0,path="$sockpath",mux=on,server=off -serial chardev:sock0 -mon chardev=sock0,mode=readline -daemonize -display none -append console=ttyS0,115200n1 "$@"
|
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. ./lib.shs
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
mkdir state/$mach/initdir
|
||||||
|
machines/$mach/vm1/create.sh state/$mach/initdir
|
||||||
|
machines/$mach/vm1/run.sh state/$mach/initdir state/$mach/vm1.sock
|
Loading…
Reference in New Issue