summaryrefslogtreecommitdiffstats
path: root/bin/build.initramfs.sh
blob: 692c5e8996d0da645d9bf559cd71714bfd06a2f9 (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 -e "[build-initramfs] \t Create initramfs."
find . | cpio --quiet -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 -e "[build-initramfs] \t New initramfs created."
echo -e "\t\t\t   Location: ${ROOT_DIR}/build/initramfs-default."
echo -e "\t\t\t   Size: ${INITRAMFS_SIZE} bytes."