Setting up a chroot to make packages (Slackware 15)
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Setting up a chroot to make packages (Slackware 15)
To build clean packages using sbopkg, I've made a chroot. Install into a folder, then mount -B /dev, /dev/pts, /sys, /proc and finally chroot in the folder.
It seems to work fine at first glance, but all sort of programs fail in weird ways:
Code:
# vi /etc/hosts
DB_CREATE must be specified to create databases.
DB_CREATE must be specified to create databases.
DB_CREATE must be specified to create databases.
DB_CREATE must be specified to create databases.
ex/vi: Error: /var/tmp/vi.recover: Value too large for defined data type
ex/vi: Modifications not recoverable if the session fails
ex/vi: Error: /etc/hosts: No such file or directory
ex/vi: Error: /var/tmp/vi.recover: Value too large for defined data type
ex/vi: Modifications not recoverable if the session fails
ex/vi: Error: /tmp/vi.B270ls: No such file or directory
"vim" or "elvis" work fine, though. Weird...
Then it gets weirder:
Code:
# slackpkg update
No 'which' command found, please install it if you want to
use slackpkg.
"which" is there, though, but then it gets crazy:
Code:
# which ls
/usr/bin/ls
# which which
which: no which in (/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/libexec/kf5:/usr/lib/qt5/bin)
What's really incredibly bizarre is that "strace which which" shows which finding itself in /bin and /usr/bin, but falling through... What the heck is happening?
I recommend you check the file permissions. It could be mixed up file permissions. For example, what is the permissions of which? Also how strace shows which fails to find which?
I recommend you check the file permissions. It could be mixed up file permissions. For example, what is the permissions of which? Also how strace shows which fails to find which?
I've thought about that, the permissions are fine:
The size and timestamp of those 'which' binaries are matching with a Slackware 15.0 32bit installation, right? I.e. your Slackware OS as well as the chroot installation are both 32bit?
What is the exact command you are using to enter your chroot?
The size and timestamp of those 'which' binaries are matching with a Slackware 15.0 32bit installation, right? I.e. your Slackware OS as well as the chroot installation are both 32bit?
Yep, both 32 bits.
Quote:
What is the exact command you are using to enter your chroot?
Simple:
Code:
su
cd chroot/
for F in proc sys dev dev/pts; do mount -B /$F $F ; done
chroot .
su -
I use exactly the same method with a Debian chroot on a Debian machine and it works perfectly fine. The "su -" in the end is the best way to set up a proper env.
Why cd to chroot and then bind mount proc sys and dev? Doesn't that mean you are not mounting the system's proc, sys and dev in the chroot?
Absolutely not, it works fine. That makes no difference at all to use absolute or relative mount points. I've made the test, and it's exactly the same.
Your chroot directory, it is perhaps not an actual directory in your Slackware filesystem but a loop-mounted container, or perhaps a network-mounted filesystem?
Your chroot directory, it is perhaps not an actual directory in your Slackware filesystem but a loop-mounted container, or perhaps a network-mounted filesystem?
No, that's the most ordinary folder in an XFS filesystem.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.