Jump to content











Photo
- - - - -

Boot LibreElec with grub4dos from HDD


  • Please log in to reply
99 replies to this topic

#26 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3041 posts
  • Location:Nantes - France
  •  
    France

Posted 13 October 2019 - 01:58 PM

FYI, here is below how I proceeded (and came with some questions along the way).
I decided not to map the librelec disk image but rather restore the librelec partitions on part 2 and 3 while using G4D on part1.

-Created part 1 (active / fat32) 64 mb for grub4dos
-Created part 2 512 mb for SYSTEM
-Created part 3 32 mb for STORAGE
-Restored SYSTEM.IMG (from librelec.img) to part 2 (which has a default VOLNAME/LABEL="LIBREELEC FAT16" which needs to be changed)
-Restored STORAGE.IMG (from librelec.img) to part 3 (which has a default VOLNAME/LABEL="STORAGE")

 

lv5Z4Nu.png

That approach sounded quite straight forward to me.

Then booted onto this new disk to discover that Grub4DOS (0.4.6a, tried different versions) would not recognize the FS on part 2.
Note that this part 2 is seen without any issue under windows.

Looking closer at, it is a FAT16 FS with OEMID=SYSLINUX.
I tweaked a few fields in the MBR (part type=06/0E) and in the BS like OEMID, media description, hidden sec but would not succeed.

I then recreated part 2 (and formated to FAT32 under windows) and this time, copied files from SYSTEM.IMG to this new "windows fat32" part 2 and modified the BS volume label to SYSTEM.
Note that this "copy" approach is possibly linking to the "copy" approach which Alacran ultimately used.

This time Libreelec would boot just fine with the below grub4dos config:

default 0
PROMPT 0

title run
find --set-root /syslinux.cfg
kernel /KERNEL boot=LABEL=SYSTEM disk=LABEL=STORAGE tty portable quiet
boot

Any idea why Grub4dos would not recognize the FS coming from the FAT16 image used by librelec?

And (beyond the now well understood matching volume/boot sector UUID or LABEL prereq), would not this be the main blocker for Grub4dos to use "as is" the image provided by Librelec?

 

Below the original Libreelec FAT16 part which Grub4dos would not recognize.
 

dQWaivZ.png



#27 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 13 October 2019 - 05:21 PM

First thing.
The label is NOT (cannot be) "LIBRELEC FAT 16".
There is a finite amount of space for a label which is 11 characters, LIBRELEC takes 8 so you should have following it 3 spaces (20 20 20).
Following this 11 bytes field there is an 8 byte one "System_ID" which normally is (for FAT 16) FAT16 followed by 3 spaces (20 20 20).

Now back to the actual issue.
The values for Heads and Sectors (as expected) are simply "crazy".

A geometry where a track has 8192 sectors (and there are 4 heads) is non-standard.

The 4 heads are fine but the 8192 might be an issue.

Even if the field has 2 bytes. i.e. you can have in theory as much as 0xFFFF = 65535 sectors, the corresponding field in the MBR has only 6 bits for it so (in the MBR) you cannot have more than 111111 = 63 sectors so I wouldn't be surprised if *somewhere* in the grub4dos code only the most relevant byte is read/used or anyway the read value *somehow* confuses it.

Besides the "hidden sectors" (which are actually "Sectors Before") should be corrected to the right value, in the original, from the MBR view you posted earlier they were 8192, but now?

As a side note, try converting 8192 to binary, take only the first 6 bits and convert back to decimal ;).

Anyway, since there are 1048576 sectors in the image, try changing Sectors per track to 63 and heads to 255.


:duff:
Wonko

#28 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3041 posts
  • Location:Nantes - France
  •  
    France

Posted 13 October 2019 - 05:28 PM

Indeed, my bad about the label / SystemID confusion.

It is indeed LIBREELEC 3 spaces FAT16 3 spaces.

 

Back to the most important point, so we would agree that this boot sector is "non standard" to say the least and unlikely to be understood by Grub4dos.

