mirror of
https://dev.iopsys.eu/iopsys/iopsyswrt.git
synced 2025-12-20 00:52:33 +08:00
"README: Update with profiles mechanism"
* Update with profiles mechanism * Fix some spelling * Temporary manual way of feeds references update
This commit is contained in:
131
README.md
131
README.md
@@ -9,7 +9,7 @@ source code for a package and how to build an OpenWRT package from
|
||||
it. Feeds are defined in feeds.conf file in TOPDIR. The layout for
|
||||
the dectmngr package is shown below. That is the feeds.conf contains a
|
||||
reference to a feeds git repo and a commit, then in that feed the
|
||||
dectmngr git repo and commit id is specified.
|
||||
dectmngr git repo and commit ID is specified.
|
||||
|
||||
feeds.conf #commit -> feeds/intenopackages/dectmngr/Makefile #commit -> dectmngr.git
|
||||
|
||||
@@ -21,14 +21,14 @@ PKG_SOURCE_URL:=http://ihgsp.inteno.se/git/dectmngr.git
|
||||
PKG_SOURCE_VERSION:=6ba403663bc9cfdb8f89fb34de367f0796d68552
|
||||
|
||||
While the OpenWRT build system supports branch names in feeds.conf, in
|
||||
Iopsys we only use commit id:s. This ensures that we can always
|
||||
IOWRT we only use commit IDs. This ensures that we can always
|
||||
recreate a build at a later date by checking out a specific commit in
|
||||
the top level repository.
|
||||
|
||||
## Iopsys initialization
|
||||
## IOWRT initialization
|
||||
|
||||
After cloning the repository the iop command needs to be initialized
|
||||
to install the commands for this version of iopsys.
|
||||
After cloning the repository, the iop command needs to be initialized
|
||||
to install the commands for this version of IOWRT.
|
||||
|
||||
Running iop without arguments gives the following output:
|
||||
|
||||
@@ -37,79 +37,68 @@ Running iop without arguments gives the following output:
|
||||
Usage: iop <command> [<args>]
|
||||
|
||||
|
||||
Avaliable commands:
|
||||
Available commands:
|
||||
bootstrap Initial command to run to install other commands
|
||||
setup_host Install needed packets to host machine
|
||||
|
||||
```
|
||||
|
||||
As can be seen, there is only two command avaliable. First you need to
|
||||
As can be seen, there is only two command available. First you need to
|
||||
install everything needed to your host with.
|
||||
|
||||
```
|
||||
./iop setup_host
|
||||
```
|
||||
|
||||
This will only work on debian based distroes. ex ubuntu. not on
|
||||
This will only work on debian based distros. ex ubuntu. not on
|
||||
fedora.
|
||||
|
||||
After the host is setup openwrt build needs to be populated with
|
||||
After the host is set up OpenWRT build needs to be populated with
|
||||
packages to build. Run this to install more commands from feeds:
|
||||
|
||||
```
|
||||
./iop bootstrap
|
||||
```
|
||||
|
||||
When bootstrap completes you should have more commands avaliable (some
|
||||
When bootstrap completes, you should have more commands available (some
|
||||
commands can differ for your version):
|
||||
|
||||
```
|
||||
./iop
|
||||
Usage: iop <command> [<args>]
|
||||
|
||||
Avaliable commands:
|
||||
Available commands:
|
||||
bootstrap Initial command to run to install other commands
|
||||
feeds_update Update feeds to point to commit hashes from feeds.conf
|
||||
genconfig Genereate configuration for board and customer
|
||||
genconfig_min Genereate configuration for board and customer (manual)
|
||||
generate_tarballs Generate tarballs for openstk
|
||||
genconfig Generate configuration for board and customer
|
||||
setup_host Install needed packages to host machine
|
||||
status Display the state of your working tree
|
||||
update_package Publish changes to packages and feeds
|
||||
```
|
||||
|
||||
Next, all feed repositories need to be cloned and packages
|
||||
installed. This is handled by running:
|
||||
|
||||
```
|
||||
iop feeds_update
|
||||
```
|
||||
|
||||
This clones all feed repositories into feeds/ and installs the
|
||||
packages from those repositories into the build system by creating
|
||||
symlinks in packages/feeds/.
|
||||
|
||||
NOTE. iop bootstrap only needs to be run once to install the commands
|
||||
above. After you have installed feeds_update, running that command
|
||||
will update iop commands along with all other packages.
|
||||
above.
|
||||
|
||||
Now, generate a .config file for the board and customer you're
|
||||
building for with
|
||||
|
||||
```
|
||||
iop genconfig <board> <customer>
|
||||
iop genconfig <profiles>
|
||||
```
|
||||
|
||||
To summarize, to intialize the repository, run:
|
||||
NOTE. To get the list of available devices profiles, run:
|
||||
```
|
||||
iop genconfig -b
|
||||
```
|
||||
|
||||
First iop genconfig will clone all required repositories into /feeds
|
||||
and install required packages from those repositories into the
|
||||
build system by creating symlinks in packages/feeds/.
|
||||
|
||||
* git clone <iopsys>
|
||||
To summarize, to initialize the repository, run:
|
||||
* git clone \<IOWRT\>
|
||||
* iop bootstrap
|
||||
* iop feeds_update
|
||||
* iop genconfig <board> <customer>
|
||||
* iop genconfig \<profiles\>
|
||||
|
||||
|
||||
If it's the first time you're building an image on your host, you
|
||||
If it's the first time you're building an image on your host, you
|
||||
should run:
|
||||
|
||||
```
|
||||
@@ -132,64 +121,32 @@ make -j8
|
||||
|
||||
## Updating the repository
|
||||
|
||||
If you run git pull in the toplevel repository you will most probably
|
||||
get changes that modify feeds.conf. Now your feeds.conf points to
|
||||
newer commits then what is checked out in the feed repositories and
|
||||
you need to update your feeds. Do this by running:
|
||||
|
||||
iop feeds_update
|
||||
|
||||
This will pull in the latest changes in the modified feed for you. To
|
||||
summarize, to update your repository, run:
|
||||
|
||||
If you run git pull in the toplevel repository, you will most probably
|
||||
get changes that modify feeds.conf.io and/or yml profile files.
|
||||
Now references in those files point to the newer commits then what
|
||||
is checked out in the feed repositories, and you need to update your feeds.
|
||||
This can be done by calling genconfig again:\
|
||||
```
|
||||
git pull
|
||||
iop feeds_update
|
||||
make
|
||||
iop genconfig <profiles>
|
||||
```
|
||||
NOTE. If you'd like to prevent your local feed changes from being overwritten
|
||||
by genconfig use `--keep` option:
|
||||
```
|
||||
iop genconfig --keep <profiles>
|
||||
```
|
||||
|
||||
## Working with feeds
|
||||
|
||||
The build system will clone and checkout the packages in build_dir in
|
||||
detached head state so before you can commit you need to checkout a
|
||||
branch to work on. To prevent an invalid state where you update
|
||||
feeds.conf with commits that are not pushed to the remote repository,
|
||||
the script pushes the new commits to the remote repos. For this to
|
||||
work the script needs to know what remote branches to push to. For
|
||||
that reason, always make sure to check out remote tracking branches,
|
||||
for example with git checkout -t origin/mybranch.
|
||||
The build system will clone and checkout the packages in build_dir in
|
||||
detached head state so before you can commit you need to checkout a branch to work on.
|
||||
|
||||
If you want to update feed references, you need to modify
|
||||
feeds.conf.io and/or yml profile files manually in profiles/include directory.
|
||||
Before updating references in feeds.conf.io or yml profile files
|
||||
make sure you've pushed relevant changes to the remote repository.
|
||||
|
||||
When you have created a new commit in the package repo in the build
|
||||
directory this commit needs to be pushed to two places. First the
|
||||
package makefile in the feed needs to be repointed to the new
|
||||
commit. This in turn creates a new commit in the feed and feeds.conf
|
||||
commit. This in turn creates a new commit in the feed and feeds.conf.io or yml
|
||||
needs to be repointed to that commit.
|
||||
|
||||
First you need to set the EDITOR environmental variable to your
|
||||
favorite editor. Ex:
|
||||
|
||||
```
|
||||
export EDITOR=/usr/bin/emacs
|
||||
```
|
||||
|
||||
You probably want to add this line to your .bashrc.
|
||||
|
||||
```
|
||||
iop update_package
|
||||
```
|
||||
|
||||
First, it will update the toplevel remote repository and abort if it
|
||||
finds that you are not on the last commit on the branch you're working
|
||||
on. If you get this complaint, just merge the remote branch into your
|
||||
local branch. This step is kept manual to ensure that you know that
|
||||
your repository changes.
|
||||
|
||||
If you are on the end of your branch the script continues and checks
|
||||
if any git repo in the build differs from the commit in the package
|
||||
makefile. If it finds a diff it first asks you what branch to make the
|
||||
new commit on since you are in detached head state in the feed
|
||||
repository. You probably want to select devel here. Once you have
|
||||
selected a branch to update the script autogenerates a commit message
|
||||
from the commits between the old and the new commit point of the
|
||||
package. The same then happens for the commit on feeds.conf.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user