Creating a Chroot (mkchakraroot)

LiveCD creation is a very messy process, requiring lots of programs to be installed and configuration to be made. Also, these configurations could be incompatible with the host system! Therefore, creating a chroot jail is quite useful. A chroot simply changes the apparent root directory for the programs inside it, preventing them from messing with the real filesystem.

Note: If you are on a 64-bit system and want to build a 32-bit ISO, put linux32 before the command to install a 32-bit chroot. Otherwise, your chroot will only be able to make a 64-bit ISO.

Chakra-based distros

If you have a Chakra-based system (Cherimoya is one of them), just use these commands to create your chroot:

pacman -S base base-devel nano vi vim rsync pacman file wget
mkchakraroot /tmp/chroot base

Then, use this command anywhere to enter the chroot:

mkchakraroot -r bash /tmp/chroot

Other Linux distros

If you don't have a Chakra based system you first have to install your basic development packages along with wget and git before proceeding.

To create a chroot using the source code of Chakra-Live, use these commands:

 git clone git://gitorious.org/chakra/chakra-live.git
 cd chakra-live/mkchakraroot
 ./mkchakraroot /tmp/chroot base

Make sure you are in that same directory, and you can use this command to enter the chroot at anytime:

./mkchakraroot -r bash /tmp/chroot

Post-install Configuration

The chroot does not have any uncommented mirrors in /etc/pacman.d/mirrorlist, so you'll have to set them manually each time.

First, open /etc/pacman.d/mirrorlist, remove the "#" from the mirror server you want, and replace <arch> with either "i686" or "x86_64", depending on your chroot's architecture. The file should then look something like this:

File: /etc/pacman.d/mirrorlist
<pre<noinclude></noinclude> style="white-space: pre-wrap; overflow-x: auto; padding: 0.25em; margin: 0 0 0.50em 0; background-color: #F7F7F7; border: thin dashed #7F7F7F; border-top: none">Server = http://mirror.selfnet.de/kdemod/$repo/i686</pre<noinclude></noinclude>>

Get all of Chakra-Live's dependencies with this command:

pacman -S git squashfs-tools syslinux chakra-live cdrkit make nbd mkinitcpio-nfs-utils ccr

After that, open /etc/pacman.conf and add these lines to the bottom of it:

File: /etc/pacman.conf
<pre<noinclude></noinclude> style="white-space: pre-wrap; overflow-x: auto; padding: 0.25em; margin: 0 0 0.50em 0; background-color: #F7F7F7; border: thin dashed #7F7F7F; border-top: none">[cherimoya]

Include = /etc/pacman.d/cherimoya-mirrorlist

[cherimoya-firefox] Include = /etc/pacman.d/cherimoya-mirrorlist

[offense] Include = /etc/pacman.d/cherimoya-mirrorlist

[defense] Include = /etc/pacman.d/cherimoya-mirrorlist</pre<noinclude></noinclude>>

Then, make the file /etc/pacman.d/cherimoya-mirrorlist, and put this in it (replace i686 with x86_64 if building 64-bit...):

File: /etc/pacman.d/cherimoya-mirrorlist
<pre<noinclude></noinclude> style="white-space: pre-wrap; overflow-x: auto; padding: 0.25em; margin: 0 0 0.50em 0; background-color: #F7F7F7; border: thin dashed #7F7F7F; border-top: none">Server = http://dl.dropbox.com/u/22186524/repo/$repo/i686</pre<noinclude></noinclude>>

Finally, get our Chakra-Live profile and update the database at the same time.

pacman -Syy cherimoya-profiles

Your chroot is ready! All steps below this should always be done inside this chroot.

tanasinn.info archive