Friday, September 01, 2006

How to change files in /usr/local/etc on nanoBSD

This is a major problem when we install software from packages or ports on nanobsd system. Root partition is readonly. Third party software keep their configuration files under /usr/local/etc Only /etc can be changed during runtime.
This custom function used after installing ports/packages during build solve this problem:

#
# Create symlinks in /usr/local/etc to /etc due to readonly filesystem in
# /usr
#
cust_fix_usr_local() (
mkdir ${NANO_WORLDDIR}/etc/uletc
cp -R ${NANO_WORLDDIR}/usr/local/etc/* ${NANO_WORLDDIR}/etc/uletc
rm -r ${NANO_WORLDDIR}/usr/local/etc
#rmdir ${NANO_WORLDDIR}/usr/locla/etc
chroot ${NANO_WORLDDIR} sh -c 'ln -s /etc/uletc /usr/local/etc'
)

1 Comments:

Anonymous Anonymous said...

mkdir ${NANO_WORLDDIR}/etc/uletc

mkdir ${NANO_WORLDDIR}/etc/usr/local/etc
(?)

cp -R ${NANO_WORLDDIR}/usr/local/etc/* ${NANO_WORLDDIR}/etc/uletc

cp -R ${NANO_WORLDDIR}/usr/local/etc/* ${NANO_WORLDDIR}/etc/usr/local/etc
(?)

rm -r ${NANO_WORLDDIR}/usr/local/etc
#rmdir ${NANO_WORLDDIR}/usr/locla/etc
chroot ${NANO_WORLDDIR} sh -c 'ln -s /etc/uletc /usr/local/etc'

#rmdir ${NANO_WORLDDIR}/usr/local/etc
chroot ${NANO_WORLDDIR} sh -c 'ln -s /etc/usr/local/etc /usr/local/etc'
)

[ You must see before your post to correct errors ]

5:08 PM  

Post a Comment

<< Home