The element user allow to specify a user ID that will be the effective user ID when executing the commands of the stage to which it applies.
<stage> <stageinfo> <base>/usr/src/mypackage</base> <user>lfs</user> </stageinfo> <make> <param>install</param> </make> </stage> |
The equivalent bash script is :
echo Stage echo Creating file ./_nalfs_tmp.1... cat > ./_nalfs_tmp.1 << 'EOF1' echo Executing make cd /usr/src/mypackage make install true EOF1 [[ $? != 0 ]] && echo Creating file failed && exit 3 chmod 775 ./_nalfs_tmp.1 echo Executing as user lfs /bin/su lfs -c ./_nalfs_tmp.1 echo Finished execution as user lfs echo Exiting stage |