Re: Re: Customized scripts in Debian Installer
On Tuesday 28 April 2009, firstname.lastname@example.org wrote:
> The command I want to execute is:
> cryptsetup -y create private /dev/sda5
> which does not have an noninteractive mode.
Just use a redirect:
echo "$PASSWORD" | cryptsetup -y create private /dev/sda5
cryptsetup -y create private /dev/sda5 </path/to/file-containing-password
cryptsetup -y create private /dev/sda5 <<EOF
If the command needs multiple inputs, just put them on separate lines.
But looking at the partman-crypto component which uses the same command,
it looks like there is a -d option to cryptsetup to pass a password on
the command line... (See /lib/partman/lib/crypto-base.sh from a running
instance of the installer.)
thanks for your help. That is what I need. I will also check partman
component in order to see what you say.
On the other hand, I have a little doubt about setting a variable with a
value executed on target system:
Could you please tell me if the following command is right?
DEVICE = `in-target /usr/bin/mawk '$2 ~ "/var/lib/postgres"' /etc/fstab`
This variable is neccesary to set the device where cryptsetup is going to
be execute. Is it possible to set a variable using in-target?