Multiboot Partitioning script for various devices and boxes.

Hier kommen die Skripte rein, die von euch erstellt wurden.
Antworten
Nachricht
Autor
Benutzeravatar
Lucifer
Member
Member
Beiträge: 232
Registriert: 01 Feb 2015 12:30
Hat gedankt: 159 Mal
Hat Dank erhalten: 155 Mal

Multiboot Partitioning script for various devices and boxes.

#1

Beitrag von Lucifer »

Hi,


The first script to create multiboot partitions was made for device sda of the Octagon sf8008 boxes:


@listener has updated the automount file to make sure that the multiboot partitions on all devices are not mounted. (well done)


The script in this thread is to create multiboot partitions on the device of your choice and other boxes then the Octagon sf8008.
That means that the boot args (for the STARTUP files) have to change, depending of the boxtype.
To get the right boot args i will need the help of the users because i only have Octagon boxes to test multiboot.


The Octagon sf8008 is a Uclan clone and there are other brands that are also Uclan clones and i have to add all these boxtypes in the script to make the script work for these boxes too/again.
The boot args of the Uclan boxes and clones should be the same, but have to be sure about that before i add those boxtypes to the script.


These telnet commands, should give enough information to figure out what to part of the boot args is needed, the info is saved in: /tmp/boot_args_boxtype.txt

Code: Alles auswählen

BOXTYPE=$(cat /proc/stb/info/boxtype)
echo -e "Boxtype: $BOXTYPE\n" > /tmp/boot_args_$BOXTYPE.txt
echo -e "cmdline: $(cat /proc/cmdline)\n" >> /tmp/boot_args_$BOXTYPE.txt
echo -e "STARTUP*1: $(cat /boot/STARTUP*1)\n" >> /tmp/boot_args_$BOXTYPE.txt
echo -e "STARTUP*5: $(cat /boot/STARTUP*5)\n" >> /tmp/boot_args_$BOXTYPE.txt
echo -e "/boot:\n$(ls -v /boot)\n" >> /tmp/boot_args_$BOXTYPE.txt


So, if you want te help then post the boot_args info file or the content here.


This is how it works in the script:
The boot args that are needed for the sf8008 boxes are these:

Code: Alles auswählen

rootwait blkdevparts=mmcblk0:1M(boot),1M(bootargs),1M(bootoptions),3M(baseparam),4M(pqparam),4M(logo),4M(deviceinfo),4M(softwareinfo),4M(loaderdb),32M(loader),8M(trustedcore),16M(linuxkernel1),16M(linuxkernel2),16M(linuxkernel3),16M(linuxkernel4),-(userdata) 


When i read out the boot args from /proc/cmdline i get this:

Code: Alles auswählen

console=ttyAMA0,115200 root=/dev/sda2 rootfstype=ext4 kernel=/dev/sda1 rootwait blkdevparts=mmcblk0:1M(boot),1M(bootargs),1M(bootoptions),3M(baseparam),4M(pqparam),4M(logo),4M(deviceinfo),4M(softwareinfo),4M(loaderdb),32M(loader),8M(trustedcore),16M(linuxkernel1),16M(linuxkernel2),16M(linuxkernel3),16M(linuxkernel4),-(userdata) coherent_pool=2M mem=1G mmz=ddr,0,0,72M vmalloc=500M MACHINEBUILD=sf8008 OEM=octagon MODEL=sf8008


To strip the boot args from the read out, i delete the parts that i don't need with the use of 2 delimiters. (<start_delimiter> and <end_delimiter>)
This code reads the boot args from /proc/cmdline and deletes everything before the start delimiter rootwait and everything after the end delimiter (userdata):

Code: Alles auswählen

cat /proc/cmdline | sed -e 's/.*\(rootwait.*(userdata)\).*/\1/')


So, if you know what part of the read out that you need for the boot args, you can set the delimiters for the boot args of your box.

In the beta script v1.6 you can see the code sofar with comments to help explain things.
When all boxtypes and boot args are added i will clean up and simplify the code where possible and make a final version 1.6 of this beta script.



@listener, when i was working on creating multiboot partitions i also got some graet help from someone who helped developing the current multiboot system.
He told me that the place to read out the boot args is /proc/cmdline , that's why i'm using this.
I know you get a different output with your sf8008 supreme when you read out the boot args from sys/firmware/devicetree/base/chosen/bootargs but the difference is just one string (root) at the end and it is not needed for the sf8008 supreme.
I have used the multiboot partitioning script v1.5 also with my sf8008 supreme and everything works fine with the current boot args for the sf8008 models.
The difference in the boot arg output is also depending on the image that is running on the box because i get the same boot arg output when i test this with my sf8008 supreme using openeight.


