Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

Running Linux From SD Card or USB Flash Drive - Using Balbes150 Method And Files.

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Originally posted by botfap View Post

    Well I went in another direction. Ubuntu was just too big and bloaty in terms of disk footprint and ram overhead. I ended up creating my own cut down linux based off the Amlogic dev kit.

    If you want to play with linux on the A95X or any other S905X device I have setup an easy build system to build the kernel image, boot.img, dtb.img, rootfs and an updated uboot bootloader.

    The git repo contains vanilla src, aml_p212 patches, amlogic dev kit, toolchains to build aarch64 on x86, build system, clean buildroot. Kernel is also android compat

    Ive posted it up to github:



    I will get round to building some TWRP flashable zips when i get the chance
    Botfap congratulations, You did a great job. Respect To You.

    This approach of using Linux there are a number of nuances. Which the user needs to evaluate before using.
    1. Be sure to do a FULL backup of the entire contents of the internal memory BEFORE any manipulation with it.
    2. When you install Linux to the internal memory, will be destroyed by a standard boot loader u-boot (replaced with the total from Amlogic). Some manufacturers TV box modify u-boot (to support its features in hardware). Therefore, when using a common loader Amlogic, can stop working piece of equipment.
    3. In the readme file botfap is a description on the use on the SD card, but there is missing one important step is the Erasure of the internal memory (loader). Without them, the system will not run from external media. Because, by default, in S905 the CPU States that the order of polling devices to run that first will run u-boot from eMMC and running the system from external media will not take place.
    4. This method is used are not standard for normal PC a breakdown of the partitions on the eMMC So you have all the software and rules to adjust for it.
    5. As the root partition, use the old ext2. This is due to the fact that this instruction from Amlogic, originates from the old systems, NAND and does not account for the possibility of a new memory eMMC.

    If make some changes in the method using this variant of Linux, it is possible good the desired operating system.

    Comment


      Arch has an image for the Odroid-C2 board, is there any chance this will work with your method, Balbes?


      I've tried moving their /boot to the fat partition, keeping my dtb and your start scripts and it won't boot. I wish I knew more about it, but it would be nice to have an Arch option for these boxes.

      Comment


        Originally posted by balbes150 View Post

        Botfap congratulations, You did a great job. Respect To You.

        This approach of using Linux there are a number of nuances. Which the user needs to evaluate before using.
        1. Be sure to do a FULL backup of the entire contents of the internal memory BEFORE any manipulation with it.
        2. When you install Linux to the internal memory, will be destroyed by a standard boot loader u-boot (replaced with the total from Amlogic). Some manufacturers TV box modify u-boot (to support its features in hardware). Therefore, when using a common loader Amlogic, can stop working piece of equipment.
        3. In the readme file botfap is a description on the use on the SD card, but there is missing one important step is the Erasure of the internal memory (loader). Without them, the system will not run from external media. Because, by default, in S905 the CPU States that the order of polling devices to run that first will run u-boot from eMMC and running the system from external media will not take place.
        4. This method is used are not standard for normal PC a breakdown of the partitions on the eMMC So you have all the software and rules to adjust for it.
        5. As the root partition, use the old ext2. This is due to the fact that this instruction from Amlogic, originates from the old systems, NAND and does not account for the possibility of a new memory eMMC.

        If make some changes in the method using this variant of Linux, it is possible good the desired operating system.
        Thanks for the input. Ive added a recovery section with instructions for backup / recovery. But balbes is right, if you follow my method it will brick your device for android unless you restore the stock bootloader.

        I would like to be able to run with the stock bootloader. I can change my build system to spit out boot as a separate FAT32 fs. If I knew what the stock u-boot was doing when booting then I can probably change my setup to adapt to it. Do you know the steps that it performs and the files / locations that it looks for at boot for kernel and dtb? Im really struggling to get any info on amlogic uboot.

        I left that step out on purpose I was waiting till i had a eMMC u-boot backup and an easy way to restore it! People who understand can see that its missing, those that dont
        know its missing dont brick the device.

        I left it a ext2 intentionally. My usage has a read only rootfs and best performance for RO while maintaining RW compat when needed is ext2. RO fs has minimal risk of corruption lol. Ive gotr rid of the ext2 output now and just left the raw tarball so people can pick what fs they want.

        Id like to be able generate system images for all S905 / S905X / S912 systems. They are generic enough a single kernel can work with all. System images can be a customised raw linux for specific purpose or from ubuntu / arch / users choice of arm8-aarch64 rootfs. If anyone wants to send me a dtb and specs I can try building and creating a config for your device or can update the code to support your device.

        Update:
        I found fw_printenv and fw_setenv on libreelec, tells me everything i need to know
        Last edited by botfap; 09-30-2016, 00:48.

        Comment


          Now I'm testing a script that can install Linux to the internal memory (eMMC) with the regular loader and create the desired partitions. In the near future I will try to describe the installation process in more detail.

          Comment


            Originally posted by nosmokingbandit View Post
            Arch has an image for the Odroid-C2 board, is there any chance this will work with your method, Balbes?


            I've tried moving their /boot to the fat partition, keeping my dtb and your start scripts and it won't boot. I wish I knew more about it, but it would be nice to have an Arch option for these boxes.
            Looked at the manual. Launch is possible, but will require adaptation. The statement pointed out that the whole system is placed on the partition ext4. U-boot TV box has no default commands for working with ext4 partitions. To start will either have to use the updated bootloader, or to change the system boot the image, having taken to boot the kernel on a FAT partition.

            Comment


              Originally posted by botfap View Post

              Id like to be able generate system images for all S905 / S905X / S912 systems. They are generic enough a single kernel can work with all. System images can be a customised raw linux for specific purpose or from ubuntu / arch / users choice of arm8-aarch64 rootfs. If anyone wants to send me a dtb and specs I can try building and creating a config for your device or can update the code to support your device.

              Update:
              I found fw_printenv and fw_setenv on libreelec, tells me everything i need to know
              i'am looking forward for this, i hope it come with xfce desktop and stable firefox.
              for dtb, balbes150 have dtb files in here https://yadi.sk/d/srrtn6kpnsKz2/DTB
              Android TV Box - Mini M8S (Amlogic S905) - Ubuntu Mate 16.04 Arm64 - 3.14.29 with VLC (X11 Accelerated XCB), Kodi Odrobian Fbdev 16.1 (VPU Accelerated), X.org 7.7 plus Mali Fbdev 20160315-r5p1

              Comment


                botfap : thanks for your efforts. Let us know when we can try any of your generic S905/S905X/S912 software. By the way: which system(s) do you have. I have MiniMX-G (2GB/16GB).

                Comment


                  Originally posted by balbes150 View Post

                  Looked at the manual. Launch is possible, but will require adaptation. The statement pointed out that the whole system is placed on the partition ext4. U-boot TV box has no default commands for working with ext4 partitions. To start will either have to use the updated bootloader, or to change the system boot the image, having taken to boot the kernel on a FAT partition.
                  Yeah, I played with it a little, I just don't know enough. I wish I could help out -- I feel bad just asking for help without contributing.

                  You are correct, their process puts everything on a single ext4 partition. I attempted to set up a partition table similar to your images, then moving the boot folder to the fat partition. Then I added that to /etc/fstab, changed the s905 autoscript to point toward Arch's initrd and kernel.

                  Without uart it is hard for me to know what is failing during the boot process. I should just buy one.

                  Comment


                    Originally posted by Nofan Tasi View Post
                    botfap : thanks for your efforts. Let us know when we can try any of your generic S905/S905X/S912 software. By the way: which system(s) do you have. I have MiniMX-G (2GB/16GB).
                    he using A95X varian with 1G and 2GB Ram, you can read it in page 15
                    Android TV Box - Mini M8S (Amlogic S905) - Ubuntu Mate 16.04 Arm64 - 3.14.29 with VLC (X11 Accelerated XCB), Kodi Odrobian Fbdev 16.1 (VPU Accelerated), X.org 7.7 plus Mali Fbdev 20160315-r5p1

                    Comment


                      Looking forward to 905x on linux. Wonderful work all thanks to all for this effort. 😃
                      Many devices now mk902ii/Shield/Mk68 /Ugoos/neox5/minix5 (yes they still work lol) mk80 no it doesnt work lol.

                      Comment


                        I built roofs from botfap git source. but I don't howto boot from sdcard.
                        Kaz kernel source support S905X https://github.com/kszaq/linux/tree/amlogic-3.14.y
                        Is possible to build balbes150's armbian with Kaz kernel source?

                        Comment


                          I used Amlogic & botfap's repo to build kernel and rootfs. (https://github.com/botfap/A95X-Linux-BuildEnv & http://openlinux.amlogic.com:8000/download/)
                          at the end I got rootfs, boot.img, Image and dtb.img (I have minim8s ii, extracted dtb & dtc from the device, used them during compile)
                          uboot latest sources does not compile, changed them to the previous version from Amlogic website (http://openlinux.amlogic.com:8000/download/ARM/u-boot/)
                          At the end I followed botfap github readme instructions but the device boots into stock sw.
                          then I used toothpick method, boots into recovery mode (stock sw)
                          Then I used balbes150 universal uboot update method, nothing changed.

                          I tried to change kernel.img and dtb.img in Kszaq's rootfs with my compiled Image dtb.img , but kernel formats are different I guess, no success..


                          Kszaq ' s Libreelec boots with toothpick method but I could not boot botfap-Amlogic kernel image and rootfs ...
                          I think I am having difficulty preparing sd card layout and boot procedure.

                          Any ideas? thanks,

                          Comment


                            Originally posted by garyang View Post
                            I built roofs from botfap git source. but I don't howto boot from sdcard.
                            Kaz kernel source support S905X https://github.com/kszaq/linux/tree/amlogic-3.14.y
                            Is possible to build balbes150's armbian with Kaz kernel source?
                            To build the kernel for a Linux system from source Kszaq, they need to change. Make files "sharpened" to use in a build environment LE.

                            Comment


                              Originally posted by albundy View Post
                              I used Amlogic & botfap's repo to build kernel and rootfs. (https://github.com/botfap/A95X-Linux-BuildEnv & http://openlinux.amlogic.com:8000/download/)
                              at the end I got rootfs, boot.img, Image and dtb.img (I have minim8s ii, extracted dtb & dtc from the device, used them during compile)
                              uboot latest sources does not compile, changed them to the previous version from Amlogic website (http://openlinux.amlogic.com:8000/download/ARM/u-boot/)
                              At the end I followed botfap github readme instructions but the device boots into stock sw.
                              then I used toothpick method, boots into recovery mode (stock sw)
                              Then I used balbes150 universal uboot update method, nothing changed.

                              I tried to change kernel.img and dtb.img in Kszaq's rootfs with my compiled Image dtb.img , but kernel formats are different I guess, no success..


                              Kszaq ' s Libreelec boots with toothpick method but I could not boot botfap-Amlogic kernel image and rootfs ...
                              I think I am having difficulty preparing sd card layout and boot procedure.

                              Any ideas? thanks,
                              You tried to merge together three different ways of starting the system from external media. Is not going to work. It is easiest to use a universal multiboot (using the file s905_autoscript). In this embodiment, it is possible to achieve running of all systems with minimal changes to them.

                              Comment


                                Hi Guys

                                Small update: https://github.com/botfap/A95X-Linux-BuildEnv

                                Ive got a working generic S905X sd card image with new uboot that is currently pushing up to github (s905x-sd-image.bin in sample output). Its not ready for any sort of production use yet. Im adapting it to work with the stock bootloader. I also have it working booting from internal emmc but its with a custom bootloader and can end up bricking your device if you dont have access to the serial console.

                                It also works for ubuntu 16.04 using the kernel image and dtb that the github project builds. Just replace my rootfs with the odroid c2 ubuntu rootfs. Making it work with the Arch linux rootfs is next on my list as thats what im going to be using in my final use of this little project. After that I will be changing the build to generate bootfs as a separate partition so the stock bootloader can be used.

                                Progeress is a bit slow at the minute. Blame the Brexit! Im in the middle of moving my businesses from the UK to Dublin and Berlin and travelling most days so its going to take a week or so for me to find the hours.

                                I have had feedback from 4 different people who have successfully built working sd card images from the github project using my kernel, dtb and rootfs.

                                I have had a quick look at libreelec and the aml_autoscript they use to get the stock bootloader to boot from sd. Im going to have a look at @150balbes s905_autoloader script too. With the info there I should be able to work out a method to boot from stock uboot using a fat16 boot partition.

                                If anyone has any info or input on adapting the boot process it would be welcome.
                                Also does anyone know how to change the GPU ram allocation? I can only get it to be either 256MB for the GPU or 0MB for the GPU. I only want to assign 8mb for server / network boxes and 128mb for the thin client boxes.

                                Edit: Os so the SD Card image didnt upload to github due to being over 100mb. Where is a good place to host it for download?
                                Last edited by botfap; 10-03-2016, 23:36.

                                Comment

                                Working...
                                X