diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-01-14 14:12:56 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-18 11:47:06 +0000 |
commit | 4d5d5dd428e8d8fa0e155988286f3b45f47e1544 (patch) | |
tree | 7870f309f56ca9cc804640416c86d8dc880ff7db /scripts/lib/wic/plugins/source/bootimg-efi.py | |
parent | 26fb2a1a45049fd5731ae83efb962a84afb14568 (diff) | |
download | poky-4d5d5dd428e8d8fa0e155988286f3b45f47e1544.tar.gz |
wic: get rid of get_timeout getter
Used bootloader.timeout instead of kickstart.get_timeout getter.
Accessing attributes instead of getting them with getters is
more pythonic, shorter and readable. It also more consistent as
most of partition and bootloader attributes are used this way.
This change also takes care of appendLine bootloader attribute:
it's renamed to bootloader.append attribute provided by new parser.
(From OE-Core rev: 8088caeff5bf4ee9279b47a69c9f1e5537909601)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/plugins/source/bootimg-efi.py')
-rw-r--r-- | scripts/lib/wic/plugins/source/bootimg-efi.py | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py index 556586f322..35afa30ea6 100644 --- a/scripts/lib/wic/plugins/source/bootimg-efi.py +++ b/scripts/lib/wic/plugins/source/bootimg-efi.py | |||
@@ -66,16 +66,13 @@ class BootimgEFIPlugin(SourcePlugin): | |||
66 | grubefi_conf = "" | 66 | grubefi_conf = "" |
67 | grubefi_conf += "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1\n" | 67 | grubefi_conf += "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1\n" |
68 | grubefi_conf += "default=boot\n" | 68 | grubefi_conf += "default=boot\n" |
69 | timeout = kickstart.get_timeout(creator.ks) | 69 | grubefi_conf += "timeout=%s\n" % bootloader.timeout |
70 | if not timeout: | ||
71 | timeout = 0 | ||
72 | grubefi_conf += "timeout=%s\n" % timeout | ||
73 | grubefi_conf += "menuentry 'boot'{\n" | 70 | grubefi_conf += "menuentry 'boot'{\n" |
74 | 71 | ||
75 | kernel = "/bzImage" | 72 | kernel = "/bzImage" |
76 | 73 | ||
77 | grubefi_conf += "linux %s root=%s rootwait %s\n" \ | 74 | grubefi_conf += "linux %s root=%s rootwait %s\n" \ |
78 | % (kernel, creator.rootdev, options) | 75 | % (kernel, creator.rootdev, bootloader.append) |
79 | grubefi_conf += "}\n" | 76 | grubefi_conf += "}\n" |
80 | 77 | ||
81 | msger.debug("Writing grubefi config %s/hdd/boot/EFI/BOOT/grub.cfg" \ | 78 | msger.debug("Writing grubefi config %s/hdd/boot/EFI/BOOT/grub.cfg" \ |
@@ -95,15 +92,11 @@ class BootimgEFIPlugin(SourcePlugin): | |||
95 | install_cmd = "install -d %s/loader/entries" % hdddir | 92 | install_cmd = "install -d %s/loader/entries" % hdddir |
96 | exec_cmd(install_cmd) | 93 | exec_cmd(install_cmd) |
97 | 94 | ||
98 | options = creator.ks.handler.bootloader.appendLine | 95 | bootloader = creator.ks.bootloader |
99 | |||
100 | timeout = kickstart.get_timeout(creator.ks) | ||
101 | if not timeout: | ||
102 | timeout = 0 | ||
103 | 96 | ||
104 | loader_conf = "" | 97 | loader_conf = "" |
105 | loader_conf += "default boot\n" | 98 | loader_conf += "default boot\n" |
106 | loader_conf += "timeout %d\n" % timeout | 99 | loader_conf += "timeout %d\n" % bootloader.timeout |
107 | 100 | ||
108 | msger.debug("Writing gummiboot config %s/hdd/boot/loader/loader.conf" \ | 101 | msger.debug("Writing gummiboot config %s/hdd/boot/loader/loader.conf" \ |
109 | % cr_workdir) | 102 | % cr_workdir) |
@@ -131,7 +124,8 @@ class BootimgEFIPlugin(SourcePlugin): | |||
131 | boot_conf = "" | 124 | boot_conf = "" |
132 | boot_conf += "title boot\n" | 125 | boot_conf += "title boot\n" |
133 | boot_conf += "linux %s\n" % kernel | 126 | boot_conf += "linux %s\n" % kernel |
134 | boot_conf += "options LABEL=Boot root=%s %s\n" % (creator.rootdev, options) | 127 | boot_conf += "options LABEL=Boot root=%s %s\n" % \ |
128 | (creator.rootdev, bootloader.append) | ||
135 | 129 | ||
136 | msger.debug("Writing gummiboot config %s/hdd/boot/loader/entries/boot.conf" \ | 130 | msger.debug("Writing gummiboot config %s/hdd/boot/loader/entries/boot.conf" \ |
137 | % cr_workdir) | 131 | % cr_workdir) |