Skip to content

PKGBUILD: Enable QR Code Panic for GCC compiled kernels #454

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

Closed
wants to merge 2 commits into from

Conversation

ptr1337
Copy link
Member

@ptr1337 ptr1337 commented May 12, 2025

This does enable the QR Code Panic Screen for GCC compiled kernels until LLVM (Thin) LTO does support it.

Not applied to all kernels yes, will do this after review

@ptr1337 ptr1337 requested review from ventureoo, 1Naim and Copilot May 12, 2025 15:22
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for enabling the QR Code Panic Screen for GCC-compiled kernels until LLVM (Thin) LTO supports it. Key changes include:

  • Adding a conditional block in the prepare() function to enable QR Code Panic via scripts/config when LLVM LTO is not used.
  • Installing Rust files in the _package-headers() function when compiling with GCC.

Comment on lines +363 to +364
scripts/config -e RUST_IS_AVAILABLE -e CONFIG_RUST -e RUST_FW_LOADER_ABSTRACTIONS -d CONFIG_BLK_DEV_RUST_NULL --set-str DRM_PANIC_SCREEN qr-code \
-e DRM_PANIC_SCREEN_QR_CODE --set-str DRM_PANIC_SCREEN_QR_CODE_URL https://panic.archlinux.org/panic_report# --set-str DRM_PANIC_SCREEN_QR_VERSION 40
Copy link
Preview

Copilot AI May 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The scripts/config command that follows spans several options, which makes it difficult to read. Consider refactoring it by either splitting it into multiple lines (with proper line continuations) or assigning the options to a variable for improved maintainability.

Suggested change
scripts/config -e RUST_IS_AVAILABLE -e CONFIG_RUST -e RUST_FW_LOADER_ABSTRACTIONS -d CONFIG_BLK_DEV_RUST_NULL --set-str DRM_PANIC_SCREEN qr-code \
-e DRM_PANIC_SCREEN_QR_CODE --set-str DRM_PANIC_SCREEN_QR_CODE_URL https://panic.archlinux.org/panic_report# --set-str DRM_PANIC_SCREEN_QR_VERSION 40
config_options=(
"-e RUST_IS_AVAILABLE"
"-e CONFIG_RUST"
"-e RUST_FW_LOADER_ABSTRACTIONS"
"-d CONFIG_BLK_DEV_RUST_NULL"
"--set-str DRM_PANIC_SCREEN qr-code"
"-e DRM_PANIC_SCREEN_QR_CODE"
"--set-str DRM_PANIC_SCREEN_QR_CODE_URL https://panic.archlinux.org/panic_report#"
"--set-str DRM_PANIC_SCREEN_QR_VERSION 40"
)
scripts/config "${config_options[@]}"

Copilot uses AI. Check for mistakes.

@@ -656,6 +662,12 @@ _package-headers() {
echo "Installing KConfig files..."
find . -name 'Kconfig*' -exec install -Dm644 {} "$builddir/{}" \;

if [ "$_use_llvm_lto" = "none" ]; then
echo "Installing Rust files..."
Copy link
Preview

Copilot AI May 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before installing the Rust files, ensure the target directory ('$builddir/rust') exists (e.g., by creating it with mkdir -p) to avoid potential install errors.

Suggested change
echo "Installing Rust files..."
echo "Installing Rust files..."
mkdir -p "$builddir/rust"

Copilot uses AI. Check for mistakes.

@@ -358,6 +358,12 @@ prepare() {

echo "Selecting '$_use_llvm_lto' LLVM level..."

if [ "$_use_llvm_lto" = "none" ]; then
echo "Enabling QR Code Panic for GCC Kernels"
scripts/config -e RUST_IS_AVAILABLE -e CONFIG_RUST -e RUST_FW_LOADER_ABSTRACTIONS -d CONFIG_BLK_DEV_RUST_NULL --set-str DRM_PANIC_SCREEN qr-code \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
scripts/config -e RUST_IS_AVAILABLE -e CONFIG_RUST -e RUST_FW_LOADER_ABSTRACTIONS -d CONFIG_BLK_DEV_RUST_NULL --set-str DRM_PANIC_SCREEN qr-code \
scripts/config -e RUST -e RUST_FW_LOADER_ABSTRACTIONS -d BLK_DEV_RUST_NULL --set-str DRM_PANIC_SCREEN qr-code \

I believe RUST_IS_AVAILABLE is automatically flipped if rustc is detected, so we don't need to explicitly enable it here.

@1Naim
Copy link
Member

1Naim commented May 22, 2025

Any blockers for this? If not I'll add it when syncing 6.15.

@ptr1337
Copy link
Member Author

ptr1337 commented May 22, 2025

Any blockers for this? If not I'll add it when syncing 6.15.

Can be put into the 6.15 sync

@@ -656,6 +665,12 @@ _package-headers() {
echo "Installing KConfig files..."
find . -name 'Kconfig*' -exec install -Dm644 {} "$builddir/{}" \;

if [ "$_use_llvm_lto" = "none" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [ "$_use_llvm_lto" = "none" ]; then
if ! _is_lto_kernel; then

@@ -358,6 +361,12 @@ prepare() {

echo "Selecting '$_use_llvm_lto' LLVM level..."

if [ "$_use_llvm_lto" = "none" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [ "$_use_llvm_lto" = "none" ]; then
if ! _is_lto_kernel; then

@1Naim
Copy link
Member

1Naim commented May 24, 2025

Superceded by #465

@1Naim 1Naim closed this May 24, 2025
@1Naim 1Naim deleted the qr-code branch May 24, 2025 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants