how /etc/grub.d/41_custom is supposed to work? The 2019 Stack Overflow Developer Survey Results Are InDebian/Grub2: Moving root partition to new drive?How to fix mistake in grub.cfg from LiveCD?How can I automatically load my config file in Grub2?GRUB2 not detecting Windows; rootnoverify: command not foundHow to generate grub.cfg for different disk?Problems in using GRUB2 - ManjaroProblem with grub-mkconfig in Arch Linux installation: grub-mkconfig fails to connect to lvmetadCan't get grub2 menu to displayGrub2 boots into prompt instead of menu after grub2-installKVM boot ERROR: device 'UUID=xxxx-51fb' not found. mount: /new_root: can't find UUID=xxxx-51fb

How do you say "canon" as in "official for a story universe"?

Limit to 0 ambiguity

Flying Bloodthirsty Lampshades

How long do I have to send my income tax payment to the IRS?

How to create dashed lines/arrows in Illustrator

What is the best strategy for white in this position?

How to make payment on the internet without leaving a money trail?

Why is Grand Jury testimony secret?

Where to refill my bottle in India?

In microwave frequencies, do you use a circulator when you need a (near) perfect diode?

Why is the maximum length of OpenWrt’s root password 8 characters?

Why do some words that are not inflected have an umlaut?

Is domain driven design an anti-SQL pattern?

Spanish for "widget"

Could a US political party gain complete control over the government by removing checks & balances?

Are USB sockets on wall outlets live all the time, even when the switch is off?

If the Wish spell is used to duplicate the effect of Simulacrum, are existing duplicates destroyed?

Where does the "burst of radiance" from Holy Weapon originate?

Why don't Unix/Linux systems traverse through directories until they find the required version of a linked library?

Falsification in Math vs Science

Access elements in std::string where positon of string is greater than its size

Landlord wants to switch my lease to a "Land contract" to "get back at the city"

I see my dog run

Monty Hall variation



how /etc/grub.d/41_custom is supposed to work?



The 2019 Stack Overflow Developer Survey Results Are InDebian/Grub2: Moving root partition to new drive?How to fix mistake in grub.cfg from LiveCD?How can I automatically load my config file in Grub2?GRUB2 not detecting Windows; rootnoverify: command not foundHow to generate grub.cfg for different disk?Problems in using GRUB2 - ManjaroProblem with grub-mkconfig in Arch Linux installation: grub-mkconfig fails to connect to lvmetadCan't get grub2 menu to displayGrub2 boots into prompt instead of menu after grub2-installKVM boot ERROR: device 'UUID=xxxx-51fb' not found. mount: /new_root: can't find UUID=xxxx-51fb



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I am asking, because fragment of file /boot/grub/grub.cfg looks like