It would be great if you can get the boot args for your zgemma and gb 4k with this code: cat /proc/cmdline | sed -e 's/.*\(<start_delimiter>.*<end_delimiter>\).*/\1/')
I know that you are an experienced coder, so if you know how to simplify or improve things then your suggestions are always welcome.


Regards,
Lucifer

EDIT: script removed, not usable for other Multiboot systems and a new script will be made.
Benutzeravatar
Lucifer
Member
Member
Beiträge: 232
Registriert: 01 Feb 2015 12:30
Hat gedankt: 159 Mal
Hat Dank erhalten: 155 Mal

#2

Beitrag von Lucifer »

This post is reserved for future info.
ente1
Member
Member
Beiträge: 62
Registriert: 21 Sep 2016 20:35
Hat gedankt: 21 Mal
Hat Dank erhalten: 4 Mal

#3

Beitrag von ente1 »

The boot args that are needed for the sf8008 boxes are these:
Dateianhänge
boot_args_sf8008.txt
(965 Bytes) 114-mal heruntergeladen
ente1
Member
Member
Beiträge: 62
Registriert: 21 Sep 2016 20:35
Hat gedankt: 21 Mal
Hat Dank erhalten: 4 Mal

#4

Beitrag von ente1 »

Was ist der Unterschied zwischen deinem script und diesem Create_x_extra_slots-SF8008-v1.6-10-Slots-mSD-card-32GB-userdata-sdb5-8.66GB-by-TBstn-31.08.2022.sh ???

Macht dein script es möglich das nachdem flaschen auf multiboot 5-14 die Abfrage kommt: Image booten das geflascht wurde oder zurück zum Image von dem geflascht wurde ???
Benutzeravatar
Lucifer
Member
Member
Beiträge: 232
Registriert: 01 Feb 2015 12:30
Hat gedankt: 159 Mal
Hat Dank erhalten: 155 Mal

#5

Beitrag von Lucifer »

Hi ente1,

Thanks for the feedback. :good:
The bootargs for the sf8008 are already in the script because it was made for the sf8008 boxes. ;)
I only have sf8008 boxes with multiboot options, do you also have other boxes with multiboot options?

Regards,
Lucifer
listener
Developer
Developer
Beiträge: 946
Registriert: 19 Aug 2021 14:24
Wohnort: Belgien
Receiver 1: vuultimo4k
Receiver 2: sf8008
Receiver 3: GBquad4k
Receiver 4: GBue4k
Receiver 5: h9se
Hat gedankt: 73 Mal
Hat Dank erhalten: 237 Mal

#6

Beitrag von listener »

Thanks for the scripts to extract boot args.
It may be easier to extract those args from
/boot/STARTUP_1

I see a bigger problem to generate the boot partitions
which the system multiboot bootloader accepts.

