Revision d144e954
b/image_creator/os_type/linux.py | ||
---|---|---|
59 | 59 |
return attr[1] |
60 | 60 |
|
61 | 61 |
def sysprep_acpid(self, print_header=True): |
62 |
"""Replace acpid powerdown action scripts to automatically shutdown
|
|
63 |
the system without checking if a GUI is running.
|
|
62 |
"""Replace acpid powerdown action scripts to immediately shutdown the
|
|
63 |
system without checking if a GUI is running. |
|
64 | 64 |
""" |
65 | 65 |
|
66 | 66 |
if print_header: |
... | ... | |
98 | 98 |
if not self.g.is_file(action): |
99 | 99 |
warn("Acpid action file: %s does not exist" % action) |
100 | 100 |
return |
101 |
self.g.copy_file_to_file(fullpath, \
|
|
102 |
"%s.orig.snf-image-creator-%d" % (fullpath, time.time()))
|
|
103 |
self.g.write(fullpath, powerbtn_action)
|
|
101 |
self.g.copy_file_to_file(action, \
|
|
102 |
"%s.orig.snf-image-creator-%d" % (action, time.time()))
|
|
103 |
self.g.write(action, powerbtn_action)
|
|
104 | 104 |
return |
105 | 105 |
else: |
106 | 106 |
warn("Acpid event file %s does not contain and action") |
107 | 107 |
return |
108 | 108 |
elif event.strip() == ".*": |
109 | 109 |
warn("Found action `.*'. Don't know how to handle this." \ |
110 |
" Please edit \%s' image file manually to make the " |
|
110 |
" Please edit \%s' image file manually to make the " \
|
|
111 | 111 |
"system immediatelly shutdown when an power button acpi " \ |
112 |
"event occures") |
|
112 |
"event occures" % action)
|
|
113 | 113 |
return |
114 | 114 |
|
115 | 115 |
def sysprep_persistent_net_rules(self, print_header=True): |
Also available in: Unified diff