# pf and kernel



## gigs (Jan 19, 2010)

Hi, i have problem when update 8.0 release. My custom kernel is replaced with new from update. And than don't have pf. How to have custom kernel and pf after update?


----------



## Beastie (Jan 19, 2010)

What do you mean you don't have pf? If your custom kernel has been replaced by GENERIC, then pf should be there as it has been included by default as a loadable module since 5.3.
Are you sure you didn't overwrite /etc/rc.conf during the upgrade thus removing the *pf_enable="YES"* entry?


----------



## SirDice (Jan 19, 2010)

Freebsd-update only works with GENERIC. But as Beastie already mentioned you can load pf as a module.

If you want to do an upgrade with a custom kernel you will need to do it from source. It really isn't that difficult, it only takes a little time.


----------



## gigs (Jan 19, 2010)

I add pf and altq in custom kernel but update back to GENERIC. How to load as a module? Yes i have in rc.conf but without custom don't work.


----------



## gigs (Jan 19, 2010)

I forget i use patch for network driver also. Maybe is only solution to build from source? Where to download updated source for kernel?


----------



## Beastie (Jan 19, 2010)

Most people update the source using csup(1). This handbook page is about cvsup, and csup is exactly like it.

You can update it using freebsd-update(8). Check the components in freebsd-update.conf(5).

And if you already have disc1 from the ftp, you can extract it from there. In the disc/ISO, cd to the directory that looks like this one and execute `# ./install.sh all`.


The pf module is loaded like all other modules: `# kldload pf.ko`. You then need to start it with `# /etc/rc.d/pf start`. Make sure you have a valid pf.conf file (in /etc by default).
Check the handbook for more information.


----------



## gigs (Jan 20, 2010)

But when i compile with source from disk or ftp and after that update with freebsd-update kernel is back to generic. Is there a way to download new kernel source who is patched and after that to build customise kernel.


----------



## SirDice (Jan 20, 2010)

gigs said:
			
		

> But when i compile with source from disk or ftp and after that update with freebsd-update kernel is back to generic.


Yes, freebsd-update only works with GENERIC.



> Is there a way to download new kernel source who is patched and after that to build customise kernel.


Yes, see the handbook on compiling a custom kernel.

You can load pf as a module (it will be loaded automatically) but the module doesn't have ALTQ enabled. To get both pf and ALTQ you really need to compile a custom kernel.


----------



## DutchDaemon (Jan 20, 2010)

freebsd-update.conf(5) -> Components

Keep the sources updated, and use them to build a custom kernel.


----------



## ohauer (Jan 21, 2010)

> But when i compile with source from disk or ftp and after that update with freebsd-update kernel is back to generic.


I happened no time to me but there is a trick you can keep both happy (freebsd-update and you).

Keep a generic kernel in boot and don't touch it so you even have a supported fallback

layout of /boot

```
/boot/GENERIC  -> original generic kernel (maybe without *.symbols files to save space)
/boot/kernel -> your custom kernel
```

Now freebsd-update will update only the GENERIC kernel and the sources if available.


----------



## gigs (Jan 22, 2010)

I have 
	
	



```
src world kernel
```
.Should i just add src/base and src/sys? I don't like to mistake first time with update and miss something.


----------



## DutchDaemon (Jan 22, 2010)

'src' is all sources, so you won't miss anything. It's just a few hundred MB anyway.


----------



## gigs (Jan 26, 2010)

The 
	
	



```
src world kernel
```
 is default conf file. I try with freebsd-update but update only base with patches don't update source files.


----------



## DutchDaemon (Jan 26, 2010)

I don't use freebsd-update myself, but you might try StrictComponents=yes. The explanation in the manual is a bit muddled, but it seems to suggest that the source code is only updated when it is actually present to begin with. The default setting of 'no' won't update stuff that's not there, so my conclusion would be that setting it to 'yes' will update stuff whether it's there or not. Try, at least.


----------



## gigs (Jan 26, 2010)

Nothing... Is there another way to download kernel source?


----------



## DutchDaemon (Jan 26, 2010)

csup(8) with tag=RELENG_8_0 should give you sources for FreeBSD 8.0-RELEASE @ current patchlevel. See examples in /usr/share/examples/cvsup.

If you decide to get the sources this way, you could try running freebsd-update again once the sources are downloaded, to see if it acts on them.


----------



## gigs (Jan 26, 2010)

I will try cvs on old computer with release. Maybe is easy and fast way to download STABLE snapshot and use source from disk? Can i lose something if i go to stable?


----------



## DutchDaemon (Jan 26, 2010)

You will lose the ability to use freebsd-update. Once you go bl... ehm .. once you start compiling STABLE from source, you'll have to keep doing it. With RELEASE you might still be able to move back to freebsd-update.


----------



## gigs (Jan 27, 2010)

Is this ok 
	
	



```
*default release=cvs tag=RELENG_8_0
```
? Only this and 
	
	



```
*default delete use-rel-suffix
```
 i don't understand very well.


----------



## OH (Jan 27, 2010)

It is explained here.


----------



## gigs (Jan 27, 2010)

But not explained what to type for release or stable, current. I need for release 8.0.


----------



## OH (Jan 27, 2010)

[cmd=]*default release=cvs tag=RELENG_8_0[/cmd] is correct

[cmd=]*default delete use-rel-suffix[/cmd] is also explained in the handbook, it all looks good from where I'm sitting.

Just use src-all only.

Note that csup is preferred over cvsup.


----------



## gigs (Feb 9, 2010)

I use binary update and after that use cvs with tag=RELENG_8_0 and compile kernel. But after that binary update again update and overwrite customise kernel.


----------



## DutchDaemon (Feb 9, 2010)

Wasn't this addressed in post #10 above?


----------



## gigs (Feb 10, 2010)

Sorry,i am totally confused. I thought that if download source from cvs and compile kernel, than after i can use freebsd-update without overwrite custome kernel. Is there anyway to compile custom kernel and use freebsd-update after that?


----------

