-
Notifications
You must be signed in to change notification settings - Fork 0
/
0008-Configure-extlinux.patch
50 lines (44 loc) · 1.87 KB
/
0008-Configure-extlinux.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From 5054123489440230e04e28be41ff661289fb0862 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <[email protected]>
Date: Mon, 9 Jun 2014 13:27:23 +0200
Subject: [PATCH 8/8] Configure extlinux
---
imgcreate/creator.py | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index 9864122..24f2a38 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -1141,6 +1141,24 @@ class PartitionedImageCreator(ImageCreator):
os.symlink('../boot/grub/grub.conf', self._instroot + '/etc/grub.conf')
+ def __create_bootconfig_extlinux(self, name, version, bootpar, ver, args):
+ cfg = "# extlinux.conf generated by python-imgcreate\n"
+ cfg += "#\n"
+ cfg += "default %s (%s) %s\n" % (name, ver, version)
+ cfg += "\n"
+ cfg += "label %s (%s) %s\n" % (name, ver, version)
+ cfg += " kernel /vmlinuz-%s\n" % (ver)
+ cfg += " append " + args + "\n"
+ cfg += " fdtdir /dtb-%s/\n" % (ver)
+ cfg += " initrd /initramfs-%s.img\n" % (ver)
+
+ os.mkdir(self._instroot + '/boot/extlinux')
+ cfgf = open(self._instroot + '/boot/extlinux/extlinux.conf', "w")
+ cfgf.write(cfg)
+ cfgf.close()
+
+ os.symlink('../boot/extlinux/extlinux.conf', self._instroot + '/etc/extlinux.conf')
+
def __install_grub(self):
(dmapfd, dmap) = self._mkstemp('device-map')
os.write(dmapfd, '(hd0) ' + self._image)
@@ -1192,6 +1210,8 @@ class PartitionedImageCreator(ImageCreator):
self.__bootloader = 'grub'
if self.__bootloader == 'grub':
self.__create_bootconfig_grub(name, version, bootpar, ver, args)
+ else:
+ self.__create_bootconfig_extlinux(name, version, bootpar, ver, args)
def _stage_final_image(self):
if self.__bootloader == 'grub':
--
1.9.3