PDA

View Full Version : [Zgemma H7] Can’t flash, Can’t Backup Image



robbieb43
03-02-23, 16:26
When I try to back up my image using the Green button from the image management menu, it crashes. Crash log attached. I get the same problem with the flash ( Blue) button, log also attached. 6469264691

Assuming there is no known workaround or simple fix, is there a way I can create a flashable image backup from the command line? I recall there were some flash tools I have used in the past on my old MIPS boxes, so perhaps an Arm equivalent or just using standard linux utils perhaps.

I am assuming that the ultimate course of action may be reflashing with a clean emmc and really don’t want to risk the matrimonial strife :violin: associated with having to rebuild from scratch just to experiment with the newer image (in connection with current thread elsewhere on the board, package differences between 5.4 and 6.3. https://www.world-of-satellite.com/showthread.php?65829-Packages).

Thanks

Rob

twol
03-02-23, 18:36
When I try to back up my image using the Green button from the image management menu, it crashes. Crash log attached. I get the same problem with the flash ( Blue) button, log also attached. 6469264691

Assuming there is no known workaround or simple fix, is there a way I can create a flashable image backup from the command line? I recall there were some flash tools I have used in the past on my old MIPS boxes, so perhaps an Arm equivalent or just using standard linux utils perhaps.

I am assuming that the ultimate course of action may be reflashing with a clean emmc and really don’t want to risk the matrimonial strife :violin: associated with having to rebuild from scratch just to experiment with the newer image (in connection with current thread elsewhere on the board, package differences between 5.4 and 6.3. https://www.world-of-satellite.com/showthread.php?65829-Packages).

Thanks

Rob
Going backwards in your comments…
1. nodejs is a really unusual package, so unless you have something really non basic in your image, you shouldn,t hit this issue.
2. Having found the likely version of ImageManager I really cannot see why this would fail. .. so cannot provide a bypass.
3. Normally backing up your settings is all most users have to do to make sure they can run the current setup even on newer images. So 1st can you run settings backup successfully? (Not image backup)
4. So if the answer is Yes, then run the backup…then download the latest image for your H7 (from the forum ….. see above) and copy to the HDD in /imagebackups.
Then using the blue button, flash the downloaded image to ANOTHER SLOT…… NOT current and restore settings when it boots up.
Then see how it goes…… you can always re boot to the current image, so you haven,t lost any thing

robbieb43
03-02-23, 19:46
Thanks twol. The settings backup works OK but it is the flashing issue that is blocking me as I cannot even get to the bit where I select a partition. The download works fine and I have checked that it saves it in the images directory. If I could do this (flash), since I have a couple of spare partitions, I could swap back and forth while I am getting the node install issue sorted out. I only started looking at the possibility of trying to do an image backup as I wondered whether I might have to re-flash with a recovery, image. Obviously I would like to avoid this. If I could just understand why flash (blue button) fails, that would be a great step forward and assuming image backup works OK in 6.xx, I can then stop worrying about trying to fix the 5.4 problem. My problem is that since we rely quite heavily on this box I don't want to take it off line for a prolonged period and I was hoping to build up my custom stuff at leisure swapping back and forth.

If anyone has a copy /usr/lib/enigma2/python/Plugins/SystemPlugins/ViX/ImageManager.py for 5.4.009 it may shed some light on what is crashing it out.

TIA

cactikid
03-02-23, 20:17
Menu -Standby and restart - Multiboot Image selector - choose an empty slot to set box up from there.

I assume you have a mounted hdd to save backup images to.

twol
03-02-23, 20:23
Thanks twol. The settings backup works OK but it is the flashing issue that is blocking me as I cannot even get to the bit where I select a partition. The download works fine and I have checked that it saves it in the images directory. If I could do this (flash), since I have a couple of spare partitions, I could swap back and forth while I am getting the node install issue sorted out. I only started looking at the possibility of trying to do an image backup as I wondered whether I might have to re-flash with a recovery, image. Obviously I would like to avoid this. If I could just understand why flash (blue button) fails, that would be a great step forward and assuming image backup works OK in 6.xx, I can then stop worrying about trying to fix the 5.4 problem. My problem is that since we rely quite heavily on this box I don't want to take it off line for a prolonged period and I was hoping to build up my custom stuff at leisure swapping back and forth.

If anyone has a copy /usr/lib/enigma2/python/Plugins/SystemPlugins/ViX/ImageManager.py for 5.4.009 it may shed some light on what is crashing it out.

TIA

Which slots are empty? As long as you are happy using putty can flash direct into a slot.
Unzip image and copy folder containing the unzipped files to /tmp
init 4
then /usr/bin/ofgwrite -r -k -mslotno /tmp/folder. Where slotno is the slot number, folder is I guess h7 but whatever it is

robbieb43
04-02-23, 10:06
Menu -Standby and restart - Multiboot Image selector - choose an empty slot to set box up from there.

I assume you have a mounted hdd to save backup images to.

Yes I have an ssd HDD and it works OK for settings backup and image download. I do suspect that there is something buried away that is confusing it though in this respect.

robbieb43
04-02-23, 13:51
Which slots are empty? As long as you are happy using putty can flash direct into a slot.
Unzip image and copy folder containing the unzipped files to /tmp
init 4
then /usr/bin/ofgwrite -r -k -mslotno /tmp/folder. Where slotno is the slot number, folder is I guess h7 but whatever it is

Thanks twol - this has moved me on a lot.

I have used this to successfully flash images to my spare partitions. I have been downloading desired images to a dir on my hdd and flashing with your syntax:

init 4
/usr/bin/ofgwrite -r -k -m3 /media/hdd/tmp/oatv/zgemma/h7
init 3

(my multiboot partitions are
/dev/mmcblk0p3,
/dev/mmcblk0p5,
/dev/mmcblk0p7,
/dev/mmcblk0p9
and to be on the safe side I temporarily mount them to check they are free/spare)

So far I have been successful with openvix 6.2 but openatv 6 or 7 boot but do not start enigma2.

Interestingly the flash from the Vix image manage still fails in the same manner (downloads, then crashes on blue button) so it looks like I will ultimately have to do a recovery flash.

If there is a flash-read tool to compliment this that anybody know about I would be grateful so that I can get my old image backed up.

twol
04-02-23, 18:49
Thanks twol - this has moved me on a lot.

I have used this to successfully flash images to my spare partitions. I have been downloading desired images to a dir on my hdd and flashing with your syntax:

init 4
/usr/bin/ofgwrite -r -k -m3 /media/hdd/tmp/oatv/zgemma/h7
init 3

(my multiboot partitions are
/dev/mmcblk0p3,
/dev/mmcblk0p5,
/dev/mmcblk0p7,
/dev/mmcblk0p9
and to be on the safe side I temporarily mount them to check they are free/spare)

So far I have been successful with openvix 6.2 but openatv 6 or 7 boot but do not start enigma2.

Interestingly the flash from the Vix image manage still fails in the same manner (downloads, then crashes on blue button) so it looks like I will ultimately have to do a recovery flash.

If there is a flash-read tool to compliment this that anybody know about I would be grateful so that I can get my old image backed up.
Give me a debug/crash log from 6.2 and I will have a look

robbieb43
04-02-23, 20:02
Thanks Twol - here is my log:
64697

After a bit of sniffing about with debugging on I have created the following crude script, designed to make a command line backup of a chosen partition. I attach it here in case anyone else gets into a similar difficulty but should add a word of caution as it is only test on my H7 and it could well trash your install. I have successfully created a backup file and used twol's command line to flash it to another partition and it seems to boot OK.



#!/bin/bash
#
################################################## #################
# robbieb43: backup multiboot partition #
# V1 - experimental #
# 04-02-23 #
# beware - this may trash your install #
################################################## #################
#
# Select partition: for zgemma it uses mmc device as follows:
# Part 1
#KPARTITION="mmcblk0p2"
#RPARTITION="mmcblk0p3"
# Part 2
KPARTITION="mmcblk0p4"
RPARTITION="mmcblk0p5"
# Part 3
#KPARTITION="mmcblk0p6"
#RPARTITION="mmcblk0p7"
# Part 4
#KPARTITION="mmcblk0p8"
#RPARTITION="mmcblk0p9"
#
mkdir /media/hdd/imagebackups/openvix-zgemmah7-release-temp/
mkdir -p /media/hdd/imagebackups/openvix-zgemmah7-release-mount/root
mkdir -p /media/hdd/imagebackups/openvix-zgemmah7-backup/zgemma/h7
#
# Copy kernel to bin file
echo "Creating Kernel file"
dd if=/dev/$KPARTITION of=/media/hdd/imagebackups/openvix-zgemmah7-release-temp/vmlinux.bin
#
# Make Root Image
# Mount rootfs in root
echo "Making rootfs tar"
mount /dev/$RPARTITION /media/hdd/imagebackups/openvix-zgemmah7-release-mount/root
/bin/tar -cf /media/hdd/imagebackups/openvix-zgemmah7-release-temp/rootfs.tar -C /media/hdd/imagebackups/openvix-zgemmah7-release-mount/root --exclude ./var/nmbd --exclude ./.resizerootfs --exclude ./.resize-rootfs --exclude ./.resize-linuxrootfs --exclude ./.resize-userdata --exclude ./var/lib/samba/private/msg.sock .
#
echo "Syncing"
sync
#
echo "Making rootfs bz2"
/usr/bin/bzip2 /media/hdd/imagebackups/openvix-zgemmah7-release-temp/rootfs.tar
#
# Create disk.img container
echo "making disk.img"
dd if=/dev/zero of=/media/hdd/imagebackups/openvix-zgemmah7-release-temp/disk.img bs=512 count=0 seek=7634944
# Partition it
parted -s /media/hdd/imagebackups/openvix-zgemmah7-release-temp/disk.img mklabel gpt
parted -s /media/hdd/imagebackups/openvix-zgemmah7-release-temp/disk.img unit KiB mkpart boot fat16 1024 4096
parted -s /media/hdd/imagebackups/openvix-zgemmah7-release-temp/disk.img unit KiB mkpart linuxkernel 4096 12288
parted -s /media/hdd/imagebackups/openvix-zgemmah7-release-temp/disk.img unit KiB mkpart linuxrootfs ext4 12288 1060864
parted -s /media/hdd/imagebackups/openvix-zgemmah7-release-temp/disk.img unit KiB mkpart linuxkernel2 1060864 1069056
parted -s /media/hdd/imagebackups/openvix-zgemmah7-release-temp/disk.img unit KiB mkpart linuxkernel3 1069056 1077248
parted -s /media/hdd/imagebackups/openvix-zgemmah7-release-temp/disk.img unit KiB mkpart linuxkernel4 1077248 1085440
parted -s /media/hdd/imagebackups/openvix-zgemmah7-release-temp/disk.img unit KiB mkpart userdata ext4 1085440 100%
# Fill partitions
echo "Filling disk.img"
dd if=/dev/mmcblk0p1 of=/media/hdd/imagebackups/openvix-zgemmah7-release-temp/disk.img seek=2048
dd if=/dev/$KPARTITION of=/media/hdd/imagebackups/openvix-zgemmah7-release-temp/disk.img seek=8192
dd if=/dev/$RPARTITION of=/media/hdd/imagebackups/openvix-zgemmah7-release-temp/disk.img seek=24576
#
umount /media/hdd/imagebackups/openvix-zgemmah7-release-mount/root && rm -rf /media/hdd/imagebackups/openvix-zgemmah7-release-mount
#
echo "Zipping up the backup"
mv /media/hdd/imagebackups/openvix-zgemmah7-release-temp/rootfs.tar.bz2 /media/hdd/imagebackups/openvix-zgemmah7-backup/zgemma/h7/.
mv /media/hdd/imagebackups/openvix-zgemmah7-release-temp/disk.img /media/hdd/imagebackups/openvix-zgemmah7-backup/zgemma/h7/.
mv /media/hdd/imagebackups/openvix-zgemmah7-release-temp/vmlinux.bin /media/hdd/imagebackups/openvix-zgemmah7-backup/zgemma/h7/kernel.bin
echo "openvix-zgemmah7-release-backup-0.0.000-00000000_000000" > /media/hdd/imagebackups/openvix-zgemmah7-backup/zgemma/h7/imageversion
#
cd /media/hdd/imagebackups/openvix-zgemmah7-backup && zip -r /media/hdd/imagebackups/openvix-zgemmah7-backup.zip *
rm -rf /media/hdd/imagebackups/openvix-zgemmah7-backup
rm -rf /media/hdd/imagebackups/openvix-zgemmah7-release-temp/
#
exit 0