This shows you the differences between two versions of the page.
tutorials:ct1:installation:install_lubuntu_desktop_server_to_sd_card [2013/11/05 11:27] 58.86.49.51 change title |
tutorials:ct1:installation:install_lubuntu_desktop_server_to_sd_card [2014/04/02 20:05] (current) benn [Partitioning] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== CT Lubuntu Desktop/Server SD Card Installation ====== | + | ====== Lubuntu Desktop/Server SD Card Installation for Cubietruck ====== |
<WRAP noprint><WRAP left box 60%> | <WRAP noprint><WRAP left box 60%> | ||
Line 9: | Line 9: | ||
===== Abstract ===== | ===== Abstract ===== | ||
- | We may want to install lubuntu desktop/server to SD card, here is a guide for you. This guide is for Linux platform only. | + | We may want to install lubuntu desktop/server to SD card, here is a guide for you. This guide is for Linux platform only. We take Desktop as a example in this guide. If you are interested in Server, just replace the images with [[http://dl.cubieboard.org/software/a20-cubietruck/lubuntu/ct-lubuntu-card0-v1.00/server/|server one]]. |
===== Prerequisites ===== | ===== Prerequisites ===== | ||
- | * Any Linux environment, we want sfdisk, dd, wget commands | + | * Any Linux environment, we want fdisk, dd, tar, wget commands |
* An SD Card(at least 2GB) | * An SD Card(at least 2GB) | ||
- | ===== Installation ====== | + | ===== Installation ====== |
+ | |||
+ | We assume card=/dev/sdd here | ||
- | ==== Download Images==== | + | ==== Get Images==== |
- | * u-boot | + | ^ Name ^ Desc ^ URL ^ |
+ | | u-boot | u-boot with spl | [[http://dl.cubieboard.org/software/a20-cubietruck/lubuntu/ct-lubuntu-card0-v1.00/u-boot-sunxi-with-spl-ct-20131102.bin|download]] | | ||
+ | | bootfs | uImage, uEnv.txt, script.bin | [[http://dl.cubieboard.org/software/a20-cubietruck/lubuntu/ct-lubuntu-card0-v1.00/desktop/bootfs-part1.tar.gz|download]] | | ||
+ | | rootfs | rootfs | [[http://dl.cubieboard.org/software/a20-cubietruck/lubuntu/ct-lubuntu-card0-v1.00/desktop/rootfs-part2.tar.gz|download]] | | ||
- | $wget http://dl.cubieboard.org/software/a20-cubietruck/lubuntu/ct-lubuntu-card0-v1.00/u-boot-sunxi-with-spl-ct-20131102.bin | ||
- | * bootfs (partition 1) | + | ==== Cleaning SD Card ==== |
+ | $card=/dev/sdd | ||
+ | $sudo dd if=/dev/zero of=${card} bs=1024 seek=544 count=128 | ||
- | $wget http://dl.cubieboard.org/software/a20-cubietruck/lubuntu/ct-lubuntu-card0-v1.00/desktop/bootfs-part1.img.gz | + | ==== Make Bootable SD Card ==== |
- | * rootfs (partition 2) | + | $sudo dd if=u-boot-sunxi-with-spl-ct-20131102.bin of=$card bs=1024 seek=8 |
- | $wget http://dl.cubieboard.org/software/a20-cubietruck/lubuntu/ct-lubuntu-card0-v1.00/desktop/rootfs-part2.img.gz | + | ==== Partitioning ==== |
- | ==== Extract the Images==== | + | $ sudo fdisk $card |
+ | |||
+ | |||
+ | Using the fdisk command to create 2 partitions on the SD Card, e.g. | ||
+ | * 1st partitions start from 2048 sectors, 64MB in size | ||
+ | * 2nd partitions just keep it all default | ||
+ | |||
+ | Show bellow | ||
+ | |||
+ | Device Boot Start End Blocks Id System | ||
+ | /dev/sdd1 2048 133119 65536 83 Linux | ||
+ | /dev/sdd2 133120 15278079 7572480 83 Linux | ||
+ | |||
+ | Also we recommend you to look at [[http://linux-sunxi.org/Bootable_SD_card |Bootable_SD_card]] | ||
+ | |||
+ | |||
+ | $sudo mkfs.ext2 ${card}1 | ||
+ | $sudo mkfs.ext4 ${card}2 | ||
- | $gzip -d bootfs-part1.img.gz | + | |
- | $gzip -d rootfs-part2.img.gz | + | ==== Copying ==== |
- | + | ||
- | ==== Create Partitions on SD Card ==== | + | $mkdir /tmp/sdd1 /tmp/sdd2 |
- | + | $sudo mount -t ext2 ${card}1 /tmp/sdd1 | |
- | sudo sfdisk --force --in-order -uS /dev/sdX <<EOF | + | $sudo mount -t ext4 ${card}2 /tmp/sdd2 |
- | 2048,24576,L | + | $sudo tar -C /tmp/sdd1 -xvf bootfs-part1.tar.gz |
- | ,,L | + | $sudo tar -C /tmp/sdd2 -xvf rootfs-part2.tar.gz |
- | EOF | + | $sync |
- | + | $sudo umount /tmp/sdd1 | |
- | /dev/sdX is the block device of your SD Card | + | $sudo umount /tmp/sdd2 |
- | + | ||
- | ==== Write Images to SD Card ==== | + | |
- | + | ===== Customizing ( optional )==== | |
- | sudo dd if=u-boot-sunxi-with-spl-ct-20131102.bin of=/dev/sdX bs=1024 seek=8 | + | |
- | sudo dd if=bootfs-part1.img of=/dev/sdX1 bs=1M | + | ==== Change your own kernel ==== |
- | sudo dd if=rootfs-part2.img of=/dev/sdX2 bs=1M | + | |
- | sync | + | |
- | + | ==== Move Rootfs to Hard Drive==== | |
- | ===== Notes ===== | + | |
- | + | * Mount rootfs partitions | |
- | * This guide is suitable for the ct-lubuntu-card0-v1.00 desktop/server images | + | After login to lubuntu system on Cubietruck with linaro, |
- | + | $sudo su - root --> change to root user | |
- | + | #mkdir /tmp/1 /tmp/target | |
+ | #mount /dev/mmcblk0p2 /tmp/1 | ||
+ | #mkfs.ext4 /dev/sda1 | ||
+ | #mount /dev/sda1 /tmp/target | ||
+ | |||
+ | * Moving rootfs | ||
+ | |||
+ | #(cd /tmp/1; tar --backup -c *) |tar -C /tmp/target -xv | ||
+ | |||
+ | * Changing Kernel Parameters | ||
+ | |||
+ | #mount /dev/mmcblk0p1 /mnt/ | ||
+ | #vi /mnt/uEnv.txt | ||
+ | (Change root=/dev/sda1) | ||
+ | |||
+ | So the file's content would like bellow | ||
+ | |||
+ | cat /mnt/uEnv.txt | ||
+ | root=/dev/sda1 | ||
+ | extraargs=console=tty0 hdmi.audio=EDID:0 disp.screen0_output_mode=EDID:1280x720p50 rootwait panic=10 rootfstype=ext4 rootflags=discard | ||
+ | |||
+ | * Sync to disk, and reboot to your hard drive | ||
+ | |||
+ | #sync | ||
+ | #umount /mnt | ||
+ | #reboot | ||
+ | |||
+ | After installing rootfs to SSD, we will get much more better experience. | ||
+ | |||
+ | * Performance (R:106MB/s, W: 148MB/s) | ||
+ | |||
+ | root@cubietruck:~# cat /sys/block/sda/device/model | ||
+ | SAMSUNG SSD 830 | ||
+ | |||
+ | root@cubietruck:~# dd if=/dev/sda2 of=/dev/null bs=1M count=10000 | ||
+ | 10000+0 records in | ||
+ | 10000+0 records out | ||
+ | 10485760000 bytes (10 GB) copied, 98.9637 s, 106 MB/s | ||
+ | |||
+ | root@cubietruck:~# dd if=/dev/zero of=/dev/sdb2 bs=1M count=5000 | ||
+ | dd: writing `/dev/sdb2': No space left on device | ||
+ | 913+0 records in | ||
+ | 912+0 records out | ||
+ | 956919808 bytes (957 MB) copied, 6.45456 s, 148 MB/s | ||
+ | |||
+ | ===== Tips ===== | ||
+ | |||
+ | ==== VGA output ==== | ||
+ | |||
+ | If we want to change to VGA output default, we need to modify the script.bin at the 1st partition | ||
+ | |||
+ | $bin2fex script.bin 1.fex | ||
+ | $vim 1.fex (and change screen0_output_type to 4) | ||
+ | $fex2bin 1.fex script.bin | ||
+ | |||
+ | |||
+ | ====Kernel Source==== | ||
+ | * http://github.com/cubieboard/linux-sunxi (cubie/sunxi-3.4 branch) | ||
+ | |||
+ | ====Wifi Module==== | ||
+ | |||
+ | Cubietruck have AP6210 wifi/bt module combo on board, to load the module, | ||
+ | |||
+ | #modprobe bcmdhd | ||
+ | |||
+ | ====Default User/Password==== | ||
+ | linaro/linaro | ||
+ | |||
+ | |||
+ |