# Installing ports on NanoBSD



## anti (May 12, 2010)

Hi guys
 i have created nanobsd image, and installed on soektris net5510

but i faced problems

i can not install any ports or packages on it , it seems to be read only as i think but i am not sure..

any ideas??


----------



## aragon (May 12, 2010)

You can mount the root file system rw and then install a port, but keep in mind that /var is a memory file system so after the next reboot the port's existence will be unknown (despite it still being installed)

What you should be doing is building all the ports you need as packages (or just downloading them from FTP), and rolling these packages into your nanobsd build script.


----------



## OH (May 13, 2010)

Personally I found it easier to just build a my own image
`# make buildkernel NO_MODULES=true KERNCONF=soekris8 DESTDIR="/some/location"`
`# make buildworld WITHOUT_THIS=true WITHOUT_THAT=true WITHOUT_etcetera... DESTDIR="/some/location"`
Copy packages to /some/location/
chroot to /some/location and _pkg_add_ those packages

Now I have a 8.0-image with BIND + DHCP-server + bash + vim-lite, all well under 256 MB!


----------



## aragon (May 13, 2010)

@OH, yea, the nanobsd script does essentially what you describe.


----------



## bsps (May 14, 2010)

*Updating NanoBSD with new Ports or Packages*

Hi Guys How are you

I would to  ask about the way that can I use to update Nanobsd by adding new ports or packages  (particularity ports).

The problem that i need to solve is that i am consuming a lot of time when i am trying to add any ports for my nanobsd via recompiled whole things using sh nanbsd.sh command.

any ideas please


----------



## anti (May 14, 2010)

Thanks guys,,,,  dear aragon can u please tell me about how can i build ports as packages ?? I dont understand exactly what u mean by that ?? 

can i put ports instead of packages and after compiling NanoBSD  i use the command "make install clean" ?? 

mmm..OH can u please give me more details about the script that u have put?? Just i need some more examples to understand the issue 
...


----------



## aragon (May 14, 2010)

anti said:
			
		

> dear aragon can u please tell me about how can i build ports as packages ??


Instead of running "make install", run "make package".  A package file will be placed in /usr/ports/packages/All. 




			
				anti said:
			
		

> can i put ports instead of packages and after compiling NanoBSD  i use the command "make install clean" ??


Not easily...


----------



## bsps (May 14, 2010)

hi  aragon


			
				aragon said:
			
		

> rolling these packages into your nanobsd build script.



what you mean by this?
do you mean i put the package in /usr/src/tools/tools/nanobsd/packages/ directory and add customize_cmd install_packages to nanobsd.sh

also are there any way update nanobsd for adding packages for example instead of compiling the whole image 
thanks


----------



## aragon (May 14, 2010)

bsps said:
			
		

> what you mean by this?
> do you mean i put the package in /usr/src/tools/tools/nanobsd/packages/ directory and add customize_cmd install_packages to nanobsd.sh


Place them into /usr/src/tools/tools/nanobsd/Pkg and add "customize_cmd cust_pkg" to nanobsd.conf.





			
				bsps said:
			
		

> also are there any way update nanobsd for adding packages for example instead of compiling the whole image


Every time you build an image the kernel and world binaries are left in /usr/obj.  If you need to rebuild the image you don't need to recompile sources if you've left the cached objects alone in /usr/obj.  Add "-b" argument to nanobsd.sh to skip world and kernel build.


----------



## bsps (May 14, 2010)

aragon said:
			
		

> Place them into /usr/src/tools/tools/nanobsd/Pkg and add "customize_cmd cust_pkg" to nanobsd.conf.
> 
> 
> 
> ...



thank you very much


----------



## aragon (May 14, 2010)

If you're anything like me, you might have a 4 GB flash card, but your nanobsd code partitions are only 256 MB in size.  In that situation all the disk IO from building a multi gigabyte disk image gets really tedious, so I recommend grabbing this patch and applying it to your nanobsd script.  It'll allow you to build only the code partition, and do most of it in RAM.  Follow point 4 in the PR.

I recommend reading through nanobsd.sh some time.  It's not very big, and seeing how it works gives you a much better understanding of how to use it well.


----------



## aragon (May 14, 2010)

Two other nanobsd improvements people might be interested in:

http://www.freebsd.org/cgi/query-pr.cgi?pr=145962
http://www.freebsd.org/cgi/query-pr.cgi?pr=145961


----------



## bsps (May 14, 2010)

thanks you for your help
i add the packages in /usr/src/tools/tools/nanobsd/Pkg and add "customize_cmd cust_pkg" to nanobsd.conf then i execute the command "sh nanobsd.sh -b" but the _.disk.full and _.disk.image not update they still
i already compile the kernel i need only to add package are there any other step needed?


----------



## aragon (May 14, 2010)

It sounds like the nanobsd script is bombing out.  If you apply my patch it'll be more descriptive about errors...


----------



## silicium (Aug 7, 2013)

*Preventing full-sized packages on NanoBSD*

How to prevent NanoBSD from spamming the target filesystem with useless files when installing packages? Like src.conf(5)() for base WITHOUT_LOCALES, WITHOUT_NLS, WITHOUT_SHAREDOCS... And how to tell NanoBSD to use alternative mtree(8)() BSD.*.dist files to avoid creating useless empty directories?


----------

