]> git.proxmox.com Git - systemd.git/commitdiff
systemd-fsckd autopkgtest: Stop assuming that /etc/default/grub.d/90-autopkgtest...
authorMartin Pitt <martin.pitt@ubuntu.com>
Tue, 12 May 2015 07:48:46 +0000 (09:48 +0200)
committerMartin Pitt <martin.pitt@ubuntu.com>
Tue, 12 May 2015 07:48:46 +0000 (09:48 +0200)
This only exists in environments where autopkgtests' adt-setup-vm ran.

debian/changelog
debian/tests/systemd-fsckd

index afaae1a7d02656fd3c25d7fe3a739b3a18328025..fd2497236abf52cd8068e2f4e81b6bb682ec31f5 100644 (file)
@@ -22,6 +22,8 @@ systemd (219-9) UNRELEASED; urgency=medium
     needed for upgrades from wheezy to jessie.
   * systemd.{pre,post}inst: Clean up obsolete (pre-wheezy/jessie) upgrade
     fixes.
+  * systemd-fsckd autopkgtest: Stop assuming that
+    /etc/default/grub.d/90-autopkgtest.cfg exists.
 
  -- Martin Pitt <mpitt@debian.org>  Tue, 05 May 2015 15:14:03 +0200
 
index b01d527f55d0bf8f9d3cc03d5dc23384f1da39fa..4aa0ea37be90ed25787d6e470426b97fab48ed5c 100755 (executable)
@@ -223,15 +223,18 @@ def enable_plymouth(enable=True):
     '''ensure plymouth is enabled in grub config (doesn't reboot)'''
     plymouth_enabled = 'splash' in open('/boot/grub/grub.cfg').read()
     if enable and not plymouth_enabled:
-        shutil.copy2(GRUB_AUTOPKGTEST_CONFIG_PATH, TEST_AUTOPKGTEST_CONFIG_PATH)
-        for line in fileinput.input([TEST_AUTOPKGTEST_CONFIG_PATH], inplace=True):
-            if line.startswith("GRUB_CMDLINE_LINUX_DEFAULT"):
-                print(line[:line.rfind('"')] + ' splash quiet"\n')
-        subprocess.check_call(['update-grub'], stderr=subprocess.DEVNULL)
+        if os.path.exists(GRUB_AUTOPKGTEST_CONFIG_PATH):
+            shutil.copy2(GRUB_AUTOPKGTEST_CONFIG_PATH, TEST_AUTOPKGTEST_CONFIG_PATH)
+            for line in fileinput.input([TEST_AUTOPKGTEST_CONFIG_PATH], inplace=True):
+                if line.startswith("GRUB_CMDLINE_LINUX_DEFAULT"):
+                    print(line[:line.rfind('"')] + ' splash quiet"\n')
+        else:
+            with open(TEST_AUTOPKGTEST_CONFIG_PATH, 'w') as f:
+                f.write('GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0 splash quiet"\n')
     elif not enable and plymouth_enabled:
         with suppress(FileNotFoundError):
             os.remove(TEST_AUTOPKGTEST_CONFIG_PATH)
-        subprocess.check_call(['update-grub'], stderr=subprocess.DEVNULL)
+    subprocess.check_call(['update-grub'], stderr=subprocess.DEVNULL)
 
 
 def boot_with_systemd_distro():