Hi to all,
I need some help to adjust the BackupSuite to make it suitable for the Openpli HD51 image.
I looked at the OpenATV solution of making a backup of the HD51 but I don't have enough info to adjust it to make is compatible with Openpli because OpenATV has also the multiboot part.
The OpenATV image differs from the Openpli image in several ways:
Openpli's image only contains the file Disk.img
OpenATV has also a kernel.bin and rootfs.tar.bz2
I understand that OpenATV's image is a multiboot image hence the additional files(?)
OpenATV has 4 different parts which contains each a kernel and a root, is this also in Openpli?
What is needed to make a working backup of an Openpli HD51 image?
Which package provides mkfs.msdos (if needed at all in the Openpli image, for the Solo2 this file isn't available in e2fsprogs-mke2fs)
Which package provides mcopy (if needed at all in the Openpli image)
So, who can guide me a bit in the backup process for the HD51, which steps have to be taken to make a Disk.img which can be restored.
The fact that I have no HD51 to test, is no contributing factor to a successful backup to say the least
The part hereunder is taken from the OpenATV solution ImageBackup.py and I understand most of it but is this also applicable for the Openpli image and are the mentioned sizes hard sizes or can these differ?
(code hereunder is solely in Pyhon but for me it shall be transformed in a bash script)
Some help would be greatly appreciated, it would be a pity if there is no BackupSuite for the Mutant HD51
if SystemInfo["HaveMultiBoot"] and self.list[self.selection] == "Recovery": GPT_OFFSET=0 GPT_SIZE=1024 BOOT_PARTITION_OFFSET = int(GPT_OFFSET) + int(GPT_SIZE) BOOT_PARTITION_SIZE=3072 KERNEL_PARTITION_OFFSET = int(BOOT_PARTITION_OFFSET) + int(BOOT_PARTITION_SIZE) KERNEL_PARTITION_SIZE=8192 ROOTFS_PARTITION_OFFSET = int(KERNEL_PARTITION_OFFSET) + int(KERNEL_PARTITION_SIZE) ROOTFS_PARTITION_SIZE=1048576 SECOND_KERNEL_PARTITION_OFFSET = int(ROOTFS_PARTITION_OFFSET) + int(ROOTFS_PARTITION_SIZE) SECOND_ROOTFS_PARTITION_OFFSET = int(SECOND_KERNEL_PARTITION_OFFSET) + int(KERNEL_PARTITION_SIZE) THRID_KERNEL_PARTITION_OFFSET = int(SECOND_ROOTFS_PARTITION_OFFSET) + int(ROOTFS_PARTITION_SIZE) THRID_ROOTFS_PARTITION_OFFSET = int(THRID_KERNEL_PARTITION_OFFSET) + int(KERNEL_PARTITION_SIZE) FOURTH_KERNEL_PARTITION_OFFSET = int(THRID_ROOTFS_PARTITION_OFFSET) + int(ROOTFS_PARTITION_SIZE) FOURTH_ROOTFS_PARTITION_OFFSET = int(FOURTH_KERNEL_PARTITION_OFFSET) + int(KERNEL_PARTITION_SIZE) EMMC_IMAGE = "%s/disk.img"%self.WORKDIR EMMC_IMAGE_SIZE=3817472 IMAGE_ROOTFS_SIZE=196608 cmdlist.append('echo " "') cmdlist.append('echo "Create: Recovery Fullbackup disk.img"') cmdlist.append('echo " "') cmdlist.append('dd if=/dev/zero of=%s bs=1024 count=0 seek=%s' % (EMMC_IMAGE, EMMC_IMAGE_SIZE)) cmdlist.append('parted -s %s mklabel gpt' %EMMC_IMAGE) PARTED_END_BOOT = int(BOOT_PARTITION_OFFSET) + int(BOOT_PARTITION_SIZE) cmdlist.append('parted -s %s unit KiB mkpart boot fat16 %s %s' % (EMMC_IMAGE, BOOT_PARTITION_OFFSET, PARTED_END_BOOT )) PARTED_END_KERNEL1 = int(KERNEL_PARTITION_OFFSET) + int(KERNEL_PARTITION_SIZE) cmdlist.append('parted -s %s unit KiB mkpart kernel1 %s %s' % (EMMC_IMAGE, KERNEL_PARTITION_OFFSET, PARTED_END_KERNEL1 )) PARTED_END_ROOTFS1 = int(ROOTFS_PARTITION_OFFSET) + int(ROOTFS_PARTITION_SIZE) cmdlist.append('parted -s %s unit KiB mkpart rootfs1 ext2 %s %s' % (EMMC_IMAGE, ROOTFS_PARTITION_OFFSET, PARTED_END_ROOTFS1 )) PARTED_END_KERNEL2 = int(SECOND_KERNEL_PARTITION_OFFSET) + int(KERNEL_PARTITION_SIZE) cmdlist.append('parted -s %s unit KiB mkpart kernel2 %s %s' % (EMMC_IMAGE, SECOND_KERNEL_PARTITION_OFFSET, PARTED_END_KERNEL2 )) PARTED_END_ROOTFS2 = int(SECOND_ROOTFS_PARTITION_OFFSET) + int(ROOTFS_PARTITION_SIZE) cmdlist.append('parted -s %s unit KiB mkpart rootfs2 ext2 %s %s' % (EMMC_IMAGE, SECOND_ROOTFS_PARTITION_OFFSET, PARTED_END_ROOTFS2 )) PARTED_END_KERNEL3 = int(THRID_KERNEL_PARTITION_OFFSET) + int(KERNEL_PARTITION_SIZE) cmdlist.append('parted -s %s unit KiB mkpart kernel3 %s %s' % (EMMC_IMAGE, THRID_KERNEL_PARTITION_OFFSET, PARTED_END_KERNEL3 )) PARTED_END_ROOTFS3 = int(THRID_ROOTFS_PARTITION_OFFSET) + int(ROOTFS_PARTITION_SIZE) cmdlist.append('parted -s %s unit KiB mkpart rootfs3 ext2 %s %s' % (EMMC_IMAGE, THRID_ROOTFS_PARTITION_OFFSET, PARTED_END_ROOTFS3 )) PARTED_END_KERNEL4 = int(FOURTH_KERNEL_PARTITION_OFFSET) + int(KERNEL_PARTITION_SIZE) cmdlist.append('parted -s %s unit KiB mkpart kernel4 %s %s' % (EMMC_IMAGE, FOURTH_KERNEL_PARTITION_OFFSET, PARTED_END_KERNEL4 )) PARTED_END_ROOTFS4 = int(EMMC_IMAGE_SIZE) - 1024 cmdlist.append('parted -s %s unit KiB mkpart rootfs4 ext2 %s %s' % (EMMC_IMAGE, FOURTH_ROOTFS_PARTITION_OFFSET, PARTED_END_ROOTFS4 )) cmdlist.append('dd if=/dev/zero of=%s/boot.img bs=1024 count=%s' % (self.WORKDIR, BOOT_PARTITION_SIZE )) cmdlist.append('mkfs.msdos -S 512 %s/boot.img' %self.WORKDIR) cmdlist.append('mcopy -i %s/boot.img -v /boot/STARTUP ::' %self.WORKDIR) cmdlist.append('mcopy -i %s/boot.img -v /boot/STARTUP_1 ::' %self.WORKDIR) cmdlist.append('mcopy -i %s/boot.img -v /boot/STARTUP_2 ::' %self.WORKDIR) cmdlist.append('mcopy -i %s/boot.img -v /boot/STARTUP_3 ::' %self.WORKDIR) cmdlist.append('mcopy -i %s/boot.img -v /boot/STARTUP_4 ::' %self.WORKDIR) cmdlist.append('dd conv=notrunc if=%s/boot.img of=%s bs=1024 seek=%s' % (self.WORKDIR, EMMC_IMAGE, BOOT_PARTITION_OFFSET )) cmdlist.append('dd conv=notrunc if=/dev/%s of=%s bs=1024 seek=%s' % (self.MTDKERNEL, EMMC_IMAGE, KERNEL_PARTITION_OFFSET )) cmdlist.append('dd if=/dev/%s of=%s bs=1024 seek=%s count=%s' % (self.MTDROOTFS, EMMC_IMAGE, ROOTFS_PARTITION_OFFSET, IMAGE_ROOTFS_SIZE )) self.session.open(Console, title = self.TITLE, cmdlist = cmdlist, finishedCallback = self.doFullBackupCB, closeOnSuccess = True)