Surprisingly Windows seems to be relax with it and there could be a backup mechanism (in windows) to work around exotic boot sectors.

 

It is disapointing to release such exotic headers as it breaks other possible scenarios/initiatives and the only alternative is to actually rebuild a partition from scratch to make it works with G4D (hence the back and forth discussion previously between "copy" and "clone").

 

On a positive note, this thread allowed me to fix/add a few things in CloneDisk around the boot sector and GPT header :)

 

I believe this exotic boot sector is actually part of the issue Alacran reported initially.



#29 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 13 October 2019 - 06:06 PM

Well, most probably it is (still) a trailer/residue of the good ol' times of CHS.

Windows is LBA only (not everywhere, but in spots[1]) but - if we are going down this path, we are back to the 1023/254/63 that just works until it doesn't (as opposed to my personal approach, properly re-do things that surely work, until they work), and be my guest on how different tools read the same data and behave differently, JFYI:
https://msfn.org/boa...&comment=987482


:duff:
Wonko


[1] strangely enough both FAT32 and NTFS (but if I recall correctly not FAT 12/16) have issues in booting with wrong HS geometry:
http://clemens.endor...ndows_3170.html
http://reboot.pro/to...sector/?p=73205

P.S. the referenced article by JdeBP can be found here:
https://jdebp.eu/FGA...name-field.html

#30 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3041 posts
  • Location:Nantes - France
  •  
    France

Posted 13 October 2019 - 06:48 PM

Because I am stubborn and also because I like to follow your advice, I went back to the original system.img from LibreElec with the "syslinux" OEMID.

 

I fixed 3 fields : secpertrack, heads and hiddensec.

And it is now accepted by G4D : again, spot on Wonko :)

Note that the hiddensec could be irrelevant here (I had tried this before) although we had discussions (about ImDisk and Qemu or virtualpc I believe) over here about this field being left to 0 which in some situations is also troublesome.

 

Edit : and reading me, i believe the hiddensec is wrong anyway in the example below (should be 131200 not 8192) and G4D does not care.

 

oprGLNU.png

 

So the below scenario now works :

 

1-Create part 1 (active / fat32) 64 mb for grub4dos (skip if you already have a G4D setup)
2-Create part 2 512 mb for SYSTEM
3-Create part 3 32 mb for STORAGE
4-Restore SYSTEM.IMG (from 7zip\librelec.img) to part 2 (which has a default VOLNAME/LABEL="LIBREELEC" which needs to be changed)
5-Restore STORAGE.IMG (from 7zip\librelec.img) to part 3 (which has a default VOLNAME/LABEL="STORAGE")

6-Change volume name to "SYSTEM" on part 3 in the boot sector (or leave it to LIBREELEC but then adapt your G4D config)

7-Fix the (C.) H.S to 255/63 in the boot sector : to fix the "exotic" libreelec/syslinux boot sector

8-Eventually fix the hiddensec to reflect the MBR "sectorsbefore" in the boot sector

9-boot from G4D...



#31 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 13 October 2019 - 07:39 PM

Well, since you are not actually booting from that volume the "Sectors Before" will be irrelevant, they are used only by the bootsector code when booting to "find self".
Compare with the (re-known) correction that is needed to boot from logical volumes inside extended:
https://www.goodells.net/multiboot/
https://www.goodells...ot/ptable.shtml

I am not sure why you want to change the "LIBRELEC" label, it seems fine to me :unsure: since you have to create the menu.lst entry anyway, just create it with it, i.e. remove step 6:

title run
find --set-root /syslinux.cfg
kernel /KERNEL boot=LABEL=LIBRELEC disk=LABEL=STORAGE tty portable quiet

and NO, you don't need a "boot" command as last line of a menu.lst entry, it is implied and only needed on command line.

 

And (only for the sake of reasoning) I am perplexed by the three partitions, I cannot see why you cannot have the grub4dos inside the 512 MB FAT partition, or is it filled to the brim? 

