parent
dbc610e54e
commit
36f05c26e4
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# LEdoian's absurdly simple initrd generator (ad-hoc arc)
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
outdir="$1"
|
||||||
|
|
||||||
|
mkdir "$outdir/initrd"
|
||||||
|
cp 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,12 @@
|
|||||||
|
#!/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 link set eth0 up
|
||||||
|
/busybox ip route add default via 2a01:4f8:c0c:36b8:ff01:8000:0:1 dev eth0 onlink
|
||||||
|
|
||||||
|
/busybox ash
|
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
arch=x86_64
|
||||||
|
kernel=/boot/vmlinuz-linux
|
||||||
|
initrd_dir="$1"
|
||||||
|
shift 1
|
||||||
|
exec qemu-system-"$arch" -m 1G -kernel "$kernel" -initrd "$initrd_dir/initrd.img" -nographic -append console=ttyS0,115200n1 "$@"
|
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. ./lib.shs
|
||||||
|
|
||||||
|
mkdir state/$mach/initdir
|
||||||
|
tmux new-window -d vm1 sh -c machines/$mach/vm1/create.sh state/$mach/initdir \&\& machines/$mach/vm1/run.sh state/$mach/initdir
|
Loading…
Reference in New Issue