here some info about it:
# STARTUP
# STARTUP_LINUX_1_BOXMODE_1
# boot emmcflash0.linuxkernel 'root=/dev/mmcblk0p3 rootsubdir=linuxrootfs1 kernel=/dev/mmcblk0p2 rw rootwait h7_4.boxmode=1'
# STARTUP_LINUX_2_BOXMODE_1
# boot emmcflash0.linuxkernel2 'root=/dev/mmcblk0p8 rootsubdir=linuxrootfs2 kernel=/dev/mmcblk0p4 rw rootwait h7_4.boxmode=1'
# STARTUP_LINUX_3_BOXMODE_1
# boot emmcflash0.linuxkernel3 'root=/dev/mmcblk0p8 rootsubdir=linuxrootfs3 kernel=/dev/mmcblk0p5 rw rootwait h7_4.boxmode=1'
# STARTUP_LINUX_4_BOXMODE_1
# boot emmcflash0.linuxkernel4 'root=/dev/mmcblk0p8 rootsubdir=linuxrootfs4 kernel=/dev/mmcblk0p6 rw rootwait h7_4.boxmode=1'
# STARTUP_LINUX_1_BOXMODE_12
# boot emmcflash0.linuxkernel 'brcm_cma=520M@248M brcm_cma=192M@768M root=/dev/mmcblk0p3 rootsubdir=linuxrootfs1 kernel=/dev/mmcblk0p2 rw rootwait h7_4.boxmode=12'
# STARTUP_LINUX_2_BOXMODE_12
# boot emmcflash0.linuxkernel2 'brcm_cma=520M@248M brcm_cma=192M@768M root=/dev/mmcblk0p8 rootsubdir=linuxrootfs2 kernel=/dev/mmcblk0p4 rw rootwait h7_4.boxmode=12'
# STARTUP_LINUX_3_BOXMODE_12
# boot emmcflash0.linuxkernel3 'brcm_cma=520M@248M brcm_cma=192M@768M root=/dev/mmcblk0p8 rootsubdir=linuxrootfs3 kernel=/dev/mmcblk0p5 rw rootwait h7_4.boxmode=12'
# STARTUP_LINUX_4_BOXMODE_12
# boot emmcflash0.linuxkernel4 'brcm_cma=520M@248M brcm_cma=192M@768M root=/dev/mmcblk0p8 rootsubdir=linuxrootfs4 kernel=/dev/mmcblk0p6 rw rootwait h7_4.boxmode=12'
#
# STARTUP
# STARTUP_1
# boot emmcflash0.kernel1: 'root=/dev/mmcblk0p5 rootwait rw rootflags=data=journal libata.force=1:3.0G,2:3.0G,3:3.0G coherent_poll=2M vmalloc=525m bmem=529m@491m bmem
# STARTUP_2
# boot emmcflash0.kernel2: 'root=/dev/mmcblk0p7 rootwait rw rootflags=data=journal libata.force=1:3.0G,2:3.0G,3:3.0G coherent_poll=2M vmalloc=525m bmem=529m@491m bmem
# STARTUP_3
# boot emmcflash0.kernel3: 'root=/dev/mmcblk0p9 rootwait rw rootflags=data=journal libata.force=1:3.0G,2:3.0G,3:3.0G coherent_poll=2M vmalloc=525m bmem=529m@491m bmem
#
# STARTUP (sfx6008)
# boot internalflash0.linuxkernel1 'ubi.mtd=12 root=ubi0:ubifs rootsubdir=linuxrootfs1 rootfstype=ubifs kernel=/dev/mtd10 userdataroot=/dev/mtd12 userdatasubdir=userd#
# /sys/firmware/devicetree/base/chosen/bootargs
# console=ttyAMA0,115200 ubi.mtd=12 root=ubi0:ubifs rootsubdir=linuxrootfs1 rootfstype=ubifs kernel=/dev/mtd10 userdataroot=/dev/mtd12 userdatasubdir=userdata1 mtdpar
#
# root=/dev/mmcblk0p3 rootsubdir=linuxrootfs1 kernel=/dev/mmcblk0p2 rw rootwait h7_4.boxmode=1
#

