Project Talk:AMD64/32-bit Chroot Guide

From Gentoo Wiki
Jump to:navigation Jump to:search
Note
Before creating a discussion or leaving a comment, please read about using talk pages. To create a new discussion, click here. Comments on an existing discussion should be signed using ~~~~:
A comment [[User:Larry|Larry]] 13:52, 13 May 2024 (UTC)
: A reply [[User:Sally|Sally]] 12:21, 18 June 2024 (UTC)
:: Your reply ~~~~

Running X (xorg) in the 32-bit environment

Talk status
This discussion is done as of 2024-04-01.

It is possible (for example to test an X window manager) to run X (xorg) directly in the 32-bit environment. To have mouse and keyboard working udev must be mounted:

root #mount --bind /run/udev /mnt/gentoo32/run/udev

--Krejvl (talk) 20:47, 30 April 2022 (UTC)

I'm closing this since it's stale. Feel free to re-open if you think this would still be a valuable addition to the page. Waldo Lemmer (talk) 07:23, 1 April 2024 (UTC)

Update Gentoo repo path

Talk status
This discussion needs help.
Tip: To get this fixed sooner, use {{Proposal}}.

The Gentoo repo path is not necessarily at /usr/portage, this needs to be updated in the guide. See /var/db/repos/gentoo.

--Krejvl (talk) 20:42, 30 April 2022 (UTC)

Warning about 32-bit emulations

Talk status
This discussion needs help.
Tip: To get this fixed sooner, use {{Proposal}}.

Most users should probably be aware, but I got caught out recently with this, that you need to have

KERNEL Enabling 32-bit emulation
Executable file formats / Emulations  --->
  [*] IA32 Emulation

enabled to avoid the error message

Exec format error. when you try to

root #linux32 chroot /mnt/gentoo32 /bin/bash

-- veremit (talk) 22:51, 24 August 2020 (UTC)

Init script update

Talk status
This discussion is done.

Just set up my own 32 bit chroot using this guide. Many thanks to Luis Medinas!

I replaced the original OpenRC script with a version containing a little less boilerplate. Additionally, I removed the lines having to do with the deprecated usbfs filesystem:

FILE /etc/init.d/gentoo32Creating a 32-bit chroot switcher
#!/sbin/openrc-run

chroot_dir=/mnt/gentoo32

depend() {
   need localmount
   need bootmisc
}

start() {
    ebegin "Mounting 32-bit chroot directories"
    mount -o bind /dev ${chroot_dir}/dev >/dev/null
    mount -o bind /dev/pts ${chroot_dir}/dev/pts >/dev/null &
    mount -o bind /dev/shm ${chroot_dir}/dev/shm >/dev/null &
    mount -o bind /proc ${chroot_dir}/proc >/dev/null
    mount -o bind /sys ${chroot_dir}/sys >/dev/null &
    mount -o bind /tmp ${chroot_dir}/tmp >/dev/null &
    mount -o bind /usr/portage ${chroot_dir}/usr/portage/ >/dev/null &
    eend $? "An error occured while attempting to mount 32bit chroot directories"
    ebegin "Copying 32bit chroot files"
    cp -pf /etc/resolv.conf ${chroot_dir}/etc >/dev/null &
    cp -pf /etc/passwd ${chroot_dir}/etc >/dev/null &
    cp -pf /etc/shadow ${chroot_dir}/etc >/dev/null &
    cp -pf /etc/group ${chroot_dir}/etc >/dev/null &
    cp -pf /etc/gshadow ${chroot_dir}/etc >/dev/null &
    cp -pf /etc/hosts ${chroot_dir}/etc > /dev/null &
    cp -Ppf /etc/localtime ${chroot_dir}/etc >/dev/null &
    eend $? "An error occured while attempting to copy 32 bits chroot files."
}

stop() {
    ebegin "Unmounting 32-bit chroot directories"
    umount -f ${chroot_dir}/dev/pts >/dev/null
    umount -f ${chroot_dir}/dev/shm >/dev/null
    umount -f ${chroot_dir}/dev >/dev/null &
    umount -f ${chroot_dir}/proc >/dev/null &
    umount -f ${chroot_dir}/sys >/dev/null &
    umount -f ${chroot_dir}/tmp >/dev/null &
    umount -f ${chroot_dir}/usr/portage/ >/dev/null &
    eend $? "An error occured while attempting to unmount 32bit chroot directories"
}

I think it would be nice to change the script in the article as well. — The preceding unsigned comment was added by Iriomotejin (talkcontribs) 21:54, September 8, 2016‎

I updated the script and made a few other changes including the point of this change. --Grknight (talk) 00:41, 8 November 2018 (UTC)