[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Re: Customized scripts in Debian Installer

On Tuesday 28 April 2009, aaraujo@cenditel.gob.ve 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

or even:
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.)


Dear Frans,
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?

Best Regards

Antonio Araujo

Reply to: