Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 46 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ OPENWRT_GIT=git://git.openwrt.org/12.09/openwrt.git
OPENWRT_DIR=$(HERE)/openwrt
OPENWRT_FEED_FILE=$(OPENWRT_DIR)/feeds.conf

PIRATEBOXMOD_DIR=$(HERE)/local_feed/piratebox-mod-imageboard

PIRATEBOX_FEED_GIT=https://github.com/PirateBox-Dev/openwrt-piratebox-feed.git
PIRATEBOX_BETA_FEED=$(HERE)/piratebox_beta_feed

Expand All @@ -33,6 +35,8 @@ PACKAGE_USB_CONFIG_SCRIPTS_GIT=https://github.com/LibraryBox-Dev/package-openwrt
PACKAGE_LIBRARYBOX_GIT=https://github.com/LibraryBox-Dev/package-openwrt-librarybox.git
PACKAGE_EXTENDROOT_GIT=https://github.com/PirateBox-Dev/package-openwrt-extendRoot.git
PACKAGE_PIRATEBOX_GIT=https://github.com/PirateBox-Dev/package-openwrt-piratebox.git
PACKAGE_PBXOPKG_GIT=https://github.com/PirateBox-Dev/package-openwrt-pbxopkg.git
PACKAGE_PIRATEBOXMESH_GIT=https://github.com/PirateBox-Dev/package-openwrt-piratebox-mesh.git

# PirateBox-image files, which are used in the package
PIRATEBOXSCRIPTS_GIT=https://github.com/PirateBox-Dev/PirateBoxScripts_Webserver.git
Expand All @@ -52,6 +56,7 @@ info:
@ echo "* install_local_feed"
@ echo "* create_piratebox_script_image"
@ echo "* build_openwrt"
@ echo "* build_openwrt_development"
@ echo "* acquire_stable_packages"
@ echo "* acquire_beta_packages"
@ echo "* run_repository_all"
Expand All @@ -63,7 +68,8 @@ info:
@ echo "Available auto build targets:"
@ echo "* auto_build_stable"
@ echo "* auto_build_beta"
@ echo "* auto_build_snapshot"
@ echo "* auto_build_development"
@ echo "* auto_build_local"

openwrt_env: $(OPENWRT_DIR) $(IMAGE_BUILD)

Expand Down Expand Up @@ -102,8 +108,11 @@ $(OPENWRT_FEED_FILE):
apply_piratebox_beta_feed: $(OPENWRT_FEED_FILE) $(PIRATEBOX_BETA_FEED)
echo "src-link piratebox $(PIRATEBOX_BETA_FEED)" >> $(OPENWRT_FEED_FILE)

copy_image_board: $(PIRATEBOX_BETA_FEED)
copy_image_board: $(PIRATEBOXMOD_DIR)

$(PIRATEBOXMOD_DIR): $(PIRATEBOX_BETA_FEED)
cp -r $(PIRATEBOX_BETA_FEED)/net/piratebox-mod-imageboard $(LOCAL_FEED_FOLDER)/
rm -rf $(PIRATEBOX_BETA_FEED)

$(PIRATEBOX_BETA_FEED):
git clone $(PIRATEBOX_FEED_GIT) $@
Expand All @@ -116,13 +125,17 @@ $(LOCAL_FEED_FOLDER):
cd $(LOCAL_FEED_FOLDER) && git clone $(PACKAGE_LIBRARYBOX_GIT) librarybox
cd $(LOCAL_FEED_FOLDER) && git clone $(PACKAGE_EXTENDROOT_GIT) extendRoot
cd $(LOCAL_FEED_FOLDER) && git clone $(PACKAGE_PIRATEBOX_GIT) piratebox
cd $(LOCAL_FEED_FOLDER) && git clone $(PACKAGE_PBXOPKG_GIT) pbxopkg
cd $(LOCAL_FEED_FOLDER) && git clone $(PACKAGE_PIRATEBOXMESH_GIT) piratebox-mesh
##test_local_folder:= $(wildcard $(LOCAL_FEED_FOLDER)/* )

