From 0885fd8050fcfbf0751144265d9f9edab2d7bb2d Mon Sep 17 00:00:00 2001 From: Chia-Che Tsai Date: Fri, 19 Jun 2015 16:44:22 -0400 Subject: [PATCH] fix busybox --- LibOS/shim/include/shim_fs.h | 2 ++ LibOS/shim/test/apps/Makefile | 1 + LibOS/shim/test/apps/busybox/busybox.manifest.template | 1 + 3 files changed, 4 insertions(+) diff --git a/LibOS/shim/include/shim_fs.h b/LibOS/shim/include/shim_fs.h index ee9ed924..cb447e5c 100644 --- a/LibOS/shim/include/shim_fs.h +++ b/LibOS/shim/include/shim_fs.h @@ -363,6 +363,8 @@ char * dentry_get_path (struct shim_dentry * dent, bool on_stack, } else { if (c != buffer && *(c - 1) == '/') c--; + if (c == buffer) + *(c++) = '/'; } *c = 0; diff --git a/LibOS/shim/test/apps/Makefile b/LibOS/shim/test/apps/Makefile index c86dc5e4..559007cf 100644 --- a/LibOS/shim/test/apps/Makefile +++ b/LibOS/shim/test/apps/Makefile @@ -13,6 +13,7 @@ manifest_rules = \ -e 's:\$$(BIN):$(subst .manifest,,$(notdir $@)):g' \ -e 's:\$$(SHIMPATH):$(abspath ../../src/libsysdb.so):g' \ -e 's:\$$(GLIBCDIR):$(abspath $(glibc_dir))/:g' \ + -e 's:\$$(HOSTNAME):$(shell hostname)/:g' \ $(extra_rules) %.manifest: %.manifest.template diff --git a/LibOS/shim/test/apps/busybox/busybox.manifest.template b/LibOS/shim/test/apps/busybox/busybox.manifest.template index 6b64153e..f8d4abf0 100644 --- a/LibOS/shim/test/apps/busybox/busybox.manifest.template +++ b/LibOS/shim/test/apps/busybox/busybox.manifest.template @@ -8,6 +8,7 @@ loader.env.LD_LIBRARY_PATH = /lib:/lib/x86_64-linux-gnu loader.env.USERNAME = loader.env.HOME = loader.env.PWD = +loader.env.HOSTNAME = $(HOSTNAME) loader.debug_type = none fs.mount.root.type = chroot