And still noone had the guts :w00t: (or more simply the time/will :)) to NOT create the partiton and use the System.img as "simple file":

http://reboot.pro/to...m-hdd/?p=212943
https://forum.libree...tem-boot-files/

:duff:
Wonko



#32 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3041 posts
  • Location:Nantes - France
  •  
    France

Posted 13 October 2019 - 08:00 PM

Well, since you are not actually booting from that volume the "Sectors Before" will be irrelevant, they are used only by the bootsector code when booting to "find self".
Compare with the (re-known) correction that is needed to boot from logical volumes inside extended:
https://www.goodells.net/multiboot/
https://www.goodells...ot/ptable.shtml

I am not sure why you want to change the "LIBRELEC" label, it seems fine to me :unsure: since you have to create the menu.lst entry anyway, just create it with it, i.e. remove step 6:

title run
find --set-root /syslinux.cfg
kernel /KERNEL boot=LABEL=LIBRELEC disk=LABEL=STORAGE tty portable quiet

and NO, you don't need a "boot" command as last line of a menu.lst entry, it is implied and only needed on command line.

 

And (only for the sake of reasoning) I am perplexed by the three partitions, I cannot see why you cannot have the grub4dos inside the 512 MB FAT partition, or is it filled to the brim? 

And still noone had the guts :w00t: (or more simply the time/will :)) to NOT create the partiton and use the System.img as "simple file":

http://reboot.pro/to...m-hdd/?p=212943
https://forum.libree...tem-boot-files/

:duff:
Wonko

 

Correct about the label, as long as the G4D conf and the boot sector label are sync, all is good.

 

The first partition (aka G4D) is only there to act a "one does it all" partition like if you already have a setup booting various distros.

Indeed, a single LibreElec setup could go with two parts only.

 

And as for the below, this is next on my todo list :)

kernel /MYKERNEL BOOT_IMAGE=MYKERNEL SYSTEM_IMAGE=MYSYSTEM boot=LABEL=FLASH live quiet

My main focus for now was to understand why G4D did not want to accept this "restored/cloned" SYSTEM partition and (selfishly) use that scenario/experience to improve my own software to achieve this scenario.



#33 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 13 October 2019 - 10:06 PM


And still noone had the guts :w00t: (or more simply the time/will :)) to NOT create the partiton and use the System.img as "simple file":

http://reboot.pro/to...m-hdd/?p=212943
https://forum.libree...tem-boot-files/

:duff:
Wonko

 

Just edited the title deleting the call to Storage partition and rebooted, It loads fine, it boots as if it was the first time it was booted, but all addons, configurations and backup are lost, (something we prefer to keep once done the first time), as they are located on the second ext4 partition on a bunch of files including some hiden (.file_name).

 

Then I don't think it is a good idea to boot it this way even if it can be done, as I think all that is on second partition should be on a linux partition to let the system interact with it as designed, specially the backup files, and it is very possible there are hard links between some files on the ext4 partition, and this is not possible on Fat environment.

 

alacran



#34 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 13 October 2019 - 11:39 PM

I think maybe steve6375 approach of having an ext4 file, could be used with some variations as on our present case, excluding creating an image partition.

 

Make a bigger size (1 GB) single Fat primary partition + an (Storage) ext4 file about 512 MB (to keep all addons, setting and backups) on the root of the 1 GB Fat single partition.  Actual used size on my ext4 partition is 195 MB, my single backup file alone is a 84 MB xxx.tar file.

 

It can be easily created with RMPrepUSB.

 

But I don't have any idea how to load it (as it is not accesible from Win), to clone or copy all files/folders from my ext4 partition (from my storage.img I could use 7-zip to extract all into it) to keep all my previous info.

 

And then attach it during boot It has to be tested if one of this lines can work on this case:

 

kernel /kernel boot=LABEL=System disk=LABEL=Storage tty portable quiet

 

kernel /kernel boot=LABEL=System disk=LABEL=System/Storage tty portable quiet
 

