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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/python

from __future__ import print_function

import apt_pkg
import glob
import os

(sysname, nodename, krelease, version, machine) = os.uname()

sum = 0
for entry in glob.glob("/boot/*%s*" % krelease):
    sum += os.path.getsize(entry)

print("Sum of kernel related files: ", sum, apt_pkg.size_to_str(sum))