Re: chrooting in a 32-bit world from a 64-bit kernel+world



On Tuesday 30 September 2008 21:57:22 Olivier Smedts wrote:
On Tue, Sep 30, 2008 at 09:28:39PM +0200, Mel wrote:
On Tuesday 30 September 2008 20:44:02 Olivier Smedts wrote:
So far I've got a working FreeBSD (kernel+world) in a 512MB image I can
dump on a CompactFlash card :
# cd /usr/src
# make buildworld TARGET=i386
# make buildkernel TARGET=i386
# mount /dev/md0a /mnt
(md0 is a 512MB file backed image I bsdlabel'd and newfs'd before)
# make installworld TARGET=i386 DESTDIR=/mnt
# make distribution TARGET=i386 DESTDIR=/mnt
# make installkernel TARGET=i386 DESTDIR=/mnt

The problem is that I can't chroot in this 32-bit world.
Say I want to install the sysutils/screen port in /mnt :

# mkdir /mnt/usr/ports
# mount -t nullfs /usr/ports /mnt/usr/ports
# mount -t devfs devfs /mnt/dev

It's a guess, but at this point:
chroot /mnt /etc/rc.d/ldconfig start

First, thank you for replying so fast !

/etc/rc.d/ldconfig is a /bin/sh script, and I can't run /bin/sh in this
chroot. Same errors.

If that don't work:
/sbin/ldconfig -32 -s -f /mnt/var/run/ld-elf.so.hints /mnt/lib \
/mnt/usr/lib

After that command, the shared libraries are found, but ld refers to /mnt :
# ldconfig -rf /mnt/var/run/ld-elf.so.hints
/mnt/var/run/ld-elf.so.hints:
search directories: /mnt/lib:/mnt/usr/lib
0:-lc.7 => /mnt/lib/libc.so.7
1:-lcrypt.4 => /mnt/lib/libcrypt.so.4
[...]

Right.
cd /mnt
rmdir mnt
ln -s . mnt

The old chroot symlink hack.

And then when trying to chroot, still the same problem. I also can't launch
ldconfig in the jail :
# chroot /mnt/ /sbin/ldconfig -32 -s -f /var/run/ld-elf.so.hints /lib
/usr/lib ELF interpreter /libexec/ld-elf.so.1 not found
Abandon

If you have /rescue there, maybe chroot /mnt /rescue/ldconfig /lib /usr/lib
will help you. I'm pretty sure it's the missing hints causing this.

If all this fails, I'd try running /mnt as a jail.
--
Mel

Problem with today's modular software: they start with the modules
and never get to the software part.
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: chrooting in a 32-bit world from a 64-bit kernel+world
    ... The problem is that I can't chroot in this 32-bit world. ... # mount -t devfs devfs /mnt/dev ... I'd try running /mnt as a jail. ...
    (freebsd-questions)
  • Re: FTP guest access chroot not working
    ... the "root" dir for the chroot is /home/someguy/ftp ... # chroot ftp users ... cannot get out of that jail. ... if you created a symlink inside the jail that points to some real ...
    (comp.unix.sco.misc)
  • Re: /devices jailbreak
    ... however as duplicating device special files does /not/ ... processes in a chroot env will ... duplicates in the chrootjail ultimately lead to the same actual ... But that path will be in the chrootjail, as far as the jailed process ...
    (comp.unix.solaris)
  • Re: /devices jailbreak
    ... processes in a chroot env will ... outside the chroot environment will of course report the device paths ... within the jail as a normal user with the restricted Korn ... directory tree, as expected, except for a couple /devices files ...
    (comp.unix.solaris)
  • Re: /devices jailbreak
    ... however as duplicating device special files does /not/ ... processes in a chroot env will ... duplicates in the chrootjail ultimately lead to the same actual ... But that path will be in the chrootjail, as far as the jailed process ...
    (comp.unix.solaris)