Skip to content

Commit 4c94c56

Browse files
committed
[MultiBootManager] UBISlotManager add option for max Slots limit 1-20
1 parent 1d52cc1 commit 4c94c56

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

data/setup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@
423423
</setup>
424424
<setup key="UBISlotManager" title="Slot Manager">
425425
<item level="0" text="Target location" description="Choose the target device for the slots.">self.UBISlotManagerLocation</item>
426+
<item level="0" text="Slot count" description="Choose the amount of additional slots." conditional="self.UBISlotManagerLocation.value">self.UBISlotManagerSlots</item>
426427
</setup>
427428
<setup key="HardDisk" title="Hard Disk Settings" showOpenWebif="1">
428429
<item level="0" text="Hard disk standby after" description="Configure the hard disk drive to go to standby after the specified idle time.">config.usage.hdd_standby</item>

lib/python/Screens/MultiBootManager.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,7 @@ def getGreenHelpText():
10171017
}.get(self.green, _("Help text uninitialized"))
10181018

10191019
self.UBISlotManagerLocation = ConfigSelection(default=None, choices=[(None, _("<Select a device>"))])
1020+
self.UBISlotManagerSlots = ConfigInteger(default=10, limits=(1, 20))
10201021
self.UBISlotManagerDevice = None
10211022
Setup.__init__(self, session=session, setup="UBISlotManager")
10221023
self.setTitle(_("Slot Manager"))
@@ -1103,7 +1104,7 @@ def closeStartUpCallback(answer):
11031104
fd.write(startupContent)
11041105
with open(f"{MOUNTPOINT}/STARTUP_FLASH", "w") as fd:
11051106
fd.write(startupContent)
1106-
count = min(diskSize, 15)
1107+
count = min(diskSize, self.UBISlotManagerSlots.value)
11071108
for i in range(1, count + 1):
11081109
startupContent = f"kernel=/dev/{mtdKernel} root=UUID={uuidRootFS} rootsubdir=linuxrootfs{i} rootfstype=ext4\n"
11091110
with open(f"{MOUNTPOINT}/STARTUP_{i}", "w") as fd:
@@ -1133,6 +1134,7 @@ def deviceSelectionCallback(self, selection):
11331134
locations.append((path, path))
11341135
self.UBISlotManagerLocation.setSelectionList(default=None, choices=locations)
11351136
self.UBISlotManagerLocation.value = path
1137+
self.createSetup()
11361138
self.updateStatus("Selected device: %s" % self.deviceData[selection][1])
11371139

11381140
def partitionSizeGB(self, dev):

0 commit comments

Comments
 (0)