Re: Kickstart-list Digest, Vol 78, Issue 10

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

 



Hello Dan:

My script already figures out the device - the problem is using that device in the harddrive statement, by putting the harddrive statement in the %pre isn't working...

Lance

On Fri, Aug 27, 2010 at 9:00 AM, <kickstart-list-request@xxxxxxxxxx> wrote:
Send Kickstart-list mailing list submissions to
       kickstart-list@xxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
       https://www.redhat.com/mailman/listinfo/kickstart-list
or, via email, send a message with subject or body 'help' to
       kickstart-list-request@xxxxxxxxxx

You can reach the person managing the list at
       kickstart-list-owner@xxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Kickstart-list digest..."

Today's Topics:

  1. Re: harddrive in %pre (Lance Gropper)
  2. Re: harddrive in %pre (Dan Davis)
  3. pungi question (Dan Davis)


---------- Forwarded message ----------
From: Lance Gropper <streamscalelance@xxxxxxxxx>
To: kickstart-list@xxxxxxxxxx
Date: Fri, 27 Aug 2010 08:43:05 -0700
Subject: Re: harddrive in %pre
Hello Ya'all:

Thank you all for the kind responses so far. Below is my kickstart (so far) - it is intended to be an automated install. Basically, the %pre finds the USB key, and sets it as the "install from" drive, and based on this sets the "install to" drive. The "install to" drive and network configuration currently works, however the "install from" harddrive statement does not, even though the USB key is properly detected. It would be great if the USB device was the same Linux short device name on every system, but it's not. Today, I am going to modify the script so it attempts other devices, other than hda, sda, and sdb. One of our customers' systems going to IBC the week after next has 73 drives, and the USB key shows up last. I'd like to keep the kickstart as light and fluffy as possible...

Lance

# Kickstart file

%include /tmp/inst-include
install
key --skip
lang en_US.UTF-8
keyboard us
skipx

rootpw --iscrypted $1$kt/7H6d3$g96NCQCYIJL.bIF7/FEJh/
firewall --disabled
authconfig --useshadow --enablemd5
selinux --disabled
timezone America/Tijuana

%packages
@core

%pre
#!/bin/bash

INSTALLFROM='sda5'
INSTALLTO='hda'

touch /tmp/inst-include
if test -e '/sys/block/hda' ; then
   ls -l /sys/block/hda/device | grep /usb
   if [ $? -neq 0 ] ; then
      INSTALLFROM='hda5'
      INSTALLTO='sda'
   fi
fi
if test -e '/sys/block/sda' ; then
   ls -l /sys/block/sda/device | grep /usb
   if [ $? -neq 0 ] ; then
      INSTALLFROM='sda5'
      if test -e '/sys/block/hda' ; then
         INSTALLTO='hda'
      else
         INSTALLTO='sdb'
      fi
   fi
fi
if test -e '/sys/block/sdb' ; then
   ls -l /sys/block/sdb/device | grep /usb
   if [ $? -neq 0 ] ; then
      INSTALLFROM='sdb5'
      if test -e '/sys/block/hda' ; then
         INSTALLTO='hda'
      else
         INSTALLTO='sda'
      fi
   fi
fi
NICPORTS=0
if test -e '/sys/class/net/eth0' ; then
   NICPORTS=1
fi
if test -e '/sys/class/net/eth1' ; then
   NICPORTS=2
fi

echo 'harddrive --partition='$INSTALLFROM' --dir=/' >>/tmp/inst-include

if [ $NICPORTS -gt 0 ] ; then
   if [ $NICPORTS -eq 1 ] ; then
      echo 'network --device eth0 --bootproto static --ip 192.168.1.129 --netmask 255.255.255.0 --gateway 192.168.1.1 --nameserver None --hostname mybox' >>/tmp/inst-include
   else
      echo 'network --device eth0 --bootproto dhcp --hostname mybox' >>/tmp/inst-include
      echo 'network --device eth1 --bootproto static --ip 192.168.1.129 --netmask 255.255.255.0 --gateway 192.168.1.1 --nameserver None --hostname mybox' >>/tmp/inst-include
   fi
fi

echo 'bootloader --location=mbr --driveorder='$INSTALLTO' --append="rhgb quiet crashkernel=128M@16M"' >>/tmp/inst-include
echo 'clearpart --all --drives='$INSTALLTO >>/tmp/inst-include
echo 'part /boot --fstype ext3 --size=100 -- >>/tmp/inst-include
echo 'part pv.100000 --size=0 --grow -- >>/tmp/inst-include
echo 'volgroup VolGroup00 --pesize=32768 pv.100000' >>/tmp/inst-include
echo 'logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=384 --grow --maxsize=768' >>/tmp/inst-include
echo 'logvol / --fstype ext3 --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow' >>/tmp/inst-include
%end



---------- Forwarded message ----------
From: Dan Davis <dansmood@xxxxxxxxx>
To: Discussion list about Kickstart <kickstart-list@xxxxxxxxxx>
Date: Fri, 27 Aug 2010 11:50:08 -0400
Subject: Re: harddrive in %pre
What we do is set a label with mkfs.vfat and change the syslinux.cfg on the USB to make reference to the USB label.

In %pre and %post scripts, you can use udevadm info on the devices and figure out which is USB, but that only works if your "real" hard disks are not USB.


---------- Forwarded message ----------
From: Dan Davis <dansmood@xxxxxxxxx>
To: kickstart-list@xxxxxxxxxx
Date: Fri, 27 Aug 2010 11:57:37 -0400
Subject: pungi question
Is there anyway I can instruct pungi to use one set of repositories to build the isolinux sub-directory, and another set of repositories for the Packages to install?

I've wanted to be able to do that for a long time, just so that nothing important to the DVD/CD changes, but we can change what we install (including the kernel).

I got hope the other day of this because I did a pungi build that turned out odd, in that these files didn't match:

x86_64/os/Packages/kernel*
x86_64/os/vmlinuz

All I did was list fedora-updates with a repository cost of 1000, trying out some options for listing my internal mirrors.

Is this a Feature or a Bug?  I'd love to use it... but I'm not sure why the build was different.

_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/kickstart-list

_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/kickstart-list

[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux