Advertisement
Guest User

Untitled

a guest
Aug 28th, 2014
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.57 KB | None | 0 0
  1. export DEBIAN_FRONTEND=noninteractive
  2. export ARCH=arm
  3. export CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf-
  4. cd ~/
  5. apt-get update
  6. apt-get --yes --force-yes install emdebian-archive-keyring debootstrap qemu-user-static
  7. echo 'deb http://www.emdebian.org/debian unstable main' >> /etc/apt/sources.list
  8. apt-get update
  9. apt-get --yes --force-yes install gcc-4.7-arm-linux-gnueabihf git u-boot-tools lzop make gcc hdparm dosfstools bc
  10. ln -s /usr/bin/arm-linux-gnueabihf-gcc-4.7 /usr/bin/arm-linux-gnueabihf-gcc
  11. dd if=/dev/zero of=/dev/sdb bs=1M count=4
  12. git clone https://github.com/SolidRun/u-boot-imx6.git
  13. sed -i "s/CROSS_COMPILE ?= arm-linux-/CROSS_COMPILE ?= arm-linux-gnueabihf-/" u-boot-imx6/arch/arm/config.mk
  14. cd u-boot-imx6
  15. make mx6_cubox-i_config
  16. make
  17. dd if=SPL of=/dev/sdb bs=1K seek=1
  18. dd if=u-boot.img of=/dev/sdb bs=1K seek=42
  19. cd ..
  20. sync
  21. fdisk /dev/sdb
  22. o
  23. n
  24. p
  25. 1
  26. 2048
  27. +20M
  28. n
  29. p
  30. 2
  31. 43008
  32. +500M
  33. t
  34. 1
  35. c
  36. w
  37. hdparm -z /dev/sdb
  38. mkfs.vfat /dev/sdb1
  39. mkfs.ext4 /dev/sdb2
  40. sync
  41. git clone https://github.com/linux4kix/linux-linaro-stable-mx6.git -b linux-linaro-lsk-v3.14-mx6
  42. cd linux-linaro-stable-mx6
  43. make imx_v7_cbi_hb_defconfig
  44. echo '--------------- optional modify .config for a custom kernel ---------------'
  45. make zImage imx6q-cubox-i.dtb imx6dl-cubox-i.dtb imx6dl-hummingboard.dtb imx6q-hummingboard.dtb
  46. make modules
  47. mkdir ~/sdb1
  48. mount /dev/sdb1 ~/sdb1
  49. cp arch/arm/boot/zImage ~/sdb1/
  50. cp arch/arm/boot/dts/*.dtb ~/sdb1/
  51. mkdir ~/sdb2
  52. mount /dev/sdb2 ~/sdb2
  53. ARH=arm INSTALL_MOD_PATH=~/sdb2 make modules_install
  54. cd ..
  55. debootstrap --foreign --arch=armhf wheezy ~/sdb2 http://http.debian.net/debian
  56. cp /usr/bin/qemu-arm-static ~/sdb2/usr/bin/
  57. chroot ~/sdb2
  58. /debootstrap/debootstrap --second-stage
  59. echo -e "debian\ndebian" | (passwd root)
  60. echo debian > /etc/hostname
  61. echo 'T0:23:respawn:/sbin/getty -L ttymxc0 115200 vt100' >> /etc/inittab
  62. echo -e '/dev/mmcblk0p2\t/\text4\tdefaults,noatime\t0\t0\n/dev/mmcblk0p1\t/boot\tvfat\tro\t0\t0\n/proc\t/proc\tproc\tdefaults\t0\t0\n/tmpfs\t/tmp\ttmpfs\tdefaults\t0\t0\n/tmpfs\t/run\ttmpfs\tdefaults\t0\t0\n' >> /etc/fstab
  63. echo -e 'allow-hotplug eth0\niface eth0 inet dhcp' >> /etc/network/interfaces
  64. echo -e 'deb http://ftp.fr.debian.org/debian/ wheezy main\ndeb-src http://ftp.fr.debian.org/debian/ wheezy main\ndeb http://security.debian.org/ wheezy/updates main\ndeb-src http://security.debian.org/ wheezy/updates main\n' > /etc/apt/sources.list
  65. exit
  66. echo -e 'bootfile=zImage\nmmcargs=setenv bootargs root=/dev/mmcblk0p2 rootwait video=mxcfb0:dev=hdmi \
  67. consoleblank=0 ' > ~/sdb1/uEnv.txt
  68. umount /dev/sdb1
  69. umount /dev/sdb2
  70. sync
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement