This guide will take you from a fresh install of linux (ubuntu 13.04 in my case) to a compiled OS ready to be flashed to your zero. I have not seen this process spelt out to a T anywhere, so I'm composing it myself. Credits to zear from dingoonity for the original how-to process of replacing the internal microsd and mth for helping me fix some of the troubles I came across while compiling. Also big shout out to Justin (aka GCW) for making such an awesome device. I imagine there will be many good years ahead for him and his team.
I will break this process down as simple as possible. I will assume you have ubuntu (or your chosen flavor of linux already installed) and you know how to open a terminal.
first we install all the prereqs
sudo apt-get install git bison flex g++ texinfo mercurial subversion libncurses5-dev libusb-dev libconfuse-dev
say (Y)es when asked.
----------------------
Next we download and compile the toolchain and rootfs (rootfs.squashfs) "~" refers to your home directory
cd ~
git clone git://github.com/gcwnow/buildroot.git
cd buildroot
make gcw0_defconfig
make
It should take several hours to complete but when the build is done, your toolchain will be under ~/buildroot/output/host/usr/ and the rootfs will be here ~/buildroot/output/images/rootfs.squashfs
Next we copy the toolchain to /opt/ and set permissions for future use with the kernel compile and any other software that will go on the zero you want to compile.
mkdir -p /opt
sudo chmod -R 777 /opt/
cp -r ~/buildroot/output/host/usr/* /opt/
--------------------------
Next we download and compile the kernel
prereq for this is that toolchain created and placed in /opt/ directory we did in the above step
we are setting the envrionmental variable that tells the compiler what to use when compiling the kernel. Then we are downloading the source, setting the configureation file to build for the zero then building the kernel.
cd ~
PATH=$PATH:/opt/bin
export PATH
git clone git://github.com/gcwnow/linux.git
cd linux
make ARCH=mips gcw0_defconfig
make ARCH=mips vmlinuz.bin -j4
-j4 is variable depending on how many cores you want to build with. Some may use -j2 some may use -j8 depending on how powerful your machine is.
Once completed your kernel (vmlinuz.bin) will be in ~/linux/
-------------
So now we have our rootfs.squashfs (file system) and our vmlinuz.bin (kernel) now comes the optional fun part of taking apart and flashing the zero.
1) Open the case
2) Remove microSD from the slot
3) Put new, empty microSD to the slot
4) Close the case
--------------
Now we're ready to flash the zero. We are downloading the 3 sources for the flash utilities. UBIBoot compiles the bootloader for the zero, Imager puts together the kernel and file system packages to be flashed. ingenic-boot actually does the flashing.
cd ~
git clone https://github.com/gcwnow/UBIBoot.git
git clone https://github.com/gcwnow/imager.git
git clone https://github.com/gcwnow/ingenic-boot.git
cd UBIBoot
make CONFIG=gcw0
here you must choose one of the 2 commands based on the device you are building for. This is for the bootloader only. If you are creative you can find a way to build for both, but for this guide we're only choosing one.
(256MB "FrankenZero" / Prototypes / Clones)
cp ./output/gcw0/ubiboot-v11_ddr2_256mb.bin ~/imager/ubiboot.bin
(512MB "Kickstarter" / Regular / "Production / SE / Pre-order")
cp ./output/gcw0/ubiboot-v20_mddr_512mb.bin ~/imager/ubiboot.bin
after you've copied your chosen boot.bin, continue
cd ~/imager
./create_mbr.sh
cp ~/linux/vmlinuz.bin ~/imager/vmlinuz.bin
./create_system_image.sh
cp ~/buildroot/output/images/rootfs.squashfs ~/imager/rootfs.squashfs
./create_data_image.sh
cd ~/ingenic-boot
make
copy the bundled files to the flasher app we just made
cp ~/imager/images/* ~/ingenic-boot/
So you have all your tools compiled, congrats! Almost there, the last step is to flash it to the device.
Make sure your device is powered off, then while holding SELECT button power it on. Release the SELECT button after about 2 seconds. You won't see anything happen on your screen but it is entering a special download mode where you are able to flash the bootloader and firmware.
to make sure your device is connected correctly
cd ~/ingenic-boot
sudo ./ingenic-boot -probe
the output should show "JZ4770" if it shows "no xburst devices found" it means you didn't put your device into download mode correctly, you need to try agian, no special drivers are needed so don't worry about that.
if you got the correct output we are now ready to proceed with flashing... last command choose the one that corresponds to the type of device you have.
(256MB "FrankenZero" / Prototypes / Clones)
sudo ./ingenic-boot -config=v11_ddr2_256mb -mbr=mbr.bin -boot=ubiboot.bin -system=system.bin -data=data.bin -check
(512MB "Kickstarter" / Regular / "Production / SE / Pre-order")
sudo ./ingenic-boot -mbr=mbr.bin -boot=ubiboot.bin -system=system.bin -data=data.bin -check
During the flash process it will start with "probe 1th" and spit out the status of the flashing process. Once it says done just let the device sit it should reboot and you should be good to go. If you find I missed something or typo'd anything let me know and I'll fix it.
--------------------------------------------------
For those that just want to use the tool, I will make snapshots and post them here occasionally to ensure you are starting off with a somewhat up to date image whenever possible before running the official "untethered" update tool.
2015MAY24
LINUX ->
https://www.dropbox.com/s/43epexcnozg48nx/GCW0-Flasher-LINUX-20130524.zipWINDOWS ->
https://www.dropbox.com/s/swurdbx8qo6vjr1/GCW0-Flasher-WIN-20130524.zip2013APR30
https://www.dropbox.com/s/o4oz7neympmftpw/GCW0-Flasher-20130430.zip:updated 7/25/13: corrected some changes to build process
-enjoy
SNESFAN