EDIT: This appoach has proven to not work see: http://reboot.pro/to...e-4#entry213091& http://reboot.pro/to...e-4#entry213093

 

alacran


Edited by alacran, 17 October 2019 - 06:55 AM.


#35 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 14 October 2019 - 09:10 AM

Alacran what EXACTLY have you tried in post  #33?

 

You don't pay a fee per word you post, just §@ç#ing post the EXACT. FULL menu.lst entry that you tried (as opposed to "diffs" to something "vague" and not properly specified)?

 

:duff:

Wonko



#36 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3041 posts
  • Location:Nantes - France
  •  
    France

Posted 14 October 2019 - 11:53 AM

About Ext4, the below may help :

 

-Formatting a volume is rather easy under windows : Mke2fs -t ext4 -b 4096 \Device\HarddiskVolume128 (optionally add -U UUID ).

About the dosdevice, \??\f: probably works too.

Just make sure you format the right volume...

mke2fs is included in cygwin but also in ext2fs.

Slightly deviating : if anyone knows of a mke2fs "native" version... i.e a "fatless" version without cygwin dependencies...

EDIT : there is a lightweight native mke2fs version here but this is from 2003... and i did not test it yet.

 

-Using ext2fsd (on my win8.1 x64) works nicely in RO or RW mode.

I would not recommend RW mode on critical/production datas but here it is perfectly safe and adequate I'd say.

 

wCb35YM.png



#37 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 14 October 2019 - 05:01 PM

Alacran what EXACTLY have you tried in post  #33?

 

You don't pay a fee per word you post, just §@ç#ing post the EXACT. FULL menu.lst entry that you tried (as opposed to "diffs" to something "vague" and not properly specified)?

 

:duff:

Wonko

 

title Start LibreELEC from HDD -2
find --set-root /syslinux.cfg
kernel /kernel boot=LABEL=System



#38 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 14 October 2019 - 06:18 PM

@ erwan.l

 

Thanks for the info, mke2fs (x86 and x64) is also included on RMPrepUSB, including cygwin.

 

I'm lazy and RMPrepUSB does it just by pushing a button (it is easier), the problem is then load/copy/clone the info to this virtual device.

I need a driver or program that allow me to recognize the file system when mounted by ImDisk.

 

I made the ext4 514 MB file and copied it to an USB device and whent to another PC where I have Win10 and Linux Mint, and copied it to my docs and tried to mount it (only by GUI) and it was not possible, anyway this is too complicated the idea is to do all on a Win PC.

 

I tried creating a virtual file with fsutil.exe file createnew "F:\Storage" 540000000 (512 MB) then mounted as HDD with ImDisk and formated it to Fat-32 and extracted all files/folders from my storage.img (allready configured) to it with 7-zip but there was a message about some missed hard links, 7-zip used another word but I thing you can get the idea, so file system has to be ext2, ext3 or ext4 (preferable as it originally was).

 

So I was right when I commented (on post 33) the existence of hard links (on ext4) may be very possible.

 

alacran



#39 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 15 October 2019 - 04:07 AM

Downloaded MiniTool Partition Wizard Free v11.5 and also Linux File Systems for Windows by Paragon Software (working full during 10 days test)

 

MiniTool Partition Wizard Free v11.5 good to create and see partitions with ext2, 3 and 4 (but not files/folders inside), under Windows environment, but you can't resize them.

 

Linux File Systems for Windows let you mount Linux partitions under Windows, Read and write or only Read if you want, all files/folders inside are available.

 

None of them are able to see an ext4 file mounted by ImDisk.

 

Only one who can see it (and its only internal empty folder lost+found) is Partition Guru, I can extract this folder, but didn't let me copy anything into the virtual drive. I have copied files into real ext4 drives using this program before, but it seems this do not work on virtual drives.

 

So far no way to copy Storage content into an ext4 file (virtual drive), mounted by ImDisk.

 

Perhaps some other tool to mount the virtual drive can let me access to it.  Any suggestion is wellcome.

 

alacran



