Nanobsd installing files into /root as user

Sean Bruno sbruno at miralink.com
Fri Aug 24 19:15:59 PDT 2007


An interesting accident happened while I was building my Nanobsd image 
that created /root and all files in /root with ownerships of me!

I have my FreeBSD src tree in subversion, so all files are owned by me.  
The image is built as root, so who cares right?  Well the following 
function cares:

#######################################################################
# Install the stuff under ./Files

cust_install_files () (
        cd ${NANO_TOOLS}/Files
        find . -print | grep -v /CVS | cpio -dumpv ${NANO_WORLDDIR}
)

Since /Files is in a tree owned by me, I had to recursively chown it 
back to root in my build.

so, install_files looks like this now:
#######################################################################
# Install the stuff under ./Files

cust_install_files () (
        cd ${NANO_TOOLS}/Files
        find . -print | grep -v /CVS | cpio -dumpv ${NANO_WORLDDIR}
        chown -R root:wheel ${NANO_WORLDDIR}/root
)

FYI for anyone crazy enough to do this in a method like mine.

Sean



More information about the freebsd-embedded mailing list