Jump to content


Photo

Help needed in adjusting BackupSuite

backupsuite hd51 backup

  • Please log in to reply
4 replies to this topic

#1 Pedro_Newbie

  • Senior Member
  • 4,631 posts

+225
Excellent

Posted 21 August 2016 - 12:51

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)


Re: Help needed in adjusting BackupSuite #2 betacentauri

  • PLi® Core member
  • 7,185 posts

+323
Excellent

Posted 22 August 2016 - 16:29

Hi,

 

it's unfortunately not so easy.

For USB flashing you need a disk.img. My ofgwrite tool cannot handle disk.img files. It can only use rootfs.tar.bz2 and kernel.bin. That's why OpenATV has both versions in their image/backup zip files.

 

The rootfs.tar.bz2 can be created in the same way as you do it for the solo4k. Kernel.bin maybe a little bit different, but not much. So creating an backup which can be installed via ofgwrite shouldn't be a big problem. Only ofgwrite has to be called with a new parameter. If you want to support multiboot things a little bit more effort is needed.

More difficult is to build a disk.img as you need to create a disk image with GPT, fat formatted boot partition and the ext4 root filesystem.

 

I have not much time now. I come back later with more informations...


Xtrend ET-9200, ET-8000, ET-10000, OpenPliPC on Ubuntu 12.04

Re: Help needed in adjusting BackupSuite #3 Pedro_Newbie

  • Senior Member
  • 4,631 posts

+225
Excellent

Posted 22 August 2016 - 17:10

If I understand you right it could be done to make a backup solely with the kernel.bin and the rootfs.tar.bz2?

Then this backup is flashable by your ofgwrite and therefore also within the backupsuite?

The disk.img isn't necessary in the backup?

Re: Help needed in adjusting BackupSuite #4 betacentauri

  • PLi® Core member
  • 7,185 posts

+323
Excellent

Posted 22 August 2016 - 17:43

Yes, right. But this backup cannot be used for usb flashing. For usb flashing you need disk.img.
Xtrend ET-9200, ET-8000, ET-10000, OpenPliPC on Ubuntu 12.04

Re: Help needed in adjusting BackupSuite #5 Pedro_Newbie

  • Senior Member
  • 4,631 posts

+225
Excellent

Posted 22 August 2016 - 18:46

It could be a compromise as long a complete disk.img isn't possible.

I wonder if the above mentioned code (part) is also applicable for Openpli or is this part specially for a multi-boot image, as I see 4 parts for the kernel and 4 for the rootfs.

Openpli hasn't mtools and mcopy on board, so that's also a small problem

I shall try to build something for the kernel.bin and rootfs.tar.bz2 parts and see where it leads to



Also tagged with one or more of these keywords: backupsuite, hd51, backup

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users