# Scripting sysinstall



## r00t (Apr 22, 2011)

Hi everyone!

I'm installing FreeBSD 8.2 over the network and am trying to script sysinstall. This way the installation is fully automatic.

Everything works fine until the country selection screen pops-up and manual intervention is necessary. I have looked in the man pages and forums but found no info on this.

Does anyone know what's missing in my script?

Thanks


----------



## hedwards (Apr 27, 2011)

Since nobody has responded, probably the easiest way would be to use the fixit DVD and just run a normal shell script from there to cover the various portions of the install. That way you don't really have to know much about sysinstall, you can just focus on scripting the partitioning and installation. Scripting the installation bit once you've created the partitions and mounted them is pretty easy.

I found this bit on the wiki http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot

```
Fixit# cd /dist/8.0-*
 Fixit# export DESTDIR=/zroot
 Fixit# for dir in base catpages dict doc games info lib32 manpages ports; \
          do (cd $dir ; ./install.sh) ; done
 Fixit# cd src ; ./install.sh all
 Fixit# cd ../kernels ; ./install.sh generic
 Fixit# cd /zroot/boot ; cp -Rlp GENERIC/* /zroot/boot/kernel/
```


----------



## r00t (Apr 28, 2011)

Thanks for your reply!

I actually found what was missing: a shutdown command at the end of the install.cfg.
After the installation process the country selection screen appears if we don't shutdown/restart the machine.


----------



## lme@ (Apr 29, 2011)

Just out of curiosity, can you provide your install.cfg, please?


----------



## izotov (May 11, 2011)

r00t said:
			
		

> Everything works fine until the country selection screen pops-up and manual intervention is necessary. I have looked in the man pages and forums but found no info on this.


It might be an overkill but you can create an own distribution where sysinstall is modified and does only the steps you want to be performed. At least that is how I do it.


----------



## r00t (Oct 27, 2011)

Izotov: thanks for suggestion. 
lme: Sorry, have been away for a while. I need to look for the file but when I find it, I'll post it!

Everyone: thanks for your help.


----------



## r00t (Nov 9, 2011)

I have another question: what if I have a custom kernel? Currently I can automatically install (through the network - PXE) the minimal version taken from the standard FreeBSD 8.2 ISO.

How and where (in the FTP server) should I add my custom kernel so that the network install takes it into account? Can it simply be copy-pasted somewhere or is it more complicated than that?

As promised, here's my install.cfg:


```
# disable all kinds of prompt but enable debug
debug=yes
nonInteractive=yes
noConfirm=yes
noWarn=no

# specify the network interface
netDev=alc0

# network information
hostname=testbox
defaultrouter=192.168.0.1
ipaddr=192.168.0.11
netmask=255.255.255.0


# FTP server
_ftpPath=ftp://192.168.0.1/pub/FreeBSD
mediaSetFTP

# distributions to extract
distSetMinimum

# Partition parameters
disk=ad10
partition=all
bootManager=boot
diskPartitionEditor

# Label parameters
ad10s1-1=ufs 2097152 / 1
ad10s1-2=swap 4194304 none
ad10s1-3=ufs 4194304 /var 1
ad10s1-4=ufs 2097152 /tmp 1
ad10s1-1=ufs 0 /usr 1
diskLabelEditor
diskLabelCommit

# Commit everything
installCommit
shutdown
```


----------

