OpenPLi / enigma2

Framebuffer based frontend for DVB functions on Linux settop boxes
GNU General Public License v2.0
151 stars 204 forks source link

[FlashImage] - Vu+ Multiboot - if rejecting usb images then deselect all #3995

Closed TwolDE2 closed 3 months ago

TwolDE2 commented 3 months ago

OpenPli doesn,t directly support flashing to usb devices, however the current check assumes usb is mounted as /dev/sda which in Vu+ Multiboot is not necesarily true. Flashing to slot 4+ will successfully add a new image to existing eMMC, which is not a good idea. This change checks for any /dev/sdX device and rejects. see following log....

[FlashImage][confirmation] currentimageslot:2 imageList;{1: {'imagename': 'Openvix 5.4 (2024-05-23)'}, 2: {'imagename': 'Openpli develop (2024-05-23)'}, 3: {'imagename': 'Openatv 7.3 (2024-03-01)'}, 4: {'imagename': 'Openbh 5.4 (2024-04-01)'}, 5: {'imagename': 'Openvix 6.5 (2024-04-17)'}, 6: {'imagename': 'Openvix 5.3 (2024-03-28)'}, 7: {'imagename': 'Openvix 6.5 (2024-03-29)'}} [FlashImage][confirmation] Boxinfo:dict_items([(1, {'device': '/dev/mmcblk0p4', 'startupfile': 'STARTUP_1', 'rootsubdir': 'linuxrootfs1'}), (2, {'device': '/dev/mmcblk0p4', 'startupfile': 'STARTUP_2', 'rootsubdir': 'linuxrootfs2'}), (3, {'device': '/dev/mmcblk0p4', 'startupfile': 'STARTUP_3', 'rootsubdir': 'linuxrootfs3'}), (5, {'device': '/dev/sdb1', 'startupfile': 'STARTUP_5', 'rootsubdir': 'uno4kse/linuxrootfs5'}), (6, {'device': '/dev/sdb1', 'startupfile': 'STARTUP_6', 'rootsubdir': 'uno4kse/linuxrootfs6'}), (7, {'device': '/dev/sdb1', 'startupfile': 'STARTUP_7', 'rootsubdir': 'uno4kse/linuxrootfs7'}), (4, {'device': '/dev/sdb1', 'startupfile': 'STARTUP_4', 'rootsubdir': 'uno4kse/linuxrootfs4'})]) [FlashImage][confirmation] slotdict:{1: {'device': '/dev/mmcblk0p4', 'startupfile': 'STARTUP_1', 'rootsubdir': 'linuxrootfs1'}, 2: {'device': '/dev/mmcblk0p4', 'startupfile': 'STARTUP_2', 'rootsubdir': 'linuxrootfs2'}, 3: {'device': '/dev/mmcblk0p4', 'startupfile': 'STARTUP_3', 'rootsubdir': 'linuxrootfs3'}, 5: {'device': '/dev/sdb1', 'startupfile': 'STARTUP_5', 'rootsubdir': 'uno4kse/linuxrootfs5'}, 6: {'device': '/dev/sdb1', 'startupfile': 'STARTUP_6', 'rootsubdir': 'uno4kse/linuxrootfs6'}, 7: {'device': '/dev/sdb1', 'startupfile': 'STARTUP_7', 'rootsubdir': 'uno4kse/linuxrootfs7'}, 4: {'device': '/dev/sdb1', 'startupfile': 'STARTUP_4', 'rootsubdir': 'uno4kse/linuxrootfs4'}}

[FlashImage][flashimage] slot:5 [Console] command: /usr/bin/ofgwrite -k -r -m5 '/media/hdd/downloaded_images/openpli-develop-vuuno4kse-20240524_usb.unzipped/vuplus/uno4kse'

Creating directory linuxrootfs5 recursively Flash rootfs unpack Delete rootfs: rm -r -f /oldroot_remount/linuxrootfs5/ Untar: tar xf /media/hdd/downloaded_images/openpli-develop-vuuno4kse-20240524_usb.unzipped/vuplus/uno4kse/rootfs.tar.bz2 Successfully flashed rootfs! Flashing kernel ... Successfully flashed kernel! Successfully flashed image

WanWizard commented 3 months ago

This is a duplicate of https://github.com/OpenPLi/enigma2/pull/3994 ?

littlesat commented 3 months ago

I still think doing slots on usb directly from then ui or supporting it from the ui is not a real good idea as it is removable and my ‘stuck’ your box. Remove the stick when you run an image on it is stuck.!When doing this it should be a manual option as you should know what you’re doing. The multiboot stuff is prepared for it when you add the proper startup files.

TwolDE2 commented 3 months ago

Unfortunately, the octagon sf8008 set a trend here, and many non OpenPli users think using a usb and a trillion slots is the way to go…… so this change is just to ensure the integrity of the eMMC is retained. I have long lost the assumption that users are reasonable, some of these guys are proud of their 30+ slots…what they do with them is beyond me.