1 |
As of my announcement post 20120901114601.4669.56900@localhost I present |
2 |
the plan for Genkernel4 and Geninitramfs. I am waiting for your |
3 |
comments. |
4 |
|
5 |
|
6 |
Geninitramfs |
7 |
~~~~~~~~~~~~ |
8 |
|
9 |
Internal initramfs generator is going to be extracted from Genkernel3 |
10 |
and named Geninitramfs. It will live with its own life independently |
11 |
from Genkernel. It will be quite simple: |
12 |
|
13 |
1) Copy genkernel repository to new geninitramfs repository. |
14 |
2) Remove kernel build parts from geninitramfs. |
15 |
3) Replace "genkernel" name with "geninitramfs" in help, man page, |
16 |
config, and so on. |
17 |
|
18 |
Voilà! |
19 |
|
20 |
Geninitramfs is going to be extracted not earlier than Genkernel4 is |
21 |
usable with Dracut to avoid synchronization work between Geninitramfs |
22 |
and Genkernel3. |
23 |
|
24 |
|
25 |
Genkernel4 |
26 |
~~~~~~~~~~ |
27 |
|
28 |
Genkernel4 is going to be rewritten from scratch in Bash4 and possibly |
29 |
with some help of Python if necessary. Genkernel4 is going to: |
30 |
|
31 |
- build kernel, modules |
32 |
- build initramfs with Dracut or Geninitramfs (or possibly some other |
33 |
tool in the future - initramfs-tools maybe?) |
34 |
- install kernel, modules, firmware and initramfs |
35 |
- add/remove boot manager entries |
36 |
|
37 |
|
38 |
Genkernel4 workflow |
39 |
~~~~~~~~~~~~~~~~~~~ |
40 |
|
41 |
|
42 |
01. List versions to (re)build |
43 |
|
44 |
a) local versions |
45 |
|
46 |
User with "list -l" argument lists versions installed in /usr/src and |
47 |
puts star next to the one to which /usr/src/linux symlink links to. |
48 |
|
49 |
b) remote versions |
50 |
|
51 |
User with "list -r <version-mask>" argument lists versions at |
52 |
kernel.org which could be downloaded and extracted to /usr/src. Why |
53 |
this option while gentoo-sources and others are installed by portage? |
54 |
Because some people prefer that portage doesn't register kernel |
55 |
sources in vdb. |
56 |
|
57 |
02. Select version |
58 |
|
59 |
a) local |
60 |
|
61 |
User selects one of versions listed with "list -l" with arguments |
62 |
"select -l <version>/<position of version on the list>". The check |
63 |
if sources still exist is done and the choice is remembered. |
64 |
|
65 |
b) remote |
66 |
|
67 |
User selects one of versions listed with "list -r" which doesn't |
68 |
exist in /usr/src with arguments "select -r <version>/<position of |
69 |
version on the list>". It is checked if this particular version |
70 |
could be downloaded and the choice is remembered. |
71 |
|
72 |
03. Fetch sources if user has chosen "remote" |
73 |
|
74 |
Tarball is fetched from kernel.org and extracted to /usr/src. |
75 |
|
76 |
04. Setup sources |
77 |
|
78 |
Symlink to selected (and fetched) sources is set. |
79 |
|
80 |
05. Prepare sources |
81 |
|
82 |
a) clean |
83 |
- make mrproper |
84 |
|
85 |
b) copy config |
86 |
|
87 |
Config file is copied from previous version (/proc/config.gz) or from |
88 |
location pointed by user. |
89 |
|
90 |
06. Configure sources |
91 |
|
92 |
- make oldconfig/silentoldconfig/defconfig/... |
93 |
- make config/menuconfig/nconfig/... if user wants to |
94 |
|
95 |
07. Build kernel and modules |
96 |
|
97 |
Runs "make" with CFLAGS, LDFLAGS, and JOBS given by user (in |
98 |
config file). |
99 |
|
100 |
08. Install modules and firmware |
101 |
|
102 |
- make modules_install firmware_install |
103 |
|
104 |
09. Run module-rebuild rebuild if present |
105 |
|
106 |
It could also be a kind of hook defined in config file, for example: |
107 |
|
108 |
POST_MODULES_INSTALL_HOOK="module-rebuild rebuild" |
109 |
|
110 |
10. Build initramfs |
111 |
|
112 |
An initramfs is going to be build either by Dracut or by |
113 |
Geninitramfs. I'd like to avoid using command line options of |
114 |
Genkernel to pass to Geninitramfs or Dracut therefore Geninitramfs |
115 |
or Dracut config is going to be used only. |
116 |
|
117 |
11. Rebuild kernel if initramfs is chosen to be built into kernel |
118 |
|
119 |
12. Mount /boot if present in /etc/fstab |
120 |
|
121 |
13. Install kernel |
122 |
|
123 |
- make install |
124 |
|
125 |
14. Install initramfs |
126 |
|
127 |
Copies from image from tmp directory to /boot. |
128 |
|
129 |
15. Update boot manager entries |
130 |
|
131 |
Adds appropriate entry to boot manager. |
132 |
|
133 |
16. Umount /boot if it has been mounted in step 12. |
134 |
|
135 |
|
136 |
After successful reboot the cleanup could be made either by user command |
137 |
or automatically with some startup script. Following items could be |
138 |
removed: |
139 |
|
140 |
1. old trees in /lib/modules |
141 |
2. old config, System.map and vmlinuz files from /boot |
142 |
3. old initramfs image from /boot |
143 |
4. old entries from boot manager |
144 |
5. clean/mrproper old sources |
145 |
6. (optionally) old sources if not managed by portage |
146 |
|
147 |
|
148 |
-- |
149 |
Amadeusz Żołnowski |