|
NAMEportsreinstall-chroot - Support utility for portsreinstall(8) to build packages in a virtual environmentSYNOPSISportsreinstall-chroot [ OPTIONS ] [ -- ] [ command ]DESCRIPTIONThis utility assists to update packages by creating and using chroot(8) environment for building. The chchroot(8)root environment is first created by forking the host environment, and the user is asked to complete update of packages at the chroot(8) environment.RESTRICTIONWhen this utility is executed inside a chroot(8) or jail(8) virtual environment as the target, the execution MAY be terminated at the process of mounting and unmounting file systems. In this case, the user should follow a message which addresses to execute portsreinstall-chroot-mount(8) at the grand host environment. Note that this utility involves mounting and unmounting operations of unionfs whose implementation is still in a challenging level, and the user MAY find that the detection of the mounting/unmounting privilege is fluctuated, namely, sometimes available and sometimes not. If you want to forcibly invalidate the privilege of such operations inside chroot(8) or jail(8) environments, set -d option.$basedir/usr/local/share/portsreinstall/bin/portsreinstall-chroot-mount for mounting, and $basedir/usr/local/share/portsreinstall/bin/portsreinstall-chroot-mount unmount for unmounting, where $basedir denotes the base directory of the target environment. Here, the exit code of the termination is 2 for mounting and 3 for unmounting. After the mounting or unmounting at the grand host environment, rerun this utility (portsreinstall-chroot(8)) at the target environment. If the installation path of portsreinstall(8) in the target environment is configured by non-default PREFIX, environment variable SYSTEMBASE must be defined for telling the base directory of the target environment as env SYSTEMBASE=$basedir \ $basedir$PREFIX/share/portsreinstall/bin/portsreinstall-chroot-mount
for mounting, and
env SYSTEMBASE=$basedir \ $basedir$PREFIX/share/portsreinstall/bin/portsreinstall-chroot-mount
unmount
for unmounting.
ROBUSTNESS AGAINST TERMINATION AND RESTARTExecution of the commands except clean and options commands can be terminated at any points and restarted from there with the same options saved in the temporary database (independent among utilities). The saved options can be changed by the ways depending on the assigned groups of the options. The options and execution progress are reset to the default by clean command.SHELL IN THE BUILDER CHROOT ENVIRONMENTThe same login shell of the current user (which will be the superuser) is invoked as the login shell in the builder chroot(8) environment. For sh(1) and its families, environment variable PS1 is modified for distinction from the host environment. For tcsh(1) and its families, the configuration file (/root/.cshrc) is modified to add a line for redefining prompt variable for the distinction. The original configuration file is backed up as /root/.cshrc.bak-portsreinstall-chroot.ARGUMENTSOne of the following commands can be given for optional operations or confirmation.
OPTIONSIf duplicated or conflicting ones are set, the last ones are effective. The end of options can be explicitly specified by --. Short options can be given in compact forms, for example, -V -a to be -Va.
Group 1: Just show messages and exit without operation
Group 2: Effective anytime
Group 3: Saved and not renewable until cleaning
DETAILSOverviewThis utility is a supporting tool of portsreinstall(8) to build packages in a chroot(8) environment "forked" from the host environment which is the final target of upgrading. On-the-fly smart entire upgrade of all installed ports and robustness against termination/restart is pursued by this utility.The forked environment is created by nullfs(5) and mount_unionfs(8) onto the host environment. Fetched/deleted distfiles and created/fetched/deleted packages are synchronized at the host to the forked environment. The ports options and other configurations of ports management (/etc/make.conf, /usr/local/etc/portsreinstall.conf, /usr/local/etc/pkgtools.conf, /usr/local/etc/pkg.conf and the temporary database of portsreinstall(8) in usual environments) are also synchronized as well. The execution of do command proceeds in the following step (while use of auto command can be more practical):
ExampleThe conventional flow of using this utility will be as follows:1. In the host (target) environment, execute this utility by the full course mode. root@[host]# portsreinstall-chroot -f
2. After successful build of the temporary database, portsreinstall(8)
may show select dialogues for leaf and obsolete ports/packages. Note that the
choice made here can be changed afterward without any fatal risk as long as
the current builder chroot(8) environment is preserved even after the
upgrade of the host environment.
3. portsreinstall(8) will continue to build, (re)install and deinstall processes, which take very long and impose a high load. You may want to interrupt the execution to cool down or shutdown your machine for your work or travel. In this case, press Ctrl+C at any point so that portsreinstall(8) will stop by preserving its progress marker information in the temporary database and this utility will unmount the builder chroot(8) environment. Some network troubles in fetching distfiles or packages may be resolved by terminating the process once. (Even damages due to critical accidents of kernel panics, overheating and sudden shutdown may be recovered without problem just like this intentional termination.) Ctrl+C
4. At any convenient time, restart the processes. Note that no option should be
speified here.
root@[host]# portsreinstall-chroot auto
5. The process may stop with some failures which cannot be resolved
automatically. It may be mismatches of port option configurations of
dependencies, unrecognized conflict or essential conflict between needed
packages. In this case, you will need to enter the builder chroot(8)
environment for the manual troubleshooting.
root@[host]# portsreinstall-chroot enter
6. Then the you will be prompted in the builder chroot(8) environment.
root@[chroot]#
7. Troubleshooting may be done by modifying the configuration files or
struggling with
freeze/taboo/escape/ok/need/noneed/reselect/reconf
commands of portsreinstall(8) referring to information obtained by
show command of portsreinstall(8). After such possible
patchwork, exit from the builder chroot(8) environment.
root@[chroot]# exit
8. Retry to continue the processes by executing
root@[host]# portsreinstall-chroot auto
or, when the configuration files were modified,
root@[host]# portsreinstall-chroot auto -L
redo
9. When the all necessary upgrade is completed inside the builder
chroot(8) environment, you will be asked whether to reflect the upgrade
to the host environment. If you select Yes here, package archiving in the
builder chroot(8) environment, synchronization of package files,
distfiles, port option database and configuration files for
portsreinstall(8), and the update of the packages at the host
environment will be automatically carried out. Here, again, Ctrl+C
interruption and unintentional termination will be recovered by simple
re-exeution of this utility.
ENVIRONMENT VARIABLES
See also the corresponding section of portsreinstall(8). The variables are conveyed to the forked environment from the target host. HISTORYThis utility first appeared as a part of portsreinstall(8) version 4.0.0 released on June 29, 2018.SEE ALSOchroot(8) portsreinstall(8), portsreinstall-chroot-mount(8), portsreinstall-upgrade(8).COPYRIGHTThis software is distributed under the 2-Clause BSD License.(C) 2018 Mamoru Sakaue, MwGhennndo, All Rights Reserved. Email: sakaue.mamoru@samurai.mwghennn.net Homepage: http://www.mwghennndo.com/software/portsreinstall/
Visit the GSP FreeBSD Man Page Interface. |