openwrtv4/target/linux
Stefan Lippers-Hollmann 9a221c6d69 ip806x: nbg6817: sysupgrade support both targets for kernel/ rootfs partitions
With this commit and the previous "nbg6817: don't hardcode the rootfs location
by using append-rootblock instead" applied, it is possible to boot- and
sysupgrade from both dual-boot sets (the primary mmcblk0p4+mmcblk0p5 or the
alternative mmcblk0p7+mmcblk0p8). However the sysupgrade support does not
toggle between both dual-boot sets between firmware upgrades so far.

The partition map of the eMMC used in the nbg6817 is:

Found valid GPT with protective MBR; using GPT.
Disk /dev/mmcblk0: 7471104 sectors, 3.6 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): XXX
Partition table holds up to 12 entries
First usable sector is 34, last usable sector is 7471070
Partitions will be aligned on 2-sector boundaries
Total free space is 1 sectors (512 bytes)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              34            8225   4.0 MiB     FFFF  rootfs_data
   2            8226           16417   4.0 MiB     FFFF  romd
   3           16418           18465   1024.0 KiB  FFFF  header
   4           18466           26657   4.0 MiB     FFFF  kernel
   5           26658          157729   64.0 MiB    FFFF  rootfs
   6          157730          159777   1024.0 KiB  FFFF  header_1
   7          159778          167969   4.0 MiB     FFFF  kernel_1
   8          167970          299041   64.0 MiB    FFFF  rootfs_1
   9          299042          823329   256.0 MiB   FFFF  bu1
  10          823330         7471069   3.2 GiB     FFFF  bu2

rootfs_data is the ext4 formatted overlay of the OEM firmware, LEDE
ignores it due to its (too) small size.

romd/ bu1 are initialized with zeroes (0x00) and unused.

bu2 is formatted with ext4 and used for streamboost and other optional
functionality by the OEM firmware, it is reformatted during factory
resets of the OEM firmware.

header/ header_1 contains version information for the corresponding
vendor firmwares installed to kernel/rootfs or kernel_1/ rootfs_1, the
format hasn't been completely reverse engineered so far and remains
left untouched by LEDE:

V1.00(ABCS.2)C0:
 00000000  00 00 a7 74 01 32 f0 00  56 31 2e 30 30 28 41 42  |...t.2..V1.00(AB|
 00000010  43 53 2e 32 29 43 30 00  ff ff ff ff ff ff ff ff  |CS.2)C0.........|
 00000020  ff ff ff ff ff ff ff ff  00 00 d5 dc 4e 42 47 36  |............NBG6|
 00000030  38 31 37 00 ff ff ff ff  ff ff ff ff ff ff ff ff  |817.............|
 00000040  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
 *
 00000060  ff ff ff ff ff ff ff ff  ff ff ff ff 00 00 22 a3  |..............".|
 00000070  00 1c 70 00 ff ff ff ff  ff ff ff ff ff ff ff ff  |..p.............|
 00000080  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
 *
 00000800  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 *
 00100000

