--- elwix/config/rc.subr 2017/10/31 15:08:53 1.10.2.9 +++ elwix/config/rc.subr 2021/07/16 18:35:50 1.12 @@ -4,7 +4,7 @@ # (C) AITNET ltd - Sofia/Bulgaria # by Michael Pounov # -# $Id: rc.subr,v 1.10.2.9 2017/10/31 15:08:53 misho Exp $ +# $Id: rc.subr,v 1.12 2021/07/16 18:35:50 misho Exp $ # ### Dont edit this file !!! @@ -148,7 +148,7 @@ MakeFS_etc() chmod 0600 $1/etc/ssh/ssh_host_ecdsa_key; chmod 0600 $1/etc/ssh/ssh_host_ed25519_key; - chmod 0440 $1/etc/sudoers; +# chmod 0440 $1/etc/sudoers; mkdir -p $1/etc/mqtt; chgrp -R 883 $1/etc/mqtt; @@ -163,7 +163,7 @@ MakeFS_etc() # ln -sf /elwix/pkg/etc/mk.conf $1/etc/mk.conf; - echo ${TARGET_ARCH} >$1/etc/platform; + echo "${TARGET_ARCH} $3" >$1/etc/platform; Create_etc_motd $1/etc/motd $3; @@ -197,6 +197,8 @@ MakeFS_boot() install -m 444 ${CFGDIR}/boot/logo-elwix.4th $1/boot; install -m 444 ${CFGDIR}/boot/brand-elwix.4th $1/boot; install -m 444 ${CFGDIR}/boot/menu.4th $1/boot; + install -m 444 ${CFGDIR}/boot/logo-elwix.lua $1/boot/lua; + install -m 444 ${CFGDIR}/boot/brand-elwix.lua $1/boot/lua; ;; *) ;; @@ -224,6 +226,11 @@ InstallList() sed -nE -e 's/^ *([^ #]+) */\1/p' < $1 | tr ':' '\n' >$TMPFILE cd $2 for i in $(cat $TMPFILE); do + if [ ! -f $i ]; then + rm -f $TMPFILE + echo "Error:: File not found $i" + exit 1 + fi if [ -x $i ]; then echo "Strip '$i'" ${CEXEC} chflags -f noschg $i @@ -312,5 +319,18 @@ StripFiles() done cd - rm -f $TMPFILE + fi +} + +# $1 = file_pattern +# $2 = From dir +# $3 = To dir +InstallLinks() +{ + if [ -d "$2" ]; then + cd $2 + find . -type l -name "$1" | + tar -cvf - -T - | tar -C $3 -xf - + cd - fi }