summaryrefslogtreecommitdiffstats
path: root/bin/build.initramfs.sh
blob: 36ee4eb52197489442ca30b6b338171fe71cdc44 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

ROOT_DIR=$(readlink -f $(dirname $(readlink -f $0))/..)

cd ${ROOT_DIR}/build/rootfs
echo "[build-initramfs] \t Create initramfs."
find . | cpio -H newc -o > ../initramfs-default.cpio
cd ..
gzip initramfs-default.cpio 

mv initramfs-default.cpio.gz initramfs-default
INITRAMFS_SIZE=$(stat -c %s ${ROOT_DIR}/build/initramfs-default)

cd - > /dev/null 2>&1

echo "[build-initramfs] \t New initramfs created."
echo "\t\t\t   Location: ${ROOT_DIR}/build/initramfs-default."
echo "\t\t\t   Size: ${INITRAMFS_SIZE} bytes."