[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
howtos:general_admin:setting_up_a_slackware_chroot [2015/03/23 05:47 (UTC)] – /* use more precise link */ aaditya | howtos:general_admin:setting_up_a_slackware_chroot [2020/11/16 12:54 (UTC)] – [See also] fix formatting aaditya | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | **Goal:** I wanted to setup a Slackware chroot | + | ===== Setting up a Slackware chroot |
- | == Obtaining | + | There are multiple reasons why you might want to set up a Slackware |
+ | * 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 a 32 bit chroot | + | For this guide, we'll create |
- | == Installing the packages | + | ==== Obtaining a Slackware installation of your desired architecture ==== |
- | Create | + | Start with a Slackware installation DVD. Download it from from http:// |
- | Mount the installation ISO(s). After they have been mounted | + | ==== Installing |
- | '' | + | === Automatically === |
- | '' | + | You can create your chroot |
- | (additional sets can be installed in a similar way) | + | === Manually === |
- | == Chroot == | + | First, create a folder which will contain the chroot: |
- | After the chroot folder | + | <code bash> |
+ | |||
+ | Mount the installation ISO: | ||
+ | |||
+ | <code bash> | ||
+ | mount -o loop slackware-14.1-install-dvd.iso / | ||
+ | cd / | ||
+ | </ | ||
+ | |||
+ | After the ISO has been mounted, the packages | ||
+ | |||
+ | <code bash> | ||
+ | installpkg --root / | ||
+ | </ | ||
+ | |||
+ | Then unmount the ISO: | ||
+ | |||
+ | <code bash> | ||
+ | umount / | ||
+ | </ | ||
+ | |||
+ | === Setting up required files === | ||
+ | |||
+ | == fstab == | ||
+ | |||
+ | The following minimal snippet can be used for /// | ||
+ | |||
+ | < | ||
+ | # <file system> <mount point> | ||
+ | tmpfs / | ||
+ | devpts | ||
+ | sysfs / | ||
+ | proc /proc | ||
+ | </ | ||
+ | |||
+ | ==== Entering the Chroot ==== | ||
+ | |||
+ | === Automatic mount === | ||
+ | |||
+ | To have the chroot mounted permanently, | ||
+ | |||
+ | < | ||
+ | /dev | ||
+ | /proc chroot_folder/ | ||
+ | /sys | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | And reboot. Then run the following command to mount the chroot folder: | ||
+ | |||
+ | <code bash> | ||
+ | mount / | ||
+ | </ | ||
+ | |||
+ | === Manual mount === | ||
+ | |||
+ | Refer to: ([[howtos: | ||
+ | |||
+ | === Entering the Chroot === | ||
+ | |||
+ | Now that the chroot is set up, one can chroot into it: | ||
+ | |||
+ | <code bash> | ||
+ | |||
+ | **Note** | ||
+ | |||
+ | Wrote a small script to automate the chroot steps. | ||
+ | |||
+ | https:// | ||
=== Updating packages === | === Updating packages === | ||
- | After that I setup slackpkg and updated | + | After that, you can run slackpkg and update |
+ | |||
+ | === Exiting === | ||
+ | |||
+ | When you're done, exited the chroot by pressing // | ||
+ | |||
+ | ==== Usecase: Building 32-bit Packages ==== | ||
=== Mounting partitions === | === Mounting partitions === | ||
- | I needed to mount the partition which contained the SlackBuilds for which I wanted to make a package, I used the command: | + | I use a chroot to build 32-bit packages on a 64-bit system. |
- | '' | + | <code bash>mount -B / |
+ | </code> | ||
(http:// | (http:// | ||
Line 35: | Line 113: | ||
Then I built the package by executing the Slackbuild as follows: | Then I built the package by executing the Slackbuild as follows: | ||
- | '' | + | <code bash> |
+ | ARCH=i686 ./my_package.SlackBuild</ | ||
- | === Exit and unmounting | + | === An alternative way to build other ARCH packages |
- | Finally I exited the chroot by pressing //Ctrl+d//, and unmounted | + | Instead of using `ARCH=i686' |
+ | called `setarch', | ||
+ | version in the shell. | ||
+ | which saves some typing. | ||
+ | ARCH as `i686'. | ||
- | == Links == | + | **SYNOPSIS** |
+ | < | ||
+ | setarch arch [options] [program [argument...]] | ||
+ | </ | ||
- | http:// | + | When we run `linux32' |
- | == Notes == | + | < |
+ | chroot / | ||
+ | </ | ||
- | Wrote a small script | + | or it could be run after chrooting into our new root. Settings will revert |
+ | normal when we exit the new shell. One useful option is to change the kernel' | ||
+ | reported version: | ||
- | https://raw.githubusercontent.com/aadityabagga/scripts/master/chroot.sh | + | < |
+ | chroot / | ||
+ | </ | ||
+ | |||
+ | That `--uname-2.6' | ||
+ | the version. | ||
+ | |||
+ | -- | ||
+ | Dave | ||
+ | |||
+ | ====== See also ====== | ||
+ | |||
+ | * https://wiki.archlinux.org/index.php/Chroot | ||
+ | * http://www.linuxquestions.org/ | ||
====== Sources ====== | ====== Sources ====== | ||
Line 61: | Line 164: | ||
<!-- You must remove the tag-word " | <!-- You must remove the tag-word " | ||
{{tag> | {{tag> | ||
+ |