if exists(device) or device == "ubi0:ubifs":
if slotCode not in bootSlots:
bootSlots[slotCode] = {}
# print("[MultiBoot] Root dictionary entry in slot '%s' created." % slotCode)
value = bootSlots[slotCode].get("device")
if value is None:
bootSlots[slotCode]["device"] = device
elif value != device:
print("[MultiBoot] Error: Inconsistent root devices found for slot '%s'! ('%s' != '%s')" % (slotCode, value, device))
value = bootSlots[slotCode].get("bootCodes")
if value is None:
bootSlots[slotCode]["bootCodes"] = [bootCode]
else:
bootSlots[slotCode]["bootCodes"].append(bootCode)
value = bootSlots[slotCode].get("startupfile")
if value is None:
bootSlots[slotCode]["startupfile"] = {}
bootSlots[slotCode]["startupfile"][bootCode] = file
value = bootSlots[slotCode].get("cmdline")
if value is None:
bootSlots[slotCode]["cmdline"] = {}
bootSlots[slotCode]["cmdline"][bootCode] = line
if "ubi.mtd=" in line:
bootSlots[slotCode]["ubi"] = True
if "UUID=" in line:
bootSlots[slotCode]["uuid"] = True
if "rootsubdir" in line:
bootSlots[slotCode]["kernel"] = self.getParam(line, "kernel")
bootSlots[slotCode]["rootsubdir"] = self.getParam(line, "rootsubdir")
elif "sda" in line:
saveKernel(bootSlots, slotCode, "/dev/sda%s" % line.split("sda", 1)[1].split(" ", 1)[0])
elif "sdb" in line:
saveKernel(bootSlots, slotCode, "/dev/sdb%s" % line.split("sdb", 1)[1].split(" ", 1)[0])
elif "sdc" in line:
saveKernel(bootSlots, slotCode, "/dev/sdc%s" % line.split("sdc", 1)[1].split(" ", 1)[0])
elif "sdd" in line:
saveKernel(bootSlots, slotCode, "/dev/sdd%s" % line.split("sdd", 1)[1].split(" ", 1)[0])
else:
parts = device.split("p")
saveKernel(bootSlots, slotCode, "%sp%s" % (parts[0], int(parts[1]) - 1))
elif "bootcmd=" in line or " recovery " in line:
# print("[MultiBoot] loadBootSlots DEBUG: 'bootcmd=' or ' recovery ' text found.")
if slotCode not in bootSlots:
bootSlots[slotCode] = {}
# print("[MultiBoot] Boot Command/Recovery dictionary entry in slot '%s' created." % slotCode)
value = bootSlots[slotCode].get("bootCodes")
if value is None:
bootSlots[slotCode]["bootCodes"] = [bootCode]
else:
bootSlots[slotCode]["bootCodes"].append(bootCode)
value = bootSlots[slotCode].get("startupfile")
if value is None:
bootSlots[slotCode]["startupfile"] = {}
bootSlots[slotCode]["startupfile"][bootCode] = file
value = bootSlots[slotCode].get("cmdline")
if value is None:
bootSlots[slotCode]["cmdline"] = {}
bootSlots[slotCode]["cmdline"][bootCode] = line
else:
print("[MultiBoot] Error: Slot can't be identified. (%s)" % line)
else:
print("[MultiBoot] Error: Slot code can not be determined from '%s'!" % file)
self.console.ePopen([UMOUNT, UMOUNT, tempDir])
rmdir(tempDir)
bootSlotsKeys = sorted(bootSlots.keys())
if self.debugMode:
for slotCode in bootSlotsKeys:
# print("[MultiBoot] loadBootSlots DEBUG: Boot slot '%s': %s" % (slotCode, bootSlots[slotCode]))
print("[MultiBoot] Slot '%s':" % slotCode)
modes = bootSlots[slotCode].get("bootCodes")
if modes and modes != [""]:
print("[MultiBoot] Boot modes: '%s'." % "', '".join(modes))
startupFile = bootSlots[slotCode].get("startupfile")
if startupFile:
if isinstance(startupFile, dict):
if "" in startupFile:
print("[MultiBoot] Startup file: '%s'." % startupFile[""])
else:
print("[MultiBoot] Startup files:")
for key in sorted(startupFile.keys()):
print("[MultiBoot] Mode '%s': '%s'." % (key, startupFile[key]))
else:
print("[MultiBoot] Startup file: '%s'." % startupFile)
commandLine = bootSlots[slotCode].get("cmdline")
if commandLine:
if isinstance(commandLine, dict):
if "" in startupFile:
print("[MultiBoot] Command line: '%s'." % startupFile[""])
else:
print("[MultiBoot] Command lines:")
for key in sorted(commandLine.keys()):
print("[MultiBoot] Mode '%s': '%s'." % (key, commandLine[key]))
else:
print("[MultiBoot] Command line: '%s'." % startupFile)
print("[MultiBoot] Kernel device: '%s'." % bootSlots[slotCode].get("kernel", "Unknown"))
print("[MultiBoot] Root device: '%s'." % bootSlots[slotCode].get("device", "Unknown"))
print("[MultiBoot] Root directory: '%s'." % bootSlots[slotCode].get("rootsubdir", "Unknown"))
print("[MultiBoot] UBI device: '%s'." % ("Yes" if bootSlots[slotCode].get("ubi", False) else "No"))
print("[MultiBoot] UUID device: '%s'." % ("Yes" if bootSlots[slotCode].get("uuid", False) else "No"))
print("[MultiBoot] %d boot slots detected." % len(bootSlots))
Benutzeravatar
Lucifer
Member
Member
Beiträge: 232
Registriert: 01 Feb 2015 12:30
Hat gedankt: 159 Mal
Hat Dank erhalten: 155 Mal

#7

Beitrag von Lucifer »

ente1 hat geschrieben:Was ist der Unterschied zwischen deinem script und diesem Create_x_extra_slots-SF8008-v1.6-10-Slots-mSD-card-32GB-userdata-sdb5-8.66GB-by-TBstn-31.08.2022.sh ???

Macht dein script es möglich das nachdem flaschen auf multiboot 5-14 die Abfrage kommt: Image booten das geflascht wurde oder zurück zum Image von dem geflascht wurde ???


The scripts that you are talking about, are from someone that is using the first multiboot partitioning scripts that i made.
I was/am more active on the Octagon forum and i helped several users to make special multiboot partitioning scripts.
I used these basic multiboot partitioning scripts because they are easier to understand by non experienced users, instead of the multiboot partitioning script that Pike_Bishop and me made and published here: https://www.opena.tv/viewtopic.php?t=54235
I don't care if other users make and publish multiboot partitioning scripts, but that does not mean that it is a 1.6 version of the script that i published.

The multiboot partitioning script in this thread is just for creating multiboot partitions on a device, that's all.
If you want to use a script that does more, then just do that.
Benutzeravatar
Lucifer
Member
Member
Beiträge: 232
Registriert: 01 Feb 2015 12:30
Hat gedankt: 159 Mal
Hat Dank erhalten: 155 Mal

#8

