Enjoy Slackware 15.0!
Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
howtos:general_admin:setting_up_a_slackware_chroot [2015/04/09 05:57 (UTC)] aaditya add link to mkchroot script |
howtos:general_admin:setting_up_a_slackware_chroot [2020/11/16 12:54 (UTC)] (current) aaditya [See also] fix formatting |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | === Setting up a Slackware chroot === | + | ===== Setting up a Slackware chroot |
- | //Goal:// I wanted | + | There are multiple reasons why you might want to set up a Slackware chroot: |
+ | * building | ||
+ | * building -stable packages on a -current system | ||
+ | * building (and testing) packages for SBo on a clean system | ||
- | == Obtaining | + | For this guide, we'll create |
- | For a 32 bit chroot I downloaded | + | ==== Obtaining |
- | == Installing the packages == | + | Start with a Slackware installation DVD. Download it from from http:// |
- | Create a folder which will contain | + | ==== Installing |
- | Mount the installation ISO(s). After they have been mounted the packages in them (found under the // | + | === Automatically === |
- | '' | + | You can create your chroot |
- | '' | + | === Manually === |
- | (additional sets can be installed in a similar way) | + | First, create |
- | An elegant script for the above: [[http://dawoodfall.net/ | + | <code bash> |
- | == Chroot == | + | Mount the installation ISO: |
- | After the chroot folder | + | <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 39: | 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 65: | Line 164: | ||
<!-- You must remove the tag-word " | <!-- You must remove the tag-word " | ||
{{tag> | {{tag> | ||
+ |