#40 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 15 October 2019 - 07:28 AM

title Start LibreELEC from HDD -2
find --set-root /syslinux.cfg
kernel /kernel boot=LABEL=System

Good, so - AGAIN - nothing connected to the proposed experiment in post #31 (referenced in your reply), experiment that - once again - was about 

1) NOT using a partition but rather "plain" files in a volume
2) later adding EITHER another file or another partition for Storage

 

:duff:

Wonko



#41 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3041 posts
  • Location:Nantes - France
  •  
    France

Posted 15 October 2019 - 07:39 AM

Downloaded MiniTool Partition Wizard Free v11.5 and also Linux File Systems for Windows by Paragon Software (working full during 10 days test)

 

MiniTool Partition Wizard Free v11.5 good to create and see partitions with ext2, 3 and 4 (but not files/folders inside), under Windows environment, but you can't resize them.

 

Linux File Systems for Windows let you mount Linux partitions under Windows, Read and write or only Read if you want, all files/folders inside are available.

 

None of them are able to see an ext4 file mounted by ImDisk.

 

Only one who can see it (and its only internal empty folder lost+found) is Partition Guru, I can extract this folder, but didn't let me copy anything into the virtual drive. I have copied files into real ext4 drives using this program before, but it seems this do not work on virtual drives.

 

So far no way to copy Storage content into an ext4 file (virtual drive), mounted by ImDisk.

 

Perhaps some other tool to mount the virtual drive can let me access to it.  Any suggestion is wellcome.

 

alacran

 

Hi Alacran,

 

Here below the steps I followed in post #36 to create and modify my own EXT4 volume :

 

1-clonedisk : create and attach a fixed vhd (whatever size you want)

2-clonedisk : create (actually initialize) a disk (raw but this is irrelevant)

3-clonedisk : create a partition (mbr but here again this is irrelevant)

4-at this stage, a non formatted volume is detected (skip the windows popup asking you to format this new volume)

5-use mke2fs to format this new unformated and undetected volume to EXT4

6-use ext2fsd (which includes mke2fs) to read/write this EXT4 volume (to be clear, once the driver is installed, windows will automatically mount EXT4 volumes)

7-you now got your self a volume/partition (within the VHD) which you can backup/restore/modify, etc

 

About ImDisk, this creates a volume but without any disk backend.

Because of this, I believe tools like ext2fsd will not detect ImDisk volumes and therefore the driver will not kick in to present it as an EXT4 FS to windows (i.e it will always be detected as a non formatted volume by windows).

So you probably have to forget about ImDisk there to mount your virtual drives / ext4 images.

 

My approach is to do it all under windows with a minimal set of tools.

Ideally I'd like to be able to handle EXT4 with CloneDisk (may be in the future...) so that I could do it all in one tool.

 

I am conscious this approach is also about a partition, not an image file (ref. previous post from Wonko).

Mke2fs can also format a raw image file but then I dont know yet of any tools that can read AND write such files (read is OK with 7zip, etc ...) and it might be then that you need to revert to linux to mount that image file...

 

Regards,

Erwan



#42 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 15 October 2019 - 08:35 AM

So, instead of IMDISK, try using Arsenal Image Mounter ...

 

@erwan.l

I have no idea of what LIBREELEC actually "offers" when booted, but since we now know that it can be booted just fine without connecting a "storage" to it, it should be possible to use LiBRELEC itself to create the storage?:

 

 

:duff:

Wonko



#43 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3041 posts
  • Location:Nantes - France
  •  
    France

Posted 15 October 2019 - 09:36 AM

So, instead of IMDISK, try using Arsenal Image Mounter ...

 

@erwan.l

I have no idea of what LIBREELEC actually "offers" when booted, but since we now know that it can be booted just fine without connecting a "storage" to it, it should be possible to use LiBRELEC itself to create the storage?:

 

 

:duff:

Wonko

 

Librelec is a linux-like OS.

By default it boots to a user interface (KODI) but you can actually boot (or SSH) to a shell.

