-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathmake-kernel-hmod.sh
More file actions
executable file
·28 lines (26 loc) · 1.05 KB
/
make-kernel-hmod.sh
File metadata and controls
executable file
·28 lines (26 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh -e
makeimg kernel notx
ksize="$(stat -c%s "kernel.img")"
kmaxsize="$((4*1024*1024))"
ksizestr="$(($kmaxsize-$ksize)) ($((($kmaxsize-$ksize)/1024))k)"
[ $ksize -le $kmaxsize ] || (echo "too big! $ksizestr" 1>&2; exit 1)
echo "$ksizestr"
rsync -ac "kernel.img" "kernel-hmod/boot/boot.img"
rsync -ac "mod/hakchi/rootfs/etc/preinit.d/b0050_boot" "kernel-hmod/etc/preinit.d/b0050_boot"
mkdir -p "kernel-hmod/lib/modules"
rsync -ac "data/modules/" "kernel-hmod/lib/modules/" --delete
bootVersion="v1.0.0"
eval "$(grep -F "bootVersion=" "mod/hakchi/init")"
./updateVersion.sh
eval "$(grep -F "hakchiVersion=" "mod/hakchi/rootfs/etc/preinit.d/b0000_defines")"
kernelVersion="$(ls "kernel-hmod/lib/modules")"
set | grep -F "Version" | sort > "kernel-hmod/var/version"
rm -f hakchi-v*.hmod
makepack "kernel-hmod/"
mv "kernel-hmod.hmod" "hakchi-$hakchiVersion.hmod"
if [ "$1" != "norsync" ]; then
rsync -avc "hakchi-$hakchiVersion.hmod" "hakchi:/var/www/hakchi/"
rsync -avc "hakchi-$hakchiVersion.hmod" "snes:/tmp/boot/"
rsync -avc "kernel.img" "snes:/tmp/boot/"
fi
echo "done"