Advertisement
Guest User

Notes for running a chrooted ubuntu on chrome os

a guest
Dec 5th, 2012
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.57 KB | None | 0 0
  1. Notes for building a chroot for chromeos:
  2.  
  3.  
  4. Section 1: Creating chroot
  5. ==========================
  6.  
  7. The following is run on an existing armhf computer (in my case a trimlice), or a computer with qemu-arm working with binfmt. This will create a minimal ubuntu root file system. Everything needs to be run as root.
  8.  
  9. # debootstrap --variant=minbase --arch=armhf quantal ubuntu-12.10-armhf http://ports.ubuntu.com
  10. Where ubuntu-12.10-armhf is the location of the chroot
  11.  
  12. Edit etc/fstab and add:
  13. proc /proc proc nodev,noexec,nosuid 0 0
  14.  
  15. Set up the chronos user:
  16. # chroot ubuntu-12.10-armhf bash
  17. # mount proc
  18. # mkdir /usr/local/home
  19. # adduser chronos --home /usr/local/home/chronos
  20. # addgroup audio-chr --gid 18
  21. # addgroup video-chr --gid 27
  22. # adduser chronos audio-chr
  23. # adduser chronos video-chr
  24.  
  25. The first user (uid 1000) will match chronos in chrome os - this is important.
  26.  
  27. Remember to umount proc before exiting the chrooted bash.
  28.  
  29. If 18 or 27 exists, add chronos to them instead. In ubuntu 27 exists as sudo.
  30.  
  31. Disable starting services in the chroot:
  32. # echo -e '#!/bin/sh\nexit 101' > /usr/sbin/policy-rc.d
  33. # chmod +x /usr/sbin/policy-rc.d
  34.  
  35. Setting up sudo support:
  36. # addgroup admin
  37. # adduser chronos admin
  38. # apt-get install sudo
  39.  
  40. Getting a working ubuntu running:
  41. # apt-get install ubuntu-minimal
  42.  
  43. You now have a functional ubuntu chroot. Copy my chromeos scripts into the root of the chroot, and tar.gz it.
  44.  
  45.  
  46. Section 2: Getting it to run on the chrome book
  47. ===============================================
  48.  
  49. Copy the tar.gz to a usb drive or similar and insert it into the chromebook. It needs to be in developer mode for this.
  50. Switch to VT2 with Ctrl+Alt+[->] (wich is F2 - [<-] moves back to chrome os again).
  51.  
  52. Log in with chronos.
  53. # sudo su
  54. # cd /usr/local
  55. # mkdir ubuntu
  56. # cd ubuntu
  57. # tar xzvpf /media/removable/<something>/ubuntu.tar.gz
  58. # ./run.sh /usr/local/ubuntu bash
  59.  
  60. Now you are running ubuntu in chroot.
  61.  
  62. Setting up locale:
  63. # apt-get install locale
  64. # locale-gen
  65. edit etc/default/locale and enter:
  66. LANG=<locale>
  67. LC_MESSAGES=POSIX
  68.  
  69. Setting up timezone:
  70. # dpkg-reconfigure tzdata
  71.  
  72. Getting your fav. window manager:
  73. # apt-get install <my window manager of choice>
  74. # mcedit /defaultprogram
  75. Enter the name of the window manager to start and press F10 (Volume up) to save and quit.
  76.  
  77. Exit the chroot with exit or Ctrl+D.
  78.  
  79.  
  80.  
  81. Section 3: Starting the window manager:
  82. =======================================
  83.  
  84. In order to start the window manager do this as root from VT2:
  85. # xinit /usr/local/ubuntu/run.sh -- :1
  86. This will start a second X server on VT-3 (Ctrl+Alt+F3). Use Ctrl+Alt+F1 to get to chromeos.
  87.  
  88.  
  89. Quirks:
  90. =======
  91.  
  92. IMPORTANT: If you are not logged in to chromeos then the chromebook will shut down instead of suspend when lid is closed etc.
  93. Screen dims even when there is activity in linux sometimes. Switch to chromeos with Ctrl+Alt+F1 to un-dim.
  94. Can't get to automounted drives such as sd cards and usb drives. But you can mount them manually.
  95. Some times you can't switch volume down, only up. If this happens you can only switch volume down from chromeos, and only if sound is actually playing from chromeos.
  96. Occationally either X server will not draw anything. Switching to VT4 (Ctrl+Alt+F4) and back to the X server seems to do the trick for me.
  97. Switching between the VT's too fast may crash the X servers, and the chromeos X server brings down everything else.
  98.  
  99.  
  100. Todo:
  101. =====
  102.  
  103. EGL support in linux - copy over EGL on run.sh.
  104. Don't dim screen in linux.
  105. Startup chroot when X starts.
  106. Create minimal ubuntu tar.gz with rchroot and run scripts.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement