Bug 2211583
| Summary: | dracut generates initramfs for non-existing kernels | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Renaud Métrich <rmetrich> |
| Component: | dracut | Assignee: | dracut-maint-list |
| Status: | NEW --- | QA Contact: | qe-baseos-daemons |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 8.8 | CC: | prjagtap |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | Bug | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Renaud Métrich
2023-06-01 06:31:25 UTC
It's unclear when the kernel removal leaves files behind, it looks like it's due to some 3rd party script executing. Anyway, for the hardening of dracut, please find below an example of listing making dracut generate a dumb initramfs "polluting" /boot: -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- # ll /lib/modules/4.18.0-193.el8.x86_64 total 24 drwxrwxrwx. 3 1002 1012 21 May 21 2022 kernel -rw-rw-rw-. 1 1002 1012 45 May 19 08:54 modules.alias -rw-rw-rw-. 1 1002 1012 12 May 19 08:54 modules.alias.bin -rw-rw-rw-. 1 1002 1012 0 May 19 08:54 modules.builtin.bin -rw-rw-rw-. 1 1002 1012 0 May 19 08:54 modules.dep -rw-rw-rw-. 1 1002 1012 12 May 19 08:54 modules.dep.bin -rw-rw-rw-. 1 1002 1012 0 May 19 08:54 modules.devname -rw-rw-rw-. 1 1002 1012 55 May 19 08:54 modules.softdep -rw-rw-rw-. 1 1002 1012 49 May 19 08:54 modules.symbols -rw-rw-rw-. 1 1002 1012 12 May 19 08:54 modules.symbols.bin -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- Here above all non-binary files are "empty" or just contain comments: -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- # cat modules.alias modules.softdep modules.symbols # Aliases extracted from modules themselves. # Soft dependencies extracted from modules themselves. # Aliases for symbols, used by symbol_request(). -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- This leads to generating a large but useless initramfs: -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- # dracut /tmp/test.img 4.18.0-193.el8.x86_64 depmod: WARNING: could not open /var/tmp/dracut.YTEvX1/initramfs/lib/modules/4.18.0-193.el8.x86_64/modules.order: No such file or directory depmod: WARNING: could not open /var/tmp/dracut.YTEvX1/initramfs/lib/modules/4.18.0-193.el8.x86_64/modules.builtin: No such file or directory Warning no default label for /tmp/test.img # ll /tmp/test.img -rw-------. 1 root root 25489249 Aug 7 17:49 /tmp/test.img -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- |