Fix #145: add deviceinfo_flash_offset_base again (#175)

* Fix #145: add deviceinfo_flash_offset_base again

* Add default OFFSET_BASE value in flasher if deviceinfo_flash_offset_base variable is not set
...and set correct default base value in create_bootimg function
This commit is contained in:
Oliver Smith 2017-07-19 20:44:12 +00:00 committed by GitHub
parent ca5b8e3367
commit 9677d89f84
4 changed files with 12 additions and 3 deletions

View File

@ -1,5 +1,5 @@
pkgname=postmarketos-mkinitfs
pkgver=0.1.6
pkgver=0.1.7
pkgrel=0
pkgdesc="Tool to generate initramfs images for postmarketOS"
url="https://github.com/postmarketOS"
@ -29,7 +29,7 @@ package() {
}
sha512sums="22418d8869448b456a775f03b18d7b4e13f3cac1129233ced42caf67c3aea4abcc6488fcba2acb5e20dd72f2a6da6419938ac44751a5ba175f02eab586573c43 init.sh.in
6d130be59507ad6c755ce8dfe345335e54b3891ca484e7865246ce69fe9d4e6441247acf6d17cc2ff414aaa0aca13fc28c8956b90f1626b784429adc3b5bf866 init_functions.sh
3026c45c14ae6d83e28e322c46b151e962493587d7ea9bdf3acfbf6c859d405800b0e3fcf2b509f06f26d5af625951a1bedff1ed7fda0eeaddcb46dc2d39dc13 mkinitfs.sh
ba56182262803fa18c85bdd5b80d7c61f098e528dfda17a8876db267770bb9aee7308d48f921ba60e14fbd95d18daa66781738a925f2515dca123d1e74b051d7 mkinitfs.sh
8129300894f0b91ba669c12df2e51fb8dd9a9366da26496523047782026714444f40037b88d3e56dc28e3049901c32bf2a4959390883dfbbff8cfa19bb82045f 10-usb-unlock.sh
35a8eabad947347afec7e3f5860d31ab9e3534972c0960ccf553c7e1cc9262316bfdddb8d61d3588db1ee2261077597617806080b9956798b3e5088d6f9b596b splash1.ppm.gz
bf11d8b3a50db984cfbb2cafe6687de327242c1f6f56c6fdd02ca579b05213f9c886aa1c0527530fdec21b16e65e68962e40a600c4ce155819df2f610b435087 splash2.ppm.gz"

View File

@ -147,9 +147,12 @@ create_bootimg()
{
[ "${deviceinfo_generate_bootimg}" == "true" ] || return
echo "==> initramfs: creating boot.img"
_base="${deviceinfo_flash_offset_base}"
[ -z "$_base" ] && _base="0x10000000"
mkbootimg \
--kernel "${outfile/initramfs-/vmlinuz-}" \
--ramdisk "$outfile" \
--base "${_base}" \
--second_offset "${deviceinfo_flash_offset_second}" \
--cmdline "${deviceinfo_kernel_cmdline}" \
--kernel_offset "${deviceinfo_flash_offset_kernel}" \

View File

@ -240,7 +240,7 @@ $FLAVOR: Kernel flavor
$IMAGE: Path to the system partition image
$KERNEL_CMDLINE: Kernel commandline
Fastboot specific: $OFFSET_KERNEL, $OFFSET_RAMDISK, $OFFSET_TAGS, $PAGE_SIZE
Fastboot specific: $OFFSET_BASE, $OFFSET_KERNEL, $OFFSET_RAMDISK, $OFFSET_TAGS, $PAGE_SIZE
Heimdall specific: $PARTITION_KERNEL, $PARTITION_INITFS
"""
flashers = {
@ -252,6 +252,7 @@ flashers = {
"flash_system": [["fastboot", "flash", "system", "$IMAGE"]],
"flash_kernel": [["fastboot", "flash", "boot", "$BOOT/boot.img-$FLAVOR"]],
"boot": [["fastboot",
"--base", "$OFFSET_BASE",
"--kernel-offset", "$OFFSET_KERNEL",
"--ramdisk-offset", "$OFFSET_RAMDISK",
"--tags-offset", "$OFFSET_TAGS",

View File

@ -30,12 +30,17 @@ def run(args, action, flavor=None):
raise RuntimeError("action " + action + " is not"
" configured for method " + method + "!")
_base = args.deviceinfo["flash_offset_base"]
if _base == "":
_base = "0x10000000"
# Variable setup
vars = {
"$BOOT": "/mnt/rootfs_" + args.device + "/boot",
"$FLAVOR": flavor if flavor is not None else "",
"$IMAGE": "/home/user/rootfs/" + args.device + ".img",
"$KERNEL_CMDLINE": args.deviceinfo["kernel_cmdline"],
"$OFFSET_BASE": _base,
"$OFFSET_KERNEL": args.deviceinfo["flash_offset_kernel"],
"$OFFSET_RAMDISK": args.deviceinfo["flash_offset_ramdisk"],
"$OFFSET_SECOND": args.deviceinfo["flash_offset_second"],