KODI is a media player interface so dont expect to do low level storage stuff in there.

 

The shell is a light one.

 

But mounting capabilities are there for sure as well for support for various filesystems.

 

So, it might be possible to (1) create a dummy file (dd?),  (2) mount it, (3) format it, and (4) finally read/write to it.

 

Am I getting you right?



#44 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 15 October 2019 - 10:16 AM

@ erwan.l

 

Ok, now your procedure on Post 41 looks more clear to me, I will try it.

 

@ Wonko

 

Tried:

 

title Start LibreELEC from HDD
find --set-root /syslinux.cfg                            >>>> This is located on (hd0,8)
kernel /kernel SYSTEM_IMAGE=SYSTEM

 

It faills here.

 

Error in mount_flash ....  and asks me to type exit.

Then 2 or 3 more errors and finally it freezes all including  the keyboard, and had to push reboot button.

 

alacran



#45 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 15 October 2019 - 10:29 AM

So, instead of IMDISK, try using Arsenal Image Mounter ...

 

 

I started looking for options and found on the forum a Thread from misty (with links to The GUI installer and the GUI mounter on Posts 2 and 3), and tried it about 3 hours ago, ext4 file is mounted but the OS, or the mentioned tools do not see it.

 

But the file system.img storage.img when mounted R/W, it is seen as an unformated drive on Win, but then Linux File Systems for Windows can mount if fine also R/W on Win getting a drive letter just fine, and any program can interact with it.

 

alacran



#46 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3041 posts
  • Location:Nantes - France
  •  
    France

Posted 15 October 2019 - 12:08 PM

I started looking for options and found on the forum a Thread from misty (with links to The GUI installer and the GUI mounter on Posts 2 and 3), and tried it about 3 hours ago, ext4 file is mounted but the OS, or the mentioned tools do not see it.

 

But the file system.img when mounted R/W, it is seen as an unformated drive on Win, but then Linux File Systems for Windows can mount if fine also R/W on Win getting a drive letter just fine, and any program can interact with it.

 

alacran

 

system.img is a FAT32 partition image.

You can mount it with ImDisk - no need for any other tool.

 

storage.img is a EXT4 partition image.

You do need a windows driver AND a "disk" mounting tool (as opposed to a "volume" mounting tool such as ImDisk).



#47 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 15 October 2019 - 12:30 PM

The shell is a light one.

 

But mounting capabilities are there for sure as well for support for various filesystems.

 

So, it might be possible to (1) create a dummy file (dd?),  (2) mount it, (3) format it, and (4) finally read/write to it.

 

Am I getting you right?

Yes and no.

 

What is the requisite/goal/current topic?

 

It is seemingly a "moving target".

It started from loading the stuff from an image <- something for which I possibly found a solution and that the OP never tested, moving to "something else".

Then it moved to using partitions and changing their labels, possibly using each and every method BUT the "normal" ones.

Then it moved to creating a new EXT4 partition (again using "external" tools).

 

What I am saying is that (since we are in a multi-boot environment) and (if the issue is creating a partition with EXT4 and copying some files to it) "native" (Linux) tools can be used.

These latter tools may belong to "another" "live" (possibly coming as a .iso) Linux distro or (if the tools exist in LIBREELEC) from within LIBREELEC itself, now that we have extabliished that it boots just fine without any "storage" attached.

 

So one could:

1) boot to LIBREELEC without any storage attached
2) *somehow* create from the booted LIBREELEC a new "storage" partition/volume (or image)

3) format the above as EXT4

4) copy to it the *whatever*  files

5) re-boot the LIBREELEC with the newly created storage attached

 

If this is not possible, another (smallish, live) Linux distro could be used to:
1) boot to this "other distro" 

2) create from the booted "other distro" a new "storage" partition/volume (or image)

3) format the above as EXT4

4) copy to it the *whatever*  files

5) boot the LIBREELEC with the newly created storage attached

 

But *anything goes*.

 

@alacran

