Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

Linuxium's Bootloader software to dualboot Android and Linux

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Linuxium's Bootloader software to dualboot Android and Linux

    I've updated my original bootloader software (https://plus.google.com/+IanMORRISON/posts/9DvTKTy99Yy) with the following improvements:


    1. There is now a separate partition for Linux. This fixes how the 'sdcard' is mounted in Android and removes the need to edit 'vold.fstab'.
    2. The bootloader now allows SD cards to hold the Linux root file system (RFS) either on the entire card or on a partition on the card. This means you can now use either 'dd' in Linux or 'Win32 Disk Imager' in Windows to create the SD card with the Linux RFS. As a result, the utilities are no longer required.
    3. Booting Android from SD card has now been removed as it added complexity and wasn't needed by most users.
    4. By sharing a common parameter file, both the Linux and Android kernels (kernel.img and recovery.img respectively) and Android RFS (system.img) can be substituted with any working image that uses the parameter file (i.e. CONFIG_CMDLINE_FROM_BOOTLOADER=y).
    5. A single update image is now available for flashing to simplify installation.
    6. The update image includes the latest stable Android image released for that device together with a Linux kernel built from the source code released for that device.


    This latest version allows the choice of booting Android from NAND or Linux from SD card/NAND with an option to install/remove Linux to/from NAND or save to SD card as well as offering access to the command-line by invoking a shell.




    Pre-Requisites
    ---------------------


    For Windows download and install 'RKBatchTool' (see these excellent instructions http://wiki.radxa.com/Rock/flash_the...Install_driver) or for Linux download and install 'upgrade_tool' (see https://plus.google.com/109451178006...ts/ZVic25M5cdT).


    Download a Linux root file system e.g.


    Ubuntu (https://docs.google.com/file/d/0B99O...TFZbHg3ZWE3LXc)
    Lubuntu (https://docs.google.com/file/d/0B99O...WRTbGxDbndlSDQ)
    Xubuntu (https://docs.google.com/file/d/0B99O...Wp1dEFJZC1hTWs)
    Debian (https://docs.google.com/file/d/0B99O...HVJT0FCbGw2V1k)


    and install to an SD card (unzip and then for Windows use 'Win32 Disk Imager' or for Linux use 'dd').




    Installation
    ----------------


    Connect your 3188 device in bootloader mode (check with your seller/manufacture's site for specific information on your device although typically it means connecting a USB cable to your PC and pressing the reset button on your device while you connect the other end of the cable to the micro USB OTG port on your device).


    Download and unzip the update image appropriate to your device:


    Radxa Rock - https://drive.google.com/file/d/0B99...TZkc1RsSlJETzQ
    Minix Neo X7 - https://drive.google.com/file/d/0B99...UpSRzlqRGhXWmc
    Rikomagic MK802IV (latest model) - https://drive.google.com/file/d/0B99...jVLSHlhQXVnX0k


    Flash your device using 'RKBatchTool' for Windows or 'upgrade_tool' for Linux (see the instructions above).


    Now insert the SD card and boot your device. Select the required boot option from the on-screen menu. Note the first Android boot is very slow as it is setting up the system ready for use. Be patient, even after you think that nothing is happening, as it will boot!


    To add the Linux modules to the Linux RFS simply:


    1. Download the relevant modules and unzip the file:
    Radxa Rock - https://drive.google.com/file/d/0B99...UpoVlUyQmplSkU
    Minix Neo X7 - https://drive.google.com/file/d/0B99...E5LRG9Ua2RIcDA
    Rikomagic MK802IV (latest model) - https://drive.google.com/file/d/0B99...jFXMmJId2l5TkE
    2. As root enter 'cd /lib/modules' and then 'cpio -ivdum < <unzipped_modules_file>'
    3. Reboot




    Caveat - required reading
    ------------------------------------


    Flashing software to a device can cause the device to become 'bricked'. Typically this is due to a specific cause e.g. poor quality USB cable, insufficient power source, manual interruption/intervention, incorrect flashing software etc.. There are several techniques to recover from this situation published on the internet. Whilst this software has been extensively tested on the specific devices without problem, your usage of it is at your own risk.
    Last edited by linuxium; 02-20-2014, 05:00.

    #2
    Will this work on MK808 (RK3066 device)?

    Comment


      #3
      Originally posted by RmatriX1218 View Post
      Will this work on MK808 (RK3066 device)?
      Conceptually it would except that you'd have to change part of the boot code and use RK3066 friendly Linux and Android kernels and a relevant system image.

      Comment


        #4
        Originally posted by linuxium View Post
        Conceptually it would except that you'd have to change part of the boot code and use RK3066 friendly Linux and Android kernels and a relevant system image.
        Thanks for your reply,

        and sorry for my knowledge on programming...

        I only know to flash ROMs, zip etc as per developer instruction and any modification, programming etc are beyond my capability...

        If anyone can make this working on MK808/RK3066, I'll be thankful.

        Comment


          #5
          Dear brother can I use pen drive for Linux rfs.
          I have tried dd GUI for Linux but it is not booting it just shows copy android to SD card.
          There is no option for booting Linux from SD card.
          Can I upgrade over bin.7z downloaded earlier from one of your post for Linux on rk-3188 devices.
          BTW my device is netxeon mk809iii(rk3188-t, ap6120). And I m able to boot default android provided in bin.7z

          Waiting for reply.
          Thanks.

          Comment


            #6
            Originally posted by ani1nonly View Post
            Dear brother can I use pen drive for Linux rfs.
            I have tried dd GUI for Linux but it is not booting it just shows copy android to SD card.
            There is no option for booting Linux from SD card.
            Can I upgrade over bin.7z downloaded earlier from one of your post for Linux on rk-3188 devices.
            BTW my device is netxeon mk809iii(rk3188-t, ap6120). And I m able to boot default android provided in bin.7z

            Waiting for reply.
            Thanks.
            I'm not sure I understand your question. However, did you do this in creating your Linux RFS SD card?

            1. Download Linux root file system e.g. linuxium-ubuntu1204-desktop-rfs.img.7z
            2. Unzip the image e.g. 7z e linuxium-ubuntu1204-desktop-rfs.img.7z
            3. Insert your SD card and make sure it is not mounted (let's assume it shows up as /dev/sdc)
            4. Copy the image to the SD card e.g. dd if=linuxium-ubuntu1204-desktop-rfs.img of=/dev/sdc bs=4M
            5. Just make sure the copy has finished by entering 'sync' followed by 'sync'
            6. Take you SD card and insert into your RK3188 device
            7. Power up the device and the menu should now show three options, the first being to boot Linux from the SD card

            Comment


              #7
              I think he want to use a USB-Stick (pen drive) instead of SD...

              1.) My question is, what do you update concretely (mtd or "pattion" or... by the batchtool at the device) and perhaps if you want to answer/explain, why?
              2.) Do I understand it correct, that the "original" device kernel for android (i.e. mod by wasser) needs the "CONFIG_CMDLINE_FROM_BOOTLOADER"?
              RK3288 Devices
              - Overview BOX (LINK !)
              - Overview STICK (Dongle) (LINK !)

              MINIX NEO: Z64 W/A - (Intel Z3735F); X8-H Plus - (Amlogic S812H); A2 Lite (sponsored by minix.com.hk)
              UGOOS UT3S (4/32GB with fan) - FW 2.0.6 - (RK3288) (sponsored by GearBest.com)
              Tronsmart Draco AW80 Meta (2/16GB) - FW v2.0rc3 - (Allwinner A80) (sponsored by GeekBuying.com)
              Beelink / UBOX R89 - FW 111k4110_1219 - (RK3288) (sponsored by Netxeon (Beelink))

              RK3188: pcb => "CH001 1332 TN-BX09_V2.1" (K-R42 / CS918...) => wasser KK 1.0.3 (old rev)
              Fly Mouse Mini Wireless Keyboard with 2 mode learning IR remote 'iPazzPort KP-810-16'

              Comment


                #8
                Originally posted by linuxium View Post
                I'm not sure I understand your question. However, did you do this in creating your Linux RFS SD card?1. Download Linux root file system e.g. linuxium-ubuntu1204-desktop-rfs.img.7z2. Unzip the image e.g. 7z e linuxium-ubuntu1204-desktop-rfs.img.7z3. Insert your SD card and make sure it is not mounted (let's assume it shows up as /dev/sdc)4. Copy the image to the SD card e.g. dd if=linuxium-ubuntu1204-desktop-rfs.img of=/dev/sdc bs=4M5. Just make sure the copy has finished by entering 'sync' followed by 'sync'6. Take you SD card and insert into your RK3188 device7. Power up the device and the menu should now show three options, the first being to boot Linux from the SD card
                Thanks for your quick reply.Brother in your 3rd step u said insert your SD card......I want to ask that can I use pen drive or SD card(full size cause I don't have micro SD card) through card reader. I have tried both of them but SD card/pen drive is detected by your bootloader menu. But there is no option of boot Linux from SD card. I am not able to use dd command directly because I have not much knowledge of linux that's why I used GUI version of dd command. Is there a possibility of problem in GUI version of dd command.I used Ubuntu 12.04 live from pen drive.Thanks.

                Comment


                  #9
                  works like a charm

                  Hi linuxium,

                  many thanks for the perfect piece of software, it works perfect.

                  The only think doesn't work at the moment, is my own rootfs with wheezy/emdebian.

                  I build the rootfs with ..

                  Code:
                  qemu-debootstrap --arch armhf --foreign --verbose --variant=minbase --include=nano,openssh-server,ifupdown,localepurge,netbase,net-tools,isc-dhcp-client,keyboard-configuration wheezy /home/x7-rootfs http://ftp.de.debian.org/debian
                  .. and copied the content of 'x7-rootsfs' to the (primary) ext4 partition on the sd-card. But the there is no 'boot from sd-card' entry like it is with your linuxium wheezy rootfs.

                  Do you have an idea?

                  Thanks a lot!
                  hid

                  Comment


                    #10
                    Originally posted by no_spam_for_me View Post
                    I think he want to use a USB-Stick (pen drive) instead of SD...

                    1.) My question is, what do you update concretely (mtd or "pattion" or... by the batchtool at the device) and perhaps if you want to answer/explain, why?
                    2.) Do I understand it correct, that the "original" device kernel for android (i.e. mod by wasser) needs the "CONFIG_CMDLINE_FROM_BOOTLOADER"?
                    Ok, I've Extract the "update.img" from the "minix-linuxium-bootloader.7z" with RK3xxx_firmware_tools_4.0.33.00 and get:
                    - linuxium-boot.img
                    - linuxium-kernel.img
                    - linuxium-parameter
                    - linuxium-recovery.img
                    - linuxium-system.img
                    So it seems it is generally nearly the "hole" system (perhaps based on stock-rom?)...
                    with a different parameter file...
                    and what else???

                    What can I do to try your solution with an K-R42 (old revision) actually flashed with wasser mod 1.2.3?
                    RK3288 Devices
                    - Overview BOX (LINK !)
                    - Overview STICK (Dongle) (LINK !)

                    MINIX NEO: Z64 W/A - (Intel Z3735F); X8-H Plus - (Amlogic S812H); A2 Lite (sponsored by minix.com.hk)
                    UGOOS UT3S (4/32GB with fan) - FW 2.0.6 - (RK3288) (sponsored by GearBest.com)
                    Tronsmart Draco AW80 Meta (2/16GB) - FW v2.0rc3 - (Allwinner A80) (sponsored by GeekBuying.com)
                    Beelink / UBOX R89 - FW 111k4110_1219 - (RK3288) (sponsored by Netxeon (Beelink))

                    RK3188: pcb => "CH001 1332 TN-BX09_V2.1" (K-R42 / CS918...) => wasser KK 1.0.3 (old rev)
                    Fly Mouse Mini Wireless Keyboard with 2 mode learning IR remote 'iPazzPort KP-810-16'

                    Comment


                      #11
                      Originally posted by ani1nonly View Post
                      Thanks for your quick reply.Brother in your 3rd step u said insert your SD card......I want to ask that can I use pen drive or SD card(full size cause I don't have micro SD card) through card reader. I have tried both of them but SD card/pen drive is detected by your bootloader menu. But there is no option of boot Linux from SD card. I am not able to use dd command directly because I have not much knowledge of linux that's why I used GUI version of dd command. Is there a possibility of problem in GUI version of dd command.I used Ubuntu 12.04 live from pen drive.Thanks.
                      I see what your problem is ... it was designed for using a micro SD card ... so I've modified it to accept an usb device and this should solve you problems and give some additional functionality to others ... see separate post (http://www.freaktab.com/showthread.p...298#post149298).
                      Last edited by linuxium; 02-23-2014, 12:41.

                      Comment


                        #12
                        Originally posted by hiddenbit View Post
                        Hi linuxium,

                        many thanks for the perfect piece of software, it works perfect.

                        The only think doesn't work at the moment, is my own rootfs with wheezy/emdebian.

                        I build the rootfs with ..

                        Code:
                        qemu-debootstrap --arch armhf --foreign --verbose --variant=minbase --include=nano,openssh-server,ifupdown,localepurge,netbase,net-tools,isc-dhcp-client,keyboard-configuration wheezy /home/x7-rootfs http://ftp.de.debian.org/debian
                        .. and copied the content of 'x7-rootsfs' to the (primary) ext4 partition on the sd-card. But the there is no 'boot from sd-card' entry like it is with your linuxium wheezy rootfs.

                        Do you have an idea?

                        Thanks a lot!
                        hid
                        I wouldn't copy over all the directories to create a clean RFS. I'd copy "bin etc home lib opt root sbin system usr var" and "mkdir boot dev media mnt proc run selinux srv sys tmp". I'd set the permissions correctly for tmp as in "chmod 1777 tmp" and I'd empty the log files with "rm -rf var/log/*". As long as you have "sbin/init" it should be recognised by the bootloader software. Try my suggestion and let me know.

                        Comment


                          #13
                          Originally posted by no_spam_for_me View Post
                          Ok, I've Extract the "update.img" from the "minix-linuxium-bootloader.7z" with RK3xxx_firmware_tools_4.0.33.00 and get:
                          - linuxium-boot.img
                          - linuxium-kernel.img
                          - linuxium-parameter
                          - linuxium-recovery.img
                          - linuxium-system.img
                          So it seems it is generally nearly the "hole" system (perhaps based on stock-rom?)...
                          with a different parameter file...
                          and what else???

                          What can I do to try your solution with an K-R42 (old revision) actually flashed with wasser mod 1.2.3?
                          Unfortunately I don't have a K-R42 so I would suggest trying "wasser mod 1.2.3"'s kernel as recovery (as this is where the Android kernel is expected) together with his system image. Also take his parameter file and add a final partition for Linux and remove any reference to console=ttyFIQ0 (otherwise it won't boot with any display) - use the linuxium-parameter as a reference. Keep the linuxium-boot.img as boot (this is the pseudo bootloader software) and linuxium-kernel.img as kernel as this is the Linux kernel which is booted first (and is compiled using source code for either Radxa Rock, Minix Neo X7 or Rikomagic MK802IV ... if the K-R42 has different LCDC or GPIO requirements it may not boot). The included Android ROM (linuxium-recovery.img and linuxium-system.img) is latest stock for either Radxa Rock, Minix Neo X7 or Rikomagic MK802IV and is unchanged. The concept is that you have your choice of Android installed on NAND and then using the best available Linux kernel for your device, you can run a Linux distro from either SD card or NAND, and now with the latest update, from any device connected by USB.

                          Hope this helps.

                          Comment


                            #14
                            THX

                            Ok, now I get an idea of what you done / how it works...

                            1.) "kernel as recovery (as this is where the Android kernel is expected)"
                            => so I will lost my original recovery with CWM... AND I lost any other possibility at recovery-mode...

                            2.) "Also take his parameter file and add a final partition for Linux and remove any reference to console=ttyFIQ0 (otherwise it won't boot with any display) - use the linuxium-parameter as a reference."
                            => no problem, I will modify it

                            3.) "linuxium-boot.img as boot"
                            => ok

                            4.) "linuxium-kernel.img as kernel as this is the Linux kernel which is booted first (and is compiled using source code for either Radxa Rock, Minix Neo X7 or Rikomagic MK802IV ... if the K-R42 has different LCDC or GPIO requirements it may not boot)"
                            => is it possible to use another matching / fitting linux-kernel perhaps like this?

                            5) "The concept is that you have your choice of Android installed on NAND and then using the best available Linux kernel for your device, you can run a Linux distro from either SD card or NAND, and now with the latest update, from any device connected by USB."
                            => for USB, do you have update the links in first post or do you mean the boot.img from the new thread?

                            Greetings
                            RK3288 Devices
                            - Overview BOX (LINK !)
                            - Overview STICK (Dongle) (LINK !)

                            MINIX NEO: Z64 W/A - (Intel Z3735F); X8-H Plus - (Amlogic S812H); A2 Lite (sponsored by minix.com.hk)
                            UGOOS UT3S (4/32GB with fan) - FW 2.0.6 - (RK3288) (sponsored by GearBest.com)
                            Tronsmart Draco AW80 Meta (2/16GB) - FW v2.0rc3 - (Allwinner A80) (sponsored by GeekBuying.com)
                            Beelink / UBOX R89 - FW 111k4110_1219 - (RK3288) (sponsored by Netxeon (Beelink))

                            RK3188: pcb => "CH001 1332 TN-BX09_V2.1" (K-R42 / CS918...) => wasser KK 1.0.3 (old rev)
                            Fly Mouse Mini Wireless Keyboard with 2 mode learning IR remote 'iPazzPort KP-810-16'

                            Comment


                              #15
                              Please see my replies line starting and ending with *** below.

                              Originally posted by no_spam_for_me View Post
                              THX

                              Ok, now I get an idea of what you done / how it works...

                              1.) "kernel as recovery (as this is where the Android kernel is expected)"
                              => so I will lost my original recovery with CWM... AND I lost any other possibility at recovery-mode...

                              *** if CMW is using two kernels (kernel and recovery) then probably yes - as stock Android doesn't use the recovery partition other than for upgrades my bootloader make use of the space - probably just like CMW ***

                              2.) "Also take his parameter file and add a final partition for Linux and remove any reference to console=ttyFIQ0 (otherwise it won't boot with any display) - use the linuxium-parameter as a reference."
                              => no problem, I will modify it

                              *** OK ***

                              3.) "linuxium-boot.img as boot"
                              => ok

                              *** see point 5 below ***

                              4.) "linuxium-kernel.img as kernel as this is the Linux kernel which is booted first (and is compiled using source code for either Radxa Rock, Minix Neo X7 or Rikomagic MK802IV ... if the K-R42 has different LCDC or GPIO requirements it may not boot)"
                              => is it possible to use another matching / fitting linux-kernel perhaps like this?

                              *** that binary kernel won't work as it uses an embeded partition definition - see the .config later in that post and see the lines
                              # CONFIG_CMDLINE_FROM_BOOTLOADER is not set
                              and
                              CONFIG_CMDLINE_FORCE=y
                              so you would have to recompile to make it use the parameter file ***

                              5) "The concept is that you have your choice of Android installed on NAND and then using the best available Linux kernel for your device, you can run a Linux distro from either SD card or NAND, and now with the latest update, from any device connected by USB."
                              => for USB, do you have update the links in first post or do you mean the boot.img from the new thread?

                              *** just replace the boot.img in the first post with the boot.img in the new thread ***

                              Greetings

                              Comment

                              Working...
                              X