Merge update_grub into client
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import re
|
||||
import string
|
||||
@@ -8,20 +7,6 @@ import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser(description='iconograph update_grub')
|
||||
parser.add_argument(
|
||||
'--boot-dir',
|
||||
dest='boot_dir',
|
||||
action='store',
|
||||
required=True)
|
||||
parser.add_argument(
|
||||
'--image-dir',
|
||||
dest='image_dir',
|
||||
action='store',
|
||||
required=True)
|
||||
FLAGS = parser.parse_args()
|
||||
|
||||
|
||||
class GrubUpdater(object):
|
||||
|
||||
_VOLUME_ID_REGEX = re.compile(b'^Volume id: (?P<volume_id>.+)$', re.MULTILINE)
|
||||
@@ -76,12 +61,3 @@ menuentry "%(image_filename)s (%(volume_id)s)" --hotkey=%(hotkey)s {
|
||||
'hotkey': self._HOTKEYS[i],
|
||||
'volume_id': self._GetVolumeID(os.path.join(self._image_dir, filename)),
|
||||
})
|
||||
|
||||
|
||||
def main():
|
||||
updater = GrubUpdater(FLAGS.image_dir, FLAGS.boot_dir)
|
||||
updater.Update()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user