3 # @copyright Copyright (c) 2019 TOYOTA MOTOR CORPORATION.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
19 CAP_LST=${ROMFILESTOP}/etc/basesystem/target/agl_cap.lst
21 #-----------------------------------------------------------------------
24 df -T / | grep nfs > /dev/null
27 #*********************from init_nfs_cap.sh**************************
29 echo "init_nfs-cap.sh: Start"
33 #-----------------------------------------------------------------------
34 # Set Capability for NFS or Set DummyLink for ROM
35 #CAP_LST="/usr/debug/share/target/cap.lst"
36 CAP_LST="/etc/basesystem/target/agl_cap.lst"
38 if [ $IS_EMMC_BOOT -eq 0 ]; then
39 if [ -f "${CAP_LST}" ];then
40 echo "*** set capability for NFS environment ***"
43 for PREAD in `cat ${CAP_LST}`
45 IFS_ORG=${IFS} ; IFS='|' ; PARAM=(${PREAD}) ; IFS=${IFS_ORG}
46 CAP_NAME=${PARAM[0]} ; FMODE=${PARAM[1]} ; FUID_GID=${PARAM[2]}
47 FCAP=${PARAM[3]} ; FKEEPORGPATH=${PARAM[4]}
48 if [ ! -f "${CAP_NAME}" -a ! -f "${CAP_NAME}.org" ];then
49 if [ "${SKIPWARN}" = "n" ];then
50 echo "set capability: ${CAP_NAME}: No such file or directory" 1>&2
54 TCAP_NAME="/tmp/${CAP_NAME##*/}"
55 # Set Capability for NFS
56 if [ ! -L "${CAP_NAME}" ]; then
57 cp -a ${CAP_NAME} ${TCAP_NAME}
58 if [ "${FKEEPORGPATH}" = "y" ];then
59 mv ${CAP_NAME} ${CAP_NAME}.org
60 ln -fs ${TCAP_NAME} ${CAP_NAME}
63 cp -a ${CAP_NAME}.org ${TCAP_NAME}
65 if [ -n "${FUID_GID}" ];then
66 chown ${FUID_GID} ${TCAP_NAME}
68 if [ -n "${FMODE}" ];then
69 chmod ${FMODE} ${TCAP_NAME}
71 if [ -n "${FCAP}" ];then
72 setcap ${FCAP} ${TCAP_NAME}
73 #if [ "${VERBOSE}" = "y" ];then