Beitrag von Lucifer »

@listener,

I see what you mean, but maby it's better to write some extra code when the H7 boxtype is detected. (extracting the args from /boot/STARTUP_1)
PLi does not support this Multiboot System, so there are no STARTUP files in /boot
Maybe this is the case with other images too.
listener
Developer
Developer
Beiträge: 946
Registriert: 19 Aug 2021 14:24
Wohnort: Belgien
Receiver 1: vuultimo4k
Receiver 2: sf8008
Receiver 3: GBquad4k
Receiver 4: GBue4k
Receiver 5: h9se
Hat gedankt: 73 Mal
Hat Dank erhalten: 237 Mal

#9

Beitrag von listener »

Yes pli is a theme in itself.
Those do not like inovation and remain
with old is better.
I figure out the partition strukture for zgemma
and gb4k.
If I find time I'll post it here
Benutzeravatar
Lucifer
Member
Member
Beiträge: 232
Registriert: 01 Feb 2015 12:30
Hat gedankt: 159 Mal
Hat Dank erhalten: 155 Mal

#10

Beitrag von Lucifer »

listener hat geschrieben:Yes pli is a theme in itself.
Those do not like inovation and remain
with old is better.


So i'm not the only one with that experience. :D

For the args of the H7 i can change the 'delimiter' code to extract them if i know what part(s) are needed.
In the 'worst' case we can always add the args the old fashioned way.
STARTUP_END="blabla bla, bla, bla'"
listener
Developer
Developer
Beiträge: 946
Registriert: 19 Aug 2021 14:24
Wohnort: Belgien
Receiver 1: vuultimo4k
Receiver 2: sf8008
Receiver 3: GBquad4k
Receiver 4: GBue4k
Receiver 5: h9se
Hat gedankt: 73 Mal
Hat Dank erhalten: 237 Mal

#11

Beitrag von listener »

Here the gb4k
cat /boot/STARTUP_2
boot emmcflash0.linuxkernel2 'root=/dev/mmcblk0p16 rootsubdir=linuxrootfs2 rootfstype=ext4 kernel=/dev/mmcblk0p13 userdataroot=/dev/mmcblk0p16 userdatasubdir=userdata2 blkdevparts=mmcblk0:1M(boot),1M(bootargs),1M(bootoptions),3M(baseparam),4M(pqparam),4M(logo),4M(deviceinfo),4M(softwareinfo),4M(loaderdb),32M(loader),8M(trustedcore),16M(linuxkernel1),16M(linuxkernel2),16M(linuxkernel3),16M(linuxkernel4),-(userdata)'

root=/dev/xxxxxxxx clear
rootsubdir=rootfs folder on root
kernel=/dev/xxxxx kernel partition

i have mounted /dev/mmcblk0p16
ls mount
ls -al
drwxr-xr-x 7 root root 4096 Jun 28 15:17 .
drwxrwxrwt 7 root root 140 Jun 29 14:19 ..
drwxr-xr-x 16 root root 4096 Jun 28 17:20 linuxrootfs1
drwxr-xr-x 15 root root 4096 Jun 28 15:00 linuxrootfs2
drwxr-xr-x 16 root root 4096 Jun 28 15:38 linuxrootfs3
drwxr-xr-x 2 root root 4096 Jun 17 02:52 linuxrootfs4
drwx------ 2 root root 16384 Jun 17 02:52 lost+found
listener
Developer
Developer
Beiträge: 946
Registriert: 19 Aug 2021 14:24
Wohnort: Belgien
Receiver 1: vuultimo4k
Receiver 2: sf8008
Receiver 3: GBquad4k
Receiver 4: GBue4k
Receiver 5: h9se
Hat gedankt: 73 Mal
Hat Dank erhalten: 237 Mal

#12

Beitrag von listener »

Here the zgemma

cat /boot/STARTUP_LINUX_1
bootcmd=setenv notee y; setenv bootargs $(bootargs) $(bootargs_common); mmc read
bootargs=root=/dev/mmcblk0p23 rootsubdir=linuxrootfs1 rootfstype=ext4 kernel=/dev/mmcblk0p19

mount /dev/mmcblk0p23
ls mmcblk0p23
adb dalvik-cache misc_ce ss
anr data misc_de system
app drm nativetest system_ce
app-asec linuxrootfs1 netshare system_de
app-ephemeral linuxrootfs2 nfc tombstones
app-lib linuxrootfs3 ota user
app-private linuxrootfs4 ota_package user_de
backup local ppp vendor
benchmarktest lost+found pq vendor_ce
bootchart media property vendor_de
bugreports mediadrm resource-cache vmx
cache misc security

