Date: Tue, 23 Oct 2012 16:19:59 +0100 From: Arthur Chance <freebsd@qeng-ho.org> To: Jack Mc Lauren <jack.mclauren@yahoo.com> Cc: "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org> Subject: Re: nanobsd configuration Message-ID: <5086B59F.9030605@qeng-ho.org> In-Reply-To: <1350992239.88890.YahooMailNeo@web126001.mail.ne1.yahoo.com> References: <1350980911.20647.YahooMailNeo@web126002.mail.ne1.yahoo.com> <50867E7B.7050704@qeng-ho.org> <1350992239.88890.YahooMailNeo@web126001.mail.ne1.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 10/23/12 12:37, Jack Mc Lauren wrote: > From: Arthur Chance <freebsd@qeng-ho.org> > To: Jack Mc Lauren <jack.mclauren@yahoo.com> > Cc: "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org> > Sent: Tuesday, October 23, 2012 2:54 PM > Subject: Re: nanobsd configuration > > On 10/23/12 09:28, Jack Mc Lauren wrote: >> hi >> >> i have a problem with nanobsd. there are somethings which don't have WITHOUT knobs, >> how can i control these directories manually ? how can i add a costume function to >> nanobsd.sh to do this ?? > > How about something along the lines of > > cust_clean () { > rm -rf ${NANO_WORLDIR}/path/to/unwanted **** Important: that should have been ${NANO_WORLDDIR} with *two* Ds - get it wrong and there's a chance you may damage your main system. > } > > customize_cmd cust_clean > > in your nanobsd config file? > > > ======================================================================= > thanks > you mean after building image, this function remove unwanted from WORLDDIR ? > i suppose this will not effect the image, because the image had been built before > removing unwanted directories ... > did i get your point correctly ? A slight caveat: it's a while since I did anything with nanobsd and this is all from memory. "man 8 nanobsd" is your friend, and reading the config files under /usr/src/tools/tools/nanobsd and nanobsd.sh itself is useful. This doeswill affect the image. nanobsd first builds (by the usual installation process) a file tree that will become the basis of the disk image. This is pointed to by ${NANO_WORLDDIR}. It then runs the customize functions which can change any part of this tree. Standard ones do things like adding more files, or alter ${NANO_WORLDDIR}/etc/ssh/sshd_config to allow root logins. You can add your own command to do what you like. After that, nanobsd creates a disk image using md based devices, mounts them and copies the ${NANO_WORLDDIR} into the relevant slice(s). If you don't want some part of the system but it hasn't got a WITHOUT knob to prevent it being installed, the only thing you can do is let nanobsd install it into the tree, and then "manually" via your own customize_cmd remove it. Any changes you make will affect the final image.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5086B59F.9030605>