|
From: George V. <vla...@gm...> - 2014-12-26 14:08:41
|
Merry Christmas everyone! I wish everyone the best, may you experience lots of love, joy and laughter with your loved ones this Christmas! And here's a very small thing I worked on which will probably help packagers, but may also be of use for regular users too... I was thinking that we should have an easy way to install and use Salix in a chroot. So I came up with a small script which you can now install in Salix 14.1 with: sudo spi -i salix-chroot-install after that, you will be able to install salix anywhere (for example in a directory in your /home) with it. You'll need to specify a salix iso and the destination directory, like: sudo salix-chroot-install -d /destination/dir -i /path/to/salix.iso you get the usual choice of Full/Basic/Core and nothing much more than that. Once it finishes, you'll have an almost complete salix installation under that destination dir. You can now use chroot to access that installation. A nice tool to do that the easy way is schroot, which is available through SBo, so: sudo spi -i schroot once it is installed, you'll need to inform schroot about your salix-in-a-chroot installation. You can do that by creating a file with contents similar to these in your /etc/schroot/chroot.d/ directory: [salix-14.1] description=Salix 14.1 32-bit directory=/home/george/salix/chroot/salix-14.1 users=george root-users=george personality=linux32 type=directory of course you'll need to swap the username with yours and adjust the directory. For 32bit chroots in a 64bit system, you'll need the personality line. For 64bit chroots in 64bit systems or 32bit chroots in 32bit systems, you'll need to remove it. After you set up your chroots this way, you can list them with: schroot -l note that you don't need sudo powers to use schroot and access the chroots. You can "log in" a chroot with: schroot -c name_of_chroot which for the above settings example translates to: schroot -c salix-14.1 and from then on, you're in a completely isolated environment, away from your day-to-day system, which you can use to build and test packages etc. You can use it for building any type of package this way, the only exception being kernel related packages (which can be done, but need extra effort). The default settings include using the same home dir in the chroot as you're normally using. You can even run GUI apps in the chroot. So you can also use this to run 32bit apps in a 64bit system that you don't want to "contaminate" with multilib. You'll need to add the -p switch for that: schroot -p -c salix-14.1 and if you're installing a 32bit chroot in a 64bit host and want to run GUI apps, you'll also need to run: sudo update-all or fonts will come up as garbage. Well, that's it for the most part. You can examine schroot options by taking a look in the man pages that come with it. This is a (very) lightweight alternative to docker, linux containers and similar stuff, but for building/testing packages and running apps in the chroot it covers all that's needed. It's like virtualization without the virtualization part. :D I'll probably write a wiki page for this one of these days... Hope this is of some use. Once again, Merry Christmas everyone! George |