1
0
mirror of https://github.com/rancher/os.git synced 2025-06-21 12:37:04 +00:00
os/scripts/package-initrd
Sven Dowideit b3a9893fcf Add version string to the initrd file so we can have 2 modern initrd's on the disk
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-01-27 03:50:00 +00:00

27 lines
417 B
Bash
Executable File

#!/bin/bash
set -e
cd $(dirname $0)/..
source scripts/version
BUILD=$(pwd)/build
INITRD_DIR=${BUILD}/initrd
ARTIFACTS=$(pwd)/dist/artifacts
mkdir -p ${ARTIFACTS}
if [ ! -f ${ARTIFACTS}/vmlinuz-${KERNEL_VERSION} ]; then
exit 0
fi
if [ "$COMPRESS" == "" ]; then
COMPRESS="gzip -1"
fi
cd ${INITRD_DIR}
echo Creating ${INITRD}
find | cpio -H newc -o | ${COMPRESS} > ${INITRD}
echo Done creating ${INITRD}