[opensuse] chroot questions
Back in the day, I used to maintain a Gentoo tree in a directory in a different Linux distro (possibly Caldera, or an early SUSE). Then, when I wanted to build software in the Gentoo tree using Gentoo tools and all, I would: cd /where/one/finds/gentoo-20XX.1 export g=`pwd` mount -t proc proc $g/proc cp -p /$g/etc/resolv.conf $g/etc/resolv.conf.keep cp /etc/resolv.conf $g/etc/resolv.conf chroot $g /bin/bash env-update source /etc/profile Mainly, I copied the name resolution stuff, mounted /proc in the gentoo tree, and updated the environment. Then, I could pretty much act as though I had booted Gentoo. It worked great. My question is if I could go do something similar today with openSUSE, but with some other version of openSUSE in the 'foreign' tree. I think my biggest concern is /run and /var/run. And which versions would play nice together. I am primarily compiling things in this environment. No kernel stuff. It is a bit like cross compiling, but without setting up cross compilers. Just a copy of the target environment. I know many people suggest just using a VM for this. It may result in that. But I just have to try the chroot method as it is much easier to access from make files and such places. Just curious if there are some show stoppers that would render my time trying this wasted. I finally have the disk space I need to do these foolish things... Yours sincerely, Roger Oberholtzer Ramböll RST / Systems Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 roger.oberholtzer@ramboll.se ________________________________________ Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden www.rambollrst.se -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday, 2013-04-08 at 16:01 +0200, Roger Oberholtzer wrote:
My question is if I could go do something similar today with openSUSE, but with some other version of openSUSE in the 'foreign' tree. I think my biggest concern is /run and /var/run. And which versions would play nice together. I am primarily compiling things in this environment. No kernel stuff. It is a bit like cross compiling, but without setting up cross compilers. Just a copy of the target environment.
Have a look at these: View this thread: <http://forums.opensuse.org/showthread.php?t=481134> My chrooting script View this thread: <http://forums.opensuse.org/showthread.php?t=485205> System recovery with chroot and systemd View this thread: <http://forums.opensuse.org/showthread.php?t=485249> How to: Chroot, How to: OpenStack Quickstart - -- Cheers, Carlos E. R. (from 12.1 x86_64 "Asparagus" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) iEYEARECAAYFAlFi0EAACgkQtTMYHG2NR9XO9gCfdrfRIrvhBXrd9JWUqzN0zxWg NREAnRtplJI1G0B5ZaeF+jYUrfMmOyzA =fpbA -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Mon, 2013-04-08 at 16:12 +0200, Carlos E. R. wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Monday, 2013-04-08 at 16:01 +0200, Roger Oberholtzer wrote:
My question is if I could go do something similar today with openSUSE, but with some other version of openSUSE in the 'foreign' tree. I think my biggest concern is /run and /var/run. And which versions would play nice together. I am primarily compiling things in this environment. No kernel stuff. It is a bit like cross compiling, but without setting up cross compilers. Just a copy of the target environment.
Have a look at these:
View this thread: <http://forums.opensuse.org/showthread.php?t=481134> My chrooting script
View this thread: <http://forums.opensuse.org/showthread.php?t=485205> System recovery with chroot and systemd
View this thread: <http://forums.opensuse.org/showthread.php?t=485249> How to: Chroot, How to: OpenStack Quickstart
Seems the bottom line is that my mount of /proc would be best done as # mount --bind /proc $g/proc/ and I should add: # mount --bind /sys $g/openstack/sys/ And /run and /var/run are not missed? Yours sincerely, Roger Oberholtzer Ramböll RST / Systems Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 roger.oberholtzer@ramboll.se ________________________________________ Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden www.rambollrst.se -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Mon, Apr 8, 2013 at 10:01 AM, Roger Oberholtzer <roger@opq.se> wrote:
Back in the day, I used to maintain a Gentoo tree in a directory in a different Linux distro (possibly Caldera, or an early SUSE). Then, when I wanted to build software in the Gentoo tree using Gentoo tools and all, I would:
cd /where/one/finds/gentoo-20XX.1 export g=`pwd`
mount -t proc proc $g/proc
cp -p /$g/etc/resolv.conf $g/etc/resolv.conf.keep cp /etc/resolv.conf $g/etc/resolv.conf
chroot $g /bin/bash
env-update
source /etc/profile
Mainly, I copied the name resolution stuff, mounted /proc in the gentoo tree, and updated the environment. Then, I could pretty much act as though I had booted Gentoo. It worked great.
My question is if I could go do something similar today with openSUSE, but with some other version of openSUSE in the 'foreign' tree. I think my biggest concern is /run and /var/run. And which versions would play nice together. I am primarily compiling things in this environment. No kernel stuff. It is a bit like cross compiling, but without setting up cross compilers. Just a copy of the target environment.
I know many people suggest just using a VM for this. It may result in that. But I just have to try the chroot method as it is much easier to access from make files and such places. Just curious if there are some show stoppers that would render my time trying this wasted.
I finally have the disk space I need to do these foolish things...
Yours sincerely,
Roger Oberholtzer
Roger, You should get up to speed on osc. As a dev, it is one of the crown jewels of opensuse. In general it works best if tied into OBS (opensuse build service), but it works standalone as well. I mostly use it in conjunction with OBS. Once you have the osc setup, you can do: osc build => build the current package for factory in a chroot environment osc build openSUSE_12.3 => build current package for opensuse 12.3 If you are working with OBS, when you build for a new distro for the first time, you will see a lot of packages pulled down to a local osc specific repo, but from then on they should just come from the local osc repo. Working with OSC/OBS so that you only pull down what you actually need to build, not the full distro is much more space efficient than I think you are assuming. Here's my to main working sub-folders for osc:
sudo du -sh build-root/ osbuild-packagecache/ 442M build-root/ 347M osbuild-packagecache/
"osc dists" will tell you the set of distros that osc is attempting to support:
osc dists distribution project repository reponame
-------- openSUSE Factory openSUSE:Factory snapshot openSUSE_Factory openSUSE 12.3 openSUSE:12.3 standard openSUSE_12.3 openSUSE 12.2 openSUSE:12.2 standard openSUSE_12.2 openSUSE 12.1 openSUSE:12.1 standard openSUSE_12.1 openSUSE Tumbleweed openSUSE:Tumbleweed standard openSUSE_Tumbleweed SUSE SLE-11 SP 2 SUSE:SLE-11:SP2 standard SLE_11_SP2 SUSE SLE-11 SP 1 SUSE:SLE-11:SP1 standard SLE_11_SP1 SUSE SLE-11 SUSE:SLE-11 standard SLE_11 SUSE SLE-10 SUSE:SLE-10:SDK standard SLE_10_SDK Debian 6.0 Debian:6.0 standard Debian_6.0 Fedora 18 Fedora:18 standard Fedora_18 Fedora 17 Fedora:17 standard Fedora_17 RedHat RHEL-6 RedHat:RHEL-6 standard RedHat_RHEL-6 RedHat RHEL-5 RedHat:RHEL-5 standard RedHat_RHEL-5 RedHat RHEL-4 RedHat:RHEL-4 standard RedHat_RHEL-4 CentOS CentOS-6 CentOS:CentOS-6 standard CentOS_CentOS-6 CentOS CentOS-5 CentOS:CentOS-5 standard CentOS_CentOS-5 Mandriva 2011 Mandriva:2011 standard Mandriva_2011 Mandriva 2010.1 Mandriva:2010.1 standard Mandriva_2010.1 Mandriva 2010 Mandriva:2010 standard Mandriva_2010 Mandriva 2009.1 Mandriva:2009.1 standard Mandriva_2009.1 Ubuntu 12.10 Ubuntu:12.10 standard xUbuntu_12.10 Ubuntu 12.04 Ubuntu:12.04 standard xUbuntu_12.04 Ubuntu 11.10 Ubuntu:11.10 standard xUbuntu_11.10 Ubuntu 11.04 Ubuntu:11.04 standard xUbuntu_11.04 Ubuntu 10.04 Ubuntu:10.04 standard xUbuntu_10.04 Greg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Mon, 2013-04-08 at 10:28 -0400, Greg Freemyer wrote:
You should get up to speed on osc. As a dev, it is one of the crown jewels of opensuse. In general it works best if tied into OBS (opensuse build service), but it works standalone as well. I mostly use it in conjunction with OBS.
I already maintain kernel drivers in OBJ just so I don't have to deal with that locally. My main problems with using OBS are (1) We use many 3rd party tools that are not in RPMs or even open source. How to get those in to a local OBS seems iffy. (2) We do not package our source or results in RPMs. Source, when not present, comes from an SVN repository. Also, as we do software development more than software packaging, compile/test is more the norm than compile/package/install/test. I do like the idea of OBS for many things. Not so sure about it as a development environment. Is anyone else doing that? I would love to hear how that works. -- Yours sincerely, Roger Oberholtzer Ramböll RST / Systems Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 roger.oberholtzer@ramboll.se ________________________________________ Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden www.rambollrst.se -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Mon, Apr 8, 2013 at 11:29 AM, Roger Oberholtzer <roger@opq.se> wrote:
On Mon, 2013-04-08 at 10:28 -0400, Greg Freemyer wrote:
You should get up to speed on osc. As a dev, it is one of the crown jewels of opensuse. In general it works best if tied into OBS (opensuse build service), but it works standalone as well. I mostly use it in conjunction with OBS.
I already maintain kernel drivers in OBJ just so I don't have to deal with that locally. My main problems with using OBS are (1) We use many 3rd party tools that are not in RPMs or even open source. How to get those in to a local OBS seems iffy. (2) We do not package our source or results in RPMs. Source, when not present, comes from an SVN repository.
Also, as we do software development more than software packaging, compile/test is more the norm than compile/package/install/test.
I do like the idea of OBS for many things. Not so sure about it as a development environment. Is anyone else doing that? I would love to hear how that works.
Roger, I was highlighting your question about chroot's working, and yes they are working with all of the distros in my first email. As to using OBS as a dev env I don't remember details, but a lot of companies setup a private OBS build farm so they can control how it works in detail. You will have better luck asking on the opensuse-buildservice list than here. You may be able to turn your new computer into a self-contained internal OBS server! Greg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 04/08/2013 11:01 AM, Roger Oberholtzer wrote:
Back in the day, I used to maintain a Gentoo tree in a directory in a different Linux distro (possibly Caldera, or an early SUSE). Then, when I wanted to build software in the Gentoo tree using Gentoo tools and all, I would:
cd /where/one/finds/gentoo-20XX.1 export g=`pwd`
mount -t proc proc $g/proc
cp -p /$g/etc/resolv.conf $g/etc/resolv.conf.keep cp /etc/resolv.conf $g/etc/resolv.conf
chroot $g /bin/bash
env-update
source /etc/profile
Mainly, I copied the name resolution stuff, mounted /proc in the gentoo tree, and updated the environment. Then, I could pretty much act as though I had booted Gentoo. It worked great.
My question is if I could go do something similar today with openSUSE, but with some other version of openSUSE in the 'foreign' tree. I think
read systemd-nspawn(1) it is designed exactly for this use-case. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday, 2013-04-08 at 16:15 -0300, Cristian Rodríguez wrote:
read systemd-nspawn(1) it is designed exactly for this use-case.
It is in at least one of the links I posted, IIRC. :-) - -- Cheers, Carlos E. R. (from 12.1 x86_64 "Asparagus" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) iEYEARECAAYFAlFjLWkACgkQtTMYHG2NR9VfpwCfZb3hZjYb/mD5GoXMZ8OxNByo r/kAn0ECeXIkUL3LuR9tgLtC1Da1S/Of =KtB6 -----END PGP SIGNATURE-----
On Mon, 2013-04-08 at 16:15 -0300, Cristian Rodríguez wrote:
systemd-nspawn
Interesting. I will have to see if it works with my trees. Yours sincerely, Roger Oberholtzer Ramböll RST / Systems Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 roger.oberholtzer@ramboll.se ________________________________________ Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden www.rambollrst.se -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (4)
-
Carlos E. R.
-
Cristian Rodríguez
-
Greg Freemyer
-
Roger Oberholtzer