Re: kernel relinking at install/upgrade time

2017-06-30 Thread Robert Peichaer
On Mon, Jun 26, 2017 at 02:35:55PM -0600, Theo de Raadt wrote:
> There is a diff in snapshots which does kernel relinking during
> install or upgrade.
> 
> Really amazing...

This is now committed to the tree.

-- 
-=[rpe]=-



Re: kernel relinking at install/upgrade time

2017-06-28 Thread Sebastien Marie
On Wed, Jun 28, 2017 at 08:58:13AM +0200, Sebastien Marie wrote:
> 
>   - should /$MODE.site to ran after "generating sha256 from /bsd" and
> before "relinking to create an unique kernel" ? it should let "make
> newbsd" detect /bsd modification, and not relinking the kernel.

small correction for this option: the installer doesn't have
"sha256 -q -C $_sha256 /bsd" to check for modifications before trying to
replace the current kernel with a new one relinked.

-- 
Sebastien Marie



Re: kernel relinking at install/upgrade time

2017-06-28 Thread Sebastien Marie
On Mon, Jun 26, 2017 at 02:35:55PM -0600, Theo de Raadt wrote:
> There is a diff in snapshots which does kernel relinking during
> install or upgrade.
> 
> Really amazing...
> 

I have an issue regarding kernel relinking during upgrade.

Not a big chunk, but I prefer to report it to see the better way to
change my workflow or to change operations order in installer.

I use /upgrade.site file in order to patch in advance (from the
installer, and before rebooting) the kernel in order to disable ulpt to
let cups using my usb printer using libusb.

# cat /upgrade.site
#!/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin

# disable ulpt if cupsd installed
[[ -x /etc/rc.d/cupsd ]] && echo 'disable ulpt*\nquit' | config -f -e /bsd.mp

exit 0


The current order of operation in the installer is (after manual
inspection):
  - do install/upgrade stuff
  - run /$MODE.site in chroot (here upgrade.site)
  - MAKEDEV and installboot
  - bsd.mp renaming to bsd if MULTIPROCESS
  - KARL stuff
- generating sha256 from /bsd
- relinking to create an unique kernel
  - adding sysmerge and fw_update in rc.* files
  - few other stuff and rebooting


The interaction between /upgrade.site (patching /bsd) and KARL makes the
reconfiguration stuff to be discarded... and my printers to not be
functional using libusb at reboot (due to ulpt).

Some questions/options:
  - should /$MODE.site to ran a bit later ? (after KARL)

  - should /$MODE.site to ran after "generating sha256 from /bsd" and
before "relinking to create an unique kernel" ? it should let "make
newbsd" detect /bsd modification, and not relinking the kernel.

  - what is the expected way to disable KARL in the installer ?
(I assume removing /usr/share/compile.tgz and /usr/share/compile
should be enough)

  - does patch for something like config(8) script would be acceptable, in
order to have an official way to apply config(8) modification *and*
to have KARL at same time ?

For me, patching the kernel in rc.firsttime wouldn't be a great option: it will
require a reboot to apply settings.

Thanks.
-- 
Sebastien Marie



Re: kernel relinking at install/upgrade time

2017-06-27 Thread Theo de Raadt
> On Mon 26/06/2017 14:35, Theo de Raadt wrote:
> > There is a diff in snapshots which does kernel relinking during
> > install or upgrade.
> > 
> > Really amazing...
> 
> Works as advertised, assuming that compXX is installed. The relinking bit uses
> strip, which is part of the compiler collection.
> 
> Does it make sense to include strip in the base system?

Aha!  That is an error we need to fix.



Re: kernel relinking at install/upgrade time

2017-06-27 Thread Leighton Sheppard
On Mon, Jun 26, 2017 at 02:35:55PM -0600, Theo de Raadt wrote:
> There is a diff in snapshots which does kernel relinking during
> install or upgrade.
> 
> Really amazing...
> 

This does sound amazing!  Upgrade time



Re: kernel relinking at install/upgrade time

2017-06-27 Thread Björn Ketelaars
On Mon 26/06/2017 14:35, Theo de Raadt wrote:
> There is a diff in snapshots which does kernel relinking during
> install or upgrade.
> 
> Really amazing...

Works as advertised, assuming that compXX is installed. The relinking bit uses
strip, which is part of the compiler collection.

Does it make sense to include strip in the base system?