Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • M mkinitcpio
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Graph
    • Compare
    • Locked Files
  • Issues 29
    • Issues 29
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Arch LinuxArch Linux
  • Mkinitcpio
  • mkinitcpio
  • Issues
  • #153
Closed
Open
Issue created Dec 12, 2022 by Ádám Maróti@05storm26Contributor

kernel-install kernelimage path quoted incorrectly.

The executed mkinitcpio command by 50-mkinitcpio.install, currently is:

mkinitcpio -k 6.0.12-hardened1-1-hardened --kernelimage ''\''/usr/lib/modules/6.0.12-hardened1-1-hardened/vmlinuz'\''' --microcode ''\''/boot/intel-ucode.img'\''' -U /efi/EFI/Linux/46e5b7b51f69426fade60fe0cc165d7a-6.0.12-hardened1-1-hardened.efi

The apostrophies inside the double quotes become literal and escaped when putting together the mkinitpcion invocation.

My idea would be to use eval to fix this, i.e.:

diff --git a/50-mkinitcpio.install b/50-mkinitcpio.install
index a5e051b..b0dc4dd 100644
--- a/50-mkinitcpio.install
+++ b/50-mkinitcpio.install
@@ -49,7 +49,7 @@ case $COMMAND in
     add)
         [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "+ mkinitcpio -k $KERNEL_VERSION $KERNEL_IMAGE_FLAGS $MICROCODE $IMAGE_GENERATION_FLAG $IMAGE_PATH"
         #shellcheck disable=SC2046
-        mkinitcpio -k "$KERNEL_VERSION" $KERNEL_IMAGE_FLAGS $MICROCODE $IMAGE_GENERATION_FLAG "$IMAGE_PATH"
+        eval "mkinitcpio -k \"$KERNEL_VERSION\" $KERNEL_IMAGE_FLAGS $MICROCODE $IMAGE_GENERATION_FLAG \"$IMAGE_PATH\""
         ;;
     remove)

This was objected against by multiple people. What is the recommended way to fix this issue? Using bash arrays for the arguments?

CC: @nl6720, @lobachevsky

Edited Dec 12, 2022 by nl6720
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking