Ubuntu Pastebin

Paste from mcphail at Thu, 9 Jul 2015 13:09:21 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Install debootstrap and  qemu-user-static

Create a big sparse file for the image:
$ truncate -s 100G vivid_base.img

Create a mount directory:
$ mkdir -p ~/vivid_armhf/mount

Make the filesystem (ignore the warning):
$ mkfs.ext4 vivid_base.img

Mount the filesystem:
$ sudo mount -o loop vivid_base.img ~/vivid_armhf/mount

Create the base system:
$ sudo debootstrap --arch armhf --foreign vivid ~/vivid_armhf/mount

Copy qemu to the base system:
$ sudo cp /usr/bin/qemu-arm-static ~/vivid_armhf/mount/usr/bin/

Mount proc and sys:
$ sudo mount -t proc /proc ~/vivid_armhf/mount/proc
$ sudo mount -t sysfs /sys ~/vivid_armhf/mount/sys

Chroot in:
$ sudo chroot ~/vivid_armhf/mount

Finish the install (note that vivid debootstraps are buggy and this will partially fail):
(chroot)# debootstrap/debootstrap --arch=armhf --second-stage
(chroot)# exit

Create a decent sources.list, using "ports.ubuntu.com/ubuntu-ports" as the mirror and copy to ~/vivid_armhf/mount/etc/apt/sources.list

Chroot back in:
$ sudo chroot ~/vivid_armhf/mount

Fix the broken install:
# apt-get install -f

Enjoy!

vivid_base.img can be copied to act as a "snapshot". If you copy with "cp --reflink=auto" you'll make a copy-on-write snapshot (to save space) if your filesystem supports it e.g. btrfs.
Download as text