[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 revision | ||
howtos:general_admin:setting_up_a_slackware_chroot [2015/03/22 20:40 (UTC)] – setting_up_a_slackware_chroot renamed to howtos:general_admin:setting_up_a_slackware_chroot (Page created in improper location) mfillpot | howtos:general_admin:setting_up_a_slackware_chroot [2024/04/22 20:54 (UTC)] (current) – Added a link to the github home of mkchroot + some remarks on Slackware 15 noryungi | ||
---|---|---|---|
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 and install Slackware into it using the following elegant script: [[http://tty1.uk/scripts/slackware/mkchroot]] |
- | (additional sets can be installed in a similar way) | + | Update - the script seems to have moved to: [[https:// |
- | == Chroot | + | === Manually === |
- | After the chroot | + | First, create a folder which will contain |
+ | |||
+ | <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 | ||
+ | /etc/resolv.conf chroot_folder/etc/resolv.conf none bind,auto 0 0 | ||
+ | </file> | ||
+ | |||
+ | 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 /slackware_host_mount_point / |
+ | </code> | ||
(http:// | (http:// | ||
Line 35: | Line 115: | ||
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 all mount points by running | + | Instead of using `ARCH=i686' |
+ | called `setarch', | ||
+ | version in the shell. | ||
+ | which saves some typing. | ||
+ | ARCH as `i686' | ||
- | '' | + | **SYNOPSIS** |
+ | < | ||
+ | setarch arch [options] [program [argument...]] | ||
+ | </ | ||
- | Then remounted the mount points in /// | + | When we run `linux32' |
- | '' | + | < |
+ | chroot / | ||
+ | </ | ||
- | == Links == | + | or it could be run after chrooting into our new root. Settings will revert to |
+ | normal when we exit the new shell. | ||
+ | reported version: | ||
- | http://www.linuxquestions.org/questions/ | + | < |
+ | chroot | ||
+ | </code> | ||
+ | That `--uname-2.6' | ||
+ | the version. | ||
+ | |||
+ | -- | ||
+ | Dave | ||
+ | |||
+ | ====== See also ====== | ||
+ | |||
+ | * https:// | ||
+ | * http:// | ||
+ | |||
+ | ====== Sources ====== | ||
+ | <!-- If you are copying information from another source, then specify that source --> | ||
+ | <!-- * Original source: [[http:// | ||
+ | <!-- Authors are allowed to give credit to themselves! --> | ||
+ | * Originally written by [[wiki: | ||
+ | <!-- * Contributions by [[wiki: | ||
+ | |||
+ | <!-- Please do not modify anything below, except adding new tags.--> | ||
+ | <!-- You must remove the tag-word " | ||
{{tag> | {{tag> | ||
+ |