> So, I understand that for the new firmware I'm going to build, I can add
> packages (i.e. to the firmware so that I don't have to use ipkg to add
> them after I flash the new firmware) that I had installed since my last
> firmware build/install simply by changing them from "m" to "y" when I
> "make config".  Am I correct, so far?

Yes.

> So I see that in package/base-files/files/etc/config/network is the
> basic network config.  Should I modify that for my local installation,
> so that the firmware I create will have it's network already configured
> for my use?

As these are vanilla config files, I would not touch them, but it should
work.

> This seems a bit un-portable though, and what of other files from other
> packages?  Running around making these "per installation specific"
> changes seems like a bad idea.  Any way to avoid?  Any way to build
> custom firmwares without using these kinds of "source hacks"?

Personally, I wrote a new package, similar to base-files which I called
zz-user-files. I put all my special files in its files/ directory, and
It will overwrite those files in the target firmware at install time. I
called it 'zz-user-files' to be sure that It will be the last installed
package. It's not perfect, but It work very well. (Do not forget to
select 'User-defined files for OpenWrt' in the 'Base system' menu).
Path is attached.

> Is there any way for me to see what the filesystem will look like on my
> router after I've reflashed, prior to reflashing?  I want to be able to
> inspect it and make tweaks to my build tree, rebuild the firmware image
> and check again, etc.  Can I easily mount the firmware's filesystem for
> examination on my build host, or is there a copy of what's in the
> firmware's filesystem in a directory in the build tree somewhere?  i.e.
> staged before building the firmware image.

Yes you should find it in the build_dir/<arch>/root-<target>/ directory,
eg. build_dir/mipsel/root-ar7/ for AR7 (TI MIPS-based SoC).
If you modify things in it and rebuild, it should be taken into account.

Regards,
Ben.

diff --git a/package/zz-user-files/Makefile b/package/zz-user-files/Makefile
new file mode 100644
index 0000000..1b36a84
--- /dev/null
+++ b/package/zz-user-files/Makefile
@@ -0,0 +1,44 @@
+#
+# Copyright (C) 2007 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# $Id$
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=user-files
+PKG_RELEASE:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/user-files
+  SECTION:=base
+  CATEGORY:=Base system
+  DEPENDS:=+base-files
+  TITLE:=User-defined files for OpenWrt
+  URL:=http://openwrt.org/
+  VERSION:=$(PKG_RELEASE)-$(REVISION)
+endef
+
+define Package/user-files/description
+ This package contains user-defined files to add to OpenWrt base filesystem.
+endef
+
+define Build/Prepare
+	mkdir -p $(PKG_BUILD_DIR)
+endef
+
+define Build/Compile/Default
+endef
+
+define Build/Compile
+	$(call Build/Compile/Default)
+endef
+
+define Package/user-files/install
+	$(CP) -af ./files/* $(1)/
+endef
+
+$(eval $(call BuildPackage,user-files))
diff --git a/package/zz-user-files/files/etc/config/network b/package/zz-user-files/files/etc/config/network
new file mode 100644
index 0000000..a35fd2e
--- /dev/null
+++ b/package/zz-user-files/files/etc/config/network
@@ -0,0 +1,14 @@
+# Copyright (C) 2006 OpenWrt.org
+
+config interface loopback
+	option ifname	lo
+	option proto	static
+	option ipaddr	127.0.0.1
+	option netmask	255.0.0.0
+
+config interface lan
+	option ifname	eth0
+	option type 	bridge
+	option proto	static
+	option ipaddr	192.168.1.1
+	option netmask	255.255.255.0

_______________________________________________
openwrt-devel mailing list
[email protected]
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to