Skip to content

Extranous apostrohpes in a makefile script #14

Closed

Description

@kiroma

NVIDIA Driver Version
515.43.04

Describe the bug
When building the kernel modules, an error popped up /bin/sh: line 1: localhost.localdomain: command not found caused by extra `` around $$(HOSTNAME) in the command GENERATE_NVIDSTRING in utils.mk:L527

Activity

  1. changed the title [-]Extranous \`\` in a makefile script[/-] [+]Extranous apostrohpes in a makefile script[/+] on May 11, 2022
  2. aritger commented on May 11, 2022

    @aritger
    Collaborator

    Thanks for the report, kiroma. It looks like utils.mk treats $(HOSTNAME) as a program, rather than a value. Does it work if you make this change?

    diff --git a/utils.mk b/utils.mk
    index d09807eb2657..22eedeb8a004 100644
    --- a/utils.mk
    +++ b/utils.mk
    @@ -107,7 +107,9 @@ CHMOD                 ?= chmod
     OBJCOPY               ?= objcopy
     XZ                    ?= xz
     WHOAMI                ?= whoami
    -HOSTNAME              ?= hostname
    +ifndef HOSTNAME
    +  HOSTNAME := $(shell hostname)
    +endif
     
     NV_AUTO_DEPEND        ?= 1
     NV_VERBOSE            ?= 0
    @@ -524,7 +526,7 @@ define GENERATE_NVIDSTRING
       # g_nvid_string.c depends on all objects except g_nvid_string.o, and version.mk
       $(NVIDSTRING): $$(filter-out $$(call BUILD_OBJECT_LIST,$$(NVIDSTRING)), $(3)) $$(VERSION_MK)
            $(at_if_quiet)$$(MKDIR) $$(dir $$@)
    -       $(at_if_quiet)$$(ECHO) "const char $(1)[] = \"nvidia id: NVIDIA $$(strip $(2)) for $$(TARGET_ARCH)  $$(NVIDIA_VERSION)  $$(NVIDSTRING_BUILD_TYPE_STRING)  (`$$(WHOAMI)`@`$$(HOSTNAME)>
    +       $(at_if_quiet)$$(ECHO) "const char $(1)[] = \"nvidia id: NVIDIA $$(strip $(2)) for $$(TARGET_ARCH)  $$(NVIDIA_VERSION)  $$(NVIDSTRING_BUILD_TYPE_STRING)  (`$$(WHOAMI)`@$$(HOSTNAME))>
            $(at_if_quiet)$$(ECHO) "const char *const p$$(strip $(1)) = $(1) + 11;" >> $$@;
     endef
     
    
  3. kiroma commented on May 11, 2022

    @kiroma
    Author

    Yep works just fine.

  4. aritger commented on May 11, 2022

    @aritger
    Collaborator

    Thanks for testing it. I'll get that change applied internally, and it should be included in a future release.

  5. PAR2020 commented on May 17, 2022

    @PAR2020
    Contributor

    Internal bug 3642605. Fix in progress.

  6. added
    NV-Triaged
    on May 17, 2022
  7. added
    bug
    Implemented
    on May 25, 2022
  8. aritger commented on May 31, 2022

    @aritger
    Collaborator

    This should be fixed in 515.48.07. Please let me know if you continue to have troubles. Marking fixed.

  9. added this to the 515.48.07 milestone on May 31, 2022
  10. added a commit that references this issue on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ImplementedNV-Triagedbug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions