Help Editing Grub

Forum Forums New users Welcome to antiX Help Editing Grub

  • This topic has 12 replies, 4 voices, and was last updated Jul 12-8:41 am by Brian Masinick.
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #38693
    Member
    steve_anunknown

      Hello everyone!

      I’m running antix 19.2 Hannie Schaft on a thinkpad x60 and I decided to libreboot it. However, in the process of backing up the original lenovo bios , I got the following error : ” /dev/mem mmap failed: Operation not permitted ”

      After some searching , I found out that I should “try again after rebooting with iomem=relaxed in your kernel command line”. My problem is that, due to my inexperience, I’m a little confused regarding how I should proceed.

      If somebody could guide me, I would very much appreciate it.

      Thank you all in advance!

      #38694
      Member
      Xecure
        Helpful
        Up
        0
        ::

        Hello, steve_anunknown

        After some searching , I found out that I should “try again after rebooting with iomem=relaxed in your kernel command line”.

        Boot parameter: iomem=relaxed

        If on an installed system:
        1. Testing parameters out:

        Booting on your installed system, when grub appears, hit “e” key and add the boot parameter in the line containing
        linux /boot/vmlinuz-.... quiet
        at the end of the line. Then hit F10 and enter to see if the system boots with a graphical interface.

        2. Making grub change permanent:

        You need to edit (with root privileges) /etc/default/grub file. You need to edit the line that says:
        GRUB_CMDLINE_LINUX_DEFAULT="
        and add the options there. For example:
        GRUB_CMDLINE_LINUX_DEFAULT="quiet xorg=safe nomodeset"

        Then save and update grub:
        sudo grub-update

        Restart your system and see how it goes.

        If you antiX system is running live (from a USB media), the temporary change would be almos identical to step 1 above (add boot parameter, exactly the same for UEFI systems, simply write it in the boot line for a Bios/Legacy system).

        antiX Live system enthusiast.
        General Live Boot Parameters for antiX.

        #38699
        Member
        steve_anunknown
          Helpful
          Up
          0
          ::

          Hello , thanks for the reply!

          Can I edit the file with root privileges using vim? The reason I am asking this is because I tried to do it using commands like “gksudo gedit /etc/default/grub” “gksu gedit /etc/default/grub” “sudo -H gedit /etc/default/grub” but they didn’t do anything (it either remained inactive or could not run the command). I searched through different forums but did not find suggestions for a different editor.

          So, in order to make my question clearer, can i edit the file with root privileges using vim? If not, how should I go about it?

          #38700
          Member
          Xecure
            Helpful
            Up
            0
            ::

            You can edit the file with whatever text editor you want, as with all linux systems.

            My preferred graphical text editor is geany, so I would do (on a terminal emulator):
            gksu geany /etc/default/grub

            if you are running with no graphical interface (no X), you would have to use a cli text editor (like nano or vim, as you suggest, using sudo instead of gksu).

            The problem you are encountering:

            I tried to do it using commands like “gksudo gedit /etc/default/grub” “gksu gedit /etc/default/grub” “sudo -H gedit /etc/default/grub” but they didn’t do anything

            That is because you forgot to install gedit (which is the default text editor of the GNOME desktop environment, but not on antiX, that doesn’t run GNOME as default). If it is not installed, you cannot expect to launch it from the terminal emulator.
            antiX does not come with gedit installed by default, so if you like gedit above all other graphical text editors, simply install it.
            antiX does come with: geany, leafpad, nano, vim, and many other cli editors (I cannot remember all right now).

            You could also open a file manager (like Spacefm, included in antiX), navigate to /etc/default folder, right-click the grub file and select “Edit as Root”, or open the file manager as root (in spaceFM it can be done point-and-clicky way in the top submenu File > Root Window, or in terminal emulator: gksu spacefm), navigate to the /etc/default folder, right-click the grub file and select with what application you want to open and edit the file.

            Many options are available.

            • This reply was modified 2 years, 9 months ago by Xecure. Reason: extra info
            • This reply was modified 2 years, 9 months ago by Xecure. Reason: sudo for cli, gksu for gui

            antiX Live system enthusiast.
            General Live Boot Parameters for antiX.

            #38704
            Member
            steve_anunknown
              Helpful
              Up
              0
              ::

              Thank you friend,

              You have been really helpful and I am grateful. Now I can edit the grub file just fine, however the error I mentioned at the beginning (concerning backing up the original lenovo bios) persists. If you have anything else to propose, I’m all ears, but you have resolved my original problem ( editing grub) so, if you cannot or do not want to offer additional help, I can try to research and solve it on my own.

              #38706
              Moderator
              Brian Masinick
                Helpful
                Up
                0
                ::

                @steve_anunknown:

                You have done well in describing the issues sufficiently well that Xecure was able to help you. I also applaud your enthusiasm and desire to learn more and experiment on your own.

                Glad you are making good progress. Best wishes for continued success!

                --
                Brian Masinick

                #38709
                Forum Admin
                rokytnji
                  Helpful
                  Up
                  0
                  ::

                  As far as your original question
                  link

                  1st thing mentioned.

                  First of all, check if your chipset, ROM chip, and mainboard are supported

                  • This reply was modified 2 years, 9 months ago by rokytnji.

                  Sometimes I drive a crooked road to get my mind straight.
                  Not all who Wander are Lost.
                  I'm not outa place. I'm from outer space.

                  Linux Registered User # 475019
                  How to Search for AntiX solutions to your problems

                  #38713
                  Member
                  Xecure
                    Helpful
                    Up
                    0
                    ::

                    Edit: deleting some links to avoid spam filter

                    I have no experience with changing or backing up the BIOS. This is new to me.

                    I was looking for the specific error and I found what I suppose is the thread you opened in reddit to figure out the problem:
                    https://www.reddit.com/r/libreboot/comments/hlsdvg/antix_and_libreboot/

                    You describe the error there as:

                    Calibrating delay loop... OK.
                    Found chipset "Intel ICH7M".
                    Enabling flash write... Error accessing ICH RCRB, 0x4000 bytes at 0xfed1c000
                    /dev/mem mmap failed: Operation not permitted
                    FAILED!
                    FATAL ERROR!
                    Error: Programmer initialization failed.

                    As you suggest, the possible solution mentioned in https://blog.fluxo.info/research/libreboot/ is:

                    NOTE: if running flashrom -p internal for software based flashing, and you get
                    an error related to /dev/mem access, you should reboot with iomem=relaxed
                    kernel parameter before running flashrom, or use a kernel that has
                    CONFIG_STRICT_DEVMEM not enabled.

                    You can test to see if the boot parameters have really loaded doing:
                    cat /proc/cmdline

                    I see that Thinkpads X60s are compatible (libreboot.org/docs/hardware/#list-of-supported-thinkpad-x60s), so I don’t know what the problem could be. I assume the step you are following (and are stuck in) is the backup step: https://www.coreboot.org/Board:lenovo/x60/Installation#Back_up_the_original_proprietary_firmware

                    Could someone with a Thinkpad x60 test this step (a non-destructive step) and see if they can also backup the bios firmware or experience the same error? I know others have talked about having this device, so maybe you could see if you have the same result as the OP. If I had it I could test this myself.

                    antiX Live system enthusiast.
                    General Live Boot Parameters for antiX.

                    #38717
                    Member
                    steve_anunknown
                      Helpful
                      Up
                      0
                      ::

                      Hello,

                      I have confirmed that the chipset is supported, however I’m not so sure about the rom chip and the mainboard. Regarding the rom chip, I don’t know how to access the information that would allow me to confirm it (the device name is probably all I need). As far as the mainboard is concerned, I tried different commands that would print some information on the terminal ( the commands were “lspci” “dmidecode -t baseboard” “dmidecode -t 2” “dmidecode | more” ) but I don’t believe I’m getting anything useful out of them (the reason i managed to identify the chipset is because when i tried to run the flashrom, it was located and its name was printed).

                      Be that as it may, I see no reason for them not to be supported. My father acquired the x60 used, but surely he did not modify it in any way. Also, if I’m not mistaken, the x60 is the “easiest” model to libreboot and judging from the documentation in the original site, there isn’t anything that I should check in the x60 in order to proceed with the librebooting process, unlike, for example , the t60 , where you have to make sure that some hardware requirements are met.

                      For that reason, I’m inclined to believe that I’m dealing with a software issue, although I do not have the experience or knowledge to argue for it. I’m open to any ideas.

                      Again, thank you for putting in the time to help me.

                      #38737
                      Member
                      steve_anunknown
                        Helpful
                        Up
                        0
                        ::

                        Hey Xecure,

                        You said

                        You can test to see if the boot parameters have really loaded doing:
                        cat /proc/cmdline

                        The output of cat /proc/cmdline is BOOT_IMAGE=/boot/vmlinuz-4.9.212-antix.1-486-smp root=UUID=38a5322c-e4d8-447f-ab9b-b9377ac1f6d9 ro quiet xorg=safe nomodeset

                        So, I think that this means the boot parameters have loaded successfully.

                        Also, I agree with what you said

                        I see that Thinkpads X60s are compatible (libreboot.org/docs/hardware/#list-of-supported-thinkpad-x60s), so I don’t know what the problem could be. I assume the step you are following (and are stuck in) is the backup step: https://www.coreboot.org/Board:lenovo/x60/Installation#Back_up_the_original_proprietary_firmware

                        This is basically the point I was trying to make in my last entry.

                        #38739
                        Member
                        Xecure
                          Helpful
                          Up
                          0
                          ::


                          The output of cat /proc/cmdline is BOOT_IMAGE=/boot/vmlinuz-4.9.212-antix.1-486-smp root=UUID=38a5322c-e4d8-447f-ab9b-b9377ac1f6d9 ro quiet xorg=safe nomodeset

                          So, I think that this means the boot parameters have loaded successfully.

                          On the post where I explain about editing the grub file, the boot parameters were an example and not the ones you need to use and were taken as a quote from a different post.
                          In you case, you needed to add the iomem=relaxed boot parameter.
                          GRUB_CMDLINE_LINUX_DEFAULT="quiet iomem=relaxed"
                          That means that iomem=relaxed should appear as a boot parameter in the output of cat /proc/cmdline. In your last post, this output does not appear, so it is possible it wasn’t added, and that is why you cannot make a backup of your bios firmware.

                          Sorry if my other post has created some problems, as it was meant to be an example and not the exact solution. Hopefully this answer clears it up.

                          antiX Live system enthusiast.
                          General Live Boot Parameters for antiX.

                          #38741
                          Member
                          steve_anunknown
                            Helpful
                            Up
                            0
                            ::

                            Well, this got unnecessarily complicated hahahahahah.

                            I made the correct changes this time and everything went according to plan.

                            Thank you for your patience @Xecure, cheers!

                            #38742
                            Moderator
                            Brian Masinick
                              Helpful
                              Up
                              0
                              ::

                              I hope that others along the way will benefit from this thread; even with plenty of experience, I still found plenty of useful tidbits here. This has been a very good dialogue; thank you to all who have participated in it!

                              --
                              Brian Masinick

                            Viewing 13 posts - 1 through 13 (of 13 total)
                            • You must be logged in to reply to this topic.