You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
510 B
Bash

#!/bin/bash
# LEdoian's absurdly simple initrd generator (ad-hoc arc)
2 weeks ago
here="$(dirname "$0")"
set -eu
outdir="$1"
mkdir "$outdir/initrd"
2 weeks ago
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