1 |
On 09/09/2012 02:46 PM, Amadeusz Żołnowski wrote: |
2 |
> As of my announcement post 20120901114601.4669.56900@localhost I |
3 |
> present the plan for Genkernel4 and Geninitramfs. I am waiting for |
4 |
> your comments. |
5 |
> |
6 |
> |
7 |
> Geninitramfs ~~~~~~~~~~~~ |
8 |
> |
9 |
> [..] |
10 |
> |
11 |
> Geninitramfs is going to be extracted not earlier than Genkernel4 |
12 |
> is usable with Dracut to avoid synchronization work between |
13 |
> Geninitramfs and Genkernel3. |
14 |
|
15 |
I don't get that point, to be honest. What is the problem and how |
16 |
does pushing the spliut further way help about it? |
17 |
|
18 |
One thing missing in the migration: does geninitramfs keep using |
19 |
/etc/genkernel.conf ? If so, how do we handle that? if not, how do |
20 |
we migrate smoothly? |
21 |
|
22 |
|
23 |
> Genkernel4 ~~~~~~~~~~ |
24 |
> |
25 |
> Genkernel4 is going to be rewritten from scratch in Bash4 and |
26 |
> possibly with some help of Python if necessary. |
27 |
|
28 |
Unlike with init scripts, there is no need for using shell scripting |
29 |
here, right? If so, let's stick to Python >=2.6 only, if just for |
30 |
argparse alone. Bash is one of genkernel's current issues in my opinion. |
31 |
|
32 |
|
33 |
> Genkernel4 is going to: |
34 |
> |
35 |
> - build kernel, modules - build initramfs with Dracut or |
36 |
> Geninitramfs (or possibly some other tool in the future - |
37 |
> initramfs-tools maybe?) - install kernel, modules, firmware and |
38 |
> initramfs - add/remove boot manager entries |
39 |
> |
40 |
> |
41 |
> Genkernel4 workflow ~~~~~~~~~~~~~~~~~~~ |
42 |
> |
43 |
> |
44 |
> 01. List versions to (re)build |
45 |
> |
46 |
> a) local versions |
47 |
> |
48 |
> User with "list -l" argument lists versions installed in /usr/src |
49 |
> and puts star next to the one to which /usr/src/linux symlink links |
50 |
> to. |
51 |
> |
52 |
> b) remote versions |
53 |
> |
54 |
> User with "list -r <version-mask>" argument lists versions at |
55 |
> kernel.org which could be downloaded and extracted to /usr/src. |
56 |
> Why this option while gentoo-sources and others are installed by |
57 |
> portage? Because some people prefer that portage doesn't register |
58 |
> kernel sources in vdb. |
59 |
> |
60 |
> 02. Select version |
61 |
> |
62 |
> a) local |
63 |
> |
64 |
> User selects one of versions listed with "list -l" with arguments |
65 |
> "select -l <version>/<position of version on the list>". The |
66 |
> check if sources still exist is done and the choice is remembered. |
67 |
> |
68 |
> b) remote |
69 |
> |
70 |
> User selects one of versions listed with "list -r" which doesn't |
71 |
> exist in /usr/src with arguments "select -r <version>/<position of |
72 |
> version on the list>". It is checked if this particular version |
73 |
> could be downloaded and the choice is remembered. |
74 |
|
75 |
These are feature additions, if I am not mistaken. Sounds good for later. |
76 |
|
77 |
|
78 |
> 03. Fetch sources if user has chosen "remote" |
79 |
> |
80 |
> Tarball is fetched from kernel.org and extracted to /usr/src. |
81 |
> |
82 |
> 04. Setup sources |
83 |
> |
84 |
> Symlink to selected (and fetched) sources is set. |
85 |
> |
86 |
> 05. Prepare sources |
87 |
> |
88 |
> a) clean - make mrproper |
89 |
> |
90 |
> b) copy config |
91 |
> |
92 |
> Config file is copied from previous version (/proc/config.gz) or |
93 |
> from location pointed by user. |
94 |
> |
95 |
> 06. Configure sources |
96 |
> |
97 |
> - make oldconfig/silentoldconfig/defconfig/... - make |
98 |
> config/menuconfig/nconfig/... if user wants to |
99 |
> |
100 |
> 07. Build kernel and modules |
101 |
> |
102 |
> Runs "make" with CFLAGS, LDFLAGS, and JOBS given by user (in config |
103 |
> file). |
104 |
|
105 |
The question of building as root or non-root by our own Tobias |
106 |
Klausmann pops into my mind: |
107 |
<http://blog.i-no.de//archives/2012/07/index.html#e2012-07-04T19_28_32.txt> |
108 |
|
109 |
|
110 |
> 08. Install modules and firmware |
111 |
> |
112 |
> - make modules_install firmware_install |
113 |
> |
114 |
> 09. Run module-rebuild rebuild if present |
115 |
> |
116 |
> It could also be a kind of hook defined in config file, for |
117 |
> example: |
118 |
> |
119 |
> POST_MODULES_INSTALL_HOOK="module-rebuild rebuild" |
120 |
> |
121 |
> 10. Build initramfs |
122 |
> |
123 |
> An initramfs is going to be build either by Dracut or by |
124 |
> Geninitramfs. I'd like to avoid using command line options of |
125 |
> Genkernel to pass to Geninitramfs or Dracut therefore Geninitramfs |
126 |
> or Dracut config is going to be used only. |
127 |
|
128 |
I see the point (when lookign from a maintenance perspective) but if |
129 |
genkernel 4.x has the power to work with different kernel versions, at |
130 |
least the kernel to operate with must be passed to the initramfs |
131 |
generator, right? I could imagine it would even make sense to |
132 |
implement and forward all the options initially. |
133 |
|
134 |
|
135 |
> 11. Rebuild kernel if initramfs is chosen to be built into kernel |
136 |
> |
137 |
> 12. Mount /boot if present in /etc/fstab |
138 |
> |
139 |
> 13. Install kernel |
140 |
> |
141 |
> - make install |
142 |
> |
143 |
> 14. Install initramfs |
144 |
> |
145 |
> Copies from image from tmp directory to /boot. |
146 |
> |
147 |
> 15. Update boot manager entries |
148 |
> |
149 |
> Adds appropriate entry to boot manager. |
150 |
> |
151 |
> 16. Umount /boot if it has been mounted in step 12. |
152 |
> |
153 |
> |
154 |
> After successful reboot the cleanup could be made either by user |
155 |
> command or automatically with some startup script. Following items |
156 |
> could be removed: |
157 |
> |
158 |
> 1. old trees in /lib/modules 2. old config, System.map and vmlinuz |
159 |
> files from /boot 3. old initramfs image from /boot 4. old entries |
160 |
> from boot manager 5. clean/mrproper old sources 6. (optionally) old |
161 |
> sources if not managed by portage |
162 |
|
163 |
Existing tool app-admin/eclean-kernel comes to my mind. We should |
164 |
check where re-use or duplication makes sense. |
165 |
|
166 |
Best, |
167 |
|
168 |
|
169 |
|
170 |
Sebastian |