~ubuntu-core-dev/ubuntu-release-upgrader/trunk

« back to all changes in this revision

Viewing changes to utils/est_kernel_size.py

  • Committer: Balint Reczey
  • Date: 2019-12-17 20:29:55 UTC
  • Revision ID: balint.reczey@canonical.com-20191217202955-nqe4xz2c54s60y59
Moved to git at https://git.launchpad.net/ubuntu-release-upgrader

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python3
2
 
 
3
 
import apt_pkg
4
 
import glob
5
 
import os
6
 
 
7
 
(sysname, nodename, krelease, version, machine) = os.uname()
8
 
 
9
 
sum = 0
10
 
for entry in glob.glob("/boot/*%s*" % krelease):
11
 
    sum += os.path.getsize(entry)
12
 
 
13
 
print("Sum of kernel related files: ", sum, apt_pkg.size_to_str(sum))