fix_editing_grub_default.patch 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. --- panda.py~ 2013-06-26 23:14:48.709209877 +0200
  2. +++ panda.py 2013-06-26 23:15:23.467208607 +0200
  3. @@ -269,10 +269,10 @@
  4. with open(grub_default_file) as grub_default:
  5. for line in grub_default:
  6. - if "GRUB_CMDLINE_LINUX=" in line:
  7. + if "GRUB_CMDLINE_LINUX_DEFAULT=" in line:
  8. params = {} if line.startswith("#") else dict((k, v.split(','))
  9. for k,v in (item.split('=') if "=" in item else (item, '')
  10. - for item in line.replace('"', '').split("LINUX=")[1].split()))
  11. + for item in line.replace('"', '').replace("'", "").split("DEFAULT=")[1].split()))
  12. old_line = " ".join(["%s%s%s" % (k, "=" if l[0] else "", ",".join([v for v in l])) for k, l in sorted(params.items())])
  13. if arg == "os":
  14. try :
  15. @@ -285,10 +285,6 @@
  16. if not params["xorg"] or not params["xorg"][0]: del params["xorg"]
  17. except KeyError:
  18. pass
  19. - try :
  20. - del params["vga"]
  21. - except KeyError:
  22. - pass
  23. status = "os"
  24. elif arg == "vendor":
  25. @@ -302,7 +298,6 @@
  26. if not params["xorg"] or not params["xorg"][0]: del params["xorg"]
  27. except KeyError:
  28. pass
  29. - if self.driver_name in ["nvidia-current"]: params["vga"] = ["794"]
  30. status = "vendor"
  31. elif arg == "generic":
  32. @@ -430,4 +425,3 @@
  33. # print p.update_grub_entries("vendor")
  34. print p.update_system_files("vendor")
  35. print p.get_needed_driver_packages(installable=False)
  36. -
  37. --- panda.py~ 2013-07-12 12:33:05.029649344 +0200
  38. +++ panda.py 2013-07-12 12:33:09.728649172 +0200
  39. @@ -309,7 +309,7 @@
  40. new_line = " ".join(["%s%s" % ("%s=" % k if l[0] else k, ",".join([v for v in l])) for k, l in sorted(params.items())])
  41. configured = old_line != new_line
  42. - new_line = 'GRUB_CMDLINE_LINUX="%s"\n' % new_line
  43. + new_line = 'GRUB_CMDLINE_LINUX_DEFAULT="%s"\n' % new_line
  44. grub_tmp.write(new_line)
  45. else:
  46. grub_tmp.write(line)