1420
Commento:
|
3626
|
Le cancellazioni sono segnalate in questo modo. | Le aggiunte sono segnalate in questo modo. |
Linea 39: | Linea 39: |
{{{ mount /dev/sdb1 /mnt/temp cp openwrt-sunxi-uImage /mnt/temp/uImage cp script.bin /mnt/temp/uImage umount /mnt/temp }}} Prepare files in the ext4 partition {{{ mount /dev/sdb2 /mnt/temp cd /mnt/temp tar -zxvf /home/saverio/Dropbox/Firmware/sunxi/v4/openwrt-sunxi-cubie-rootfs.tar.gz cd ~ umount /mnt/temp }}} == First boot == |
|
Linea 41: | Linea 58: |
{{{ U-Boot SPL 2012.10-04280-g1a8ac55 (May 25 2013 - 19:42:12) DRAM: 1024MB SUNXI SD/MMC: 0 U-Boot 2012.10-04280-g1a8ac55 (May 25 2013 - 19:42:12) Allwinner Technology CPU: SUNXI Family Board: Cubieboard I2C: ready DRAM: 1 GiB MMC: SUNXI SD/MMC: 0 *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial Hit any key to stop autoboot: 0 sun4i# }}} Use printenv {{{ sun4i#printenv baudrate=115200 boot_mmc=fatload mmc 0 0x43000000 script.bin && fatload mmc 0 0x48000000 ${kernel} && watchdog 0 && bootm 0x48000000 bootcmd=if run loadbootenv; then echo Loaded environment from ${bootenv};env import -t ${scriptaddr} ${filesize};fi;if test -n ${uenvcmd}; then echo Running uenvcmd ...;run uenvcmd;fi;if run loadbootscr; then echo Jumping to ${bootscr};source ${scriptaddr};fi;run setargs boot_mmc; bootdelay=3 bootenv=uEnv.txt bootscr=boot.scr console=ttyS0,115200 kernel=uImage loadbootenv=fatload mmc 0 $scriptaddr ${bootenv} || ext2load mmc 0 $scriptaddr ${bootenv} || ext2load mmc 0 $scriptaddr boot/${bootenv} loadbootscr=fatload mmc 0 $scriptaddr ${bootscr} || ext2load mmc 0 $scriptaddr ${bootscr} || ext2load mmc 0 $scriptaddr boot/${bootscr} loglevel=8 panicarg=panic=10 root=/dev/mmcblk0p2 rootwait scriptaddr=0x44000000 setargs=setenv bootargs console=${console} root=${root} loglevel=${loglevel} ${panicarg} ${extraargs} stderr=serial stdin=serial stdout=serial Environment size: 1028/131068 bytes sun4i# }}} Set the env {{{ sun4i#setenv setargs setenv bootargs console=${console} root=${root} loglevel=${loglevel} ${panicarg} ${extraargs} init=/etc/preinit }}} Check the change with {{{printenv}}} and if it looks ok you can save with saveenv {{{ sun4i#saveenv Saving Environment to MMC... Writing to MMC(0)... done sun4i# }}} |
Cubieboard with OpenWrt
Build OpenWrt
TODO
https://github.com/zioproto/openwrt-sunxi
PreBuilt Images
If you dont want to compile OpenWrt you can find some prebuilt images here:
http://stud.netgroup.uniroma2.it/~saverio/sunxi/v3/
Prepare the microSD card
use fdisk to make two partitions the first one of 16Mb, and starting at sector 2048 (it should be the default value) the second partition can take all the rest of the SD card
format msdos the first partition: mkfs.msdos /dev/sdb1 format ext4 the second partition mkfs.ext4 /dev/sdb2
now you have to install the u-boot, the bootloader.
dd if=sunxi-spl.bin of=/dev/sdb bs=1024 seek=8 dd if=u-boot.bin of=/dev/sdb bs=1024 seek=32
now copy in th first partition the script.bin file and the kernel openwrt-sunxi-uImage and call the file exactly uImage
in the ext4 partition untar the tar.gz with the OpenWRT root filesystem
mount /dev/sdb1 /mnt/temp cp openwrt-sunxi-uImage /mnt/temp/uImage cp script.bin /mnt/temp/uImage umount /mnt/temp
Prepare files in the ext4 partition
mount /dev/sdb2 /mnt/temp cd /mnt/temp tar -zxvf /home/saverio/Dropbox/Firmware/sunxi/v4/openwrt-sunxi-cubie-rootfs.tar.gz cd ~ umount /mnt/temp
First boot
the system will not boot correctly (you will not see /proc) if you dont set init=/etc/preinit in your uboot evironment
U-Boot SPL 2012.10-04280-g1a8ac55 (May 25 2013 - 19:42:12) DRAM: 1024MB SUNXI SD/MMC: 0 U-Boot 2012.10-04280-g1a8ac55 (May 25 2013 - 19:42:12) Allwinner Technology CPU: SUNXI Family Board: Cubieboard I2C: ready DRAM: 1 GiB MMC: SUNXI SD/MMC: 0 *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial Hit any key to stop autoboot: 0 sun4i#
Use printenv
sun4i#printenv baudrate=115200 boot_mmc=fatload mmc 0 0x43000000 script.bin && fatload mmc 0 0x48000000 ${kernel} && watchdog 0 && bootm 0x48000000 bootcmd=if run loadbootenv; then echo Loaded environment from ${bootenv};env import -t ${scriptaddr} ${filesize};fi;if test -n ${uenvcmd}; then echo Running uenvcmd ...;run uenvcmd;fi;if run loadbootscr; then echo Jumping to ${bootscr};source ${scriptaddr};fi;run setargs boot_mmc; bootdelay=3 bootenv=uEnv.txt bootscr=boot.scr console=ttyS0,115200 kernel=uImage loadbootenv=fatload mmc 0 $scriptaddr ${bootenv} || ext2load mmc 0 $scriptaddr ${bootenv} || ext2load mmc 0 $scriptaddr boot/${bootenv} loadbootscr=fatload mmc 0 $scriptaddr ${bootscr} || ext2load mmc 0 $scriptaddr ${bootscr} || ext2load mmc 0 $scriptaddr boot/${bootscr} loglevel=8 panicarg=panic=10 root=/dev/mmcblk0p2 rootwait scriptaddr=0x44000000 setargs=setenv bootargs console=${console} root=${root} loglevel=${loglevel} ${panicarg} ${extraargs} stderr=serial stdin=serial stdout=serial Environment size: 1028/131068 bytes sun4i#
Set the env
sun4i#setenv setargs setenv bootargs console=${console} root=${root} loglevel=${loglevel} ${panicarg} ${extraargs} init=/etc/preinit
Check the change with printenv and if it looks ok you can save with saveenv
sun4i#saveenv Saving Environment to MMC... Writing to MMC(0)... done sun4i#
you can adjust that with printenv (show all stuff) setenv (change the variable the contains init) saveenv
everything is documented in details here:
http://linux-sunxi.org/FirstSteps https://github.com/linux-sunxi/u-boot-sunxi/wiki https://github.com/zioproto/openwrt-sunxi/blob/sunxi-rebased/README.sunxi