Advertisement
Guest User

Untitled

a guest
Feb 28th, 2012
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. ## Building the base image
  2. This documents exactly what I did step by step. As I had some small mis-steps, it's longer than needs to be. When I give it another go, I'll condense it to the bare minimum.
  3.  
  4. First use debootstrap to generate a chrootable rootfs. We do this on any speedy machine (faster to do the dependency calculation there) and do the next bit on the raspi.
  5.  
  6. sudo debootstrap \
  7. --include=ssh,python,lua5.1,build-essential,lxde,sudo,locales,xserver-xorg,bash-completion \
  8. --components=main,contrib,non-free \
  9. --verbose \
  10. --foreign --arch armel \
  11. sid sid_rootfs http://www-uxsup.csx.cam.ac.uk/pub/linux/debian
  12.  
  13. Now tar that over the network to the raspberry pi
  14.  
  15. sudo sh -c "tar -cpf - sid_rootfs | ssh user@raspi sudo tar -xpf -"
  16.  
  17. Then, on the raspi:
  18.  
  19. cd sid_rootfs
  20. sudo chroot .
  21. ./debootstrap/debootstrap --second-stage
  22. apt-get clean # get rid of downloaded .debs
  23.  
  24.  
  25. You know longer need to be in the chroot, but might prefer to be.
  26.  
  27. Configure `etc/fstab`:
  28.  
  29.  
  30. cat <<EOF > etc/fstab
  31. proc /proc proc defaults 0 0
  32. /dev/mmcblk0p1 /boot vfat defaults 0 0
  33. /dev/mmcblk0p2 / ext3 defaults,noatime 0 0
  34. /dev/mmcblk0p3 none swap sw 0 0
  35. EOF
  36.  
  37.  
  38. Configure `etc/apt/sources.list`
  39.  
  40. cat <<EOF > etc/apt/sources.list
  41. deb http://www-uxsup.csx.cam.ac.uk/pub/linux/debian sid main contrib non-free
  42. deb-src http://www-uxsup.csx.cam.ac.uk/pub/linux/debian sid main contrib non-free
  43. EOF
  44.  
  45.  
  46. Configure `etc/network/interfaces`:
  47.  
  48. echo "auto usb0" >> etc/network/interfaces
  49. echo "iface usb0 inet dhcp" >> etc/network/interfaces
  50.  
  51. Now set up hostname:
  52.  
  53. export NEWHOSTNAME=blank # or whatever you want
  54. echo $NEWHOSTNAME > etc/hostname
  55. printf "127.0.1.1\t$NEWHOSTNAME\n" >> etc/hosts
  56.  
  57.  
  58. Now copy `/lib/modules/*` from root fs and set up vchiq:
  59.  
  60. cp -a /lib/modules/* lib/modules
  61. echo vchiq >> etc/modules
  62. cp -a /etc/init.d/vchiq etc/init.d/
  63. chroot .
  64. inserv /etc/init.d/vchiq
  65. exit
  66.  
  67.  
  68. The image now *should* be bootable. Tar it over the network, compress it,
  69. archive it. On the computer connected to the raspi do:
  70.  
  71. ssh eupton@10.42.43.40 sudo tar -cpf - -C sid_rootfs . | bzip2 --best > rootfs_sid_armel_blank_20_09_11.tar.bz2
  72.  
  73. Now we can rewrite card and boot the new system, then do the post-system
  74. setup.
  75.  
  76. Edit `/etc/shadow` and remove the `*`. Now
  77. you can log in as root with no password.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement