diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2016-02-08 14:28:50 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2016-02-08 14:28:50 +0000 |
commit | 93f7ca2b58f0509fdb8a35d8c2a3c283b5d8f17d (patch) | |
tree | 574ef33e892ecedafa3d05e753592adfd73eb86c | |
parent | c351c01fd4b234c9990ad2bdab703807316a2d33 (diff) | |
download | master-187ad058-93f7ca2b58f0509fdb8a35d8c2a3c283b5d8f17d.tar.gz master-187ad058-93f7ca2b58f0509fdb8a35d8c2a3c283b5d8f17d.tar.bz2 master-187ad058-93f7ca2b58f0509fdb8a35d8c2a3c283b5d8f17d.zip |
base-files: honor CONFIG_TARGET_INIT_PATH
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48678 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r-- | package/base-files/Makefile | 14 | ||||
-rwxr-xr-x | package/base-files/files/etc/preinit | 6 | ||||
-rw-r--r-- | package/base-files/files/etc/profile | 2 | ||||
-rwxr-xr-x | package/base-files/files/sbin/hotplug-call | 4 |
4 files changed, 16 insertions, 10 deletions
diff --git a/package/base-files/Makefile b/package/base-files/Makefile index bf32f6306a..4e3591a30b 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2015 OpenWrt.org +# Copyright (C) 2007-2016 OpenWrt.org # Copyright (C) 2010 Vertical Communications # # This is free software, licensed under the GNU General Public License v2. @@ -11,17 +11,18 @@ include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/version.mk PKG_NAME:=base-files -PKG_RELEASE:=165 +PKG_RELEASE:=166 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ PKG_BUILD_DEPENDS:=usign/host PKG_LICENSE:=GPL-2.0 -PKG_CONFIG_DEPENDS := CONFIG_SIGNED_PACKAGES +PKG_CONFIG_DEPENDS := CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH include $(INCLUDE_DIR)/package.mk ifneq ($(DUMP),1) + STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell $(SH_FUNC) echo $(CONFIG_TARGET_INIT_PATH) | md5s) TARGET:=-$(BOARD) ifneq ($(wildcard $(PLATFORM_DIR)/base-files-$(PROFILE) $(PLATFORM_SUBDIR)/base-files-$(PROFILE)),) TARGET:=$(TARGET)-$(PROFILE) @@ -70,7 +71,7 @@ define ImageConfigOptions mkdir -p $(1)/lib/preinit echo 'pi_suppress_stderr="$(CONFIG_TARGET_PREINIT_SUPPRESS_STDERR)"' >$(1)/lib/preinit/00_preinit.conf echo 'fs_failsafe_wait_timeout=$(if $(CONFIG_TARGET_PREINIT_TIMEOUT),$(CONFIG_TARGET_PREINIT_TIMEOUT),2)' >>$(1)/lib/preinit/00_preinit.conf - echo 'pi_init_path=$(if $(CONFIG_TARGET_INIT_PATH),$(CONFIG_TARGET_INIT_PATH),"/usr/sbin:/usr/bin:/sbin:/bin")' >>$(1)/lib/preinit/00_preinit.conf + echo 'pi_init_path="$(TARGET_INIT_PATH)"' >>$(1)/lib/preinit/00_preinit.conf echo 'pi_init_env=$(if $(CONFIG_TARGET_INIT_ENV),$(CONFIG_TARGET_INIT_ENV),"")' >>$(1)/lib/preinit/00_preinit.conf echo 'pi_init_cmd=$(if $(CONFIG_TARGET_INIT_CMD),$(CONFIG_TARGET_INIT_CMD),"/sbin/init")' >>$(1)/lib/preinit/00_preinit.conf echo 'pi_init_suppress_stderr="$(CONFIG_TARGET_INIT_SUPPRESS_STDERR)"' >>$(1)/lib/preinit/00_preinit.conf @@ -141,6 +142,11 @@ define Package/base-files/install $(1)/etc/openwrt_release \ $(1)/etc/device_info + $(SED) "s#%PATH%#$(TARGET_INIT_PATH)#g" \ + $(1)/sbin/hotplug-call \ + $(1)/etc/preinit \ + $(1)/etc/profile + mkdir -p $(1)/CONTROL mkdir -p $(1)/dev mkdir -p $(1)/etc/crontabs diff --git a/package/base-files/files/etc/preinit b/package/base-files/files/etc/preinit index 31f861edf9..181b332f14 100755 --- a/package/base-files/files/etc/preinit +++ b/package/base-files/files/etc/preinit @@ -1,10 +1,10 @@ #!/bin/sh -# Copyright (C) 2006 OpenWrt.org +# Copyright (C) 2006-2016 OpenWrt.org # Copyright (C) 2010 Vertical Communications [ -z "$PREINIT" ] && exec /sbin/init -export PATH=/usr/sbin:/usr/bin:/sbin:/bin +export PATH="%PATH%" pi_ifname= pi_ip=192.168.1.1 @@ -20,7 +20,7 @@ fs_failsafe_wait_timeout=2 pi_suppress_stderr="y" pi_init_suppress_stderr="y" -pi_init_path="/usr/sbin:/usr/bin:/sbin:/bin" +pi_init_path="%PATH%" pi_init_cmd="/sbin/init" . /lib/functions.sh diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile index 8a55fecb37..ad8fe12b66 100644 --- a/package/base-files/files/etc/profile +++ b/package/base-files/files/etc/profile @@ -6,7 +6,7 @@ fgrep -sq '/ overlay ro,' /proc/mounts && { echo 'Please try to remove files from /overlay/upper/... and reboot!' } -export PATH=/usr/sbin:/usr/bin:/sbin:/bin +export PATH="%PATH%" export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6) export HOME=${HOME:-/root} export PS1='\u@\h:\w\$ ' diff --git a/package/base-files/files/sbin/hotplug-call b/package/base-files/files/sbin/hotplug-call index 743871a3ff..28e957c398 100755 --- a/package/base-files/files/sbin/hotplug-call +++ b/package/base-files/files/sbin/hotplug-call @@ -1,11 +1,11 @@ #!/bin/sh -# Copyright (C) 2006-2010 OpenWrt.org +# Copyright (C) 2006-2016 OpenWrt.org export HOTPLUG_TYPE="$1" . /lib/functions.sh -PATH=/usr/sbin:/usr/bin:/sbin:/bin +PATH="%PATH%" LOGNAME=root USER=root export PATH LOGNAME USER |