switch_local_feed_to_dev:
$(call git_checkout_development, $(LOCAL_FEED_FOLDER)/box-installer)
$(call git_checkout_development, $(LOCAL_FEED_FOLDER)/librarybox)
$(call git_checkout_development, $(LOCAL_FEED_FOLDER)/piratebox)
$(call git_checkout_development, $(LOCAL_FEED_FOLDER)/extendRoot)
$(call git_checkout_development, $(LOCAL_FEED_FOLDER)/pbxopkg)
$(call git_checkout_development, $(LOCAL_FEED_FOLDER)/piratebox-mesh)
# no dev branch for usb config scripts yet
# $(call git_checkout_development, $(LOCAL_FEED_FOLDER)/usb-config-scripts)

Expand Down Expand Up @@ -166,13 +179,23 @@ build_openwrt:
# cd $(OPENWRT_DIR) && make toolchain/install
cd $(OPENWRT_DIR) && make -j $(THREADS)

build_openwrt_development:
cp $(HERE)/configs/openwrt.snapshot $(OPENWRT_DIR)/.config
# cd $(OPENWRT_DIR) && make tools/install
# cd $(OPENWRT_DIR) && make toolchain/install
cd $(OPENWRT_DIR) && make -j $(THREADS)

# Acquire the stable packages that are not in the official OpenWRT repository
# yet
#
# This target will be obsolete in the future and is not used by the snapshot target
acquire_stable_packages:
wget -nc http://stable.openwrt.piratebox.de/all/packages/pbxopkg_0.0.6_all.ipk -P $(OPENWRT_DIR)/bin/ar71xx/packages
wget -nc http://stable.openwrt.piratebox.de/all/packages/piratebox-mesh_1.1.1_all.ipk -P $(OPENWRT_DIR)/bin/ar71xx/packages

# Acquire the beta packages that are not in the official OpenWRT repository yet
#
# This target will be obsolete in the future and is not used by the snapshot target
acquire_beta_packages:
wget -nc http://beta.openwrt.piratebox.de/all/packages/pbxopkg_0.0.6_all.ipk -P $(OPENWRT_DIR)/bin/ar71xx/packages
wget -nc http://beta.openwrt.piratebox.de/all/packages/piratebox-mesh_1.1.2_all.ipk -P $(OPENWRT_DIR)/bin/ar71xx/packages
Expand Down Expand Up @@ -262,7 +285,7 @@ auto_build_beta: \
end_timer

# Build the piratebox snapshot release
auto_build_snapshot: \
auto_build_development: \
start_timer \
clean \
openwrt_env \
Expand All @@ -272,8 +295,25 @@ auto_build_snapshot: \
copy_image_board \
install_local_feed \
create_piratebox_script_image \
build_openwrt \
acquire_beta_packages \
build_openwrt_development \
run_repository_all \
piratebox \
stop_repository_all \
end_timer

# Build the piratebox from the local feed
# Does basically the same thing as the above target, except it does not switch
# branches in the local feed.
auto_build_local: \
start_timer \
clean \
openwrt_env \
apply_local_feed \
update_all_feeds \
copy_image_board \
install_local_feed \
create_piratebox_script_image \
build_openwrt_development \
run_repository_all \
piratebox \
stop_repository_all \
Expand All @@ -284,6 +324,7 @@ clean: stop_repository_all
if [ -e $(IMAGE_BUILD) ]; then cd $(IMAGE_BUILD) && make clean; fi;
if [ -e $(OPENWRT_DIR) ]; then cd $(OPENWRT_DIR) && make clean; fi;
rm -rf $(OPENWRT_FEED_FILE)
rm -rf $(IMAGE_BUILD)/target_piratebox

