Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Using apt to set up a "chroot"
Using apt to set up a "chroot"
I'm trying to set up a cross-build environment as an addon to another cross-build environment. I've got development packages in an apt repository and I'd like to use apt to manage the cross-build directory to hold the "installed" packages. I want to use /usr from the system for the dpkg & apt executables, but /var and /etc in the cross-build directory to hold the configuration and the metadata for apt/dpkg.
I can run apt-get with "-o Dir=cross-build-directory" and that works mostly, but is not honoured for accessing /var/lib/dpkg/lock.
I can use "-o Debug::NoLocking=True" to get around the lock problem.
I can see cross-build-directory/etc/apt is being used for the sources.list.d, but not for the apt.conf.d, and so it is picking up my system configuration from /etc/apt/apt.conf.d. How do I get around this? I tried "-o Dir::Etc::parts=cross-build-directory/etc/apt/apt.conf.d" but apt-get is still accessing the system /etc/apt/apt.conf.d
I don't want to use RootDir, as that will affect things like /usr/lib/apt/methods/http.
I can run apt-get with "-o Dir=cross-build-directory" and that works mostly, but is not honoured for accessing /var/lib/dpkg/lock.
I can use "-o Debug::NoLocking=True" to get around the lock problem.
I can see cross-build-directory/etc/apt is being used for the sources.list.d, but not for the apt.conf.d, and so it is picking up my system configuration from /etc/apt/apt.conf.d. How do I get around this? I tried "-o Dir::Etc::parts=cross-build-directory/etc/apt/apt.conf.d" but apt-get is still accessing the system /etc/apt/apt.conf.d
I don't want to use RootDir, as that will affect things like /usr/lib/apt/methods/http.
Re: Using apt to set up a "chroot"
Why not try
chroot /path/to/chroot
apt-get .....
That works perfectly.
chroot /path/to/chroot
apt-get .....
That works perfectly.
Compressed Air Energy Storage, Entropy and Efficiency
http://saurorja.org/2012/06/18/compress ... fficiency/
http://saurorja.org/2012/06/18/compress ... fficiency/
Re: Using apt to set up a "chroot"
Can I set up a chroot without root? Can I set up a chroot without libc and stuff? (libc and stuff is already in the original cross-build environment I don't want to modify in place.)
Re: Using apt to set up a "chroot"
You need privileged access for chroot, CAP_SYS_CHROOT as per "man 2 chroot"
If you application is a statically linked one, then you dont need libc etc. for chroot.
If you application is a statically linked one, then you dont need libc etc. for chroot.
Compressed Air Energy Storage, Entropy and Efficiency
http://saurorja.org/2012/06/18/compress ... fficiency/
http://saurorja.org/2012/06/18/compress ... fficiency/
Re: Using apt to set up a "chroot"
so rather than requiring root for my purposes, i set up this hacky script: http://runswift.cse.unsw.edu.au/opennao/apt-get-nao-dev
hopefully someone else will also find it useful.
hopefully someone else will also find it useful.
Re: Using apt to set up a "chroot"
I'm not sure edit: there are no debian production tools for rooting a box..... right!
Last edited by llivv on 2011-01-05 16:42, edited 2 times in total.
In memory of Ian Ashley Murdock (1973 - 2015) founder of the Debian project.
Re: Using apt to set up a "chroot"
I've set up an schroot before on my own machine, but I needed root to set it up. I'll look again.
chroot(2) wrote: Only a privileged process (Linux: one with the CAP_SYS_CHROOT capabil‐
ity) may call chroot().
Re: Using apt to set up a "chroot"
So it looks like I need root to at least set up access.schroot(1) wrote: If the user is not an allowed user, or a member of the allowed groups
(or if changing to root, the allowed root users or allowed root groups)
for the specified chroot(s), permission will be immediately denied. If
switching users, and the user running the command has access, the user
will be required to authenticate themselves using the credentials of
the user being switched to.
Re: Using apt to set up a "chroot"
dchroot(1) wrote: · dchroot provides a restricted subset of the functionality imple‐
mented by schroot, but is still schroot underneath. Thus dch‐
root is still subject to schroot security checking, including
PAM authentication and authorisation, and session management,
for example, and hence may behave slightly differently to older
dchroot versions in some circumstances.
Re: Using apt to set up a "chroot"
edit
rrrrrrrjayen wrote:I've set up an schroot before on my own machine, but I needed root to set it up.
Last edited by llivv on 2011-01-05 16:43, edited 3 times in total.
In memory of Ian Ashley Murdock (1973 - 2015) founder of the Debian project.
Re: Using apt to set up a "chroot"
I'm trying to root a cross-build environment...
And now I've discovered apt-cross. I wonder if it works as well as my apt-get wrapper...
And now I've discovered apt-cross. I wonder if it works as well as my apt-get wrapper...
Re: Using apt to set up a "chroot"
I never tried apt-cross as the apt-get wrapper was working fine for the ~10 debian/ubuntu users using it to cross-build for opennao. http://runswift.cse.unsw.edu.au/opennao/apt-get-nao-dev
And since opennao is planning to move from apt to portage, it's unlikely I'll ever try apt-cross.
And since opennao is planning to move from apt to portage, it's unlikely I'll ever try apt-cross.