HOWTO_startx_in_a_chroot
| Installation • Kernel & Hardware • Networks • Portage • Software • System • X Server • Gaming • Non-x86 • Emulators • Misc |
Contents |
Introduction
To test packages as Archtester you need to test them on a stable install. I guess that most of you have lots of unstable packages installed on your machine. For example the newest kde packages. So if you want to test you'll need a stable environment. You can use a chroot for this. In this article i'll describe (basicly) how to set up a chroot and also how you can run X in this chroot environment.
Setting up the chroot
I'll be very short about setting up chroot. With a litle bit googeling you'll find lots of info about chroot. Ok the steps are as follow:
- Create a directory for your chroot (for example: /mnt/chroot)
- Grab a stage tarbal and extract this in your chroot
- Now before y'all go login in, you'll want to bind some directories, here's what you need. Substitute /chroot with the location of your chroot directory:
mount --bind /proc /chroot/proc (you need this for system stats) mount --bind /dev /chroot/dev (need to access device nodes) mount -t devpts none /chroot/dev/pts (don't forget this one or else X won't start in your chrooted environment!) mount --bind /usr/portage /chroot/usr/portage (otherwise you'll do needless multiple emerge --sync's)
mount --bind /usr/src/linux /chroot/usr/src/linux (otherwise kernel based stuff will die on compile) mount --bind /lib/modules /chroot/lib/modules (module installations) mount --bind /sys /chroot/sys (for more system info) mount --bind /tmp /chroot/tmp (for access with base X ie. sharing 1 X server)
Also copy your resolv.conf if it contains nameserver info:
# cp -L /etc/resolv.conf /mnt/chroot/etc/resolv.conf
Entering the chroot
Enter the chroot with:
# chroot /mnt/chroot /bin/bash # source /etc/profile && env-update
first off, you need to package.provide a few things. Go ahead and
echo "sys-kernel/kernel-sources-version" >> /etc/make.profile/package.provided
and if you have an nvidia
echo "media-video/nvidia-kernel-version" >> /etc/make.profile/package.provided echo "app-admin/eselect ~x86" >> /etc/portage/package.keywords echo "app-admin/eselect-opengl ~x86" >> /etc/portage/package.keywords echo "media-video/nvidia-glx ~x86" >> /etc/portage/package.keywords
to get sync'ed up with your base system drivers. Now then you can emerge some stuff. Don't forget the post setup stuff in the handbook. Instead of rebooting, exit the chroot. Now it's time to set things up.
Configure mainsystem
Sometimes it's wise to copy over things like xorg.conf or whatever you feel like not making all over again.
# cp /etc/X11/xorg.conf /mnt/chroot/etc/X11/xorg.conf
Now you need to change your /etc/inittab file. Open it with your favorite editor and search for the following lines:
c1:2345:respawn:/sbin/agetty 38400 tty1 linux c2:2345:respawn:/sbin/agetty 38400 tty2 linux
Then edit the file something like this:
c1:2345:respawn:/sbin/agetty 38400 tty1 linux c2:2345:respawn:/sbin/agetty 38400 tty2 linux c3:2345:respawn:/bin/chroot /mnt/chroot /sbin/agetty 38400 tty3 linux c4:2345:respawn:/bin/chroot /mnt/chroot /sbin/agetty 38400 tty4 linux
Of course you are free to use other tty's. After this you need to reload inittab. This is done with the command:
# telinit Q
You're now ready to start X in your chrooted environment! Enter your chroot as mentioned above. You can now start X with the command:
# startx -- :1
The :1 is to start it on a different desktop to avoid confusion. Normaly X is started on desktop 0 and that one is most probebly used for your main istallation.
Credits
All credits go to Chris White. He put this information first on his blog, where I found it. I also thank him for his gentle help. For questions you can contact me at bbroeksema AT bluebottle DOT com.
Created by NickStallman.net, Luxury Homes Australia
Real estate agents should list their apartments, townhouses and units in Australia.
