From d1701004e5f5721c6b51320588bff7e1b6c8dce4 Mon Sep 17 00:00:00 2001 From: TomasM Date: Mon, 30 Oct 2017 07:49:20 -0400 Subject: [PATCH] support cache= boot parameter to specify httpfs cache size in MB. If not used, cache is not stored --- TODO | 3 --- livekitlib | 8 +++++++- 2 files changed, 7 insertions(+), 4 deletions(-) delete mode 100644 TODO diff --git a/TODO b/TODO deleted file mode 100644 index 94bd496..0000000 --- a/TODO +++ /dev/null @@ -1,3 +0,0 @@ -* copy DOC/* to Live Kit created -* describe meaning of special files in bundles -* PXE should include all possible .ko dependencies else some of the ethernet modules won't work, like b44.ko diff --git a/livekitlib b/livekitlib index 46dc4c5..32e225c 100644 --- a/livekitlib +++ b/livekitlib @@ -389,16 +389,22 @@ init_network_ip() mount_data_http() { debug_log "mount_data_http" "$*" + local CACHE echo_green_star >&2 echo "Load data from $1" >&2 + CACHE=$(cmdline_value cache | sed -r "s/[^0-9]//g" | sed -r "s/^0+//g") + if [ "$CACHE" != "" ]; then + CACHE="-S "$(($CACHE*1024*1024)) + fi + init_network_ip if [ "$(network_device)" != "" ]; then echo "* Mounting remote file..." >&2 mkdir -p "$2" - mount.httpfs2 -r 9999 -t 5 -C /tmp/httpfs.cache -S 100000000 -c /dev/null "$1" "$2" >/dev/null 2>/dev/null + mount.httpfs2 -r 9999 -t 5 -C /tmp/httpfs.cache $CACHE -c /dev/null "$1" "$2" >/dev/null 2>/dev/null mount -o loop "$2"/* "$2" # self mount echo "$2/$LIVEKITNAME" fi