Skip to content

Commit

Permalink
Install Boot disk Partition Type
Browse files Browse the repository at this point in the history
* This code helps to partition boot disk eithier with or without LVM
* when "--partition-type plain" is used standard partitoin will occur on boot disk
* By default, LVM partition will occur during installation
* This code will exit, when user initiates with wrong value

Signed-off-by: priyama2 <[email protected]>
  • Loading branch information
priyama2 committed Sep 30, 2024
1 parent 8103df2 commit a64d93e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
20 changes: 14 additions & 6 deletions installvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,20 @@ def createKickstart(self):
lstr = "telnet\njava\n%end"
urlstring = "--url=nfs://"+vmParser.confparser('repo', 'RepoIP') + ':/var/www/html' + self.repoDir

if vmParser.args.fs_type == 'btrfs':
addksstring = "autopart --type=lvm --fstype=btrfs"
elif vmParser.args.fs_type == 'ext4':
addksstring = "autopart --type=lvm --fstype=ext4"
else:
addksstring = "autopart --type=lvm --fstype=xfs"
exit_nosupport=0
if vmParser.args.partition_type not in ['lvm', 'plain']:
logging.info("Aborting Installation : as partition type %s is not supported or not valid" % vmParser.args.partition_type)
exit_nosupport=1

if vmParser.args.fs_type not in ['xfs','ext4', 'btrfs']:
logging.info("Aborting Installation : as filesystem type %s is not supported or not valid" % vmParser.args.fs_type)
exit_nosupport=1

if exit_nosupport:
exit(1)

addksstring = "autopart --type=%s --fstype=%s" % (vmParser.args.partition_type,vmParser.args.fs_type)


ksparm = sftp.open('/var/www/html'+self.ksinst, 'w')
sshd_file = ''
Expand Down
1 change: 1 addition & 0 deletions lib/configparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def parse_args(self, argv=None):
parser.add_argument(
'--install-protocol' , help='Mode of Install Protocol ex: http, ftp, nfs',default='http')
parser.add_argument('--fs-type' ,help='RootFS type ex: xfs, ext4, btrfs',default='xfs')
parser.add_argument('--partition-type' ,help='Boot disk partition type with or without lvm ex: plain or lvm',default='lvm')
parser.add_argument(
'--set-boot-order', help='yes/True to set the boot disk order', required=False)
parser.add_argument(
Expand Down

0 comments on commit a64d93e

Please sign in to comment.