Skip to content

Commit

Permalink
quotas for al8/9
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Sep 17, 2024
1 parent e5aa2b5 commit 5dda970
Showing 1 changed file with 30 additions and 25 deletions.
55 changes: 30 additions & 25 deletions install/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ def installQuota(self,):
command,
1, 0, os.EX_OSERR)

self.edit_fstab('/', '/')

command = 'mount -o remount /'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)

##

if self.distro == ubuntu:
Expand All @@ -171,42 +176,42 @@ def installQuota(self,):
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)


self.edit_fstab('/','/')
self.edit_fstab('/','/')

command = 'mount -o remount /'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
command = 'mount -o remount /'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)

command = 'quotacheck -ugm /'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
command = 'quotacheck -ugm /'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)

####
####

command = "find /lib/modules/ -type f -name '*quota_v*.ko*'"
iResult = subprocess.run(command, capture_output=True, text=True, shell=True)
print(repr(iResult.stdout))
command = "find /lib/modules/ -type f -name '*quota_v*.ko*'"
iResult = subprocess.run(command, capture_output=True, text=True, shell=True)
print(repr(iResult.stdout))

# Only if the first command works, run the rest
# Only if the first command works, run the rest

if iResult.returncode == 0:
command = "echo '{}' | sed -n 's|/lib/modules/\\([^/]*\\)/.*|\\1|p' | sort -u".format(iResult.stdout)
result = subprocess.run(command, capture_output=True, text=True, shell=True)
fResult = result.stdout.rstrip('\n')
print(repr(result.stdout.rstrip('\n')))
if iResult.returncode == 0:
command = "echo '{}' | sed -n 's|/lib/modules/\\([^/]*\\)/.*|\\1|p' | sort -u".format(iResult.stdout)
result = subprocess.run(command, capture_output=True, text=True, shell=True)
fResult = result.stdout.rstrip('\n')
print(repr(result.stdout.rstrip('\n')))

command = 'uname -r'
ffResult = subprocess.run(command, capture_output=True, text=True, shell=True)
ffResult = ffResult.stdout.rstrip('\n')
command = 'uname -r'
ffResult = subprocess.run(command, capture_output=True, text=True, shell=True)
ffResult = ffResult.stdout.rstrip('\n')

command = f"apt-get install linux-modules-extra-{ffResult}"
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
command = f"apt-get install linux-modules-extra-{ffResult}"
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)

###
###

command = f'modprobe quota_v1 -S {ffResult}'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
command = f'modprobe quota_v1 -S {ffResult}'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)

command = f'modprobe quota_v2 -S {ffResult}'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
command = f'modprobe quota_v2 -S {ffResult}'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)

command = f'quotacheck -ugm /'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
Expand Down

0 comments on commit 5dda970

Please sign in to comment.