make-initrd.sh (624B)
- #!/bin/sh
- # bootstrap-initrd: Linux initrd to bootstrap from a small binary seed
- # SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
- # SPDX-License-Identifier: MPL-2.0
- WORKDIR="$(dirname "$0")"
- WORKDIR="$(realpath "$WORKDIR")"
- . "$WORKDIR/common.sh"
- : ${ALPINE_ARCH:=x86_64}
- name_base="bootstrap-initrd"
- out_base="${WORKDIR}/${name_base}/${ALPINE_ARCH}"
- set -ex
- ./make-root.sh || die "Failed: make-root"
- cd "$out_base" || die "Failed: cd $out_base"
- deblob -n
- find . -print0 | cpio --null -o --format=newc > "${out_base}.cpio"
- pigz --best -f -k "${out_base}.cpio"
- cd "${WORKDIR}"