0% found this document useful (0 votes)
136 views

Setting Up Slackware Chroot

This document provides instructions for setting up a Slackware chroot environment. It can be done automatically using a script or manually by creating a folder for the chroot, mounting a Slackware ISO, installing packages to the chroot folder, mounting necessary parts of the filesystem to the chroot, and chrooting into it. Once set up, the chroot can be used to build 32-bit packages on a 64-bit system by executing SlackBuilds after mounting the source folder and setting the architecture.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
136 views

Setting Up Slackware Chroot

This document provides instructions for setting up a Slackware chroot environment. It can be done automatically using a script or manually by creating a folder for the chroot, mounting a Slackware ISO, installing packages to the chroot folder, mounting necessary parts of the filesystem to the chroot, and chrooting into it. Once set up, the chroot can be used to build 32-bit packages on a 64-bit system by executing SlackBuilds after mounting the source folder and setting the architecture.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

2017/05/29 11:02 (BST) 1/3 Setting up a Slackware chroot

Setting up a Slackware chroot

There are multiple reasons why you might want to set up a Slackware chroot:

building 32-bit packages on a 64-bit multilib system


building -stable packages on a -current system
building (and testing) packages for SBo on a clean system

For this guide, we'll create a chroot at /chroot_folder from slackware-14.1-install-dvd.iso.

Obtaining a Slackware installation of your desired architecture

Start with a Slackware installation DVD. Download it from from http://www.slackware.com/getslack/


via torrent.

Installing the packages

Automatically

You can create your chroot and install Slackware into it using the following elegant script:
http://dawoodfall.net/files/scripts/bash/mkchroot

Manually

First, create a folder which will contain the chroot:

mkdir /chroot_folder

Mount the installation ISO:

mount -o loop slackware-14.1-install-dvd.iso /mnt/cdrom


cd /mnt/cdrom

After the ISO has been mounted, the packages (found under the slackware or slackware64 folder) can
be installed to the chroot folder with:

installpkg --root /chroot-folder */*.t?z

Then unmount the ISO:

umount /mnt/cdrom

Mounting the Chroot

SlackDocs - http://docs.slackware.com/
Last
update:
2015/11/09 howtos:general_admin:setting_up_a_slackware_chroot http://docs.slackware.com/howtos:general_admin:setting_up_a_slackware_chroot
12:56
(GMT)

To have the chroot mounted permanently, add the following to your fstab:

/dev chroot_folder/dev none bind,auto 0 0


/proc chroot_folder/proc none bind,auto 0 0
/sys chroot_folder/sys none bind,auto 0 0
/etc/resolv.conf chroot_folder/etc/resolv.conf none bind,auto 0 0

If you don't want to reboot at this point, then you can mount the chroot manually:

mount /chroot_folder

Also, refer to: (volume_mounting).

Chrooting into the Chroot

Now that the chroot is set up, you can chroot into it:

chroot /chroot_folder /bin/bash

Updating packages

After that, you can run slackpkg and update the packages: (configure_a_package_manager).

Exiting

When you're done, exited the chroot by pressing Ctrl+d.

One Use: Building 32-bit Packages

Mounting partitions

I use a chroot to build 32-bit packages on a 64-bit system. I needed to mount the partition which
contained the SlackBuilds for which I wanted to make a package, As my Slackware host mount point
is (in this example) at /slackware_host_mount_point, I used the command:

mount -B /slackware_host_mount_point /chroot_folder

(http://www.thegeekstuff.com/2013/01/mount-umount-examples/)

Then I built the package by executing the Slackbuild as follows:

ARCH=i686 ./my_package.SlackBuild

http://docs.slackware.com/ Printed on 2017/05/29 11:02 (BST)


2017/05/29 11:02 (BST) 3/3 Setting up a Slackware chroot

Links

http://www.linuxquestions.org/questions/slackware-installation-40/install-slackware-to-a-folder-using-c
hroot-825598/#post4093831

Notes

Wrote a small script to automate these steps.

https://raw.githubusercontent.com/aadityabagga/scripts/master/chroot.sh

Sources

* Originally written by Aaditya

howtos

From:
http://docs.slackware.com/ - SlackDocs

Permanent link:
http://docs.slackware.com/howtos:general_admin:setting_up_a_slackware_chroot

Last update: 2015/11/09 12:56 (GMT)

SlackDocs - http://docs.slackware.com/

You might also like