Results 1 to 12 of 12

Thread: Kali 2.0 on Cubietruck

  1. #1
    Join Date
    2015-Aug
    Posts
    1

    Kali 2.0 on Cubietruck

    Hi, I downloaded and copied the Kali 2 for cubietruck image on my SD card with Win32 Disk Imager as I do with Cubian X1 but it didn't go further than "Starting Kernel..."



    is there any extra steps I need to do for Kali 2 to work on Cubietruck using the image provided on offensive security download page?

  2. #2
    Join Date
    2014-Feb
    Posts
    309
    Unfortunately while I build the image, I do not have a way to test it (I don't own a cubietruck and the script was contributed by a user.) - And if you're using windows, well, I don't test anything but using dd (as that's how we document how to image these) - it seems like if it's getting that far the image *should* be written correctly.

    I'll kick off another build of the script here, and look through the output, and see if something funky is happening in the way it's being generated, but typically what you're seeing only happens on newer kernels where the device tree (not used in the case of the CT and a 3.4 kernel), is getting overwritten in memory by u-boot.

    I can't see anything in the script that would have changed that would cause that. And you're able to boot a cubian image off the same sdcard no problem? (You've tried after trying the kali image?)

  3. #3
    Join Date
    2015-Oct
    Posts
    5
    I've just received a Cubietruck (Cubieboard3) and I have the same issues.
    Other armhf distributions don't have any issues. I tried berryboot install, that one loads the kernel kali but shuts down and won't boot again.

    Edit: I'm putting a considerate amount of time in to fix this. I'll update when I have progress.

    Edit2: Seems to be the issue "Unrecognized/unsupported machine ID " I tried with the bootm_boot_mode changed and it did not resolve the issue. I believe below patches would need to be integrated but that is above my skill level for now.

    Legacy kernel won't start
    If your 3.4.x kernel refuses to boot / gets stuck right after "Starting kernel ...": Double-check that bootm_boot_mode is set to "sec"! (see above)
    If you don't have a serial console and only use VGA/HDMI/LCD, then it might be also the case of "Unrecognized/unsupported machine ID" (see below).

    Unrecognized/unsupported machine ID

    The sunxi-3.4 kernel may fail to boot with one of the following error messages on the serial console (but this message is not visible on a HDMI monitor or a LCD display!):
    Error: unrecognized/unsupported machine ID (r1 = 0x10001008).
    Error: unrecognized/unsupported machine ID (r1 = 0x1000102a).
    Error: unrecognized/unsupported machine ID (r1 = 0x100010bb).


    In this case either upgrade to a recent stage/sunxi-3.4 kernel (github branch) - or try to "Enable workarounds for booting old kernels" in U-Boot: make menuconfig or make CROSS_COMPILE=arm-linux-gnueabihf- menuconfig, the option is located under "ARM architecture". (Make sure to rebuild your U-Boot after changing it.)

    If upgrading to stage/sunxi-3.4 is not an option (i.e. using some old and very much diverged sunxi-3.4 fork is really necessary), then the following patches can be cherry-picked (i.e. selectively merged as a set):
    wget https://github.com/linux-sunxi/linux...139ad8c5.patch
    wget https://github.com/linux-sunxi/linux...c1687db6.patch
    wget https://github.com/linux-sunxi/linux...21ff43b5.patch
    wget https://github.com/linux-sunxi/linux...2bcb3ec8.patch
    wget https://github.com/linux-sunxi/linux...14231af9.patch
    wget https://github.com/linux-sunxi/linux...74d061d9.patch
    wget https://github.com/linux-sunxi/linux...a4593a88.patch
    git am 5052b83aa44dc16d6662d8d9d936166c139ad8c5.patch
    git am 9a1cd034181af628d4145202289e1993c1687db6.patch
    git am c4c4664ed1a2f35e54a33ae4e65f517721ff43b5.patch
    git am ade08aa6e5249a9e75a97393e86c250b2bcb3ec8.patch
    git am 16b25a95327f45a995f6efcf3e9d83a414231af9.patch
    git am dea62f21deb177053b84b15a519dff6c74d061d9.patch
    git am d47d367036be38c5180632ec8a3ad169a4593a88.patch


    Exclamation.png It is required to apply all of them, as they contain important stability/safety changes. The last patch in this series only takes care of the safety guard, which exists there specifically to block booting problematic kernels. Just removing the safety guard alone without applying all the bugfixes will lead to obscure runtime problems, please don't be tempted to do this.
    Last edited by Pheal; 2015-10-01 at 22:54. Reason: Update

  4. #4
    Join Date
    2014-Feb
    Posts
    309
    Quote Originally Posted by Pheal View Post
    I've just received a Cubietruck (Cubieboard3) and I have the same issues.
    Other armhf distributions don't have any issues. I tried berryboot install, that one loads the kernel kali but shuts down and won't boot again.

    Edit: I'm putting a considerate amount of time in to fix this. I'll update when I have progress.

    Edit2: Seems to be the issue "Unrecognized/unsupported machine ID " I tried with the bootm_boot_mode changed and it did not resolve the issue. I believe below patches would need to be integrated but that is above my skill level for now.
    We use stage/sunxi-3.4 so I'm not really sure what's going on there at all. While they may ship with a 2015 u-boot, that is vendor released, most likely, and possibly those changes haven't propogated down just yet, or they are specific to the cubietruck/cubieboard3 - Have you looked to see if they have a specific u-boot release somewhere? If so, you could modify the build script to use it instead of the community released u-boot. That's about the only thing I can think of right now.

  5. #5
    Join Date
    2015-Oct
    Posts
    5
    I'll run some tests with other images that work to see what's different.

    Update 1: Plugged in a UART cable to debug and it freezes, there is no update sent through serial when loading kernel. I also successfully installed debian from a netinstall using the device dtb... Is there a place I can find the patches that are applied to the kernel in kali? Might be able to recreate the kali install if I can patch the kernel myself since there seems to be something wrong with either u-boot or the kernel (I suspect u-boot is wrong I'll try putting a new one in place (or older).)...

    Update 2: Still working on this, I'm now testing multiple u-boots/configs.
    Last edited by Pheal; 2015-10-09 at 23:14. Reason: Update

  6. #6
    Join Date
    2015-Oct
    Posts
    5
    Seems like I can't figure it out. Closest I got is an emergency recovery shell...

  7. #7
    Quote Originally Posted by Pheal View Post
    Seems like I can't figure it out. Closest I got is an emergency recovery shell...
    Well here is how I make the Cubietruck boot Kali 2.0 from the provided image download:

    * Flash SDCard with Kali 2.0 Image
    * Put SDCard into Cubietruck slot
    * Connect USB Keyboard to Cubietruck
    * Connect Cubietruck with a VGA adaptor to your monitor, have a HDMI cable at hand
    * Boot up Cubietruck
    * Wait for the Bootloader to find the USB keyboard (if it doesn't find the keyboard and gives an error message for the USB slot reboot and try again)
    * When it says: HIT ANY KEY TO ENTER BOOTLOADER MENU (something similar) then hit any keyboard key
    * Now you are in the UBoot menu;
    * type: setenv bootm_boot_mode sec
    * type: boot

    Now the Cubietruck correctly boots from the Kali Image

    * Take the HDMI cable and connect Cubietruck with your monitor and configure the Monitor to use HDMI as a display source!!!

    You now see the Kali Login Screen


    You can automate the process by building a proper Kali Linux Image, the only change needed for the cubietruck.sh (this one here: https://github.com/offensive-securit.../cubietruck.sh) is:

    * open cubietruck.sh with an editor
    * locate the string
    setenv bootargs (...)
    * add before this string:
    setenv bootm_boot_mode sec
    * build the kali image for cubietruck with this change and flash it to an SDCard

    Voila!

  8. #8
    Join Date
    2014-Feb
    Posts
    309
    If you could send that as a pull request, I would gladly merge it.

  9. #9
    Join Date
    2015-Oct
    Posts
    5
    Weird I did try adding that argument to u-boot... Will try it again when I have some time. Thanks!

  10. #10
    Join Date
    2015-Oct
    Posts
    5
    I confirm this worked. I don't know why it didn't work when I tried this before, must have been a problem with the script file I generated.

    I created a pull request to save more lives out there.

  11. #11
    Join Date
    2014-Feb
    Posts
    309
    And I merged the pull request thanks again!

  12. #12
    Join Date
    2016-Feb
    Posts
    1
    can you build the img for cubietruck plus and Cubieboard4?
    thank you.

Similar Threads

  1. Install kali on cubietruck I can't find image
    By luca219 in forum ARM Archive
    Replies: 0
    Last Post: 2019-12-22, 13:25
  2. Cubietruck built-in wireless module troubles
    By anosov in forum ARM Archive
    Replies: 1
    Last Post: 2015-08-01, 16:15
  3. Kali on Cubieboard 3 aka Cubietruck
    By kryptsec in forum ARM Archive
    Replies: 2
    Last Post: 2014-06-02, 09:44

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •