Welcome to mirror list, hosted at ThFree Co, Russian Federation.

makeimg « bin - github.com/ClusterM/hakchi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4f3a5f4d48a56433c50b18a6921eaa5afa081c67 (plain)
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
29
30
31
#!/bin/bash
set -e

inpath=$1
if [ -z "$inpath" ]; then
  inpath=./kernel
fi

infile=$(basename "$inpath").img
img=./$infile

rm -rf "$inpath/initramfs/hakchi/transfer"
(cd "$inpath/../mod";cp -a * "../$inpath/initramfs/")
if [ "$2" == "notx" ]; then
  rm -rf "$inpath/initramfs/hakchi/transfer"
fi
upx -qq --best "$inpath/initramfs/sbin/cryptsetup" || true
(cd "$inpath/initramfs";find . -print0 | sort -z | cpio -0o -H newc -R root:root --quiet > ../initramfs.cpio)
lzop --best -f -o "$inpath/$infile-ramdisk.gz" "$inpath/initramfs.cpio"

mkbootimg \
--kernel "$inpath/$infile-zImage" \
--ramdisk "$inpath/$infile-ramdisk.gz" \
--cmdline "$(cat $inpath/$infile-cmdline)" \
--board "$(cat $inpath/$infile-board)" \
--base "$(cat $inpath/$infile-base)" \
--pagesize "$(cat $inpath/$infile-pagesize)" \
--kernel_offset "$(cat $inpath/$infile-kerneloff)" \
--ramdisk_offset "$(cat $inpath/$infile-ramdiskoff)" \
--tags_offset "$(cat $inpath/$infile-tagsoff)" \
-o "$img"