Comments (17)
@danimo @haraldh thanks for not merging my PR (#119), and rather than creating new one...
from dracut.
@haraldh The problem is the modules without a signature in this case. The ones I've looked at have multiple '00' in the end of the file. Adding head -c 27 won't do much good.
00030350 de fd 02 00 00 00 00 00 d5 00 00 00 00 00 00 00 |................|
00030360 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 |................|
00030370 00 00 00 00 00 00 00 00 |........|
Maybe using something like modinfo "$f" | grep '^sig_key:' to find the signed modules?
EDIT: Actually when looking at it again, why not just skip assigning the data to the variable SIG and do: tail -c 28 "$f" | grep -q '~Module signature appended~' || { printf ... }
it's the variable assignment that is the issue here right?.
from dracut.
running dracut -f --debug on already existing initrams
//usr/lib/dracut/dracut-init.sh@1050(find_kernel_modules_by_path): continue
//usr/lib/dracut/dracut-init.sh@1049(find_kernel_modules_by_path): read a rest
//usr/lib/dracut/dracut-init.sh@1050(find_kernel_modules_by_path): [[ kernel/drivers/block/floppy.ko.xz = /drivers/gpu/drm/ ]]
//usr/lib/dracut/dracut-init.sh@1050(find_kernel_modules_by_path): [[ kernel/drivers/block/floppy.ko.xz = updates/* ]]
//usr/lib/dracut/dracut-init.sh@1050(find_kernel_modules_by_path): continue
//usr/lib/dracut/dracut-init.sh@1049(find_kernel_modules_by_path): read a rest
//usr/lib/dracut/dracut-init.sh@1050(find_kernel_modules_by_path): [[ kernel/drivers/block/pmem.ko.xz = /drivers/gpu/drm/ ]]
//usr/lib/dracut/dracut-init.sh@1050(find_kernel_modules_by_path): [[ kernel/drivers/block/pmem.ko.xz = updates/* ]]
//usr/lib/dracut/dracut-init.sh@1050(find_kernel_modules_by_path): continue
//usr/lib/dracut/dracut-init.sh@1049(find_kernel_modules_by_path): read a rest
/usr/lib/dracut/modules.d/50drm/module-setup.sh: line 29: warning: command substitution: ignored null byte in input
//usr/lib/dracut/dracut-init.sh@1050(find_kernel_modules_by_path): [[ kernel/drivers/block/loop.ko.xz = /drivers/gpu/drm/ ]]
/usr/lib/dracut/modules.d/50drm/module-setup.sh: line 29: warning: command substitution: ignored null byte in input
/usr/lib/dracut/modules.d/50drm/module-setup.sh: line 29: warning: command substitution: ignored null byte in input
/usr/lib/dracut/modules.d/50drm/module-setup.sh: line 29: warning: command substitution: ignored null byte in input
//usr/lib/dracut/dracut-init.sh@1050(find_kernel_modules_by_path): [[ kernel/drivers/block/loop.ko.xz = updates/* ]]
/usr/lib/dracut/modules.d/50drm/module-setup.sh: line 29: warning: command substitution: ignored null byte in input
/usr/lib/dracut/modules.d/50drm/module-setup.sh: line 29: warning: command substitution: ignored null byte in input
/usr/lib/dracut/modules.d/50drm/module-setup.sh: line 29: warning: command substitution: ignored null byte in input
/usr/lib/dracut/modules.d/50drm/module-setup.sh: line 29: warning: command substitution: ignored null byte in input
//usr/lib/dracut/dracut-init.sh@1050(find_kernel_modules_by_path): continue
/usr/lib/dracut/modules.d/50drm/module-setup.sh: line 29: warning: command substitution: ignored null byte in input
from dracut.
talk on #bash maybe this will help
[19:57] Is it this? $(xz -dc <$_f)
[19:57] <_TPG> greycat: yes
[19:58] Well, you are decompressing a *.ko.xz file (and *.ko implies it's a BINARY COMPILED OBJECT FILE) and trying to load it into a bash string.
[19:59] Bash cannot handle binary data in that way. It will either lose all the NULs, or simply truncate at the first one.
[19:59] <_TPG> greycat: well that was working fine before bash 4.4
[19:59] _TPG: you mean "I was not made aware of the HORRIBLE GAPING HOLES until..."
[20:01] If you are SURE you want to proceed with this approach at all (recognizing now that you are doing something tremendously silly) and you want to suppress the warnings, you can either redirect whatever FD bash is writing the warnings to, or you can strip the NUL bytes in the $() yourself.
[20:03] by the way, should be <"$_f"
[20:03] <_TPG> greycat: thanks for help
from dracut.
Ping @haraldh can you please merge it ?
from dracut.
Can somebody do something with this issue please?
from dracut.
@alesak What do you want to do about this issue ?
from dracut.
in master the kernel module handling is now done with libkmod.
from dracut.
Updated proposed workaround for 044 at danimo@3c823a4
from dracut.
can you test master HEAD please, if this is still an issue?
from dracut.
I changed the whole insmod/firmware code. So again... is there still an issue with bash 4.4 and master HEAD?
from dracut.
So I finally got fed-up waiting for a fix to reach the main tree...
Why am I having to apply tpgxyz 's working PR manually as a user patch to dracut?
This issue has been going on for months...
from dracut.
@bobwya Because these patches are not applicable to the main tree, which handles the functions in question in pure C. If you can positively confirm that there are still issues, please respond to @haraldh 's question.
from dracut.
@danimo @haraldh
So I've test a live, vanilla build of dracut - using commit cc81672 ...
With an install of Gentoo, kernel 4.8.8, on my laptop. The resulting initramfs boots fine and there are no errors, console spam during the build process (as with 044).
So looks good to me, thanks! Would be nice to have a release of the master (as I don't really want to use a live build of dracut permanently!)
from dracut.
There seems to be a similar bash 4.4 issue in dracut.sh using the latest commit from master when strip of kernel modules is enabled.
The problem is in the function that strips the modules unless they are signed (https://github.com/dracutdevs/dracut/blob/master/dracut.sh#L1596), see below:
/usr/bin/dracut@1596(main): SIG=$'\001'
/usr/bin/dracut@1597(main): [[ == \~\M\o\d\u\l\e\ \s\i\g\n\a\t\u\r\e\ \a\p\p\e\n\d\e\d\~ ]]
/usr/bin/dracut@1597(main): printf '%s\000' /var/tmp/dracut.4YEmfq/initramfs/lib/modules/4.8.11/kernel/fs/fuse/fuse.ko
/usr/bin/dracut@1595(main): read -r -d '' f
//usr/bin/dracut@1596(main): tail -c 28 /var/tmp/dracut.4YEmfq/initramfs/lib/modules/4.8.11/kernel/fs/fuse/cuse.ko
/usr/bin/dracut: line 1596: warning: command substitution: ignored null byte in input
...
from dracut.
Hmm.. our kernel modules have '0a' as the last byte.
000371c0 00 00 00 00 00 02 d3 7e 4d 6f 64 75 6c 65 20 73 |.......~Module s|
000371d0 69 67 6e 61 74 75 72 65 20 61 70 70 65 6e 64 65 |ignature appende|
000371e0 64 7e 0a |d~.|
guess I will have to:
SIG=$(tail -c 28 "$f" | head -c 27)
any better solution?
from dracut.
Closing it as it works :)
from dracut.
Related Issues (20)
- Request to repair the error of qemu nbd in the switch_root process HOT 5
- RFC: review if '.early' postfix for ucode is still required
- dracut uses wrong version description for Unified Kernel Images HOT 5
- network-legacy module dropped from Fedora 40 package HOT 8
- systemd will dlopen libraries that used to be statically included
- RFE: new version?🤔 HOT 3
- rd.live.overlay.overlayfs=1 is broken on Fedora 39 LiveOS HOT 4
- Support bcachefs encrypted root unlocking
- [REPO DEAD] This repo is dead HOT 1
- Start job for disk device hangs, Linux Zen images and snapshots fail to boot, after update from 059-6 to 101-1 HOT 1
- Dracut generated initramfs fails to boot with recent kernels due to SELinux Permission Denied errors
- make parsing of `rd.luks.timeout` singular instead of plural to avoid Mal-formed `cryptsetup` command line
- `dracut-initramfs-restore.sh` fails on ostree-based systems HOT 3
- dracut failled to boot a crypt_luks with systemd-gpt-auto mount !!! HOT 2
- sshd not starting after recent patch HOT 10
- Unable to find a root filesystem error
- Dracut now has many dependencies on systemd-modules-load, requiring building modules support into systemd. HOT 1
- dracut-install falls over if sysroot argument end with `/`
- Should dracut uncompress compressed kernel modules before installing into the initramfs?
- dracut creates odd dir
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dracut.