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.
21 lines
476 B
Bash
21 lines
476 B
Bash
2 weeks ago
|
#!/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
|