How do we declare local variables that are computed from the LXC being built by executing commands in the LXC files under creation?
For example, in Debian 12 Bookworm, we get the PHP Build Date folder name in bash with:
How is this done in the
The
At present we load the files into the root folder in the Makefile and then execute the bash commands in the first boot script like:
The above helps not having to install
For example, in Debian 12 Bookworm, we get the PHP Build Date folder name in bash with:
Bash:
PHPBDATE=`ls /usr/lib/php/*/*.so | head -n 1 | cut -d/ -f 5`
echo ${PHPBDATE}
20220829
mv /root/dbase.so /usr/lib/php/${PHPBDATE}/dbase.so
How is this done in the
DAB Makefile
using local variables?The
${BASEDIR}
is declared using the shell command at the beginning of the Makefile
without the leading tab. How do we do this for within rootfs
?At present we load the files into the root folder in the Makefile and then execute the bash commands in the first boot script like:
Bash:
# Enable dbase module for PHP
PHPBDATE=`ls /usr/lib/php/*/*.so | head -n 1 | cut -d/ -f 5`
PHPVER=`ls /etc/php/*/apache2/php.ini | cut -d/ -f 4`
mv /root/dbase.so /usr/lib/php/${PHPBDATE}/dbase.so
mv /root/dbase.ini /etc/php/${PHPVER}/mods-available/dbase.ini
phpenmod dbase
php-dev
and building the pecl
code and thereby bloating the template and delaying each install by having them in the Makefile as:
Code:
dab install php-dev
dab exec pecl install dbase-7.1.1
Last edited: