LibreELEC as a linux distribution

  • I like Libreelec S905x support, linux for powerfull 64 bit quadore cpu just great. But how can i use readonly squashfs SYSTEM image as rw ext4 rootfs? I would like to install new software etc..

    I know the just enough os for kodi philosophy but i can't help myself.

    What changes are required? Do i need to rebuild kernel without squashfs support and what else? Is it required to change init? Would extracting SYSTEM to a partition be enough? u-boot bootargs need to change i assume. Can i do it through s905_autoscript?


    Thanks for this great support, hard work


  • I like Libreelec S905x support, linux for powerfull 64 bit quadore cpu just great. But how can i use readonly squashfs SYSTEM image as rw ext4 rootfs? I would like to install new software etc..

    I know the just enough os for kodi philosophy but i can't help myself.

    What changes are required? Do i need to rebuild kernel without squashfs support and what else? Is it required to change init? Would extracting SYSTEM to a partition be enough? u-boot bootargs need to change i assume. Can i do it through s905_autoscript?


    Thanks for this great support, hard work

    Maybe you need to consider another alternatives like ARMBian or DietPI


  • I like Libreelec S905x support, linux for powerfull 64 bit quadore cpu just great. But how can i use readonly squashfs SYSTEM image as rw ext4 rootfs? I would like to install new software etc..

    I know the just enough os for kodi philosophy but i can't help myself.

    What changes are required? Do i need to rebuild kernel without squashfs support and what else? Is it required to change init? Would extracting SYSTEM to a partition be enough? u-boot bootargs need to change i assume. Can i do it through s905_autoscript?


    Thanks for this great support, hard work

    Yes it would take a large change to the build system, even then we don't have a package manager or build tools so you would have a hard time installing other software. Maybe another distribution is better for you.

  • hello,
    even though it is not the best alternative for general purpose OS, it supports mini m8s ii hardware-devices fully . so I am trying to understand the Libreelec scripts. It is really good reference. so here is my approach:

    Kernel first extracts initramfs then execute init script.
    within init script prepare_sysroot() function mounts SYSTEM rootfs image as "ro, loop".
    I am trying to change mount target from SYSTEM to /dev/mmcblk1p2 (rw) which have extracted rootfs.
    I found extracted SYSTEM rootfs & initramfs.cpio under "LibreELEC/buildxxxx7.0.2.008/image" folder.

    **********
    prepare_sysroot() {
    progress "Preparing system"

    #if [ "$SYSTEM_TORAM" = "no" -o "$INSTALLED_MEMORY" -lt "$SYSTEM_TORAM_LIMIT" ]; then
    #mount_part "/flash/$IMAGE_SYSTEM" "/sysroot" "ro,loop"
    #else
    #cp /flash/$IMAGE_SYSTEM /dev/$IMAGE_SYSTEM
    #mount_part "/dev/$IMAGE_SYSTEM" "/sysroot" "ro,loop"
    #fi

    mount_part "/dev/mmcblk1p2" "/sysroot" "rw" # 1.st attempt does not work
    mount --move /storage /sysroot # 2.nd attempt does not work
    mount --move /flash /sysroot/flash
    #mount --move /storage /sysroot/storage
    **********

    scripts still generate images but I use new kernel.img and extracted rootfs in sdcard.
    until now no luck, kernel hangs at 4th second like this: (I think it cannot change rootfs from ram to mmcblk1p2)

    [ 4.268764@3] [<ffffffc001083da0>] el1_irq+0x60/0xc0
    [ 4.273680@3] [<ffffffc0010e755c>] cpu_startup_entry+0x17c/0x1d0
    [ 4.279632@3] [<ffffffc00108da10>] secondary_start_kernel+0x110/0x120

    any help from someone who has insight kernel-initramfs-rootfs transitions would be appreciated, (I am reading ramfs-rootfs-initramfs.txt but it seems every system has it's own ways )

    thanks,

    EDIT:
    It turns out, when I try to change init script inside initramfs.cpio through Archive Manager (Ubuntu), it changes cpio compression switches. So kernel cannot extract initramfs and halts. Instead I changed init file in http://LibreELEC.tv/packages/sysutils/busybox/scripts/init, deleted already built kernel, image etc, rerun make...and now i have rw LibreElec system booting.

    Edited once, last by Albundy (October 22, 2016 at 10:13 AM).

  • I like Libreelec S905x support, linux for powerfull 64 bit quadore cpu just great. But how can i use readonly squashfs SYSTEM image as rw ext4 rootfs? I would like to install new software etc..

    EDIT:
    It turns out, when I try to change init script inside initramfs.cpio through Archive Manager (Ubuntu), it changes cpio compression switches. So kernel cannot extract initramfs and halts. Instead I changed init file in http://LibreELEC.tv/packages/sysutils/busybox/scripts/init, deleted already built kernel, image etc, rerun make...and now i have rw LibreElec system booting.

    Albundy, hi
    Thank you for very interesting topic
    looking for continue of your story) pls tell how you plan to use new possibilities? What to install?


  • Learn how to use Docker, it will let you run anything without touching LE.

    Agree with you in general... but speaking about Amlogic LE builds, not is possible, the kernel not is compatible with the Docker addon.

    In any case, from my point of view, try to use LE as generic linux distribution not made sense. Instead of spend time developing something to adapt LE I think that a better approach is spend time fixing a generic distributions like ARMBian.


  • In any case, from my point of view, try to use LE as generic linux distribution not made sense. Instead of spend time developing something to adapt LE I think that a better approach is spend time fixing a generic distributions like ARMBian.


    True, even having a read write root fs gives you no benefit compared to installing new software to /storage. Back porting the overlay2 driver to the amlogic kernel for docker support would be the better alternative.

    Gerald

    Edited once, last by gdachs (October 27, 2016 at 6:58 PM).


  • True, even having a read write root fs gives you no benefit compared to installing new software to /storage. Back porting the overlay2 driver to the amlogic kernel for docker support would be the better alternative.

    Gerald

    GitHub - hardkernel/linux: Linux kernel source tree looks like is compatible with docker


    Same SOC, similar kernel... is a good point to start if someone have the time and the skills to backport it to LE.

    Edited once, last by CGarces (October 27, 2016 at 7:35 PM).

  • IIRC then the last internal discussion was about that this kernel has only overlayfs and not overlayfs2. There seem to be some issues with overlayfs.

    Gerald