You are not logged in.
Hi, I can't figure this out on my own so I had to ask.
The scenario is I have an arch64 and I would like to have a 32bit chroot, the problem is my /opt is in a different partition so i can't do a hardlink of important file in /etc. I tried a "mount --bind" of 64bit /etc inside the chroot folder named /etc64 (or /opt/arch32/etc64 when not chrooted) and symlinking /etc64 (the important files only not the whole content) to 32bit /etc - this is done during my modified arch32 daemon startup (the modifications are just "mount --bind" of /etc to /opt/arch32/etc64, and symlinking of important /etc files). The problem is the symlink is done during the main root so when you try chrooting to the /opt/arch32 the symlink is gone - at least that is what happened in my case.
I thought about restructuring my partitions since i'm on a lvm (merging /opt in /) but if there's a better, more elegant way to do this i'll probably try it out first.
OT:
Can jackbridge work with a chroot32 or do I have to go multilib?
Last edited by Jerry (2009-08-17 04:18:55)
Offline
The solution you attempted should work, but the symlinks need to be created with relative paths.
mount -o bind /etc /opt/arch32/etc64
cd /opt/arch32/etc
ln -s ../etc64/<important>
where <important> is the file in etc you want to have a link to should do the trick. Note that I have not tested this since I don't have a second system to fool around with chrooting to, but as far as I know this should work. it won't work with an absolute path based on the main root.
hope this helps.
Offline
Take a look at bindfs too. There's a package in the AUR.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Hi i'm here to give a rather late update on this situation... I went 32bit last time.
Using Zerathidune's tip and a modified arch32 daemon got me a working 32bit chroot but with symlinks rather than hardlinks. I'm able to launch 32bit applications inside the chrooted 32bit installation but only if i'm using the terminal emulator that I used for chrooting.
Schroot chugs out this error:
cp: not writing through dangling symlink `/var/lib/schroot/mount/Arch32-5ecb5faf-5106-4d05-b21d-2bb49fe66a03/etc/group'
E: Arch32-5ecb5faf-5106-4d05-b21d-2bb49fe66a03: Chroot setup failed: stage=setup-start
Now I haven't tried out bindfs as Xyne suggested but I think the problem is because schroot can't follow or change a symbolic link file? I haven't edited anything in the schroot.conf and have also checked it if it chroots to /opt/arch32 and it does.
Here's my arch32 daemon btw:
case $1 in
start)
stat_busy "Starting Arch32 chroot"
mount --bind /proc /opt/arch32/proc
mount --bind /proc/bus/usb /opt/arch32/proc/bus/usb
mount --bind /dev /opt/arch32/dev
mount --bind /dev/pts /opt/arch32/dev/pts
mount --bind /dev/shm /opt/arch32/dev/shm
mount --bind /sys /opt/arch32/sys
mount --bind /tmp /opt/arch32/tmp
mount --bind /home /opt/arch32/home
mount --bind /etc /opt/arch32/etc64
cd /opt/arch32/etc
ln -sf ../etc64/passwd* .
ln -sf ../etc64/shadow* .
ln -sf ../etc64/group* .
ln -sf ../etc64/rc.conf .
ln -sf ../etc64/resolv.conf .
ln -sf ../etc64/localtime .
ln -sf ../etc64/locale.gen .
ln -sf ../etc64/profile.d/locale.sh profile.d
add_daemon arch32
stat_done
;;
stop)
stat_busy "Stopping Arch32 chroot"
umount /opt/arch32/proc/bus/usb
umount /opt/arch32/proc
umount /opt/arch32/dev/pts
umount /opt/arch32/dev/shm
umount /opt/arch32/dev
umount /opt/arch32/sys
umount /opt/arch32/tmp
umount /opt/arch32/home
umount /opt/arch32/etc64
rm /opt/arch32/etc/passwd
rm /opt/arch32/etc/shadow
rm /opt/arch32/etc/group
rm /opt/arch32/etc/rc.conf
rm /opt/arch32/etc/resolv.conf
rm /opt/arch32/etc/localtime
rm /opt/arch32/etc/locale.gen
rm /opt/arch32/etc/profile.d/locale.sh
rm_daemon arch32
stat_done
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0
Last edited by Jerry (2009-10-10 02:14:16)
Offline