Gentoo Archives: gentoo-genkernel

From: Richard Farina <sidhayn@×××××.com>
To: gentoo-genkernel@l.g.o
Subject: Re: [gentoo-genkernel] Hello all
Date: Sun, 25 Mar 2012 04:10:25
In Reply to: Re: [gentoo-genkernel] Hello all by Sebastian Pipping
On 03/24/12 23:27, Sebastian Pipping wrote:
> On 03/25/2012 05:11 AM, Richard Farina wrote: >> A while back my project, pentoo, forked genkernel. Super sorry about >> that (no seriously). Several gentoo devs have approached me about >> merging my changes back in so here I am, looking forward to getting rid >> of my garbage fork and extending the features of gentoo's genkernel. >> >> >> >> likewhoa is already working on the aufs changes (the biggest set of >> changes), but I'll begin to merge in the smaller stuff as I find the time. >> >> Please feel free to poke at my repo and if anyone wants to help with any >> part please just let me know, I need it. > It looks like your tag "3.4.18" is quite close to trunk. Trunk seems to > mostly differ to 3.4.18 of mainline with respect to the init script stuff.
There are a few major differences to our genkernel which were made by various members of the pentoo team (mostly not me), they are outlined as follows: aufs support, under aufs support we allow for persistant changes in a partition and modular changes in a file. The "module" support we add allows us to make a compressed file that gets overlaid onto the live filesystem at boot, we use this for saving changes or adding programs one at a time. As I said earlier, this is the biggest set of changes. Additionally we have made a few changes around e2fsprogs e2fstools for use in the above aufs stuff. On a completely separate note, we added in a keymap for .ch (which seems to just be an alias for .fr). Lastly, and possibly the only bit interesting to most of the list, we added in selectable compression to make the initramfs compress with the best possible supported method, since it's the simplest, I'll paste that inline and get some feedback now. Basically we remove all that static stuff and then attempt to detect the best compression and use it. Please note this diff is based on 3.4.18 not current, I'll update once you all pick it apart. diff -Naur '--exclude=.svn' '--exclude=.git' genkernel-3.4.18/ pentoo/genkernel/trunk/ --- genkernel-3.4.18/ 2012-03-24 23:23:39.478742478 -0400 +++ pentoo/genkernel/trunk/ 2011-10-16 21:32:05.000000000 -0400 @@ -652,16 +672,40 @@ append_data 'overlay' fi - gzip -9 "${CPIO}" - mv -f "${CPIO}.gz" "${CPIO}" - + # handle the last image if isTrue "${INTEGRATED_INITRAMFS}" then -# cp ${TMPDIR}/initramfs-${KV} ${KERNEL_DIR}/usr/initramfs_data.cpio.gz - mv ${TMPDIR}/initramfs-${KV} ${TMPDIR}/initramfs-${KV}.cpio.gz -# sed -i "s|^.*CONFIG_INITRAMFS_SOURCE=.*$|CONFIG_INITRAMFS_SOURCE=\"${TMPDIR}/initramfs-${KV}.cpio.gz\"|" ${KERNEL_DIR}/.config + # put in kernel, here we should put CPIO sed -i '/^.*CONFIG_INITRAMFS_SOURCE=.*$/d' ${KERNEL_DIR}/.config - echo -e "CONFIG_INITRAMFS_SOURCE=\"${TMPDIR}/initramfs-${KV}.cpio.gz\"\nCONFIG_INITRAMFS_ROOT_UID=0\nCONFIG_INITRAMFS_ROOT_GID=0"
>> ${KERNEL_DIR}/.config
>> ${KERNEL_DIR}/.config
+ else + # compress using the best way + print_info 1 " >> compressing the initrd " False + if `grep -q '^CONFIG_RD_XZ=y' ${KERNEL_DIR}/.config` && test -f /usr/bin/xz + then + print_info 1 "using xz..." True False + /usr/bin/xz -e --check=none -z -f -9 ${CPIO} + mv "${CPIO}.xz" "${CPIO%%.cpio}" + + elif `grep -q '^CONFIG_RD_LZMA=y' ${KERNEL_DIR}/.config` && test -f /usr/bin/lzma + then + print_info 1 "using lzma..." True False + /usr/bin/lzma -z -f -9 ${CPIO} + mv "${CPIO}.lzma" "${CPIO%%.cpio}" + elif `grep -q '^CONFIG_RD_BZIP2=y' ${KERNEL_DIR}/.config` && test -f /bin/bzip2 + then + print_info 1 "using bzip2..." True False + /bin/bzip2 -z -f -9 ${CPIO} + mv "${CPIO}.bz2" "${CPIO%%.cpio}" + elif test -f /bin/gzip + then + print_info 1 "using gzip..." True False + /bin/gzip -f -9 ${CPIO} + mv "${CPIO}.gz" "${CPIO%%.cpio}" + else + print_info 1 "--not compressed!" True False + mv "${CPIO}" "${CPIO%%.cpio}" + fi fi if ! isTrue "${CMD_NOINSTALL}" Let the abuse begin, Zero_Chaos
> Best, > > > > Sebastian > >


Subject Author
Re: [gentoo-genkernel] Hello all Sebastian Pipping <sping@g.o>