Meego Wiki
Views

ARM/N900/Install/chroot

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
Line 2: Line 2:
== Prepare chroot directory ==
== Prepare chroot directory ==
-
Create directory for chroot and unpack Meego image there
+
Problem with chroot installation is finding space for it. Flash card would have plenty of space but that uses FAT32 so it can't be used directly. We can however create image and loopback mount it.
-
  export MEEGO_ROOT="FIXME"
+
 
-
mkdir $MEEGO_ROOT
+
Create 2GB image file
 +
dd if=/dev/zero of=/home/user/MyDocs/meego-image bs=1024 count=2097152
 +
 
 +
Create filesystem on image file
 +
mkfs.ext3 /home/user/MyDocs/meego-image
 +
 
 +
Create mount point and loopback mount the image
 +
mkdir /mnt/meego
 +
mount -o loop /home/user/MyDocs/meego-image /mnt/meego
 +
 
 +
Unpack Meego rootfs image there
 +
  export MEEGO_ROOT="/mnt/meego"
  tar xzf <meego-image> -C $MEEGO_ROOT
  tar xzf <meego-image> -C $MEEGO_ROOT
Line 31: Line 42:
== Cleanup ==
== Cleanup ==
Don't forget to unmount all the system directories that were mounted inside chroot. '''You might have to setup MEEGO_ROOT again after leaving chroot'''.
Don't forget to unmount all the system directories that were mounted inside chroot. '''You might have to setup MEEGO_ROOT again after leaving chroot'''.
-
   
+
  cd ~
  umount $MEEGO_ROOT/proc
  umount $MEEGO_ROOT/proc
  umount $MEEGO_ROOT/sys
  umount $MEEGO_ROOT/sys
Line 42: Line 53:
  umount $MEEGO_ROOT/tmp
  umount $MEEGO_ROOT/tmp
  umount $MEEGO_ROOT/var/run
  umount $MEEGO_ROOT/var/run
 +
 +
umount $MEEGO_ROOT

Revision as of 16:18, 31 March 2010

Under construction

Contents

Prepare chroot directory

Problem with chroot installation is finding space for it. Flash card would have plenty of space but that uses FAT32 so it can't be used directly. We can however create image and loopback mount it.

Create 2GB image file

dd if=/dev/zero of=/home/user/MyDocs/meego-image bs=1024 count=2097152

Create filesystem on image file

mkfs.ext3 /home/user/MyDocs/meego-image

Create mount point and loopback mount the image

mkdir /mnt/meego
mount -o loop /home/user/MyDocs/meego-image /mnt/meego

Unpack Meego rootfs image there

export MEEGO_ROOT="/mnt/meego"
tar xzf <meego-image> -C $MEEGO_ROOT

Mount system directories

Mounts for chroot environment

mount -o bind /proc $MEEGO_ROOT/proc
mount -o bind /sys  $MEEGO_ROOT/sys
mount -o bind /dev  $MEEGO_ROOT/dev
mount -o bind /dev/pts $MEEGO_ROOT/dev/pts

mount -o bind /var/lib/dbus/ $MEEGO_ROOT/var/lib/dbus/
mount -o bind /usr/share/fonts $MEEGO_ROOT/usr/share/fonts

mount -t tmpfs tmpfs  $MEEGO_ROOT/tmp
mount -t tmpfs tmpfs  $MEEGO_ROOT/var/run

Setup

Copy resolv.conf for networking

cp /etc/resolv.conf $MEEGO_ROOT/etc/resolv.conf

Start your engines

Starting chroot

cd $MEEGO_ROOT
chroot $MEEGO_ROOT /bin/bash

Cleanup

Don't forget to unmount all the system directories that were mounted inside chroot. You might have to setup MEEGO_ROOT again after leaving chroot.

cd ~
umount $MEEGO_ROOT/proc
umount $MEEGO_ROOT/sys
umount $MEEGO_ROOT/dev
umount $MEEGO_ROOT/dev/pts

umount $MEEGO_ROOT/var/lib/dbus/
umount $MEEGO_ROOT/usr/share/fonts

umount $MEEGO_ROOT/tmp
umount $MEEGO_ROOT/var/run

umount $MEEGO_ROOT
Personal tools