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

Commit 03ddf53

Browse files
committed
move kernel and modules into arch specified path
Signed-off-by: Gao feng <omarapazanadi@gmail.com>
1 parent 88deee6 commit 03ddf53

File tree

8 files changed

+10
-12
lines changed

8 files changed

+10
-12
lines changed

build/Makefile.am

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ export INCLUDE_KMODULES=1
55
endif
66

77
if WITH_AARCH64
8+
ARCHPATH=arch/aarch64
89
initrd-local:
910
bash ./make-initrd.sh aarch64
1011
else
12+
ARCHPATH=arch/x86_64
1113
initrd-local:
1214
bash ./make-initrd.sh
1315
endif
@@ -16,8 +18,10 @@ cbfs-local:
1618
bash ./make-initrd.sh cbfs
1719

1820
kernel-local:
21+
cp $(ARCHPATH)/kernel_config ./kernel_config
1922
hyperctl build -t hyperstart-dev:latest .
20-
hyperctl run --rm hyperstart-dev:latest cat /root/build/result/kernel >kernel.new && mv -f kernel.new kernel
21-
hyperctl run --rm hyperstart-dev:latest cat /root/build/result/modules.tar >modules.tar
22-
mv kernel_config kernel_config.old
23-
hyperctl run --rm hyperstart-dev:latest cat /root/build/result/kernel_config >kernel_config
23+
hyperctl run --rm hyperstart-dev:latest cat /root/build/result/kernel >kernel.new && mv -f kernel.new $(ARCHPATH)/kernel
24+
hyperctl run --rm hyperstart-dev:latest cat /root/build/result/modules.tar > $(ARCHPATH)/modules.tar
25+
mv $(ARCHPATH)/kernel_config $(ARCHPATH)/kernel_config.old
26+
hyperctl run --rm hyperstart-dev:latest cat /root/build/result/kernel_config > $(ARCHPATH)/kernel_config
27+
rm ./kernel_config
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

build/make-initrd.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,7 @@ cp $ARCHPATH/binary/socat /tmp/hyperstart-rootfs/sbin/
2424
cp $ARCHPATH/binary/mount.nfs /tmp/hyperstart-rootfs/sbin/mount.nfs4
2525

2626
if [ "$INCLUDE_KMODULES"x == "1"x ]; then
27-
if [ "$1"x = "aarch64"x ]; then
28-
echo "build hyperstart for aarch64"
29-
tar -xf modules_aarch64.tar -C \
30-
/tmp/hyperstart-rootfs/lib/modules
31-
else
32-
tar -xf modules.tar -C /tmp/hyperstart-rootfs/lib/modules
33-
fi
27+
tar -xf $ARCHPATH/modules.tar -C /tmp/hyperstart-rootfs/lib/modules
3428
fi
3529

3630
# create symlinks to busybox and iptables
@@ -77,7 +71,7 @@ if [ "$1"x = "cbfs"x ]; then
7771
mkdir .cbfs
7872
dd if=/dev/zero of=.cbfs/boot.bin bs=4096 count=1
7973
cbfstool .cbfs/cbfs.rom create -s 8128k -B .cbfs/boot.bin -m x86 0x1000
80-
cbfstool .cbfs/cbfs.rom add -f kernel -n vmlinuz -t raw
74+
cbfstool .cbfs/cbfs.rom add -f $ARCHPATH/kernel -n vmlinuz -t raw
8175
cbfstool .cbfs/cbfs.rom add -f hyper-initrd.img -n initrd -t raw
8276
echo 'console=ttyS0 panic=1 no_timer_check' > .cbfs/cmdline
8377
cbfstool .cbfs/cbfs.rom add -f .cbfs/cmdline -n cmdline -t raw

0 commit comments

Comments
 (0)