Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove firmware in Ubuntu uki images #2565

Closed
Tracked by #1792
mudler opened this issue May 16, 2024 · 3 comments
Closed
Tracked by #1792

feat: remove firmware in Ubuntu uki images #2565

mudler opened this issue May 16, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@mudler
Copy link
Member

mudler commented May 16, 2024

The firmware in the ubuntu image brings nearly ~500MB (see also the previous attempt in #2283 ).

We can drop the firmware in the core uki images such as those have to be consumed already in a process that includes remastering and customization - and document that we don't ship firmware and is left to the user to build images with the proper firmware.

@@ -229,8 +229,10 @@ FROM base-ubuntu-current AS kernel-ubuntu-24.04

 RUN apt-get update
 # If a kernel is already installed, don't try to install it again, this way the base image can
 # be non-hwe for older releases
+#RUN [ -z "$(ls -A /lib/modules/)" ] && apt-get install -y --no-install-recommends \
+#    linux-image-generic-hwe-24.04 || true
 RUN [ -z "$(ls -A /lib/modules/)" ] && apt-get install -y --no-install-recommends \
-    linux-image-generic-hwe-24.04 || true
+    amd64-microcode intel-microcode iucode-tool kmod linux-base linux-image-6.8.0-31-generic linux-modules-6.8.0-31-generic || true
 RUN apt-get clean && rm -rf /var/lib/apt/lists/*
@mudler mudler added enhancement New feature or request triage Add this label to issues that should be triaged and prioretized in the next planning call labels May 16, 2024
@mudler mudler mentioned this issue May 16, 2024
33 tasks
@ci-robbot
Copy link
Collaborator

Hello mudler, thank you for opening this issue (#2565). In order to meet the project's requirements, please provide a detailed description of the issue and, if it's a bug, the steps to reproduce it. Additionally, it would be helpful if you could mention the versions of the relevant artifacts being used.
I apologize for any inconvenience this may cause, but as a bot, I have labeled this issue with 'enhancement' and 'triage' labels. Please update the issue with the necessary information to proceed with the review process. Remember, this is an experiment by @mudler and @jimmykarily. If you have any further questions, feel free to ask.

@mauromorales
Copy link
Member

@mudler what do you think about #2566 ? I also like the idea of no firmware

@jimmykarily jimmykarily moved this to In Progress 🏃 in 🧙Issue tracking board Jun 3, 2024
@mauromorales mauromorales moved this from In Progress 🏃 to Done ✅ in 🧙Issue tracking board Jun 5, 2024
@mauromorales mauromorales removed the triage Add this label to issues that should be triaged and prioretized in the next planning call label Jun 5, 2024
@mauromorales mauromorales self-assigned this Jun 6, 2024
@bencorrado
Copy link
Contributor

For anyone who needs firmware and finds this you can install the firmware then remove the things you don't need. I figured this out by booting a system with firmware removed and grepping dmesg for firmware then noting the missing directories and adding them to the code below. This should go into a dockerfile before doing any enki packaging.

# Remove all files in /usr/lib/firmware except the specified ones in mediatek, i915, intel, amd, and their sub-directories
RUN find /usr/lib/firmware \
    ! -path "/usr/lib/firmware" \
    ! -path "/usr/lib/firmware/mediatek" \
    ! -path "/usr/lib/firmware/mediatek/*" \
    ! -path "/usr/lib/firmware/i915" \
    ! -path "/usr/lib/firmware/i915/*" \
    ! -path "/usr/lib/firmware/intel-ucode" \
    ! -path "/usr/lib/firmware/intel-ucode/*" \
    ! -path "/usr/lib/firmware/intel" \
    ! -path "/usr/lib/firmware/intel/*" \
    ! -path "/usr/lib/firmware/amd" \
    ! -path "/usr/lib/firmware/amd/*" \
    ! -path "/usr/lib/firmware/amd-ucode" \
    ! -path "/usr/lib/firmware/amd-ucode/*" \
    ! -path "/usr/lib/firmware/mediatek/*MT7922*.bin" \
    ! -path "/usr/lib/firmware/mediatek/*MT7922*.bin.zst" \
    -type f -exec rm -f {} \;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

No branches or pull requests

4 participants