Gentoo Archives: gentoo-genkernel

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

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
[gentoo-genkernel] Re: [RFC] Genkernel4 and Geninitramfs plan "Amadeusz Żołnowski" <aidecoe@g.o>