/[smeserver]/cdrom.image/sme10/netinstall/ks.cfg
ViewVC logotype

Diff of /cdrom.image/sme10/netinstall/ks.cfg

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

Revision 1.1 by jpp, Sat Jun 13 20:01:09 2020 UTC Revision 1.3 by chrissn, Tue Dec 29 15:12:14 2020 UTC
# Line 1  Line 1 
1  # System authorization information  # System authorization information
2  auth --enableshadow --passalgo=sha512  auth --enableshadow --passalgo=sha512
3    
4  # we do not want Selinux  # We do not want SELinux
5  selinux --disabled  selinux --disabled
6    
7  # services to activate  # Services to activate
8  services --disabled=lm_sensors  services --disabled=lm_sensors
9    
10  # default root pass, willbe changed in post-install process anyway  # Default root pass, will be changed in post-install process anyway
11  rootpw --lock  rootpw --lock
12    
13  # Accept eula  # Accept EULA
14  eula --agreed  eula --agreed
15    
16  # include the partitioning logic from the pre section.  # Partitioning from pre section
17  %include /tmp/part-include  %include /tmp/part-include
18    
19  # disable kdump  # Disable kdump
20  %addon com_redhat_kdump --disable  %addon com_redhat_kdump --disable
21  %end  %end
22    
23  # added for netinstall  
24    # Add netinstall repos
25  url --url  https://mirror.canada.pialasse.com/releases/testing/10/smeos/x86_64/  url --url  https://mirror.canada.pialasse.com/releases/testing/10/smeos/x86_64/
26  repo --name=smeupdates --baseurl=https://mirror.canada.pialasse.com/releases/testing/10/smeupdates/x86_64/  repo --name=smeupdates --baseurl=https://mirror.canada.pialasse.com/releases/testing/10/smeupdates/x86_64/
 #repo --name=remi-safe --baseurl=http://rpms.famillecollet.com/enterprise/7/safe/x86_64/  
 #repo --name=smeupdates-testing --baseurl=http://mirror.canada.pialasse.com/releases/testing/10/smeupdates-testing/x86_64/  
 #firewall --disabled  
 # /added for netinstall  
   
 %pre --interpreter=/bin/bash  
 # pre section  
 #----- partitioning logic below--------------  
 # pick the first drive that is not removable and is over MINSIZE  
 DIR="/sys/block"  
27    
28  # minimum size of hard drive needed specified in GIGABYTES  # Packages to install
29  MINSIZE=5  %packages
30    @^minimal
31    @base
32    @core
33    -chrony
34    -kexec-tools
35    %end
36    
37    
38    # Partitioning in pre-install
39    %pre --interpreter=/bin/bash --log=/var/log/ks.pre01.log
40    
41    # Minimum size of hard drive needed specified in GB
42    MINSIZE=5
43    
44  # Number of detected drives  # Number of detected drives
45  NDEV=0  NDEV=0
46    
47    # Loop through block devices and keep those over MINSIZE
48    # TODO: Only pair up drives of the same size
49  for DEV in $(lsblk -nl | grep disk | cut -d' ' -f1); do  for DEV in $(lsblk -nl | grep disk | cut -d' ' -f1); do
50    if [ -d /sys/block/$DEV ]; then    if [ -d /sys/block/$DEV ]; then
51      REMOVABLE=`cat /sys/block/$DEV/removable`      REMOVABLE=`cat /sys/block/$DEV/removable`
# Line 55  for DEV in $(lsblk -nl | grep disk | cut Line 60  for DEV in $(lsblk -nl | grep disk | cut
60    fi    fi
61  done  done
62    
63  # For now keep things simple and just use the first one  # Declare useful variables
64  # TODO:  printf -v DRIVELIST ",%s" "${DRIVES[@]}"
65  # * Create software RAID depending on the number of detected drives  DRIVELIST=${DRIVELIST:1}
66  # * Allow non LVM install  LEVEL=1
67    SPARE=0
68  ROOTDRIVE=${DRIVES[0]}  
69  if [ $ROOTDRIVE == "" ] ; then  # Error if detection has failed and fall back
70  echo "No drive suitable for installation found! Please proceed manually."  if [ ${#DRIVES[@]} == 0 ] ; then
71  # first in case detection fails...    echo "No drive suitable for installation found! Reverting to Anaconda defaults."
72  cat << EOF > /tmp/part-include  
73  # Clear the Master Boot Record    cat > /tmp/part-include <<EOF
74  zerombr    # Clear the Master Boot Record
75  # System bootloader configuration    zerombr
76  clearpart --all  --initlabel  
77  # Automatically create partitions, no LVM    # Clear current partitions
78  autopart --lvm    clearpart --all  --initlabel
79    
80      # Automatically create partitions using LVM
81      autopart --lvm --nohome
82  EOF  EOF
83    
84    # Otherwise clear detected devices and set up bootloader
85  else  else
86  cat <<_EOF > /tmp/part-include    cat > /tmp/part-include <<EOF
87  zerombr    # Clear the Master Boot Record
88  clearpart --all --drives=$ROOTDRIVE --initlabel    zerombr
89  bootloader --boot-drive=$ROOTDRIVE  
90  part /boot --fstype xfs --size=500 --ondisk=$ROOTDRIVE --label=BOOT    # Clear current partitions and install bootloader
91  part pv.01 --size=4500 --grow --ondisk=$ROOTDRIVE    clearpart --all --drives=$DRIVELIST --initlabel
92  volgroup main pv.01    ignoredisk --only-use=$DRIVELIST
93  logvol / --fstype xfs --name=root --vgname=main --grow --size=3000 --label=ROOT    bootloader --location=mbr --driveorder=$DRIVELIST
94  logvol swap --fstype swap --name=swap --vgname=main --recommended --label=SWAP  EOF
 _EOF  
95    
96  fi    # If single disk then set up partitioning without RAID
97      # NOTE: From this point we're appending to part-include
98      if [ ${#DRIVES[@]} == 1 ] ; then
99    
100        # Include the EFI partition if necessary
101        if [ -d /sys/firmware/efi ] ; then
102          printf "part /boot/efi --fstype=efi --size=200 --ondisk=%s\n" "${DRIVES[0]}" >> /tmp/part-include
103        fi
104    
105  %end      cat >> /tmp/part-include <<EOF
106        part /boot --fstype=xfs --size=500 --ondisk=${DRIVES[0]} --label=BOOT
107        part pv.01 --size=4300 --grow --ondisk=${DRIVES[0]}
108        volgroup main pv.01
109        logvol / --fstype=xfs --name=root --vgname=main --grow --size=3000 --label=ROOT
110        logvol swap --fstype=swap --name=swap --vgname=main --recommended --label=SWAP
111    EOF
112    
113      # Otherwise multiple disks - prepare for RAID
114      else
115    
116        # Define EFI, boot and LVM RAID partitions
117        for i in "${!DRIVES[@]}"; do
118          if [ -d /sys/firmware/efi ] ; then
119            printf "part raid.%s0 --size=200 --ondisk=%s\n" "$i" "${DRIVES[$i]}" >> /tmp/part-include
120          fi
121          printf "part raid.%s1 --size=500 --ondisk=%s\n" "$i" "${DRIVES[$i]}" >> /tmp/part-include
122          printf "part raid.%s2 --size=4300 --grow --ondisk=%s\n" "$i" "${DRIVES[$i]}" >> /tmp/part-include
123        done
124    
125        # Compute RAID level
126        # from https://wiki.contribs.org/Raid
127        # 2 Drives - Software RAID 1
128        # 3 Drives - Software RAID 1 + 1 Hot-spare
129        # 4 Drives - Software RAID 6
130        # 5+ Drives - Software RAID 6 + 1 Hot-spare
131    
132        if [ ${#DRIVES[@]} == 2 ] ; then
133          LEVEL=1
134          SPARE=0
135        elif [ ${#DRIVES[@]} == 3 ] ; then
136          LEVEL=1
137          SPARE=1
138        elif [ ${#DRIVES[@]} == 4 ] ; then
139          LEVEL=6
140          SPARE=0
141        else
142          LEVEL=6
143          SPARE=1
144        fi
145    
146  # packages to install      # Set up RAID devices
147  %packages      printf -v EFIDEVS "raid.%s0 " "${!DRIVES[@]}"
148  @base      printf -v BOOTDEVS "raid.%s1 " "${!DRIVES[@]}"
149  @core      printf -v ROOTDEVS "raid.%s2 " "${!DRIVES[@]}"
150  -chrony      
151  -kexec-tools      # Include the EFI partition if necessary
152  -firewalld      if [ -d /sys/firmware/efi ] ; then
153  %end        printf "raid /boot/efi --fstype=efi --level=1 --spares=0 --device=md9 %s\n" "$EFIDEVS" >> /tmp/part-include
154        fi
155    
156        printf "raid /boot --fstype=xfs --level=1 --spares=0 --device=md0 %s\n" "$BOOTDEVS" >> /tmp/part-include
157        printf "raid pv.01 --level=%s --spares=%s --device=md1 %s\n" "$LEVEL" "$SPARE" "$ROOTDEVS" >> /tmp/part-include
158    
159        # Set up LVM
160        cat >> /tmp/part-include <<EOF
161        volgroup main pv.01
162        logvol / --fstype xfs --name=root --vgname=main --grow --size=3000 --label=ROOT
163        logvol swap --fstype swap --name=swap --vgname=main --recommended --label=SWAP
164    EOF
165    
166      fi
167    fi
168    
169    %end
170    
171    
172    # SME events in post-install
173  %post  --interpreter=/usr/bin/bash --log=/var/log/ks.post02.log  %post  --interpreter=/usr/bin/bash --log=/var/log/ks.post02.log
174  # before reboot performing post-install  /sbin/rsyslogd;
175  # this is for first alpha iso. we should put this in anaconda  sleep 2;
176  # and / or handle possible upgrade later  /sbin/e-smith/signal-event post-install;
 /sbin/rsyslogd;  
 sleep 2;  
 /sbin/e-smith/signal-event post-install;  
177  sleep 2;  sleep 2;
178  /sbin/e-smith/db configuration set UnsavedChanges no;  /sbin/e-smith/db configuration set UnsavedChanges no;
179  touch /forcequotacheck  touch /forcequotacheck
   
180  %end  %end
181    
182    
183  %post  --nochroot --log=/mnt/sysimage/var/log/ks.post01.log  %post  --nochroot --log=/mnt/sysimage/var/log/ks.post01.log
184  #!/bin/bash  #!/bin/bash
185  sysimage="/mnt/sysimage"  sysimage="/mnt/sysimage"
   
186  cp -r /tmp/anaconda.log ${sysimage}/root/  cp -r /tmp/anaconda.log ${sysimage}/root/
187  %end  %end


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed