1 |
On 03/24/12 23:27, Sebastian Pipping wrote: |
2 |
> On 03/25/2012 05:11 AM, Richard Farina wrote: |
3 |
>> A while back my project, pentoo, forked genkernel. Super sorry about |
4 |
>> that (no seriously). Several gentoo devs have approached me about |
5 |
>> merging my changes back in so here I am, looking forward to getting rid |
6 |
>> of my garbage fork and extending the features of gentoo's genkernel. |
7 |
>> |
8 |
>> https://www.pentoo.ch/svn/genkernel/trunk/ |
9 |
>> |
10 |
>> likewhoa is already working on the aufs changes (the biggest set of |
11 |
>> changes), but I'll begin to merge in the smaller stuff as I find the time. |
12 |
>> |
13 |
>> Please feel free to poke at my repo and if anyone wants to help with any |
14 |
>> part please just let me know, I need it. |
15 |
> It looks like your tag "3.4.18" is quite close to trunk. Trunk seems to |
16 |
> mostly differ to 3.4.18 of mainline with respect to the init script stuff. |
17 |
There are a few major differences to our genkernel which were made by |
18 |
various members of the pentoo team (mostly not me), they are outlined as |
19 |
follows: |
20 |
|
21 |
aufs support, under aufs support we allow for persistant changes in a |
22 |
partition and modular changes in a file. The "module" support we add |
23 |
allows us to make a compressed file that gets overlaid onto the live |
24 |
filesystem at boot, we use this for saving changes or adding programs |
25 |
one at a time. As I said earlier, this is the biggest set of changes. |
26 |
|
27 |
Additionally we have made a few changes around e2fsprogs e2fstools for |
28 |
use in the above aufs stuff. |
29 |
|
30 |
On a completely separate note, we added in a keymap for .ch (which seems |
31 |
to just be an alias for .fr). |
32 |
|
33 |
Lastly, and possibly the only bit interesting to most of the list, we |
34 |
added in selectable compression to make the initramfs compress with the |
35 |
best possible supported method, since it's the simplest, I'll paste that |
36 |
inline and get some feedback now. Basically we remove all that static |
37 |
stuff and then attempt to detect the best compression and use it. Please |
38 |
note this diff is based on 3.4.18 not current, I'll update once you all |
39 |
pick it apart. |
40 |
|
41 |
|
42 |
diff -Naur '--exclude=.svn' '--exclude=.git' |
43 |
genkernel-3.4.18/gen_initramfs.sh pentoo/genkernel/trunk/gen_initramfs.sh |
44 |
--- genkernel-3.4.18/gen_initramfs.sh 2012-03-24 23:23:39.478742478 -0400 |
45 |
+++ pentoo/genkernel/trunk/gen_initramfs.sh 2011-10-16 |
46 |
21:32:05.000000000 -0400 |
47 |
@@ -652,16 +672,40 @@ |
48 |
append_data 'overlay' |
49 |
fi |
50 |
|
51 |
- gzip -9 "${CPIO}" |
52 |
- mv -f "${CPIO}.gz" "${CPIO}" |
53 |
- |
54 |
+ # handle the last image |
55 |
if isTrue "${INTEGRATED_INITRAMFS}" |
56 |
then |
57 |
-# cp ${TMPDIR}/initramfs-${KV} |
58 |
${KERNEL_DIR}/usr/initramfs_data.cpio.gz |
59 |
- mv ${TMPDIR}/initramfs-${KV} |
60 |
${TMPDIR}/initramfs-${KV}.cpio.gz |
61 |
-# sed -i |
62 |
"s|^.*CONFIG_INITRAMFS_SOURCE=.*$|CONFIG_INITRAMFS_SOURCE=\"${TMPDIR}/initramfs-${KV}.cpio.gz\"|" |
63 |
${KERNEL_DIR}/.config |
64 |
+ # put in kernel, here we should put CPIO |
65 |
sed -i '/^.*CONFIG_INITRAMFS_SOURCE=.*$/d' |
66 |
${KERNEL_DIR}/.config |
67 |
- echo -e |
68 |
"CONFIG_INITRAMFS_SOURCE=\"${TMPDIR}/initramfs-${KV}.cpio.gz\"\nCONFIG_INITRAMFS_ROOT_UID=0\nCONFIG_INITRAMFS_ROOT_GID=0" |
69 |
>> ${KERNEL_DIR}/.config |
70 |
+ echo -e |
71 |
"CONFIG_INITRAMFS_SOURCE=\"${CPIO}\"\nCONFIG_INITRAMFS_ROOT_UID=0\nCONFIG_INITRAMFS_ROOT_GID=0" |
72 |
>> ${KERNEL_DIR}/.config |
73 |
+ else |
74 |
+ # compress using the best way |
75 |
+ print_info 1 " >> compressing the initrd " False |
76 |
+ if `grep -q '^CONFIG_RD_XZ=y' ${KERNEL_DIR}/.config` && |
77 |
test -f /usr/bin/xz |
78 |
+ then |
79 |
+ print_info 1 "using xz..." True False |
80 |
+ /usr/bin/xz -e --check=none -z -f -9 ${CPIO} |
81 |
+ mv "${CPIO}.xz" "${CPIO%%.cpio}" |
82 |
+ |
83 |
+ elif `grep -q '^CONFIG_RD_LZMA=y' ${KERNEL_DIR}/.config` |
84 |
&& test -f /usr/bin/lzma |
85 |
+ then |
86 |
+ print_info 1 "using lzma..." True False |
87 |
+ /usr/bin/lzma -z -f -9 ${CPIO} |
88 |
+ mv "${CPIO}.lzma" "${CPIO%%.cpio}" |
89 |
+ elif `grep -q '^CONFIG_RD_BZIP2=y' |
90 |
${KERNEL_DIR}/.config` && test -f /bin/bzip2 |
91 |
+ then |
92 |
+ print_info 1 "using bzip2..." True False |
93 |
+ /bin/bzip2 -z -f -9 ${CPIO} |
94 |
+ mv "${CPIO}.bz2" "${CPIO%%.cpio}" |
95 |
+ elif test -f /bin/gzip |
96 |
+ then |
97 |
+ print_info 1 "using gzip..." True False |
98 |
+ /bin/gzip -f -9 ${CPIO} |
99 |
+ mv "${CPIO}.gz" "${CPIO%%.cpio}" |
100 |
+ else |
101 |
+ print_info 1 "--not compressed!" True False |
102 |
+ mv "${CPIO}" "${CPIO%%.cpio}" |
103 |
+ fi |
104 |
fi |
105 |
|
106 |
if ! isTrue "${CMD_NOINSTALL}" |
107 |
|
108 |
|
109 |
Let the abuse begin, |
110 |
|
111 |
Zero_Chaos |
112 |
> Best, |
113 |
> |
114 |
> |
115 |
> |
116 |
> Sebastian |
117 |
> |
118 |
> |