Changeset 12212


Ignore:
Timestamp:
2008-08-06T16:30:46+02:00 (10 years ago)
Author:
nbd
Message:

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

Location:
trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/build.tex

    r10001 r12212  
    484484\end{itemize} 
    485485 
     486 
     487\subsection{Using build environments} 
     488OpenWrt provides a means of building images for multiple configurations 
     489which can use multiple targets in one single checkout. These \emph{environments} 
     490store a copy of the .config file generated by \texttt{make menuconfig} and the contents 
     491of the \texttt{./files} folder. 
     492The script \texttt{./scripts/env} is used to manage these environments, it uses 
     493\texttt{git} (which needs to be installed on your system) as backend for version control. 
     494 
     495The command  
     496\begin{Verbatim} 
     497  \texttt{./scripts/env help} 
     498\end{Verbatim} 
     499produces a short help text with a list of commands. 
     500 
     501To create a new environment named \texttt{current}, run the following command 
     502\begin{Verbatim} 
     503  ./scripts/env new current 
     504\end{Verbatim} 
     505This will move your \texttt{.config} file and \texttt{./files} (if it exists) to 
     506the \texttt{env/} subdirectory and create symlinks in the base folder. 
     507 
     508After running make menuconfig or changing things in files/, your current state will 
     509differ from what has been saved before. To show these changes, use: 
     510\begin{Verbatim} 
     511  ./scripts/env diff 
     512\end{Verbatim} 
     513 
     514If you want to save these changes, run: 
     515\begin{Verbatim} 
     516  ./scripts/env save 
     517\end{Verbatim} 
     518If you want to revert your changes to the previously saved copy, run: 
     519\begin{Verbatim} 
     520  ./scripts/env revert 
     521\end{Verbatim} 
     522 
     523If you want, you can now create a second environment using the \texttt{new} command. 
     524It will ask you whether you want to make it a clone of the current environment (e.g. 
     525for minor changes) or if you want to start with a clean version (e.g. for selecting 
     526a new target). 
     527 
     528To switch to a different environment (e.g. \texttt{test1}), use: 
     529\begin{Verbatim} 
     530  ./scripts/env switch test1 
     531\end{Verbatim} 
     532 
     533To rename the current branch to a new name (e.g. \texttt{test2}), use: 
     534\begin{Verbatim} 
     535  ./scripts/env rename test2 
     536\end{Verbatim} 
     537 
     538If you want to get rid of environment switching and keep everything in the base directory 
     539again, use: 
     540\begin{Verbatim} 
     541  ./scripts/env clear 
     542\end{Verbatim} 
Note: See TracChangeset for help on using the changeset viewer.