This shows you the differences between two versions of the page.
tutorials:ct1:installation:cb3_lubuntu-12.10-desktop_nand_installation_20130910-build [2013/10/15 15:36] benn [Installing] |
tutorials:ct1:installation:cb3_lubuntu-12.10-desktop_nand_installation_20130910-build [2014/06/12 10:45] (current) parker parker |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Cb3 Lubuntu-12.10-desktop Nand Installation 20130910-build ====== | + | ====== Cb3 Lubuntu-12.10-desktop Nand Installation 20131015-build ====== |
<WRAP noprint><WRAP left box 60%> | <WRAP noprint><WRAP left box 60%> | ||
Line 19: | Line 19: | ||
==== Download Images ==== | ==== Download Images ==== | ||
- | wget http://dl.cubieboard.org/software/a20-cubietruck/lubuntu/ct_lubuntu_desktop_12.10_20130910.img.gz | + | wget http://dl.cubieboard.org/software/a20-cubietruck/lubuntu/ct-lubuntu-nand-v1.00/ct-lubuntu-desktop-20131026/lubuntu-desktop-nand.img.gz |
- | gzip -d ct_lubuntu_desktop_12.10_20130910.img.gz | + | gzip -d lubuntu-desktop-nand.img.gz |
==== PhoenixSuit ==== | ==== PhoenixSuit ==== | ||
To flash the image to cubietruck board, you need to install phoenixsuit on your labtop. Please refer to the [[http://docs.cubieboard.org/tutorials/common/livesuit_installation_guide|Installation Guide]] | To flash the image to cubietruck board, you need to install phoenixsuit on your labtop. Please refer to the [[http://docs.cubieboard.org/tutorials/common/livesuit_installation_guide|Installation Guide]] | ||
Line 39: | Line 38: | ||
- | ===== Installing ===== | + | ===== Installation ===== |
- | * Start LiveSuit | + | ==== Start LiveSuit ==== |
$ ~/Bin/LiveSuit/LiveSuit.sh | $ ~/Bin/LiveSuit/LiveSuit.sh | ||
Line 47: | Line 46: | ||
{{:tutorials:ct1:installation:lubuntu-livesuit.png?700|LiveSuit GUI}} | {{:tutorials:ct1:installation:lubuntu-livesuit.png?700|LiveSuit GUI}} | ||
- | * Select Image | + | ==== Select Image ==== |
{{:tutorials:ct1:installation:lubuntu-livesuit-2.png?700|LiveSuit GUI}} | {{:tutorials:ct1:installation:lubuntu-livesuit-2.png?700|LiveSuit GUI}} | ||
- | * Enter FEL Mode | + | ==== Enter FEL Mode ==== |
{{:tutorials:ct1:installation:livesuit-enter-fel-mode.png?700|LiveSuit GUI}} | {{:tutorials:ct1:installation:livesuit-enter-fel-mode.png?700|LiveSuit GUI}} | ||
Line 61: | Line 60: | ||
{{:tutorials:ct1:installation:lubuntu-livesuit-3.png?700|LiveSuit GUI}} | {{:tutorials:ct1:installation:lubuntu-livesuit-3.png?700|LiveSuit GUI}} | ||
- | * Flash to Board | + | ==== Flash to Board ==== |
When seeing the prombt, you have enter the FEL mode. Select Yes to continue | When seeing the prombt, you have enter the FEL mode. Select Yes to continue | ||
Line 70: | Line 69: | ||
Congratulations! You have finished the installation process. Enjoy your Cubie and Lubuntu Desktop! | Congratulations! You have finished the installation process. Enjoy your Cubie and Lubuntu Desktop! | ||
+ | |||
+ | When you first start up the system, It will take about 2 minutes to initialize the system. Also we suggest you have the ethernet cable connected when booting, to avoid waiting DHCP timeout. | ||
Line 76: | Line 77: | ||
==== Changing Boot Parameters ==== | ==== Changing Boot Parameters ==== | ||
- | TBD | + | |
+ | If we want to change boot parameter, say, we want to add "hdmi.audio=EDID:0 disp.screen0_output_mode=EDID:1920x1080p50" to the kernel parameter: | ||
+ | |||
+ | $wget http://dl.cubieboard.org/software/a20-common/mk_env_fex.tar | ||
+ | $tar -xf mk_env_fex.tar | ||
+ | $cd mk_env_fex | ||
+ | $vim env.cfg | ||
+ | |||
+ | Change the content below | ||
+ | ... | ||
+ | loglevel=5 | ||
+ | extras=hdmi.audio=EDID:0 disp.screen0_output_mode=EDID:1920x1080p50 | ||
+ | #set kernel cmdline if boot.img or recovery.img has no cmdline we will use this | ||
+ | setargs_nand=setenv bootargs console=${console} init=${init} loglevel=${loglevel} ${extras} | ||
+ | setargs_mmc=setenv bootargs console=${console} init=${init} loglevel=${loglevel} | ||
+ | #nand command syntax: sunxi_flash read address partition_name read_bytes | ||
+ | .. | ||
+ | |||
+ | $mk_env_fex | ||
+ | |||
+ | copy env.fex to lubuntu OS, then dd if=env.fex of=/dev/nandb bs=1M | ||
==== Changing Kernel ==== | ==== Changing Kernel ==== | ||
- | TBD | + | * Getting The Kernel Source |
+ | The kernel source matching this image is [[http://dl.cubieboard.org/software/a20-cubietruck/lubuntu/obsolete/ct_lubuntu_desktop_12.10_20131015/linux-sunxi.tar.gz|here]]. And the defconfig is [[http://dl.cubieboard.org/software/a20-cubietruck/lubuntu/obsolete/ct_lubuntu_desktop_12.10_20131015/kernel_defconfig|here]]. | ||
+ | |||
+ | Please also refer to | ||
+ | |||
+ | http://github.com/linux-sunxi | ||
+ | http://github.com/cubieboard2 | ||
+ | |||
+ | * Compiling | ||
+ | |||
+ | $tar -zxvf linux-sunxi.tar.gz | ||
+ | $cp kernel_defconfig linux-sunxi/.config | ||
+ | $cd linux-sunxi | ||
+ | $make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage modules | ||
+ | $objcopy -R .note.gnu.build-id -S -O binary vmlinux bImage | ||
+ | $mkbootimg --kernel bImage \ | ||
+ | --ramdisk rootfs.cpio.gz \ | ||
+ | --board "sun7i" \ | ||
+ | --base 0x40000000 \ | ||
+ | -o "boot.img" | ||
+ | |||
+ | Note: mkbootimg command can be found at this [[http://dl.cubieboard.org/software/a20-common/mk_env_fex.tar|package]] | ||
+ | |||
+ | * Replacing | ||
+ | |||
+ | Copy boot.img, modules to your lubuntu system, | ||
+ | |||
+ | #dd if=boot.img of=/dev/nandc bs=1M | ||
+ | |||
+ | Note: You should be skilled in kernel building, else it's easy to damage your OS system. | ||
+ | |||
+ | |||
==== Building Custom Modules ==== | ==== Building Custom Modules ==== | ||
- | TBD | + | |
+ | * Download Kernel Source | ||
+ | |||
+ | $wget http://dl.cubieboard.org/software/a20-cubietruck/lubuntu/obsolete/ct_lubuntu_desktop_12.10_20131015/linux-sunxi.tar.gz | ||
+ | $wget http://dl.cubieboard.org/software/a20-cubietruck/lubuntu/obsolete/ct_lubuntu_desktop_12.10_20131015/kernel_defconfig | ||
+ | |||
+ | * Extract and create local git repo | ||
+ | |||
+ | $tar -zxf linux-sunxi.tar.gz | ||
+ | $cp kernel_defconfig linux-sunxi/.config | ||
+ | $git init | ||
+ | $git add . | ||
+ | $git commit -m "init a repo just for match the uname -r token" -a | ||
+ | $make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig | ||
+ | $make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage | ||
+ | $cd $your_kernel_module_path_and_point_your_kdir_here | ||
+ | ... | ||
+ | |||
+ | *Copy your new module to your lubuntu OS | ||
+ | |||
+ | |||
+ | |||
+ | |||
==== Using GPIOs ==== | ==== Using GPIOs ==== | ||
Line 97: | Line 174: | ||
+ | ==== C/C++ Programming ==== | ||
+ | lubuntu-12.10-desktop is quite a modern operating system, that we can do almost all language programming, including C/C++, JAVA, Python, Perl, and so on. To support C/C++ programming, just run the following command: | ||
+ | #apt-get install build-essential | ||
+ | |||
+ | To become more productivy, you can also use VIM or EMACS | ||
+ | |||
+ | #apt-get install vim emacs cscope cscope-el | ||
+ | |||
+ | |||
+ | ===== Tips ===== | ||
+ | |||
+ | ==== About Partitions ==== | ||
+ | |||
+ | * Partitons Layout | ||
+ | We have 5 partitions on the system, nand represent the whole nandflash. Nand[a-e] are treated as partitons | ||
+ | |||
+ | root@cubietruck:~# ls /dev/nand* -l | ||
+ | brw-rw---- 1 root disk 93, 0 Oct 15 08:46 /dev/nand | ||
+ | brw-rw---- 1 root disk 93, 1 Oct 15 08:46 /dev/nanda | ||
+ | brw-rw---- 1 root disk 93, 2 Oct 15 08:46 /dev/nandb | ||
+ | brw-rw---- 1 root disk 93, 3 Oct 15 08:46 /dev/nandc | ||
+ | brw-rw---- 1 root disk 93, 4 Oct 15 08:46 /dev/nandd | ||
+ | brw-rw---- 1 root disk 93, 5 Oct 15 08:46 /dev/nande | ||
+ | |||
+ | * /dev/nanda | ||
+ | Contains the bootlogo, script.bin, and so on | ||
+ | |||
+ | root@cubietruck:~# ls /mnt/nanda/ | ||
+ | boot.axf drv_de.drv font24.sft linux os_show script.bin | ||
+ | boot.ini drv_hdmi.drv font32.sft magic.bin prvt.axf sprite.axf | ||
+ | |||
+ | * /dev/nandb | ||
+ | Contains the u-boot boot parameters. The origin is showed below, | ||
+ | |||
+ | bootdelay=1 | ||
+ | #default bootcmd, will change at runtime according to key press | ||
+ | bootcmd=run setargs_nand boot_normal#default nand boot | ||
+ | #kernel command arguments | ||
+ | console=ttyS0,115200 | ||
+ | nand_root=/dev/system | ||
+ | mmc_root=/dev/mmcblk0p7 | ||
+ | init=/init | ||
+ | loglevel=5 | ||
+ | #set kernel cmdline if boot.img or recovery.img has no cmdline we will use this | ||
+ | setargs_nand=setenv bootargs console=${console} init=${init} loglevel=${loglevel} | ||
+ | setargs_mmc=setenv bootargs console=${console} init=${init} loglevel=${loglevel} | ||
+ | #nand command syntax: sunxi_flash read address partition_name read_bytes | ||
+ | #0x40007800 = 0x40008000(kernel entry) - 0x800(boot.img header 2k) | ||
+ | boot_normal=boota 40007800 | ||
+ | #boot_normal=sunxi_flash read 40007800 boot;boota 40007800 | ||
+ | boot_recovery=sunxi_flash read 40007800 recovery;boota 40007800 | ||
+ | boot_fastboot=fastboot | ||
+ | #recovery key | ||
+ | recovery_key_value_max=0x13 | ||
+ | recovery_key_value_min=0x10 | ||
+ | #fastboot key | ||
+ | fastboot_key_value_max=0x8 | ||
+ | fastboot_key_value_min=0x2 | ||
+ | |||
+ | If you want to change your own kernel parameter, you can: | ||
+ | - Save above text to a file, e.g. env.cfg | ||
+ | - Use u_boot_env_gen tool to convert the file to a image | ||
+ | - dd the image to /dev/nandb | ||
+ | |||
+ | If you are using Ubuntu 12.04 X86_64, there is a simple script help you do that | ||
+ | $wget http://dl.cubieboard.org/software/a20-common/mk_env_fex.tar | ||
+ | $tar -xf mk_env_fex.tar | ||
+ | $cd mk_env_fex | ||
+ | $vim env.cfg -- and change the content as you want | ||
+ | $./mk_env_fex.sh | ||
+ | |||
+ | |||
+ | |||
+ | | ||