V1.00(ABCS.5)C0:
 00000000  00 00 bf 94 01 46 d8 00  56 31 2e 30 30 28 41 42  |.....F..V1.00(AB|
 00000010  43 53 2e 35 29 43 30 00  ff ff ff ff ff ff ff ff  |CS.5)C0.........|
 00000020  ff ff ff ff ff ff ff ff  00 00 d6 5a 4e 42 47 36  |...........ZNBG6|
 00000030  38 31 37 00 ff ff ff ff  ff ff ff ff ff ff ff ff  |817.............|
 00000040  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
 *
 00000060  ff ff ff ff ff ff ff ff  ff ff ff ff 00 00 c0 2c  |...............,|
 00000070  00 1c 58 00 ff ff ff ff  ff ff ff ff ff ff ff ff  |..X.............|
 00000080  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
 *
 00010000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 *
 00100000

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
2017-10-29 03:11:51 +01:00
..
adm5120 treewide: populate boardname and model earlier 2017-07-15 23:13:34 +02:00
adm8668 build: fix subtarget descriptions 2016-09-04 13:35:11 +02:00
apm821xx kernel: bump 4.9 to 4.9.57 2017-10-18 19:44:09 +03:00
ar7 ar7: add kernel 4.9 support 2017-10-29 23:41:00 +01:00
ar71xx ar71xx: fix section mismatch in TP-Link Archer C7 v4 support 2017-11-05 18:52:14 +01:00
arc770 arc770: mark as source-only 2017-10-28 13:59:03 +02:00
archs38 treewide: drop target board_name functions 2017-07-15 23:13:34 +02:00
armvirt armvirt: Enable CONFIG_ARM_PMU 2017-09-16 16:38:10 -07:00
at91 at91: remove unused at91part driver 2017-10-22 15:17:42 +02:00
ath25 kernel: cleanup CONFIG_SCHED_HRTICK 2017-06-29 04:46:59 +02:00
au1000 kernel: update kernel 3.18 to version 3.18.43 2016-10-24 20:25:14 +03:00
bcm53xx bcm53xx: Fix Generic profile description 2017-10-24 18:39:17 -07:00
brcm47xx brcm47xx: use kernel 4.9 by default 2017-10-18 23:27:17 +02:00
brcm63xx kernel: update 4.4 to 4.4.86 2017-09-05 08:43:39 +02:00
brcm2708 kernel: bump 4.9 to 4.9.58 2017-10-23 17:23:34 +03:00
cns3xxx kernel: bump 4.9 to 4.9.57 2017-10-18 19:44:09 +03:00
gemini treewide: do not use IMG_PREFIX in Image/Prepare 2017-10-26 12:26:25 +02:00
generic kernel: enable CONFIG_ADVISE_SYSCALLS 2017-10-27 00:45:32 +02:00
imx6 imx6: add driver for temp/voltage monitoring 2017-08-18 18:47:11 +02:00
ipq806x ip806x: nbg6817: sysupgrade support both targets for kernel/ rootfs partitions 2017-10-29 03:11:51 +01:00
ixp4xx treewide: drop target board_name functions 2017-07-15 23:13:34 +02:00
kirkwood treewide: drop target board_name functions 2017-07-15 23:13:34 +02:00
lantiq lantiq: xway: rename nas0/ptm0 to dsl0 2017-10-25 08:45:05 +02:00
layerscape layerscape: reverse changes to ndo_get_stats64 2017-10-29 16:16:35 +01:00
malta treewide: do not use IMG_PREFIX in Image/Prepare 2017-10-26 12:26:25 +02:00
mcs814x treewide: drop target board_name functions 2017-07-15 23:13:34 +02:00
mediatek kernel: bump 4.9 to 4.9.57 2017-10-18 19:44:09 +03:00
mpc85xx mpc85xx: use image metadata 2017-10-25 09:22:13 +02:00
mvebu mvebu: clean up ClearFog Base package selection 2017-10-15 00:24:22 +02:00
mxs treewide: drop target board_name functions 2017-07-15 23:13:34 +02:00
octeon treewide: use only board_name function to get name 2017-07-15 23:13:34 +02:00
omap omap: clean up configuration 2017-10-18 21:46:05 +02:00
omap24xx treewide: use only board_name function to get name 2017-07-15 23:13:34 +02:00
orion orion: Switch to 4.9 kernel 2017-10-24 18:39:17 -07:00
oxnas kernel: bump 4.4 to 4.4.91 2017-10-08 20:51:03 +03:00
pistachio kernel: update 4.9 to 4.9.44 2017-08-17 12:34:34 +02:00
ppc40x treewide: drop target board_name functions 2017-07-15 23:13:34 +02:00
ppc44x ppc44x: mark as broken 2017-01-10 12:49:34 +01:00
ramips mt7620: image.mk: make elecom-header reproducible 2017-11-06 00:09:18 +01:00
rb532 treewide: drop obsolete kernel config options 2017-10-04 20:08:15 +02:00
sunxi kernel: bump 4.9 to 4.9.58 2017-10-23 17:23:34 +03:00
uml uml: Switch to 4.9 kernel 2017-10-24 15:10:23 -07:00
x86 x86: fix reboot on apu2 boards 2017-10-05 21:14:43 +02:00
xburst xburst: enable high-res timers, refresh kernel config 2017-06-07 18:31:10 +02:00
zynq treewide: use only board_name function to get name 2017-07-15 23:13:34 +02:00
Makefile