Advertisement
Guest User

Untitled

a guest
Jan 18th, 2014
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.59 KB | None | 0 0
  1. Ubuntu for Sunxi:
  2. ------------------
  3. Host OS: Ubuntu
  4. Target: sunxi
  5. assumprion: kernel + script.bin ready to go
  6.  
  7.  
  8. ##### STAGE 1 #####
  9.  
  10. sudo debootstrap --arch=armel --foreign precise ubuntu/ http://archive.ubuntu.com/ubuntu/
  11. (cd ubuntu ;  tar jcf ../ubuntu_debootstrat_armel.tar.bz2 .)
  12.  
  13. #creating ext4 on sd partition 2
  14. mkfs.ext4 /dev/sdc2
  15. mount /dev/sdc2 /mnt
  16.  
  17. #extract the rootfs to sd
  18. tar jxf ubuntu_debootstrat_armel.tar.bz2 -C /mnt/
  19.  
  20. #add some tewaks
  21. cd /mnt
  22. echo "proc /proc proc none 0 0" >>etc/fstab
  23. echo "ubuntu-sunxi" > etc/hostname
  24.  
  25. sync
  26.  
  27.  
  28.  
  29.  
  30. ##### STAGE 2 #####
  31.  
  32. #now put sd in machine and stop in uboot
  33. in uboot make sure kernal args include:
  34. rootfs=ext4 init=/bin/sh
  35. #with a command like: setenv extraargs "rootfs=ext4 init=/bin/sh"
  36.  
  37. #boot the kernel
  38. #After the kernel is bootet you should be in bin/sh #:
  39. #in console type:
  40.  
  41. mount /proc /proc -t proc
  42. export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  43. #start the 2nd stage deboostrapping, grabb some coffee as this will take a while
  44. /debootstrap/debootstrap --second-stage
  45.  
  46. #at the end: I: Base system installed successfully.
  47.  
  48.  
  49.  
  50. ##### STAGE 3 - Optimization #####
  51.  
  52. #after this is completed
  53. printf "T0:123:respawn:/sbin/getty 115200 ttyS0\n" >>etc/inittab
  54. #define your new password
  55. passwd
  56.  
  57.  
  58. rm /etc/init/tty2.conf
  59. rm /etc/init/tty3.conf
  60. rm /etc/init/tty4.conf
  61. rm /etc/init/tty5.conf
  62. rm /etc/init/tty6.conf
  63.  
  64. vi /etc/init/tty1.conf
  65. and modify to:
  66. ------------------------------------------------------
  67. # ttyS0 - getty
  68. #
  69. # This service maintains a getty on ttyS0 from the point the system is
  70. # started until it is shut down again.
  71.  
  72. start on stopped rc RUNLEVEL=[2345] and (
  73.             not-container or
  74.             container CONTAINER=lxc or
  75.             container CONTAINER=lxc-libvirt)
  76.  
  77. stop on runlevel [!2345]
  78.  
  79. respawn
  80. ------------------------------------------------------
  81.  
  82.  
  83.  
  84. sync
  85.  
  86. #now restart the system
  87. in uboot make sure your kernel args contain
  88. rootfs=ext4 init=/sbin/init
  89. #with a command like: setenv extraargs "rootfs=ext4 init=/sbin/init"
  90.  
  91.  
  92.  
  93.  
  94. #Done
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103. evola:
  104. Ubuntu 12.04 LTS ubuntu-sunxi ttyS0
  105.  
  106. ubuntu-sunxi login: root
  107. Password:
  108. Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.4.43+ armv7l)
  109.  
  110.  * Documentation:  https://help.ubuntu.com/
  111.  
  112. The programs included with the Ubuntu system are free software;
  113. the exact distribution terms for each program are described in the
  114. individual files in /usr/share/doc/*/copyright.
  115.  
  116. Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
  117. applicable law.
  118.  
  119. root@ubuntu-sunxi:~# uname -r
  120. 3.4.43+
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement