package-initrd 402 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. set -e
  3. cd $(dirname $0)/..
  4. BUILD=$(pwd)/build
  5. INITRD_DIR=${BUILD}/initrd
  6. ARTIFACTS=$(pwd)/dist/artifacts
  7. INITRD=${ARTIFACTS}/initrd
  8. mkdir -p ${ARTIFACTS}
  9. if [ ! -f ${ARTIFACTS}/vmlinuz ]; then
  10. exit 0
  11. fi
  12. if [ "$COMPRESS" == "" ]; then
  13. COMPRESS="gzip -1"
  14. fi
  15. cd ${INITRD_DIR}
  16. echo Creating ${INITRD}
  17. find | cpio -H newc -o | ${COMPRESS} > ${INITRD}
  18. echo Done creating ${INITRD}