HunterDavis.com 4.0!

1Oct/09326

New Video/Tutorial – Flashing a Stock Z2 to Newest Debian Image (Windows edition)

So you've only got a windows machine handy, and you want to flash your Z2 to the newest debian (apt-get! no more cross-compiling!) image with wireless? This video is for you. Full Text after the jump.

You'll need

  1. Either Aliosa27's 1gb or 2gb disk image posted to the SF page.
  2. Aliosa27's latest oe userland image
  3. phsydiskwrite (I recommend the GUI version for ease of use)
  4. The autoflasher script
  5. (if windows can't see the fat partition) Windows ext2 filesystem driver

Ready?

  1. First, flash the zipit. Extract the autoflasher bundle to a fat16 formatted memory card
  2. Open Aliosa27's wireless+x+audio.tar.gz file, and copy out the /boot/linux-2.6.29 file to your memory card
  3. Rename this file kernel.bin
  4. Boot the zipit with the SD card inserted. If this does not start the linux flash, go to settings->reset to default and it should soft-reset
  5. Some SD cards are reported to not work, or not always be seen by the zipit. Try both with and without the power cable plugged in
  6. The z2 will boot linux and copy the wifi firmware to the sd card before flashing linux to the Z2
  7. Copy off the 2 wireless firmware files gspsi.bin and gpspsi_helper.bin to a folder, you will copy these back to the memory card after we write the image
  8. IMPORTANT -- rename helper_gspi.bin to be gspi8686_hlp.bin or it will not load later!
  9. Extract the 1/2gb image to a folder
  10. Extract phsydiskwrite to a folder
  11. Insert your microSD card into the computer (adapter, usb stick, etc)
  12. Run phsygui.exe from within the folder you extracted psydiskwrite to (requires .net framework)
  13. right-click on the drive letter for your SD card, select the first menu item, and then select the 1/2gb image you extracted earlier (.img)
  14. After it writes, safely remove the disk then plug it back in. if windows can see the fat partition copy the firmware files to it
  15. If windows cannot see this fat partition, congratulations! Windows sucks! Dowload the ext2 filesystem driver, run it, then copy the firmware files over to /lib/firmware/notlibertas/ (yes notlibertas, the fat filesystem is mounted as /lib/firmware/libertas so you can't use that)
  16. Insert the sd card into the Z2, and boot. Login as root, password debian. Congrats! You've got debian on the zipit!
  17. If windows couldn't see your fat32 partition, copy the firmware files from /lib/firmware/notlibertas to /lib/firmware/libertas. You may need to run fsck if linux can't see the files.
  18. Reboot, and you should have wireless device when you type iwconfig. Configure the wireless settings, and you're ready. I like to apt-get install ssh right away, as that's what I use most of all. Ahhhhhhh! Doesn't it feel refreshing to install new software to the Z2 without cross-compiling?
  19. Install ssh/sshd with apt-get install ssh You'll also have to force-move the real start-stop-daemon back in place with mv /sbin/start-stop-daemon.REAL /sbin/start-stop-daemon
Comments (326) Trackbacks (0)
  1. Thanx Chris,

    I’ts working !
    Rdp and vnc are working also but, yeah ehm the screensize is now a little problem :)

    I tried an apt-get upgrade but that one resulted in a crash don’t know why because i was forgotten the /var/log/apt/

  2. anyone know how to fix “lo no wireless extensions. I have the same issue as Donald

  3. Hi Jason,

    I walked Paul through it in the comments above, reposted some below for your benefit:

    #

    Hi Paul,

    Does the dmesg log show libertas as being loaded on startup? That’ll let you know if it loaded the driver or not. GL
    #
    Paul Masterson // Oct 31, 2009 at 11:04 pm

    nope, not loading.

    libertas : request_firmware failed with err = -2
    libertas: failed to load helper firmware (err=-2)
    libertas_spi: probe of spi1.0 failed with error -2

    Any suggestions on where to go from here?

  4. Thanks I figured it out. I think it had something to do with renaming it.. like you said or something to do with moving it to a a created folder in /lib/firmware/ under windows then moving it as root on the zipit to /lib/firmware/libertas.when i plugged the card into linux it showed it in the vfat partition with both being executable so i just deleted them from the card under linux and untarred the wifi from above and renamed them and stuck them into the vfat then rebooted the zipit and it looks to be working.

    Thanks for the help

  5. i ran the autoflasher, but after inserting the minisd with the disc image, the zipit hangs on the openZipit screen. I dont know what information will be helpful, so ask questions.

  6. Hey Aaron,

    I’ve answered a few questions along this line further up in the comments. Basically you need to check that the disk image has been correctly put onto the sd card. Things to check

    How many partitions does it contain?
    What files are on each partition?
    Did you DD (or psydiskwrite etc) the files to the card with proper permissions?

    good luck!
    /H

  7. I dont think i used sudo for the dd. (im running linux) anyways thanks for the help in the irc

  8. Hunter did you see this ??
    http://zipit.rootnexus.org/

    It’s so cool

  9. Hey Pabilo,

    Yeah, we’ve been helping him to work through his remaining issues on the other comments thread here :) . Definitely looks like something people will enjoy.

  10. on what base is this made, also debian ?
    I like it a lot !!!

  11. I bricked my Zipit Z2 by flashing a false Kernel to it. Now it won’t boot. I put a serial interface on it so that I was able to see the debug messages. Can somebody give me a hint how I can now flash a new Kernel on it?

  12. Hey flubar,

    Check my youtube channel http://www.youtube.com/huntergdavis. One of my “favorites’ is a video from another z2 user who walks you through the serial flashing process. Good LucK!

  13. Thank you, with the video instruction I was able to unbrick the zipit. :)

  14. Hunter,
    Thanks in advance for any help you can provide.
    I’m a serious newb with basically no linux experience using windows on my Z2. I’ve done the autoflashing and kernal rename and my Z2 does it’s backup and shuts down. Great. Then when I restart the Z2, it boots up normally, as if I’ve done nothing. No openzipit. Just the usual Zipit startup. I’ve tried the restore to default reflashing and it backs up everything like it should and when I restart the Z2, same thing. Over and over. I can’t get to the openzipit screen. I guess I’m lucky it’s not bricking. Please help.
    p.s. Hope this hasn’t been posted before. If so, sorry. I didn’t see it.

  15. Hey CK,

    Sounds like you’ve got the backup script, and not the flasher script. THe flasher script backs up the current firmware, then flashes the new firmware on there. What is the script name on the card? Could be a permissions issue on the card as well, or perhaps on the firmware file, or the firmware file is missing? Hope this helps, good luck

  16. Hunter, thanks for the response. I used the autoflasher and the zImage-2.6.29 file as shown on Hak5.

  17. Just retried it with newly downloadded files and got the same results. Am I using the right files? I tried to be very careful to do so since I am so new to these things.

  18. I reformatted the card to FAT 32 and Also Fat16 and tried with no results. The script is z2script.sh with the readme and modules. The kernal I used is the zImage-2.6.29 renamed kernal.bin. I’ve seen nothing that says there’s a permission issue. The zipit is receiving the sd card. It accepts the autoflasher and backs up the files it should and and powers down.

  19. Hey CK,

    Edit the autoflasher script with wordpad or gedit. Are the bottom lines (where it does the actual flash after the backup) commented out? That could cause it.

  20. I’m not a programmer although I am familiar with comments and I don’t see anything commented out.

    Here’s what the last 4 line say.

    echo Backing up original kernal… > /dev/tty0
    dd if=/dev/mtdblock1 of=/mnt/sd0/orig.kernal.bin

    echo Backing up original wifi firmware… > /dev/tty0
    cp /lib/firmware/*/mnt/sd0

    echo Flashing new kernal… > /dev/tty0
    dd if=/mnt/sd0/kernal.bin of=/dev/mtdblock1

    echo Flash done, powering down… > /devtty0
    poweroff

    Sorry if there are any typos. I had to type that out. I’m on a computer that I can’t put any files on. I appreciate any help.

    p.s. The first line is of the script is

    #!/bin/sh

    That wouldn’t hurt anything, right?
    Boy, do I feel like the biggest newb ever.

  21. Hey CK,

    No, that wouldn’t hurt anything that’s the correct first line. Here’s the question for me. You see the last line:
    dd if=/mnt/sd0/kernal.bin of=/dev/mtdblock1

    That’s what does the kernel flash. Previously you said you renamed it kernal.bin. Could it be looking for kernel.bin (el not al)? That is to say, is there a typo in your spelling? Is the kernel.bin in the root of the SD card with easy to read permissions? These are things to check. Good Luck

  22. Great eyes Hunter. That was the problem. Thank you Thank you Thank you Thank you.

  23. I foolishly over wrote my autoflash SD card before I was able to copy my orig.kernel.bin. Any suggestions where I might get one?

  24. Hey dklots,

    You should be able to get a new autoflash card and bin from the sourceforge page. Same with a userland image. Good Luck!

  25. hey for eveyone checking out the zipit you might want to check out the clarion mind its a little expensive because its 100$ more but it can run xp,ubuntu,android,crunchbang and alot more oses if you put the drivers on them i got mine for about 140$ on amazon for more go to http://ill-logix.com/forum/ its not as small and handheld as the zipit but its still worth checking out oh and it has a usb port mini usb port and a head phone port i have been messing with it to much i need to fix my zipit … in school suspension + zipit + vgpocket + the old game boy that takes aa batterys = good day =P

  26. Hey zonemad96,

    That’s quite an interesting little device. I may end up picking one up when they go on sale. Good find.

  27. Ok, finally got it working, but is there anyway to improve, web browsing experience like flash ot something? just a question.

    And also… is it posible, to install a modified vercion of chrome OS, in the zipit, i mean, itś pure linux, and need no system resources soooo

  28. Hey Pato,

    You can install gnash, but I wouldn’t expect much :) For chrome OS… the ram becomes an issue. Pretty sure chromium uses more than 32m itself, not counting the lightweigh OS behind it. Would be interested to see if you get this working, good luck!

  29. Hi Hunter,

    Thanks a lot for your helpful instructions. I was able to set up my zipit on my first attempt. I’ve 3 questions:

    1. I opened Dillo (after starting startx) but can’t get to close it since it has taken up the whole screen. How do I close Dillo or for that matter any other X app that does not fit the screen?
    2. The boot loader seems slow. Is it just me or is the boot loaded really that slow?
    3. Does the SD card need to be inserted when booting up zipit?

    Thanks for your response.

  30. Hey Pranav,

    Glad it’s working for you! There are hotkey modifiers to close apps if you’re using a window manager like fluxbox. For regular xwindows you can probably set up the “kill current window” key in a keys config file or something.

    For the boot, yeah it’s pretty slow. You can adjust what’s started and in what order to try and tweak it some.

    Yep, SD card needs to be in so it’ll load the userland/kernel/etc from the SD card.

    Good luck! Glad its working out for you :)

  31. Thanks for your response Hunter. Yesterday I saw that the zipit did not even come up. It was just hanging (probably) at the boot loader stage showing the Open Zipit screen. I tried it multiple times without any success. Is this a known issue?

  32. Hey Pranav,
    If I had to guess, I’d say that the sd card may have come dislodged. This can happen and that would cause the bootloader to get stuch on the OZ screen. Good Luck!

  33. Hi Hunter,

    Somehow my SD card had got corrupted. No idea how. I installed the userland again and everything was back to normal. I’ve been able to install pkgs and do stuff on it now except that somehow I’ve not been able to control the volume. I think the sound is coming from the headphone socket. I guess I’ll have to play around with the alsamixer to figure this one out. (a) Any obvious tips would help. (b) Also, do you know of any vpnclient that can be used on the zipit? (c) am also looking for a zipit compatible voip client for doing basic voice communication. (d) also, have you experimented on how to use the headphone jack as a mic? Sorry for so many queries.

    Thanks a lot for your valuable time.

  34. Hey Pranav,

    Not sure why your SD card would have become corrupted. Could have been a chunk of sectors that went bad on the physical media? For alsamixer, it’s the far right volume control (about 20 mixers to the right). I know vpnc should work fine if you’re looking for ipsec vpn connections. Not sure about other implementations. For voip.. Hrm. None come to mind, mostly due to the lack of an audio-in on the z2. Technically pidgin or gizmo should be able to work with some tweaking, but have not tried. Not sure how one would use the headphone jack as a mic, I believe the mic connector is actually a pinout on the mini usb looking plug. The sourceforge page should have more info. Good luck!

  35. Amazing tutorial, very informative, works great. Thanks!!

  36. Hey thanks hope it helped

  37. Hi Hunter,

    Sorry to bother you on your lovely blog but you seem to be quite the expert on the zipit z2. Mine just arrived yesterday, I quickly got the latest rootnexus zipit image on there and I’m amazed at how (relatively) polished it is, and how much can be done with this cute little thing (also the tactile feedback on the keyboard is great).

    I’m now trying to start customizing it, installing my own software and such. Having the whole debian repository waiting for me is just great. But I’m seeing some odd problems while trying to use apt-get. I first tried running “apt-get update” and “apt-get upgrade.” Obviously the second fails, because the tmpfs filesystems on /tmp and /var/tmp don’t have enough space for some of the packages I’m updating.

    OK, so I comment out the /tmp, /var/tmp, and /var/log entries in /etc/fstab and reboot. Now “apt-get update” fails with a bzip2 error. I consider myself to be pretty experienced with linux, but I do not understand how not having tmpfs mounted on /tmp and /var/tmp would cause bzip2 to fail. I’ve downloaded the same file (http://http.us.debian.org/debian/dists/unstable/main/binary-armel/Packages.bz2) on my PC and was able to extract it just fine. I md5sum’d it to make sure its the same file as on my zipit, and it is. When I mount the tmpfs filesystems again, the “apt-get update” succeeds. What’s going on here?

    Now when I try to run “apt-get upgrade”, I get a segfault:
    OpenZipIt:~# apt-get upgrade
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Segmentation fault
    OpenZipIt:~#

    Any ideas how I can get apt-get working properly?

    Also, I feel a little weird asking this kind of question on a comment on a blog… is there a mailing list I should be using instead, or a wiki with this kind of information?

  38. Hey Jimbo,

    Well, there’s the sourceforge page. There’s also a lot of personal pages about it, and of course previous comments on here etc etc.. For the apt-get.. not sure why it needs .tmpfs. How much disk space to you have free? What size card are you running on? Sounds like it’s running out of space. If not, a fresh DD of the image may be faster than debugging? Good luck!

  39. Hey Hunter,

    Thanks for your recommendation for using ‘vpnc’ as a vpn client. However, it requires the ‘tun’ kernel driver. I’ve installed the 1G image but it doesn’t come with that drive. Any idea where I can get it for zipit? I tried looking for a debian package that comes with the module but can’t seem to find it. May be I should build it myself using scratchbox?

    Thanks once again.

  40. Hi Hunter,

    You were right, reimaging the SD card fixed everything. I have an 8 GB micro-SD card in a mini adapter, and apparently I had screwed up the partition table on it at some point, because I discovered I was getting “attempt to access beyond end of device” errors in my dmesg on the z2. In case it helps anyone else, the “Adjust the Geometry of the Card” section of the following document fixed the partition table on the SD card:
    http://pixhawk.ethz.ch/tutorials/omap/boot_from_sd_sdhc

    I had no idea SD cards were so finicky! Anyway obviously there was some file corruption while I was getting those errors. After reimaging, I was able to complete an ‘apt-get update’ without any tmpfs weirdness, and ‘apt-get upgrade’ is in progress as I type. Here’s hoping my Z2 works fine with the updated userland. :)

  41. Hey Pranav, if the kernel doesn’t have tun support you’ll have to recompile the kernel, here’s a similar compile situation http://fedoraproject.org/wiki/Architectures/ARM/HowToQemu#Pre-built_Kernel_Image .

    If it is in the kernel, the following should work
    mknod /dev/net/tun c 10 200
    modprobe tun

    Hey Jimbo,

    Glad to hear it worked! Thanks for the info! You should write about your experience on Sourceforge too, so it helps future people as well. Thanks and good luck with your Z2 :)

  42. I get the following when I run the commands:

    OpenZipIt:~# uname -a
    Linux OpenZipIt 2.6.29 #1 Sat Sep 12 13:15:44 CDT 2009 armv5tel GNU/Linux
    OpenZipIt:~# mknod /dev/net/tun c 10 200
    OpenZipIt:~# modprobe tun
    FATAL: Module tun not found.
    OpenZipIt:~#

    Also, I can’t seem to find the kernel config file that specifies what was or not compiled into the kernel.

    OpenZipIt:~# ls /usr/src/
    OpenZipIt:~#

    I guess I better recompile the kernel.

    Thanks for your help.

  43. Sorry, one more question: is there a way to bring the zipit to the original factory conditions (like the way we received it)? Thanks so much.

  44. Hey Pranav,

    You should in theory be able to flash the original zipit firmware that was backed up during the flashing process back to the correct /mmblk0 device, but I have not tried this myself. Sounds like you may need to re-compile the kernel, as it doesn’t seem to have been built with tun/tap support turned on by default. Hope it goes well. Good lucK!

  45. I just ordered my z2 and can’t wait to get it in the mail. I just have one question. I know the .img file will contain the partitions (ext3 + swap) which take up 2gb. If I was to get a 4gb microsd and partition the rest to ext3 will I be able to store data on it and access it from the z2?

    Thanks for all of your work!

  46. Hey Preston,

    Yep, you should be able to use that space just fine. You could also use gparted to increase the partition size of the existing ext3 partition. Good luck!

  47. Thanks Hunter for the fast response! You are awesome and I appreciate your hard work!
    Preston

  48. Hey Preston, anytime, just pay it forward to someone else who needs help :)

  49. windows noob here. how do i move files in step 17? i tried a few things i saw online, but i don’t understand permissions

  50. i should add, i don’t even know if i need permissions. i’ve never used linux, i had a stock zipit, so whatever needs to get done for that step, i need to know


Leave a comment


No trackbacks yet.