you see linuxrootfs1 that can on sd/usb
Benutzeravatar
Lucifer
Member
Member
Beiträge: 232
Registriert: 01 Feb 2015 12:30
Hat gedankt: 159 Mal
Hat Dank erhalten: 155 Mal

#13

Beitrag von Lucifer »

listener hat geschrieben:Here the gb4k
cat /boot/STARTUP_2
boot emmcflash0.linuxkernel2 'root=/dev/mmcblk0p16 rootsubdir=linuxrootfs2 rootfstype=ext4 kernel=/dev/mmcblk0p13 userdataroot=/dev/mmcblk0p16 userdatasubdir=userdata2 blkdevparts=mmcblk0:1M(boot),1M(bootargs),1M(bootoptions),3M(baseparam),4M(pqparam),4M(logo),4M(deviceinfo),4M(softwareinfo),4M(loaderdb),32M(loader),8M(trustedcore),16M(linuxkernel1),16M(linuxkernel2),16M(linuxkernel3),16M(linuxkernel4),-(userdata)'

root=/dev/xxxxxxxx clear
rootsubdir=rootfs folder on root
kernel=/dev/xxxxx kernel partition

i have mounted /dev/mmcblk0p16
ls mount
ls -al
drwxr-xr-x 7 root root 4096 Jun 28 15:17 .
drwxrwxrwt 7 root root 140 Jun 29 14:19 ..
drwxr-xr-x 16 root root 4096 Jun 28 17:20 linuxrootfs1
drwxr-xr-x 15 root root 4096 Jun 28 15:00 linuxrootfs2
drwxr-xr-x 16 root root 4096 Jun 28 15:38 linuxrootfs3
drwxr-xr-x 2 root root 4096 Jun 17 02:52 linuxrootfs4
drwx------ 2 root root 16384 Jun 17 02:52 lost+found


Does that mean this part should be used for the args?
blkdevparts=mmcblk0:1M(boot),1M(bootargs),1M(booto ptions),3M(baseparam),4M(pqparam),4M(logo),4M(devi ceinfo),4M(softwareinfo),4M(loaderdb),32M(loader), 8M(trustedcore),16M(linuxkernel1),16M(linuxkernel2 ),16M(linuxkernel3),16M(linuxkernel4),-(userdata)

I tought that the gb trio 4k is also a Uclan clone just like the sf8008, in that case i think the same args are needed.
rootwait blkdevparts=mmcblk0:1M(boot),1M(bootargs),1M(bootoptions),3M(baseparam),4M(pqparam),4M(logo),4M(deviceinfo),4M(softwareinfo),4M(loaderdb),32M(loader),8M(trustedcore),16M(linuxkernel1),16M(linuxkernel2),16M(linuxkernel3),16M(linuxkernel4),-(userdata)

Do you have a gb trio or a different model?


listener hat geschrieben:Here the zgemma

cat /boot/STARTUP_LINUX_1
bootcmd=setenv notee y; setenv bootargs $(bootargs) $(bootargs_common); mmc read
bootargs=root=/dev/mmcblk0p23 rootsubdir=linuxrootfs1 rootfstype=ext4 kernel=/de

mount /dev/mmcblk0p23
ls mmcblk0p23
adb dalvik-cache misc_ce ss
anr data misc_de system
app drm nativetest system_ce
app-asec linuxrootfs1 netshare system_de
app-ephemeral linuxrootfs2 nfc tombstones
app-lib linuxrootfs3 ota user
app-private linuxrootfs4 ota_package user_de
backup local ppp vendor
benchmarktest lost+found pq vendor_ce
bootchart media property vendor_de
bugreports mediadrm resource-cache vmx
cache misc security

you see linuxrootfs1 that can on sd/usb


so, for the zgemma the file names are STARTUP_LINUX instead of STARTUP.


If i use cat /proc/cmdline when the sf8008 is running an image in slot 1-4 then the rootwait part is not shown in the args:
console=ttyAMA0,115200 root=/dev/mmcblk0p16 rootsubdir=linuxrootfs1 rootfstype=ext4 kernel=/dev/mmcblk0p12 userdataroot=/dev/mmcblk0p16 userdatasubdir=userdata1 blkdevparts=mmcblk0:1M(boot),1M(bootargs),1M(bootoptions),3M(baseparam),4M(pqparam),4M(logo),4M(deviceinfo),4M(softwareinfo),4M(loaderdb),32M(loader),8M(trustedcore),16M(linuxkernel1),16M(linuxkernel2),16M(linuxkernel3),16M(linuxkernel4),-(userdata) coherent_pool=2M mem=1G mmz=ddr,0,0,72M vmalloc=500M MACHINEBUILD=sf8008 OEM=octagon MODEL=sf8008

If i use cat /proc/cmdline when the sf8008 is running an image in slot 5 (SD-card sda) then the rootwait part is shown in the args, and that part is needed for the args of an external device:
console=ttyAMA0,115200 root=/dev/sda2 rootfstype=ext4 kernel=/dev/sda1 rootwait userdataroot=/dev/sda5 userdatasubdir=userdata1 blkdevparts=mmcblk0:1M(boot),1M(bootargs),1M(bootoptions),3M(baseparam),4M(pqparam),4M(logo),4M(deviceinfo),4M(softwareinfo),4M(loaderdb),32M(loader),8M(trustedcore),16M(linuxkernel1),16M(linuxkernel2),16M(linuxkernel3),16M(linuxkernel4),-(userdata) coherent_pool=2M mem=1G mmz=ddr,0,0,72M vmalloc=500M MACHINEBUILD=sf8008 OEM=octagon MODEL=sf8008

That means that reading a STARTUP file of slot 1-4 doen not (always) show the complete args that are needed for a slot on an external device.
so, the best way is to read out the (complete) args
listener
Developer
Developer
Beiträge: 946
Registriert: 19 Aug 2021 14:24
Wohnort: Belgien
Receiver 1: vuultimo4k
Receiver 2: sf8008
Receiver 3: GBquad4k
Receiver 4: GBue4k
Receiver 5: h9se
Hat gedankt: 73 Mal
Hat Dank erhalten: 237 Mal

#14

Beitrag von listener »

I take it from gbquad4k and the gbue4k use the same.
My plan for zgemma
i wil copy all from /dev/mmcblk0p23 to /dev/mmcblk1p2 (the sd card)
and create on sdcard the kernel partitions.
See if its work and add then rootfs folders.
It wil take some time and testing and footbal :->
Benutzeravatar
Lucifer
Member
Member
Beiträge: 232
Registriert: 01 Feb 2015 12:30
Hat gedankt: 159 Mal
Hat Dank erhalten: 155 Mal

#15

Beitrag von Lucifer »

No problem, i have other things to do too. :)
Benutzeravatar
Lucifer
Member
Member
Beiträge: 232
Registriert: 01 Feb 2015 12:30
Hat gedankt: 159 Mal
Hat Dank erhalten: 155 Mal

#16

Beitrag von Lucifer »

Lucifer hat geschrieben:
so, for the zgemma the file names are STARTUP_LINUX instead of STARTUP.


If i use cat /proc/cmdline when the sf8008 is running an image in slot 1-4 then the rootwait part is not shown in the args:
console=ttyAMA0,115200 root=/dev/mmcblk0p16 rootsubdir=linuxrootfs1 rootfstype=ext4 kernel=/dev/mmcblk0p12 userdataroot=/dev/mmcblk0p16 userdatasubdir=userdata1 blkdevparts=mmcblk0:1M(boot),1M(bootargs),1M(bootoptions),3M(baseparam),4M(pqparam),4M(logo),4M(deviceinfo),4M(softwareinfo),4M(loaderdb),32M(loader),8M(trustedcore),16M(linuxkernel1),16M(linuxkernel2),16M(linuxkernel3),16M(linuxkernel4),-(userdata) coherent_pool=2M mem=1G mmz=ddr,0,0,72M vmalloc=500M MACHINEBUILD=sf8008 OEM=octagon MODEL=sf8008

If i use cat /proc/cmdline when the sf8008 is running an image in slot 5 (SD-card sda) then the rootwait part is shown in the args, and that part is needed for the args of an external device:
console=ttyAMA0,115200 root=/dev/sda2 rootfstype=ext4 kernel=/dev/sda1 rootwait userdataroot=/dev/sda5 userdatasubdir=userdata1 blkdevparts=mmcblk0:1M(boot),1M(bootargs),1M(bootoptions),3M(baseparam),4M(pqparam),4M(logo),4M(deviceinfo),4M(softwareinfo),4M(loaderdb),32M(loader),8M(trustedcore),16M(linuxkernel1),16M(linuxkernel2),16M(linuxkernel3),16M(linuxkernel4),-(userdata) coherent_pool=2M mem=1G mmz=ddr,0,0,72M vmalloc=500M MACHINEBUILD=sf8008 OEM=octagon MODEL=sf8008

That means that reading a STARTUP file of slot 1-4 doen not (always) show the complete args that are needed for a slot on an external device.
so, the best way is to read out the (complete) args


One way of solving this, is to change the start delimiter and extract the part that is always found, and then add the rootwait part to the args, like this:

Code: Alles auswählen

STARTUP_END="[B][color=#FF0000]rootwait[/color][/B] $(cat /proc/cmdline | sed -e 's/.*\([B][color=#FF0000]blkdevparts[/color][/B].*(userdata)\).*/\1/')'"


