On Tue, Sep 11, 2012 at 05:29:06PM -0500, Ryan Nowakowski wrote:
> I'm building a minimal OpenWRT image from trunk.  I have some
> pre-compiled packages that I would like to add to the image during the
> build.  Is there a way to extend the build system to do that?  I'm
> trying to avoid having to use the image builder for this since it seems
> convoluted to build the image builder, untar it, then use it to add the
> packages.

I added a dependency to "make world" that runs opkg to install a list
of pre-built packages right after all the other packages are built
and installed.  Here's a little patch if anyone else has the need to do
something similar.

diff --git a/Makefile b/Makefile
index 44b4e94..0f99648 100644
--- a/Makefile
+++ b/Makefile
@@ -38,6 +38,8 @@ else
   include tools/Makefile
   include toolchain/Makefile

+  include prebuilt.mk
+
 $(toolchain/stamp-install): $(tools/stamp-install)
 $(target/stamp-compile): $(toolchain/stamp-install) $(tools/stamp-install) 
$(BUILD_DIR)/.prepared
 $(package/stamp-cleanup): $(target/stamp-compile)
@@ -86,7 +88,7 @@ prereq: $(target/stamp-prereq) tmp/.prereq_packages
    fi

 prepare: .config $(tools/stamp-install) $(toolchain/stamp-install)
-world: prepare $(target/stamp-compile) $(package/stamp-cleanup) 
$(package/stamp-compile) $(package/stamp-install) 
$(package/stamp-rootfs-prepare) $(target/stamp-install) FORCE
+world: prepare $(target/stamp-compile) $(package/stamp-cleanup) 
$(package/stamp-compile) $(package/stamp-install) prebuilt 
$(package/stamp-rootfs-prepare) $(target/stamp-install) FORCE
    $(_SINGLE)$(SUBMAKE) -r package/index

 # update all feeds, re-create index files, install symlinks
diff --git a/prebuilt.mk b/prebuilt.mk
new file mode 100644
index 0000000..3cedfa7
--- /dev/null
+++ b/prebuilt.mk
@@ -0,0 +1,9 @@
+include $(TOPDIR)/include/package-ipkg.mk
+
+OPKG:=$(OPKG) -f $(TOPDIR)/../../prebuilt/repositories.conf
+
+PREBUILT_PKGS=package-a package-b package-c
+
+prebuilt:
+   $(OPKG) update
+   $(OPKG) install $(PREBUILT_PKGS)

_______________________________________________
openwrt-users mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-users

Reply via email to