Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit 5c16805

Browse files
author
Gao feng
committed
make cbfs rom through Makefile
`make cbfs` will generate cbfs.rom under build directory. Signed-off-by: Gao feng <[email protected]>
1 parent a8b61d2 commit 5c16805

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

build/Makefile.am

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ bin_PROGRAMS=hyper_daemon
22
hyper_daemon_SOURCES=hyper_daemon.c ../src/net.c
33
all-local:
44
bash ./make-initrd.sh
5+
6+
cbfs-local:
7+
bash ./make-initrd.sh cbfs

build/make-initrd.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,22 @@ do
1919
done
2020
done
2121
cd ./root && find . | cpio -H newc -o | gzip -9 > ../hyper-initrd.img
22+
23+
24+
if [ "$1" != "cbfs" ]; then
25+
exit 0
26+
fi
27+
28+
cd ../
29+
30+
echo "build cbfs"
31+
rm -rf .cbfs
32+
rm -rf cbfs.rom
33+
34+
mkdir .cbfs
35+
dd if=/dev/zero of=.cbfs/boot.bin bs=4096 count=1
36+
cbfstool .cbfs/cbfs.rom create -s 4096k -B .cbfs/boot.bin -m x86 0x1000
37+
cbfstool .cbfs/cbfs.rom add -f kernel -n vmlinuz -t raw
38+
cbfstool .cbfs/cbfs.rom add -f hyper-initrd.img -n initrd -t raw
39+
cp .cbfs/cbfs.rom ./
40+
rm -rf .cbfs

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
AC_PREREQ([2.69])
55
AC_INIT([hyperstart], [0.1], [www.hyper.sh])
66
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
7+
AM_EXTRA_RECURSIVE_TARGETS([cbfs])
78
AC_CONFIG_SRCDIR([src/init.c])
89
AC_CONFIG_HEADERS([config.h])
910

0 commit comments

Comments
 (0)