But then you have to know that the rootwait part is needed. :confused:

I think it's better to split this experiment in two parts:
1. Find the boot args that are needed for the STARTUP/STARTUP_LINUX files.
2. Find a clever way to extract the boot args from somewhere somehow.

With the use of the boxtype it's easy to create STARTUP_LINUX files instead of STARTUP files:

Code: Alles auswählen

if [ $BOXTYPE = "zgemmah7" ] ; then
   echo "$STARTUP $STARTUP_END" > $BOOT/STARTUP_LINUX_${count_startups}
else
   echo "$STARTUP $STARTUP_END" > $BOOT/STARTUP_${count_startups}
fi
listener
Developer
Developer
Beiträge: 946
Registriert: 19 Aug 2021 14:24
Wohnort: Belgien
Receiver 1: vuultimo4k
Receiver 2: sf8008
Receiver 3: GBquad4k
Receiver 4: GBue4k
Receiver 5: h9se
Hat gedankt: 73 Mal
Hat Dank erhalten: 237 Mal

#17

Beitrag von listener »

take a look at
cat /sys/firmware/devicetree/base/chosen/bootargs

I think the best way is to get it live from system
cat /boot/STARTUP_LINUX_1
bootcmd=setenv notee y; setenv bootargs $(bootargs) $(bootargs_common); mmc read 0 0x1000000 0x3BD000 0x8000; bootm 0x1000000; run bootcmd_fallback
bootargs=root=/dev/mmcblk0p23 rootsubdir=linuxrootfs1 rootfstype=ext4 kernel=/dev/mmcblk0p19


and change
dev/mmcxxxxxxx to new
and rootsubdir=linuxrootfs1 to 56789....

only the last part need to be changed
bootargs=root=/dev/mmcblk0p23 rootsubdir=linuxrootfs1 rootfstype=ext4 kernel=/dev/mmcblk0p19

if it not work op pli hmmmmmmmmmmmmmm

it is also not possible to add slots in pli missing /boot
you must at the moment only use openatv to create more slots
Benutzeravatar
Lucifer
Member
Member
Beiträge: 232
Registriert: 01 Feb 2015 12:30
Hat gedankt: 159 Mal
Hat Dank erhalten: 155 Mal

#18

Beitrag von Lucifer »

For the sf8008 boxes cat /sys/firmware/devicetree/base/chosen/bootargs does not make a difference.
If the box is running an image in slot 1-4, i don't get the complete args that are needed for an image in an external slot.
So extracting the args from STARTUP file 1,2,3 or 4 will give the same incomplete args.

But if that works for the zgemma, then we can use that for the script.

The distro name can be red via the web interface:

Code: Alles auswählen

BOXIP=http://localhost
WGET=/usr/bin/wget
DISTROVERSION="$($WGET -O - -q $BOXIP/web/deviceinfo | grep "\(<\|</\)e2distroversion" | tr -d '\n' | sed "s/.*<e2distroversion>\(.*\)<\/e2distroversion>.*/\\1\n/")"


If the distro i openpli, the STARTUP files are in /media/mmc because the multiboot partitions are mounted in /media.
urie
Senior member
Senior member
Beiträge: 1122
Registriert: 07 Mai 2019 13:52
Wohnort: Scotland
Receiver 1: Gigablue Quad UHD 4K Pro
Receiver 2: Gigablue Quad UHD 4K
Receiver 3: Zgemma H9 Combo
Hat gedankt: 214 Mal
Hat Dank erhalten: 233 Mal
Geschlecht:

#19

Beitrag von urie »

Here is report from zgemma h9 combo which I thought more like octagon and gbtrio4k unlike gbquad4k and gbue4k
Dateianhänge
boot_args_H9Combo.txt
(778 Bytes) 61-mal heruntergeladen
listener
Developer
Developer
Beiträge: 946
Registriert: 19 Aug 2021 14:24
Wohnort: Belgien
Receiver 1: vuultimo4k
Receiver 2: sf8008
Receiver 3: GBquad4k
Receiver 4: GBue4k
Receiver 5: h9se
Hat gedankt: 73 Mal
Hat Dank erhalten: 237 Mal

#20

Beitrag von listener »

I don't think we should pay so much attention to the bootatgs

The system multiboot loader does adjust that according to
the data in STARTUP_xxxx_x file

the boot arguments are hardcoded in system multiboot loader.

Think we should also move away from the method for each kernel and each rootfs one partition

Now they use 1 partition for multiple rootfilesystems which makes it
advantage that the size of rootfs is limited by large partition which is bigger than by one rootfs on one partition
Antworten

Zurück zu „Skripte“