# Delete all files and directories that were created during the build process
distclean: stop_repository_all
Expand Down
26 changes: 17 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# PirateBox OpenWRT development environment scripts
This collection and documentation is for developing on scratch on PirateBox-OpenWRT packages, images and so on. All of those commands in the Makefile are customized or assume, that you don't rely on the current stable source.
This is a collection of scripts and documentation for developing on scratch on PirateBox-OpenWRT packages, images and related things. All of the commands in the Makefile are customized or assume, that you don't rely on the current stable source.

## What this repository is
This repository is intended to get you started with a development environment to build your own PirateBox images - no matter if you just want to enable an additional Kernel feature, remaster your PirateBox image or start developing for the PirateBox.
This repository is intended to get you started with a development environment to build your own PirateBox images - no matter if you just want to enable an additional OpenWRT feature, remaster your PirateBox image or start developing for the PirateBox.

## What this repository is not
* __NO__ newbie guide. You should know your way around in Makefiles you should also have some knowledge about building OpenWRT. In doubt follow the reference Links - if they do not help, feel free to file an issue.
Expand All @@ -21,23 +21,26 @@ This repository is intended to get you started with a development environment to

## Setting up the development enviroment
There are two methods to build the image:
* Using the piratebox feed
* Using the *official* piratebox feed
* Using a custom, local feed

Use the __local feed__ variant if you want to use __other__ branches __than__ the __master__ branch or if you want to pull in your own packages.
Use the __local feed__ variant if you want to use __other__ branches __than__ the __master__ or __develepmont__ branch or if you want to pull in your own packages.

## For the impatient
The Makefile comes with __three auto build targets__, you start them, lean back and wait for the finished images. They at some point all require you to enter the root password, so either run them as root, or enter your password when prompted.
The Makefile comes with __four auto build targets__, you start them, lean back and wait for the finished images. They at some point all require you to enter the root password, so you either need to wait until you are prompted to input your password or set your sudo timeout to unlimited, do some action as sudo in the current terminal and than start the build process.

* _make auto_build_stable_
Will build the stable release with the **master branch** of the [openwrt-piratebox-feed](https://github.com/PirateBox-Dev/openwrt-piratebox-feed).

* _make auto_build_beta_
Will build the beta release with the **development branch** of the [openwrt-piratebox-feed](https://github.com/PirateBox-Dev/openwrt-piratebox-feed).

* _make auto_build_snapshot_
* _make auto_build_development_
Will build a snapshot release, using a local feed including the __develompment branches__ of packages otherwise pulled in via the [openwrt-piratebox-feed](https://github.com/PirateBox-Dev/openwrt-piratebox-feed).

* _make auto_build_local_
Will build a release using all the packages from the _local_feed_ folder, but without changing brnaches. It will use all the packages at the set branch und build from there. This is the best way to implement and test your own changes, using exactly the branches you want.

## Detailed build instructions
Find below the steps described each of the automated targets uses.
The PirateBox feed variant is described in detail, other variants are described in how they differ from the PirateBox feed variant.
Expand All @@ -57,6 +60,9 @@ Detailed information about the OpenWRT build system may be found in the OpenWRT
You can learn more about feeds on the [feeds page](http://wiki.openwrt.org/doc/devel/feeds) in the OpenWRT wiki.

make apply_piratebox_feed

or
make apply_piratebox_beta_feed

3. Update all feeds

Expand All @@ -82,6 +88,10 @@ Building the OpenWRT image may take a long time, depending on your machine, up t
There are a couple of packages that did not make it in the OpenWRT repo yet, so you need to acquire them manually:

make acquire_stable_packages

or

make acquire_beta_packages

8. Start local repository
After building OpenWRT you can start your local repository:
Expand Down Expand Up @@ -123,9 +133,7 @@ Instead of __Step 4__ you run:

make install install_local_feed

Instead of __Step 7__ you run:

make acquire_beta_packages
Skip __Step 7__, because the packages downloaded in this step are build from source when using the local feed variant.

### Cleaning up
There are two different clean targets:
Expand Down
Loading