-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
591ffee
commit dfe25f0
Showing
7 changed files
with
104 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env bash | ||
|
||
die() { | ||
cat <<EOF >&2 | ||
Error: $@ | ||
Usage: ${0} -c GENIMAGE_CONFIG_FILE | ||
EOF | ||
exit 1 | ||
} | ||
|
||
# Parse arguments and put into argument list of the script | ||
opts="$(getopt -n "${0##*/}" -o c: -- "$@")" || exit $? | ||
eval set -- "$opts" | ||
|
||
GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp" | ||
|
||
while true ; do | ||
case "$1" in | ||
-c) | ||
GENIMAGE_CFG="${2}"; | ||
shift 2 ;; | ||
--) # Discard all non-option parameters | ||
shift 1; | ||
break ;; | ||
*) | ||
die "unknown option '${1}'" ;; | ||
esac | ||
done | ||
|
||
[ -n "${GENIMAGE_CFG}" ] || die "Missing argument" | ||
|
||
# Pass an empty rootpath. genimage makes a full copy of the given rootpath to | ||
# ${GENIMAGE_TMP}/root so passing TARGET_DIR would be a waste of time and disk | ||
# space. We don't rely on genimage to build the rootfs image, just to insert a | ||
# pre-built one in the disk image. | ||
|
||
trap 'rm -rf "${ROOTPATH_TMP}"' EXIT | ||
ROOTPATH_TMP="$(mktemp -d)" | ||
GENIMAGE_TMP="$(mktemp -d)" | ||
rm -rf "${GENIMAGE_TMP}" | ||
|
||
genimage \ | ||
--rootpath "${ROOTPATH_TMP}" \ | ||
--tmppath "${GENIMAGE_TMP}" \ | ||
--inputpath "${BINARIES_DIR}" \ | ||
--outputpath "${BINARIES_DIR}" \ | ||
--config "${GENIMAGE_CFG}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
image boot.vfat { | ||
vfat { | ||
files = { | ||
"zImage", | ||
"sunxi.dtb" | ||
} | ||
} | ||
size = 8M | ||
} | ||
|
||
image sdcard.img { | ||
hdimage {} | ||
|
||
partition boot0 { | ||
in-partition-table = "no" | ||
image = "syter_boot_bin.elf" | ||
offset = 8K | ||
} | ||
|
||
partition boot0-gpt { | ||
in-partition-table = "no" | ||
image = "syter_boot_bin.elf" | ||
offset = 128K | ||
} | ||
|
||
partition kernel { | ||
partition-type = 0xC | ||
bootable = "true" | ||
image = "boot.vfat" | ||
} | ||
|
||
partition rootfs { | ||
partition-type = 0x83 | ||
image = "rootfs.img" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
image sdcard.img { | ||
hdimage {} | ||
|
||
partition boot0 { | ||
in-partition-table = "no" | ||
image = "syter_boot_bin.elf" | ||
offset = 8K | ||
} | ||
|
||
partition boot0-gpt { | ||
in-partition-table = "no" | ||
image = "syter_boot_bin.elf" | ||
offset = 128K | ||
} | ||
} |