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

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."