如何在Yocto Rocko分支的machine.conf中禁用IO-APIC?
Alright, let's break down why your current attempts didn't work and how to properly add the noapic parameter to the GRUB-EFI command line for your custom machine:
Why Your Initial Approaches Failed
MACHINE_FEATURES += "noapic": This variable controls hardware feature support flags for your machine (like enabling/disabling driver-level support for APIC), not kernel command line arguments. It won't modify the GRUB config.APPEND += "noapic": This variable is used for passing kernel arguments to bootloaders like U-Boot, but it doesn't affect GRUB-EFI configurations in the Rocko branch.
Correct Solutions
1. Use GRUB-Specific Variables in mymachine.conf
For GRUB-EFI in Yocto Rocko, you need to use GRUB's dedicated command line variables. Add one of these lines to your mymachine.conf file:
- To add
noapicto the default boot entry's command line:GRUB_CMDLINE_LINUX_DEFAULT += "noapic" - To add
noapicto all GRUB boot entries (regardless of default):GRUB_CMDLINE_LINUX += "noapic"
2. Ensure GRUB-EFI is Set as the Preferred Bootloader
Double-check that your machine config explicitly uses GRUB-EFI (in case it's falling back to another bootloader):
Add this to mymachine.conf:
PREFERRED_PROVIDER_virtual/bootloader = "grub-efi"
3. (Optional) Modify the GRUB Config Template (If Needed)
If your custom BSP has a hardcoded GRUB template file (e.g., recipes-bsp/grub/grub.cfg.in), you can directly add noapic to the kernel line:
linux /bzImage root=PARTUUID=${root_uuid} rootwait rootfstype=ext4 console=ttyS0,115200 console=tty0 noapic
Note: Using the GRUB variables above is more maintainable than editing templates directly.
4. Rebuild and Verify
After updating your configs, rebuild the image:
bitbake core-image-minimal-mymachine
Once built, write the WIC image to your USB drive again. Check the grub.cfg in the EFI partition—you should now see noapic in the linux line.
Quick Troubleshooting Tip
If the change still doesn't show up, check the generated GRUB config in your build directory first:
cat tmp/work/<your-machine-name>/grub-efi/<version>/image/efi/EFI/BOOT/grub.cfg
This will confirm if the parameter was added during the build phase (if it's here but missing from the USB drive, the issue is with the WIC image creation, not the GRUB config).
内容的提问来源于stack exchange,提问作者aicastell

