I wanted this to be able to sysupgrade later and preserve the partition size, but will not work:
root@OpenWrt:~# sysupgrade
Usage: /sbin/sysupgrade [<upgrade-option>...] <image file or URL>
/sbin/sysupgrade [-q] [-i] <backup-command> <file>
upgrade-option:
-f <config> restore configuration from .tar.gz (file or url)
-i interactive mode
-c attempt to preserve all changed files in /etc/
-n do not save configuration over reflash
-p do not attempt to restore the partition table after flash.
-T | --test
Verify image and config .tar.gz but do not actually flash.
-F | --force
Flash image even if image checks fail, this is dangerous!
-q less verbose
-v more verbose
-h | --help display this help
backup-command:
-b | --create-backup <file>
create .tar.gz of files specified in sysupgrade.conf
then exit. Does not flash an image. If file is '-',
i.e. stdout, verbosity is set to 0 (i.e. quiet).
-r | --restore-backup <file>
restore a .tar.gz created with sysupgrade -b
then exit. Does not flash an image. If file is '-',
the archive is read from stdin.
-l | --list-backup
list the files that would be backed up when calling
sysupgrade -b. Does not create a backup file.
Even with sysupgrade listing -p do not attempt to restore the partition table after flash.
When I ran the sysupgrade command with -p
flag it just ignore it:
root@OpenWrt:~# sysupgrade -v -p /tmp/openwrt-*-x86-generic-combined-ext4.img.gz
Image metadata not found
Reading partition table from bootdisk...
Reading partition table from image...
Partition layout has changed. Full image will be written.
(...)
and the after the sysupgrade reboot the partition layout comes back to initial state:
root@OpenWrt:~# fdisk -l /dev/sda
Disk /dev/sda: 7.5 GiB, 8004304896 bytes, 15633408 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xd534cb06
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 512 33279 32768 16M 83 Linux
/dev/sda2 33792 558079 524288 256M 83 Linux
note that /dev/sda2
was 1G before and not 256M