для варианта: ("/postinstall/laststate" run "command arg1 arg2") предлагаю сделать так: if [ -n "$in_run" ] ; then destfile="$outdir/99-zz-auto_postinstall_run.sh" echo "#!/bin/sh" > $destfile echo "# alterator-postinstall create it" >> $destfile echo ". install2-init-functions" >> $destfile echo "$in_run" >> $destfile chmod a+x $destfile printf '%s run:%s - OK\n' "$(date +%T)" "$in_run" >&2 fi чтобы можно было запускать команды в чруте: ("/postinstall/laststate" run "exec_chroot date +%s > /timestamp") потому что все скрипты в postinstall.d подразумевают этот инклуд