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
508 B
Bash
23 lines
508 B
Bash
#!/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
|