add script for managing 'build environments' (.config+files/), including documentation

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12212 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nbd 2008-08-06 14:30:46 +00:00
parent 41b5c4d51c
commit accaafac27
2 changed files with 276 additions and 0 deletions

View file

@ -483,3 +483,60 @@ Other useful targets include:
\item \texttt{make package/\textit{<name>}/configure V=99}
\end{itemize}
\subsection{Using build environments}
OpenWrt provides a means of building images for multiple configurations
which can use multiple targets in one single checkout. These \emph{environments}
store a copy of the .config file generated by \texttt{make menuconfig} and the contents
of the \texttt{./files} folder.
The script \texttt{./scripts/env} is used to manage these environments, it uses
\texttt{git} (which needs to be installed on your system) as backend for version control.
The command
\begin{Verbatim}
\texttt{./scripts/env help}
\end{Verbatim}
produces a short help text with a list of commands.
To create a new environment named \texttt{current}, run the following command
\begin{Verbatim}
./scripts/env new current
\end{Verbatim}
This will move your \texttt{.config} file and \texttt{./files} (if it exists) to
the \texttt{env/} subdirectory and create symlinks in the base folder.
After running make menuconfig or changing things in files/, your current state will
differ from what has been saved before. To show these changes, use:
\begin{Verbatim}
./scripts/env diff
\end{Verbatim}
If you want to save these changes, run:
\begin{Verbatim}
./scripts/env save
\end{Verbatim}
If you want to revert your changes to the previously saved copy, run:
\begin{Verbatim}
./scripts/env revert
\end{Verbatim}
If you want, you can now create a second environment using the \texttt{new} command.
It will ask you whether you want to make it a clone of the current environment (e.g.
for minor changes) or if you want to start with a clean version (e.g. for selecting
a new target).
To switch to a different environment (e.g. \texttt{test1}), use:
\begin{Verbatim}
./scripts/env switch test1
\end{Verbatim}
To rename the current branch to a new name (e.g. \texttt{test2}), use:
\begin{Verbatim}
./scripts/env rename test2
\end{Verbatim}
If you want to get rid of environment switching and keep everything in the base directory
again, use:
\begin{Verbatim}
./scripts/env clear
\end{Verbatim}