Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

Tiny Core Linux for mk908, full distro in recovery img UPDATE

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

    Tiny Core Linux for mk908, full distro in recovery img UPDATE

    Update:
    - wifi now connects using config from Android! (wifi now automagically works if setup in Android)
    - The new Mali 3D acceleration added
    - fixed bug (issue connecting http://repo.tinycorelinux.com)

    Tiny Core Linux is a linux distribution that is built to be run from ramdisk. I've been working a bit to port it to my mk908 and I think it is ready for a first release. It fits including kernel in a recovery image, and is just over 15MB in size at the moment. Kernel is from tyeo098 sources:Rockchip-GPL-Kernel

    Image with 720p kernel:
    MEGA provides free cloud storage with convenient and powerful always-on privacy. Claim your free 50GB now!


    What you will get:
    Fully working linux command line, run by busybox.
    Networking support, wifi runs out of the box (on AP6210).
    Internal bluetooth support (AP6210).
    SSH deamon is running (passwordless at the moment! please turn it off if you don't use it).
    All debian armhf packages can be installed using a single command!

    What you will not get:
    I did not include a graphical desktop yet, but I am working on this for future releases. It is very easy to install with instructions below.

    USB ethernet dongles should be detected on boot, and dhcp assigns an address to it automatically. Wifi picks up the configuration from Android (Tested on Finless 1.7).
    The mk908 can run headless using the SSH daemon running by default. Username is 'tc', without password.

    Debian packages are downloaded using importsce and loadsce. They are saved in RAM (default, after reboot gone), or on an external disk / USB drive (persistent after reboot). Simply connect an external drive and use the tc-setdrive tool to select external storage.

    Installing debian packages is simple, for example setting up a fully functional openbox desktop do the following:
    Code:
    tc@mk908:~$ importsce xorg-fbdev
    tc@mk908:~$ importsce openbox
    tc@mk908:~$ loadsce xorg-fbdev
    tc@mk908:~$ loadsce openbox
    tc@mk908:~$ ln -s /usr/bin/xterm /usr/bin/x-terminal-emulator
    tc@mk908:~$ echo "openbox-session" > .xinitrc
    tc@mk908:~$ startx
    A fully working toolchain is installed with:
    Code:
    tc@mk908:~$ importsce build-essential
    tc@mk908:~$ loadsce build-essential
    After packages are imported once to local storage, importsce is not needed anymore after reboot.

    reboot to recovery is provided by 'sudo reboot_recovery' or ctrl-alt-del, reboot back to android is the normal reboot: 'sudo reboot'

    I know this is not a real turn-key linux distro, but I find it a great way to learn linux internals! And it boots FAST!
    Please refer to the Tiny Core website http://tinycorelinux.net/ for further reference.
    Last edited by biemster; 03-24-2014, 21:54.

    #2
    Sorry for reengineering your work
    But I'm very interesting in your way, how you boot to recovery...
    Is the 'boot-recovery' at the misc.img use by the bootloader or how do you handle it?

    And do you use the
    CONFIG_CMDLINE= with 'mtdparts=rk29xxnand:'
    CONFIG_CMDLINE_FORCE=y
    or
    CONFIG_CMDLINE_FROM_BOOTLOADER=y
    at the kernel config
    or how do you get the information of the mtdpart?
    Last edited by no_spam_for_me; 03-11-2014, 17:17.
    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


      #3
      Originally posted by no_spam_for_me View Post
      Sorry for reengineering your work
      Don't worry, thanks for taking interest in my work

      Originally posted by no_spam_for_me View Post
      But I'm very interesting in your way, how you boot to recovery...
      Is the 'boot-recovery' at the misc.img use by the bootloader or how do you handle it?
      Exactly that. Credit goes to mmm123 on this method, see this #2 post. /sbin/reboot_recovery is just a shell script that dd's a misc.img with boot-recovery @ 0x4000 to /dev/mtdblock0. (if you want to use this method in your own project be sure to dd a clean misc.img to /dev/mtdblock0 at boot or the stick will have problems booting after power down)

      Originally posted by no_spam_for_me View Post
      And do you use the
      CONFIG_CMDLINE= with 'mtdparts=rk29xxnand:'
      CONFIG_CMDLINE_FORCE=y
      or
      CONFIG_CMDLINE_FROM_BOOTLOADER=y
      at the kernel config
      or how do you get the information of the mtdpart?
      The first. I force the cmdline to be compiled in (again after mmm123 recommendation in some thread where he discusses with tyeo098 how to boot the kernel). The kernel has /proc/config.gz enabled so you could check it there if you like

      Comment


        #4
        THX...
        How do you handle the 'clear' misc?
        I had seen the tar... but after reboot (busybox softlink) you leave linux...
        PS: Perhaps via /etc/init.d/{script} with '# Default-Stop: 0 6' ?

        I've not flashed your solution so I can't get the '/proc/config.gz' at the moment, but do you only use the (misc) at CMDLINE?
        And what will be happen, if the "structure" of the nand size@address with another custom rom will change?
        Last edited by no_spam_for_me; 03-11-2014, 23:50.
        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


          #5
          Kernel

          good work, I use debian with Tyeo Rockchip kernel, but it have ramdom reboots somes times. Have you this problem? My device is a mk908 v3.

          Comment


            #6
            Hi Biemster

            Can you add this line to /etc/inittab , because I don't have a HDMI screen and I need serial console.

            T0:23:respawn:/sbin/getty -L ttyS2 115200 vt100

            first, I tried to do it myself by unpack the recovery.img by unpack_bootimg.pl, but I don't know how to repack it.

            Or, just attach the .config here.

            Thanks
            Last edited by maxchen; 03-12-2014, 05:17.

            Comment


              #7
              Hi ,me again

              I only need linux running on mk908, so I unpack your image , add a line :

              ttyS2::respawn:/bb/getty -L 115200 ttyS2 vt102

              into etc/inittab and pack the ramdisk files as a boot.img and use the Kernel is from tyeo098 sources:Rockchip-GPL-Kernel to compile a kernel image ,the flash , I can see the boot process from the serial console, but after this line:

              DWC_OTG:***************** vbus detect ***********************

              no shell show up.
              How can I get a serial console ?

              Comment


                #8
                Originally posted by no_spam_for_me View Post
                THX...
                How do you handle the 'clear' misc?
                I had seen the tar... but after reboot (busybox softlink) you leave linux...
                PS: Perhaps via /etc/init.d/{script} with '# Default-Stop: 0 6' ?
                I flash the clear misc immediately after booting up. I'm not sure what is your question? If busybox softlink reboot is called, it will just reboot as a normal stick (since the clear misc was flashed while booting tinycore), when reboot_recovery is called the boot-recovery misc is flashed first and then reboot is called.

                Originally posted by no_spam_for_me View Post
                I've not flashed your solution so I can't get the '/proc/config.gz' at the moment, but do you only use the (misc) at CMDLINE?
                And what will be happen, if the "structure" of the nand size@address with another custom rom will change?
                I use the whole mtdpartmisc)..(boot)..(kernel)..(recovery)..(user)..etc.. cmdline from stock rom, because otherwise the kernel is messing up the addresses somehow (or I just don;t know how to call that correctly). Then the kernel sets up the mtdblock block devices in /dev, and I flash using dd to the /dev/mtdblock[0-9] corresponding to the misc partition. Check 'cat /proc/mtd' which partition is your misc partition, and use that one in your dd command.

                good luck!

                Comment


                  #9
                  Originally posted by jakson View Post
                  good work, I use debian with Tyeo Rockchip kernel, but it have ramdom reboots somes times. Have you this problem? My device is a mk908 v3.
                  I used to have random reboots sometimes and the flickering screen issue. But after I replaced the hdmi code with the hdmi code from a kitkat kernel both problems disappeared. I'm preparing a github with a fork of that code and the hdmi code replaced, so you could try that and see if it resolves your problem.
                  (for now you could extract the kernel from the image and try your debian with that? it is a 720p though)

                  It could also be that you are loading your cpu heavily and have an insufficient power supply.. (you still use the 2A supply that came with the stick? Did you try a 3A supply?)

                  Comment


                    #10
                    Originally posted by maxchen View Post
                    ttyS2::respawn:/bb/getty -L 115200 ttyS2 vt102

                    into etc/inittab and pack the ramdisk files as a boot.img and use the Kernel is from tyeo098 sources:Rockchip-GPL-Kernel to compile a kernel image ,the flash , I can see the boot process from the serial console, but after this line:

                    DWC_OTG:***************** vbus detect ***********************

                    no shell show up.
                    How can I get a serial console ?
                    Did you set the file permissions correctly when you repacked the ramdisk? cpio normally keeps the permissions as they are on your disk, so if you unpacked it as a normal user it will pack it back with uid:gid wrong. Then the boot process does not have sufficient rights to attach a tty anywhere.

                    I use this to pack the ramdisk (on osx, the linux flag to set permissions is different IIRC)
                    Code:
                    (cd tinycoreMK908 && find * | sort | cpio -o -H newc -R root:wheel) | gzip > tinycoreMK908.gz
                    If you are on linux you probably need to use -R root:root, find the combination that gives uid=0 gid=0 in the archive.

                    good luck!

                    Comment


                      #11
                      Originally posted by biemster View Post
                      I flash the clear misc immediately after booting up. I'm not sure what is your question? If busybox softlink reboot is called, it will just reboot as a normal stick (since the clear misc was flashed while booting tinycore), when reboot_recovery is called the boot-recovery misc is flashed first and then reboot is called.!
                      THX
                      Aaah, OK!
                      => "flash the clear misc immediately after booting up ... flashed while booting tinycore"
                      and I understood at Android (and I don't have any idea how you handle it )
                      So because "problems booting after power down" means only at tinycore and not at the Android..?..
                      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


                        #12
                        Originally posted by no_spam_for_me View Post
                        THX
                        Aaah, OK!
                        => "flash the clear misc immediately after booting up ... flashed while booting tinycore"
                        and I understood at Android (and I don't have any idea how you handle it )
                        So because "problems booting after power down" means only at tinycore and not at the Android..?..
                        For some reason after fully power off (taking out power cable) my mk908 does not boot at all with the boot-recovery misc. I need to flash the 'clear' misc using my laptop back to my stick when this happens to bring it back alive. Then it boots to android, after that I can reboot to recovery. (maybe it is just my current bootloader that cannot handle this)
                        Does this answer your question?

                        Comment


                          #13
                          Yes


                          Originally posted by biemster View Post
                          I use the whole mtdpartmisc)..(boot)..(kernel)..(recovery)..(user)..etc.. cmdline from stock rom, because otherwise the kernel is messing up the addresses somehow (or I just don;t know how to call that correctly)
                          Only an idea:
                          ok, I thought about it and you are only interesting in the '0x00002000@0x00002000(misc)' that must fit and so I'm thinking it isn't important if the rest fits to the "real world" of the flashed custom rom or not...
                          So perhaps this works 'mtdparts=rk29xxnand:0x00002000@0x00002000(misc),-@0x00004000(unknown)' ...
                          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


                            #14
                            1080p kernel request and howto make it persistent

                            Wow, this's becoming more interesting day after day!

                            At this days I was trying picuntu.img on sdcard using jakson's recovery kernel (tnks jakson), but having problems: blacks screens, reboots, etc.

                            Now, the question is: can I flash this tiny-core-Linux.img to recovery partition of mi mk908 v3 without loosing Android and getting Linux start when I reboot to recovery?

                            Can you make a 1080p kernel? I will test...

                            And you are telling about including a graphical desktop in future releases...
                            I don't understand then how can it fits in the recovery partition (I don't know exactly the max size this partition can be) or how to make it persistent using a external usb or sd card? ¿can you explain?

                            Thanks again for the hard work. I'm dummy, sorry for the inconvenience, but I want to understand andI think this way is what finally all we want: our tronsmart mk908 running android and linux persistent dual-system without issues and fully funtional, in a easy-way-to-go and making it possible!! stay on!

                            Comment


                              #15
                              Originally posted by gvigueras View Post
                              Wow, this's becoming more interesting day after day!

                              At this days I was trying picuntu.img on sdcard using jakson's recovery kernel (tnks jakson), but having problems: blacks screens, reboots, etc.

                              Now, the question is: can I flash this tiny-core-Linux.img to recovery partition of mi mk908 v3 without loosing Android and getting Linux start when I reboot to recovery?
                              This image should be flashed to the recovery partition indeed. You will not lose Android and Linux will start when you boot into recovery.

                              Originally posted by gvigueras View Post
                              Can you make a 1080p kernel? I will test...
                              I'll find some time to do that tomorrow and update the first post.

                              Originally posted by gvigueras View Post
                              And you are telling about including a graphical desktop in future releases...
                              I don't understand then how can it fits in the recovery partition (I don't know exactly the max size this partition can be) or how to make it persistent using a external usb or sd card? ¿can you explain?
                              The recovery partition is 32MB, the recovery image is currently 14MB. That leaves 18MB for the desktop. Which is not much, so don;t expect anything like full Ubuntu or something like that. I'd be happy if I can get a display manager and window manager in, browsers and that kind of stuff will have to be installed on external storage (or the Android /sdcard partition, which is mounted as /dev/mtdblock9).

                              About making newly installed packages persistent after reboot, that is explained in the first post:
                              Code:
                              1. Insert external storage
                              2. run `tce-setdrive`
                              3. select your external storage
                              From now every package that is downloaded using importsce will be stored on that drive and available also after reboot. Please refer to the Tiny Core website to learn more about importsce and loadsce.

                              Please do not select your "user" partition /dev/mtdblock9 as your tce-drive, since that is most likely a vfat filesystem which does not support symlinks (which the tinycore packages rely heavily on).

                              I'm also thinking of making a package that boots not to a linux console or desktop but directly to XBMC, maybe if there is interest in this I'll move that project forward a bit.

                              Originally posted by gvigueras View Post
                              Thanks again for the hard work. I'm dummy, sorry for the inconvenience, but I want to understand andI think this way is what finally all we want: our tronsmart mk908 running android and linux persistent dual-system without issues and fully funtional, in a easy-way-to-go and making it possible!! stay on!
                              Thanks!

                              Comment

                              Working...
                              X