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

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

SYSLINUX=${ROOT_DIR}/contrib/syslinux/latest
[ ! -f ${SYSLINUX}/Makefile ] && $ROOT_DIR/bin/env.setup-syslinux.sh

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