### BEGIN /etc/grub.d/41_custom ###
if [ -f $config_directory/custom.cfg ]; then
source $config_directory/custom.cfg
elif [ -z "$config_directory" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###


I don't understood, how this should work, because there is no "source" command in grub2 - see

http://www.gnu.org/software/grub/manual/grub.html



source if the command of /bin/sh shell.

I think, that this fragment should include $config_directory/custom.cfg

during the building of /boot/grub/grub.cfg (with grub-mkconfig):



[user@localhost ~]$ cat /etc/grub.d/41_custom 
#!/bin/sh
cat <<EOF
if [ -f $config_directory/custom.cfg ]; then
source $config_directory/custom.cfg
elif [ -z "$config_directory" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
EOF


but it doesn't!


it just inserts the text with the "source" command...










share|improve this question




























    2















    I am asking, because fragment of file /boot/grub/grub.cfg looks like



    ### BEGIN /etc/grub.d/41_custom ###
    if [ -f $config_directory/custom.cfg ]; then
    source $config_directory/custom.cfg
    elif [ -z "$config_directory" -a -f $prefix/custom.cfg ]; then
    source $prefix/custom.cfg;
    fi
    ### END /etc/grub.d/41_custom ###


    I don't understood, how this should work, because there is no "source" command in grub2 - see

    http://www.gnu.org/software/grub/manual/grub.html



    source if the command of /bin/sh shell.

    I think, that this fragment should include $config_directory/custom.cfg

    during the building of /boot/grub/grub.cfg (with grub-mkconfig):



    [user@localhost ~]$ cat /etc/grub.d/41_custom 
    #!/bin/sh
    cat <<EOF
    if [ -f $config_directory/custom.cfg ]; then
    source $config_directory/custom.cfg
    elif [ -z "$config_directory" -a -f $prefix/custom.cfg ]; then
    source $prefix/custom.cfg;
    fi
    EOF


    but it doesn't!


    it just inserts the text with the "source" command...










    share|improve this question
























      2












      2








      2


      1






      I am asking, because fragment of file /boot/grub/grub.cfg looks like



      ### BEGIN /etc/grub.d/41_custom ###
      if [ -f $config_directory/custom.cfg ]; then
      source $config_directory/custom.cfg
      elif [ -z "$config_directory" -a -f $prefix/custom.cfg ]; then
      source $prefix/custom.cfg;
      fi
      ### END /etc/grub.d/41_custom ###


      I don't understood, how this should work, because there is no "source" command in grub2 - see

      http://www.gnu.org/software/grub/manual/grub.html



      source if the command of /bin/sh shell.

      I think, that this fragment should include $config_directory/custom.cfg

      during the building of /boot/grub/grub.cfg (with grub-mkconfig):



      [user@localhost ~]$ cat /etc/grub.d/41_custom 
      #!/bin/sh
      cat <<EOF
      if [ -f $config_directory/custom.cfg ]; then
      source $config_directory/custom.cfg
      elif [ -z "$config_directory" -a -f $prefix/custom.cfg ]; then
      source $prefix/custom.cfg;
      fi
      EOF


      but it doesn't!


      it just inserts the text with the "source" command...










      share|improve this question














      I am asking, because fragment of file /boot/grub/grub.cfg looks like



      ### BEGIN /etc/grub.d/41_custom ###
      if [ -f $config_directory/custom.cfg ]; then
      source $config_directory/custom.cfg
      elif [ -z "$config_directory" -a -f $prefix/custom.cfg ]; then
      source $prefix/custom.cfg;
      fi
      ### END /etc/grub.d/41_custom ###


      I don't understood, how this should work, because there is no "source" command in grub2 - see

      http://www.gnu.org/software/grub/manual/grub.html



      source if the command of /bin/sh shell.

      I think, that this fragment should include $config_directory/custom.cfg

      during the building of /boot/grub/grub.cfg (with grub-mkconfig):



      [user@localhost ~]$ cat /etc/grub.d/41_custom 
      #!/bin/sh
      cat <<EOF
      if [ -f $config_directory/custom.cfg ]; then
      source $config_directory/custom.cfg
      elif [ -z "$config_directory" -a -f $prefix/custom.cfg ]; then
      source $prefix/custom.cfg;
      fi
      EOF


      but it doesn't!


      it just inserts the text with the "source" command...







      grub2 bugs






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 22 '15 at 13:07









      user1709408user1709408

      2861414




      2861414




















          2 Answers
          2






          active

          oldest

          votes


















          2














          here is the description of mapping from command to modulename.mod

          http://blog.fpmurphy.com/2010/06/grub2-modules.html?output=pdf



          grep -E "^source" /boot/grub/i386-pc/command.lst
          source: configfile

          grep -E "^.:" /boot/grub/i386-pc/command.lst
          .: configfile


          here is the code of function:

          http://git.savannah.gnu.org/cgit/grub.git/tree/grub-core/commands/configfile.c#n61



          So, "source" is just an undocumented command of grub2






          share|improve this answer
































            1














            The manual for Grub 2.02 on the gnu.org website gives documentation for the "source" command at 16.3.71 in the "Command-line and Menu entry commands" section. So by 25th April 2017 - the date of the current version of the Grub Manual - the source command was documented and I now find it being used in the file /etc/grub.d/41_custom in the current Linux MINT 19 distribution.






            share|improve this answer










            New contributor




            David Casson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.




















              Your Answer








              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "106"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f180470%2fhow-etc-grub-d-41-custom-is-supposed-to-work%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              2














              here is the description of mapping from command to modulename.mod

              http://blog.fpmurphy.com/2010/06/grub2-modules.html?output=pdf



              grep -E "^source" /boot/grub/i386-pc/command.lst
              source: configfile

              grep -E "^.:" /boot/grub/i386-pc/command.lst
              .: configfile


              here is the code of function:

              http://git.savannah.gnu.org/cgit/grub.git/tree/grub-core/commands/configfile.c#n61



              So, "source" is just an undocumented command of grub2






              share|improve this answer





























                2














                here is the description of mapping from command to modulename.mod

                http://blog.fpmurphy.com/2010/06/grub2-modules.html?output=pdf



                grep -E "^source" /boot/grub/i386-pc/command.lst
                source: configfile

                grep -E "^.:" /boot/grub/i386-pc/command.lst
                .: configfile


                here is the code of function:

                http://git.savannah.gnu.org/cgit/grub.git/tree/grub-core/commands/configfile.c#n61



                So, "source" is just an undocumented command of grub2






                share|improve this answer



























                  2












                  2








                  2







                  here is the description of mapping from command to modulename.mod

                  http://blog.fpmurphy.com/2010/06/grub2-modules.html?output=pdf



                  grep -E "^source" /boot/grub/i386-pc/command.lst
                  source: configfile

                  grep -E "^.:" /boot/grub/i386-pc/command.lst
                  .: configfile


                  here is the code of function:

                  http://git.savannah.gnu.org/cgit/grub.git/tree/grub-core/commands/configfile.c#n61



                  So, "source" is just an undocumented command of grub2






                  share|improve this answer















                  here is the description of mapping from command to modulename.mod

                  http://blog.fpmurphy.com/2010/06/grub2-modules.html?output=pdf



                  grep -E "^source" /boot/grub/i386-pc/command.lst
                  source: configfile

                  grep -E "^.:" /boot/grub/i386-pc/command.lst
                  .: configfile


                  here is the code of function:

                  http://git.savannah.gnu.org/cgit/grub.git/tree/grub-core/commands/configfile.c#n61



                  So, "source" is just an undocumented command of grub2







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Apr 6 at 14:59









                  sourcejedi

                  25.8k445113




                  25.8k445113










                  answered Jan 22 '15 at 13:52









                  user1709408user1709408

                  2861414




                  2861414























                      1














                      The manual for Grub 2.02 on the gnu.org website gives documentation for the "source" command at 16.3.71 in the "Command-line and Menu entry commands" section. So by 25th April 2017 - the date of the current version of the Grub Manual - the source command was documented and I now find it being used in the file /etc/grub.d/41_custom in the current Linux MINT 19 distribution.






                      share|improve this answer










                      New contributor




                      David Casson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.
























                        1














                        The manual for Grub 2.02 on the gnu.org website gives documentation for the "source" command at 16.3.71 in the "Command-line and Menu entry commands" section. So by 25th April 2017 - the date of the current version of the Grub Manual - the source command was documented and I now find it being used in the file /etc/grub.d/41_custom in the current Linux MINT 19 distribution.






                        share|improve this answer










                        New contributor




                        David Casson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.






















                          1












                          1








                          1







                          The manual for Grub 2.02 on the gnu.org website gives documentation for the "source" command at 16.3.71 in the "Command-line and Menu entry commands" section. So by 25th April 2017 - the date of the current version of the Grub Manual - the source command was documented and I now find it being used in the file /etc/grub.d/41_custom in the current Linux MINT 19 distribution.






                          share|improve this answer










                          New contributor




                          David Casson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.










                          The manual for Grub 2.02 on the gnu.org website gives documentation for the "source" command at 16.3.71 in the "Command-line and Menu entry commands" section. So by 25th April 2017 - the date of the current version of the Grub Manual - the source command was documented and I now find it being used in the file /etc/grub.d/41_custom in the current Linux MINT 19 distribution.







                          share|improve this answer










                          New contributor




                          David Casson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          share|improve this answer



                          share|improve this answer








                          edited Apr 6 at 14:34





















                          New contributor




                          David Casson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          answered Apr 6 at 14:26









                          David CassonDavid Casson

                          112




                          112




                          New contributor




                          David Casson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.





                          New contributor





                          David Casson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






                          David Casson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Unix & Linux Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f180470%2fhow-etc-grub-d-41-custom-is-supposed-to-work%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

                              Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

                              Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.