Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 417375 - media-gfx/splashutils: initramfs corruption when compression is not gzip (new genkernel feature)
Summary: media-gfx/splashutils: initramfs corruption when compression is not gzip (new...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard: Pending removal: 2018-11-21
Keywords: PMASKED, REGRESSION
: 453034 488524 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-05-24 14:03 UTC by Fabio Erculiani (RETIRED)
Modified: 2018-11-28 13:19 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Add lzma/xz compression support (1.5.4.4-xz.patch,1.88 KB, patch)
2012-06-26 00:15 UTC, AlexOmskiy
Details | Diff
1.5.4.4-all-kernel-compressors.patch (1.5.4.4-all-kernel-compressors.patch,2.08 KB, patch)
2012-06-26 03:18 UTC, AlexOmskiy
Details | Diff
Patch on splashutils-1.5.4.4/scripts/splash_geninitramfs.in (splashutils-1.5.4.4-splash_geninitramfs-compress.patch,2.73 KB, patch)
2013-06-17 09:08 UTC, Vince C.
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio Erculiani (RETIRED) gentoo-dev 2012-05-24 14:03:32 UTC
splash_geninitramfs corrupts genkernel-generated initramfs when its compression is not gzip. The outcome is an unbootable system in most cases, due to initramfs not being loaded by the kernel.

Steps to reproduce:
1. build an initramfs using xz compression using genkernel >3.4.24
2. run: splash_geninitramfs -a <initramfs> <theme name>


printv "o Creating initramfs image.."
if [ "$mode" == "g" ] || [ "$mode" == "a" ]; then
        (cd "${imgdir}" ; find . | cpio --quiet -o -H newc \
             | gzip -9>../img.cpio.gz)
        mv "${workdir}/img.cpio.gz" "${img}"
fi

This above is smelly.
Comment 1 AlexOmskiy 2012-06-26 00:15:26 UTC
Created attachment 316259 [details, diff]
Add lzma/xz compression support
Comment 2 AlexOmskiy 2012-06-26 00:16:19 UTC
From my local overlay: splashutils-1.5.4.4-r1.ebuild,v 1.2

#Add xz/lzma support
grep -q "${PF}.ebuild,v 1.2" "${PORTDIR}"/media-gfx/splashutils/${PF}.ebuild \
 || die
RDEPEND+=app-arch/xz-utils
src_prepare() {
 ...
+epatch "${FILESDIR}"/1.5.4.4-xz.patch

 rm -f m4/*
 eautoreconf
}
Comment 3 AlexOmskiy 2012-06-26 03:18:15 UTC
Created attachment 316271 [details, diff]
1.5.4.4-all-kernel-compressors.patch

Here i add bzip2 and lzo compression support.
The 1.5 half later i downgrade zlib to stable 1.2.5.1-r2 ver.
Now my @system and all deps are stable (x86): gcc-4.5.3-r2, glibc-2.14.1-r3.
After revdep-rebuild i rebuild deps of splashutils:
emerge --oneshot gpm freetype bzip2 libpng lcms libmng baselayout cpio xz-utils fbgrab libjpeg-turbo klibc pkgconfig
ahd, then:
emerge --oneshot splashutils
with new patch.

RDEPEND+=app-arch/lzop
src_prepare() {
-epatch "${FILESDIR}"/1.5.4.4-xz.patch
+epatch "${FILESDIR}/1.5.4.4-all-kernel-compressors.patch"
}

P.S.: I don't use genkernel
Comment 4 Pacho Ramos gentoo-dev 2013-02-03 09:29:10 UTC
*** Bug 453034 has been marked as a duplicate of this bug. ***
Comment 5 Vince C. 2013-02-04 07:58:22 UTC
Shameless self-promo: nice but my patch reuses Genkernel's approach, minimizing the number of possible arguments on the command line ;-) .
Comment 6 AlexOmskiy 2013-02-05 22:45:43 UTC
[[[ Poorly translated in Google thought (Плохо переведённые в гугле мысли) (and then edit by me) ]]]

No problem here.
Projects genkernel and splashutils differently understand the purpose initrd and are independent of each other.
genkernel initramfs creates all modules to load a specific kernel configuration. And, if necessary, with a splash.
splash_geninitramfs includes into initramfs only splash.
And i think they do not have to edit the files initrd - only to create new ones.

PS: About dracut i do not know anything. Don't use.

[[[ Orig thinks (Оригинальные мысли) ]]]

Проблемы здесь вообще нет.
Проекты genkernel и splashutils по разному понимают назначение initrd и не зависят друг от друга.
genkernel создаёт initramfs со всеми модулями для загрузки конкретной конфигурации ядра. И, если надо, со сплешем.
splash_geninitramfs включает в initramfs только сплеш.
И я думаю они не обязаны редактировать файлы initrd - только создавать новые.

PS: Про dracut я вообще ничего не знаю. Не пробовал.
Comment 7 Vince C. 2013-02-06 09:21:04 UTC
(In reply to comment #6)
...
> And I think they do not have to edit the files initrd - only to create new
> ones.

Indeed. Both are intended for different purposes but they're complementary. However I think there's no need to make splashutils ebuild depend on app-arch/lzop. Or at least, add a USE flag (e.g. "lzo") and make the dependency conditional to it.

Just my 2¢.
Comment 8 AlexOmskiy 2013-02-06 23:29:30 UTC
(In reply to comment #7)
...
> However I think there's no need to make splashutils ebuild depend on
> app-arch/lzop. Or at least, add a USE flag (e.g. "lzo") and make the
> dependency conditional to it.

MMMM... may be. gentoo-sources (& other kernel sources) don't have this DEP's.
Simply i support my local lzma-patch from splashutils-1.5.4.3 and i add to my local ebuild version app-arch/lzma-utils --> app-arch/xz-utils --> app-arch/lzop without more thinks.
And this my 'grep' call in the top of local ebiuld it's NOT good idea, but i more years do so.

Vince C. I find your patch interesting too for try.
Please, put it here as alternative and the time will decide what to do next.
(NOT need some themes for one bug)

PS: Patch for /usr/sbin/splash_geninitramfs it's bad idea (but may be good only for pkg_postinst() ).
Rewrite your patch for splashutils-1.5.4.4/scripts/splash_geninitramfs.in
Comment 9 Vince C. 2013-06-17 09:08:36 UTC
Created attachment 351190 [details, diff]
Patch on splashutils-1.5.4.4/scripts/splash_geninitramfs.in

> Vince C. I find your patch interesting too for try.
> Please, put it here as alternative and the time will decide what to do next.
> (NOT need some themes for one bug)
> 
> PS: Patch for /usr/sbin/splash_geninitramfs it's bad idea (but may be good
> only for pkg_postinst() ).
> Rewrite your patch for splashutils-1.5.4.4/scripts/splash_geninitramfs.in

Sorry for taking such a long time. I've just adapted my patch for splashutils-1.5.4.4/scripts/splash_geninitramfs.in as suggested. All I did was change the path name in the diff header. Hope this helps. I haven't tested it yet and I guess the ebuild should be modified to apply this patch accordingly.
Comment 10 Vince C. 2013-06-17 09:34:55 UTC
Okay, tested it, works as expected.

I copied splashutils-1.5.4.4-r1 ebuild to my local overlay and added the following @ line 87:

 	epatch "${FILESDIR}/${P}-bzip2.patch"
+	epatch "${FILESDIR}/${P}-splash_geninitramfs-compress.patch"

Then I re-emerged splashutils.
Comment 11 Michael Weber (RETIRED) gentoo-dev 2013-07-08 21:07:19 UTC
@Asaf: Your opinion on this?
Comment 12 Asaf Gery 2013-07-09 05:36:11 UTC
I will take a look at the patches and test them.
It will take me a few days...
Comment 13 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-12-07 08:59:56 UTC
Ping, reminder.
Comment 14 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2016-01-29 01:42:20 UTC
no genkernel changes needed for this, but I would suggest that spashutils detect what is being done and match it, so that the entire initramfs has consistent compression.
Comment 15 Vince C. 2016-03-04 22:42:58 UTC
(In reply to Robin Johnson from comment #14)
> no genkernel changes needed for this, but I would suggest that spashutils
> detect what is being done and match it, so that the entire initramfs has
> consistent compression.

I don't get it. How would one expect splashutils to "guess" the compression type if the latter is not given as an argument, for instance?
Comment 16 Pacho Ramos gentoo-dev 2016-08-18 08:33:27 UTC
*** Bug 488524 has been marked as a duplicate of this bug. ***
Comment 17 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-11-28 13:19:51 UTC
Package removed.