logo

bootstrap-initrd

Linux initrd to bootstrap from a small binary seed git clone https://hacktivis.me/git/bootstrap-initrd.git

make-initrd.sh (624B)


  1. #!/bin/sh
  2. # bootstrap-initrd: Linux initrd to bootstrap from a small binary seed
  3. # SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  4. # SPDX-License-Identifier: MPL-2.0
  5. WORKDIR="$(dirname "$0")"
  6. WORKDIR="$(realpath "$WORKDIR")"
  7. . "$WORKDIR/common.sh"
  8. : ${ALPINE_ARCH:=x86_64}
  9. name_base="bootstrap-initrd"
  10. out_base="${WORKDIR}/${name_base}/${ALPINE_ARCH}"
  11. set -ex
  12. ./make-root.sh || die "Failed: make-root"
  13. cd "$out_base" || die "Failed: cd $out_base"
  14. deblob -n
  15. find . -print0 | cpio --null -o --format=newc > "${out_base}.cpio"
  16. pigz --best -f -k "${out_base}.cpio"
  17. cd "${WORKDIR}"