FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 03-29-2012, 09:46 PM
"Gabriel L. Somlo"
 
Default interactive kickstart ?

Is there any way to keep environment variables across different
sections of a kickstart file ? E.g., if during %pre I solicit some
input:

%pre
echo "enter bootloader password now:" > /dev/tty
read -s GRUBPW < /dev/tty
echo "you entered: ${GRUBPW}" > /dev/tty
export GRUBPW
%end

... is there any way to make $GRUBPW visible later on, on the
'bootloader' line in the main section of the kickstart file?
I.e., can I make something like this work:

bootloader --location=mbr --driveorder=sda --password=${GRUBPW}

Is there a better way to solicit the bootloader password interactively
(as I'd prefer not to publish it in a kickstart file, for reasons
similar to why I'm not including a 'rootpw' line) ?

Also, this is not the only application. I'd like to use environment
variables read during %pre in %post (in order to ask all the questions
early on, then proceed with an unattended install).

Thanks for any ideas, suggestions, or pointers.

--Gabriel
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 
Old 03-30-2012, 10:12 PM
Phil Meyer
 
Default interactive kickstart ?

On 03/29/2012 03:46 PM, Gabriel L. Somlo wrote:

Is there any way to keep environment variables across different
sections of a kickstart file ? E.g., if during %pre I solicit some
input:

%pre
echo "enter bootloader password now:"> /dev/tty
read -s GRUBPW< /dev/tty
echo "you entered: ${GRUBPW}"> /dev/tty
export GRUBPW
%end

... is there any way to make $GRUBPW visible later on, on the
'bootloader' line in the main section of the kickstart file?
I.e., can I make something like this work:

bootloader --location=mbr --driveorder=sda --password=${GRUBPW}

Is there a better way to solicit the bootloader password interactively
(as I'd prefer not to publish it in a kickstart file, for reasons
similar to why I'm not including a 'rootpw' line) ?

Also, this is not the only application. I'd like to use environment
variables read during %pre in %post (in order to ask all the questions
early on, then proceed with an unattended install).



We typically use a /tmp file in the %pre section to hold data needed in
a %post or other section, and then %include it.


example: Note that the %pre section comes 'after' the %include
keyword in the kickstart, meaning that %pre is executed first, before
the actual kickstart ...


...
%include /tmp/partitions
%pre
awk 'BEGIN {disk=""} /a$/ {if (disk == "") disk=$4} END {printf "part
swap --size=4096 --ondisk=%s
part / --fstype ext3 --size 1 --grow
--asprimary --ondisk=%s
", disk, disk}' /proc/partitions > /tmp/partitions

%end
...

Lots of folks generate the bulk of the kickstart from the %pre script.

Good Luck!


--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 

Thread Tools




All times are GMT. The time now is 12:03 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org