http://layer-acht.org

freedom's just another word for nothing left to lose

Enrico has made an updated howto for conditional partitioning with debian installer using etch.

preseeding d-i to lazyformat some partitions and keep the ssh host keys

"lazyformat" is a term taken from FAI: with FAI you can define partitions of type "lazyformat", that means, those partitions will only be formatted if they are not formatted allready. That means, if they are valid partitions, the data will be kept.

Below you will find a lazy implementation of that idea ;) I just use two different configs, one formats, the other keeps some partitions (/home, /var/log and /backup in this example).

You can download the files which are described below at http://layer-acht.org/d-i-files/preserve/

preseed_3.cfg contains this line:

d-i preseed/include_command   string if $(grep -q "nolazyformat" /proc/cmdline); then echo 3_nolazyformat.cfg; else echo 3_lazyformat.cfg; fi

These are the preseeding files included: 3_lazyformat.cfg and 3_nolazyformat.cfg.

The ssh host keys are preserved using a script env_preserve.sh run by base-config:

 

base-config base-config/early_command  string wget http://mainframe/d-i/env_preserve.sh -O /root/env_preserve.sh && chmod +x /root/env_preserve.sh && /root/env_preserve.sh

And here you can grab the pxelinux.cfg I use - watch for the difference between 3 and 3init!

It's simple to extend this to recover a authorized key for root (/home is preserved with lazyformat allready - btw, using sudo might be better anyway) - the next example will show a step by step howto (based on rc2, and rc3 when it's released...) to build an initrd, to gain some more security. Either by opening a network console via ssh (to enter the root/sudo-user passwd manually) or by including authorized keys so there is no need to fetch them via http. But unfortunatly it's too late now - stayed tuned :-)

 3_lazyformat.cfg (26.05.2005 19:56)
 3_nolazyformat.cfg (26.05.2005 19:56)
 env_preserve.sh (10.02.2005 02:40)
 pxelinux.cfg (08.02.2005 20:51)