Most probably it is just me, either lacking since a few days some basic English understanding or suddenly becoming too old for this :( , but I cannot make head or tail of most of your posts lately and I just got tired of needing to solve one or more puzzles at each of your posts to maybe understand their contents. 

Anyway, if you are root to a filesystem that has a file called "system.img" in it and you pass to a kernel a parameter "SYSTEM_IMAGE=SYSTEM" how do you extect it to find "system.img"? (maybe it will look for "SYSTEM" or "system" and not for "system.img")

 

:duff:

Wonko



#48 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3041 posts
  • Location:Nantes - France
  •  
    France

Posted 15 October 2019 - 12:44 PM

My understanding of the topic (but again english is not my native langage :) ), is "how to use LibreElec in a multi boot environement using grub4dos?"

 

From there few findings appeared :

-one must match the UUID or LABEL for LibreElec to boot (well understood, sorted out)

-it is unlikely that G4D understands "as is" the exotic syslinux/librelec fat32 image (well understood I believe, sorted out)

-we have not been able to map the whole libreelec.img (possibly/partly because of the above)

-one can restore the system.img (and "fix" it) and storage.img to new hdd partitions and boot via G4D (I did)

-one should be able to use a different syntax by passing a parameter to the kernel pointing at the squashfs file (would be nice to test/assert once for all)

-on this journey, Alacran introduced a new need : how to read/write the EXT4 partition (for a purpose I did not fully understand I must say)

 

I believe the discussion around disk signature, volume UUID/LABEL was a useful one.

Same was the finding about the exotic FAT32 image not understood by G4D.

 

Now building/sharing some extra knowledge around how to deal with EXT4 under windows.

 

My 2 cents...



#49 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 15 October 2019 - 01:30 PM

I believe the discussion around disk signature, volume UUID/LABEL was a useful one.

Same was the finding about the exotic FAT32 image not understood by G4D.

 

Now building/sharing some extra knowledge around how to deal with EXT4 under windows.

Sure :) , but those were "discussions".

 

They tended to be "normal", like:

1) observation or issue

2) question/idea->possible answer or tentative explanation

3) suggested test/verification

4) if test OK-> problem solved

5) next issue (goto 7)

6) if test not OK -> new possible question/answer ( goto 2) or (after a reasonable number of iterations) problem not solvable

7) something else (next item)

 

The whole thread is going more *like*:

1) observation or issue

2) question/idea->possible answer or tentative explanation-> 

3) suggested test/verification

4) something else (possibly vague)

5) something else (possibly not based on anything discussed till here)

6) a completely different test (usually not OK)

7) something else (possibly more vague or unrelated)

 

:duff:

Wonko



#50 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 15 October 2019 - 07:49 PM

Ok, for all that matters, I just did the following:

1) attached the (stupid) LibreELEC-Generic.x86_64-9.0.2.img to Virtualbox

2) booted from a grub4dos floppy (I used a 0.4.5c, but *any* would do)

3) got to command line

4) made sure that the libreelec image was (hd0)

5) cat --hex --skip=24 --length=4 (hd0,0)0+1

6)got the (expected) 00000018: 00 20 04 00

7) write --offset=24 (hd0,0)0+1 \x3F\x00\xFF\x00

8) root (hd0,0)

9) kernel /KERNEL BOOT_IMAGE=KERNEL SYSTEM_IMAGE=SYSTEM boot=LABEL=LIBREELEC live quiet

10) boot

 

And the (stupid) Librelec booted just fine.

 

Then it stopped with a XORG error about GPU not supported, but that was expected:

https://forum.libree...-gpu-supported/

 

Anyway, should be an entirely different story.

 

As I cannot go further on VirtualBox, it remains to see (the second partition has seemingly a label of "STORAGE") if this works:

kernel /KERNEL BOOT_IMAGE=KERNEL SYSTEM_IMAGE=SYSTEM boot=LABEL=LIBREELEC disk=LABEL=STORAGE live quiet

 

:duff:

Wonko






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users