run_ramfs() uses install_bin to copy executable files to the ram
partition. The install_bin function takes multiple parameters,
the first being the executable to copy and the rest of the args
are symlinks to that binary.
There currently isn't any way to pass multiple arguments to
install_bin in run_ramfs using the RAMFS_COPY_BIN parameter.
This patch enables specifying multiple parameters by separating
them with a colon. In effect one can now install a binary and it's
symlinks using RAMFS_COPY_BIN.
For example:
RAMFS_COPY_BIN="/bin/busybox:/bin/sed:/bin/mktemp"
Will install 2 symlinks for sed and mktemp to the busybox binary
in the ramfs.
Without this patch, the sed and mktemp would be complete copies
of busybox, taking up precious ram memory.
---
package/base-files/files/lib/upgrade/common.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/package/base-files/files/lib/upgrade/common.sh
b/package/base-files/files/lib/upgrade/common.sh
index e53e844..31857a8 100644
--- a/package/base-files/files/lib/upgrade/common.sh
+++ b/package/base-files/files/lib/upgrade/common.sh
@@ -60,7 +60,7 @@ run_ramfs() { # <command> [...]
install_bin /sbin/fs-state
install_bin /sbin/snapshot
for file in $RAMFS_COPY_BIN; do
- install_bin $file
+ install_bin ${file//:/ }
done
install_file /etc/resolv.conf /lib/functions.sh /lib/functions.sh
/lib/upgrade/*.sh $RAMFS_COPY_DATA
--
1.7.1
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel