make-initrd.sh (705B)
- #!/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}"
- test -z "${EXCLUDE_EXTRAS}" && out_base="${out_base}+extras"
- set -ex
- ./make-root.sh || die "Failed: make-root"
- cd "$out_base" || die "Failed: cd $out_base"
- deblob -n
- find . -type f -print0 | sort -z | pax -w -0 -M norm -x sv4cpio -f "${out_base}.cpio"
- pigz --best -f -k "${out_base}.cpio"
- cd "${WORKDIR}"