/srv/irclogs.ubuntu.com/2019/08/21/#ubuntu-kernel.txt

alkisgHi, in ltsp, to netboot clients, we're passing 2 initrds. This works fine up to and including ubuntu 19.04.06:44
alkisgBut I just tried the 19.10 lubuntu daily build, and the 5.2 kernel there doesn't see the additional initrd, it's like if we only passed one.06:44
alkisgAny recent commits that broke it? Any related changes?06:44
apwalkisg, as in you say initrd=x initrd=y ?08:33
alkisgapw: exactly08:33
* apw is supprised that works at all, that you don't only get hte last one08:33
alkisgapw: oh the kernel has supported it since ages, and in the recent years all boot managers added support for that,08:34
alkisggrub, syslinux, ipxe, anyone that I tested has had patches in the recent years to support it08:34
alkisg*anything08:34
apwalkisg, the kernel supports concantenation of initramfs objects in a single passed block08:35
alkisgapw: although, I tried concating the two initrd, and that didn't work either, which probably means a change in the kernel itself08:35
alkisgSo if someone is able to test that ^ (create an initrd with just a /test file, append it to initrd.img, boot, and see if /test is there),08:36
apwalkisg, the kernel only gets initrd=<start>,<len> of a single block08:36
alkisgand it doesn't work with 19.10 like it doesn't work for me, then I guess he reproduced the issue...08:36
apwalkisg, so all of the bootloaders must be concantenating; so it would be continuration which would have to be broken08:37
alkisgI'm testing in the exact same system with the same bootloaders etc08:37
alkisg(ipxe, in this case, I'll test kvm in a few minutes)08:37
apwalkisg, and would be equivalent for your test and the bootloader test08:37
alkisgRight, so it sounds to me like something in the kernel initrd decompression code has broken in 19.1008:38
alkisgMaybe my initrd.gz has different compression parameters and it can't follow it? Maybe the early microcode thing? I don't know...08:39
apwalkisg, a good point what are you using for that08:39
apwas in 19.10 the default compression changed to lz4 initramfs-tools08:40
apwthough we have not turned off any compression options08:41
alkisgapw: find . ! -name ltsp.img | cpio -oH newc | gzip > "$_DST_DIR/ltsp.img"08:42
apwalkisg, do you have a dmesg of the failed boot08:52
alkisgMoment...08:53
apwalkisg, i can see no significant changes in the code to decode the initramfs from 5.0 to unstable08:57
apwalkisg, would you attach all of this to an 'ubuntu-bug linux' please too and tell us the number08:57
alkisgapw: ok; then I'd best collect all these and do a proper report tomorrow morning. Thanks a lot :)08:58
apwalkisg, thanks ... do ping me with the bug number08:58
alkisgwill do08:59
ograalkisg, apw, the bootloader typically just loads the initrds back to back into ram and hands the kernel the adresses of that merged ram space ... (we use this feature in core too, grub is very easy there if you just hand it two initrds, u-boot is a bit more tricky since you need to do the math and loading yourself) ... but this only works if both initrds use the same compression ... i'D bet there is a difference between the two initrds alkisg loads12:30
apwogra, i wonder why that restriction exists, as its not like the decompresson format individually would understand the reset in the middle12:43
apwi am sure it iterates at the top level there, strange12:43
apwi would think that is a bug, and likely the bug12:44
ograwell, the bootloader loads the compressed bits back to back ... the kernel tries to uncompress ... my guess would be it only looks at the header at the start of that ram area so wont know that the second half uses a different compression12:44
ogra(also, i think, the kernel typically doesnt know there are two parts, it only gets start address and size from the BL)12:52
alkisgogra: thanks, I'll try with lz4 or whatever else it is, and with uncompressed ltsp.img, and report back... but a bit later, too sleepy now...13:03
alkisgogra: I was guessing that the code would be like "while ... check initrd header; decompress; done" => i.e. it would check the header/compression type on each new initrd it sees while "walking the list", not just once at start...13:04
alkisgBut OK if it's a restriction, we can match it from the ltsp code13:05
apwalkisg, let me know in the bug if it does work with the 'same compression'13:28
apwalkisg, as i am not sure we are not going to end up missmatched with cpu firmware too13:29
ograwell, this is stuff i found during testing with u-boot, ipxe or grub might work differently (i never tried different compressions etc on grub and never used ipxe), i'm just assuming that the process is similar on other bootloaders13:31
apwogra, right, this would be a kernel side limitation, just very odd13:32
ograwell, for u-boot is it pretty clear that the kernel only sees a single initrd blob in ram because it only hands start address and size over ... might be different in the other cases13:33
ogra(size=complete size of both parts)13:33
apwogra, right there is only 'here,this-big' option to the kernel13:46
apwogra, and it decompresses till the compressor says 'done' then it tries again if we are not at the end13:46
* alkisg starts testing with kvm and a single concatenated initrd, which should be faster to test with...13:47
ograaha ... well, if it tries agan if not at the end that might indeed mean it should support multiple compressions13:50
ograand then i agree there is a bug ... i didnt know the kernel does that13:50
alkisgHere are the first results, with concat:13:51
alkisginitrd.img: ASCII cpio archive (SVR4 with no CRC) => 19.1013:51
alkisgltsp.img:   gzip compressed data, last modified: Wed Aug 21 11:46:58 2019, from Unix ==> fails with gzip13:51
alkisgcat ltsp.raw initrd.img.original > initrd.img (no gzip) ==> succeeds13:51
alkisgSo it works fine with raw, but not with gz now; while it worked from debian jessie and ubuntu 16.04 that I'm testing with, until all the recent versions up to 19.1013:52
* alkisg tries to see how to make it lz4...13:52
alkisgunmkinitramfs ../initrd.img.original .13:53
alkisgcpio: premature end of archive13:53
alkisgapw: premature end of archive? maybe bad initrd in 19.10?13:54
alkisg(that's the stock one from the live cd)13:54
alkisgOK that would explain it then, why it can't follow up with the next one13:54
apwalkisg, odd13:55
alkisgSo not a kernel thing, but a mkinitramfs thing13:55
ograwell, if its invalid, how would the livecd's boot ?13:55
ograi'd assume we'd have heard if they do not ...13:55
alkisgogra: e.g. if it's just some padding, it could do that13:55
alkisgI.e. decompress correctly, even with "oh premature end", but then it won't be able to follow up with the next initrd13:56
* alkisg downloads the ubuntu.iso instead of the lubuntu one...13:56
apwright if it was a byte long it might parse and unpack the cpu firmware in section 1, the real initramfs in section 2, and think there is a section 3 of the padding and barf there13:56
alkisgapw: do you know if an installed systemd uses different code to update-initramfs vs the live cd? I'm only testing with live cds for 19.10...13:59
alkisg*system13:59
alkisg(live cds worked fine up to 19.04 too)13:59
apwalkisg, the initramfs is different in contend but made the same way14:00
apwcontent14:00
alkisgOK the content shouldn't matter with rdinit=/bin/sh, so...14:00
* alkisg is downloading yesterday's ubuntu.iso, let's see...14:00
apwalkisg, i just mounted up the eoan ubuntu desktop image on my machine here, and the initrd in that is extractable without that error14:02
apw(and this machine is also running eoan)14:03
ograapw, oh, since i have you here ... whats the reason for all the armhf metapackages (linux-raspi2, linux-snapdragon) to be in unverse (i have been trying to derive clssic images from core based ones using u-image and noticed that ... the server rootfs build in u-image doesnt have universe in its sources.list so you cant instal a kernel on these devices without hackery)14:03
alkisgHrm. Let me see what happens with yesterdays'...14:03
apwogra, because things end up in main through need mostly, and things which only end up in core avoid seeding14:04
apw$ md5sum /mnt/casper/initrd14:04
apwf3a8e1484ad2ebcca4437a8bf949266b  /mnt/casper/initrd14:04
apwalkisg, ^ is the one i can dething14:04
ograapw, well, we officially support server images for pi and dragonboard ... that is what made me curious14:05
ograi'd have the metas expected to be seeded via -supported or some such14:05
apwogra, and the "we" part is where care is needed; does "ubuntu" or "canonical" support those14:05
alkisg(different one here) 4b0a58102b099fa26d89aad3a7952e7a  initrd.img.original14:05
ogracanonical AFAIK14:05
ogra(which in turn includes ubuntu i think)14:06
apwanyhow that isn't quite what main means; and you will find people arguing both ways to put it in main and not14:06
ograwe're offering these builds to customers for commercial products ... 14:06
ograheh, ok 14:06
ograwell, it just made me curious ... i didnt mean to start a discussion about it 14:06
apwthat is a separate commercial concern and not related to ubuntu support status14:06
ograok14:06
apwas we support each of those for customer specific times; and peopel tend to assume main == 5 years14:07
apw(in an lts)14:07
ograright14:07
apwogra, but we also move things to main to make isos, so ... 14:07
apwwe can support longer than the ubuntu marked support not less14:08
apwsort of thing14:08
ograyup14:08
alkisgapw: same problem with http://cdimage.ubuntu.com/daily-live/20190819/eoan-desktop-amd64.iso14:09
alkisgI'm running unmkinitramfs in 18.04,would it matter?14:09
* alkisg tries booting the live cd to unmkinitramfs in 19.10...14:09
apwalkisg, maybe, does that old version support lz414:09
alkisgIt does show the contents14:09
apwoh, then not that14:09
alkisgOh never mind. 56k14:10
apwalkisg, md5sum of your .iso please14:10
apw56k ?14:10
apw19 ?  i have an .iso from 2114:10
apwwith a date of the 21st14:10
alkisgapw: no the iso was fine, but unmkinitramfs isn't,14:10
alkisgI saw early/main and thought it was ok, 14:10
apwoh14:10
alkisgbut it only managed to uncompress the -rw-r--r-- 1 alkisg alkisg  30K Νοε  28  2018 AuthenticAMD.bin14:11
alkisgSo no lz414:11
alkisgOK that would explain the "premature" error, but not the "second initrd isn't shown when booted" error14:11
* alkisg moves to test from 19.10 now...14:12
alkisgHeh nice desktop icons :D14:13
alkisgVerified that 18.04 can't decompress 19.10 initramfs (same md5sum, works in 19.10)14:16
=== logan_ is now known as logan-
alkisgcat /cdrom/casper/initrd ltsp.cpio.gz > test1; unmkinitramfs test1 .  ==> premature end of archive (all inside 19.10)14:26
alkisgcat /cdrom/casper/initrd ltsp.cpio > test2; unmkinitramfs test2 .  ==> works14:26
alkisgapw: would you consider it a bug when unmksquashfs fails when lz4+gz initrds are joined?14:27
* alkisg moves on to testing netbooting again, but with uncompressed ltsp.img...14:28
apwalkisg, i thnk the manual page has a bugs section saying it is a bit crap14:30
alkisgAh14:30
apwBUGS14:31
apw       unmkinitramfs cannot deal with multiple-segmented initramfs images, except  where14:31
apw       an  early (uncompressed) initramfs with system firmware is prepended to the regu‐14:31
apw       lar compressed initramfs.14:31
apwactually so crap it is hard to believe the text is right !14:32
alkisgNope, 19.10 can't load even lz4+raw; I don't know how to create lz4+lz4 to test that. Checking dmesg...14:36
apwraw comes first14:38
alkisgI mean my raw, not the microcode14:39
alkisgI didn't say that correctly, I mean this:14:39
alkisg        find . ! -name ltsp.img | cpio -oH newc > "$_DST_DIR/ltsp.img"14:39
alkisgvs this:         find . ! -name ltsp.img | cpio -oH newc  | gzip > "$_DST_DIR/ltsp.img"14:39
apwahh14:39
alkisgunmkinitramfs in 19.10 works without gzip, fails with gzip there,14:39
alkisgthe kernel fails in both cases14:39
apwand you are concatting them how14:40
alkisgcat 1 2 > 314:40
apwmakes sense14:40
apwalkisg, there seems to be an lz4 command14:41
alkisgI tried this silly test: 19.10 kernel, 18.04 initramfs, plus ltsp.img ==> works14:42
alkisgSo it's not a kernel change, but something in the new initramfs that makes the kernel choke14:42
apwok which is raw+gz+gz i assume14:42
alkisgRight14:42
apwso you need to make the raw+lz4+lz414:42
apwand the command lz4 with no arguemnts seems to be a compressing pipeline14:42
alkisgOK let me install that and test, ty14:43
apwalkisg, it is also possible that there is padding at the end of an lz4 that the kernel does not grok, we will find out from this test14:43
alkisg        find . ! -name ltsp.img | cpio -oH newc | lz4 > "$_DST_DIR/ltsp.img"14:44
alkisgThis has the same issue14:44
alkisgI.e. it only sees the first initramfs14:44
alkisgSince raw+lz4+raw didn't work... yes it sounds like a padding in lz414:45
apwalkisg, can you give me the actual error the kernel emits please, it matters14:48
alkisgapw: I don't see anything in dmesg, where would I find that?14:49
apwalkisg, never mind, i'll see if i can repo14:50
alkisgTy :)14:51
* alkisg tries injecting a couple of zeros between, in case it's a matter of padding...14:51
apwalkisg, don't think that will work, it expects the first two bytes of the remaining space to be a file magic14:53
alkisgYeah it didn't; although it does have a few nulls at the end, adding/removing some didn't help15:03
apw[    0.288625] Initramfs unpacking failed: junk within compressed archive15:16
* alkisg didn't have that in dmesg15:20
apwalkisg, as i can reproduce it, i will poke for a bit15:24
apwalkisg, could you file that bug for me15:25
apwalkisg, a +filebug will be fine15:25
apwalkisg, which kernel does this work with previously ?15:26
alkisgapw, 19.04; will check in a bit and file bug, ty15:29
alkisgapw: I think it's a bug in mkinitramfs though, not in the kernel, e.g. it might generate invalid length of lz4 or something...15:38
apwalkisg, also it does handle padding, as long as it is 0's15:38
apwalkisg, or the lz4 format is not length aware, or15:38
alkisgOK... but then this is the first kernel that we try lz4 booting, right?15:39
alkisgSo "it worked in 19.04" doesn't make any sense15:39
alkisgSince it was gz, and gz still works15:39
alkisgSo lz4 might have been broken since its initial implementation, and noone would have noticed, since concatenating something after lz4 isn't too common15:40
alkisg(or passing multiple initrds)15:40
* alkisg wonders how to check if 19.04 used lz4 or gz15:43
apwalkisg, it only just changed in eoan15:45
alkisgOK then it sounds possible that it never worked correctly with lz415:46
alkisgapw: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/184094516:42
ubot5`Ubuntu bug 1840945 in linux (Ubuntu) "Concatenated lz4 initrds don't work" [Undecided,New]16:42
alkisgI didn't run ubuntu-bug, as it would report the host, not whatever's inside kvm16:42
alkisgAnd I only had kernel/initrd inside kvm, so I couldn't run ubuntu-bug from there either16:42
alkisgIf needed, I can do an installation inside a VM... but I'm not sure if it'll help16:42
apwalkisg, no that is enough20:31

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!