3 Replies Latest reply on Jun 26, 2015 5:41 PM by CMata_Intel

    ./gitstep/py gives index error while patching

    Janki

      Hi all

       

      I have Galileo (Gen 1) board. I am trying to build Grub. I have downloaded BSP v1.1.0.7 from http://downloadmirror.intel.com/23197/eng/Board_Support_Package_Sources_for_Intel_Quark_v1.1.0.7z.

      I have follwed the below steps:

      sudo apt-get install git autoconf
      tar -xvf grub-legacy_5775f32a+v1.1.0.tar.gz
      cd grub-legacy_5775f32a+v1.1.0
      ./gitsetup.py

       

      This gave many errors. I searched and found that GRUB is being replaced by GRUB2 at GitGub repo. So I changed the git URL to https://github.com/vathpela/grub2-fedora/ and changed the following files:

       

      upstream.cfg

      [upstream]

      name = grub-legacy

      #url = git://github.com/vathpela/grub-fedora.git

      url = git://github.com/vathpela/grub2-fedora.git

      #sha = 5775f32a6268dead6939d01cbe72f23972f6d3c0

      sha = be41c1cf11313bc433eaad4792f1e5a90d30e5b5                ---- latest commit copied from https://github.com/vathpela/grub2-fedora

       

      upstreambase

      #5775f32a6268dead6939d01cbe72f23972f6d3c0
      be41c1cf11313bc433eaad4792f1e5a90d30e5b5

       

      Running ./gitsetup.py after these changes gives these error

      new-files-from-patch-quark
      Running: cd new-files-from-patch-quark && >/dev/null patch --force -p1 < ../quark.patch; test $? -lt 2
      Running: git clone git://github.com/vathpela/grub2-fedora.git work
      Cloning into 'work'...
      remote: Counting objects: 87855, done.
      remote: Total 87855 (delta 0), reused 0 (delta 0), pack-reused 87855
      Receiving objects: 100% (87855/87855), 18.41 MiB | 90.00 KiB/s, done.
      Resolving deltas: 100% (62632/62632), done.
      Checking connectivity... done.
      Running: git checkout -b clanton be41c1cf11313bc433eaad4792f1e5a90d30e5b5
      Switched to a new branch 'clanton'
      Applying patches, in this order: ['quark.patch']
      Running: git apply --index "../quark.patch"
      fatal: patch with only garbage at line 3
      Traceback (most recent call last):
        File "./gitsetup.py", line 130, in <module>
          main()
        File "./gitsetup.py", line 121, in main
          run_command('git apply --index "../%s"' % p)
        File "./gitsetup.py", line 52, in run_command
          subprocess.check_call(command, shell=True)
        File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command 'git apply --index "../quark.patch"' returned non-zero exit status 128

       

      I think this must be because the quark.patch has index of older files (grub-legacy). I replaced the index of /.gitignore in quark.patch

       

      diff --git a/.gitignore b/.gitignore
      #index 4e19579..92e1a21 100644
      index 18ab8e8..c024945 100644                     --- found this from git ls-files stage
      --- a/.gitignore
      +++ b/.gitignore
      @@ -1,8 +1,38 @@
      Makefile.in
      -Makefile

       

      This throws the error

      Running: git apply --index "../quark.patch"
      ../quark.patch:12070: trailing whitespace.
         
      ../quark.patch:12207: trailing whitespace.
        errnum = intel_quark_imr_setup(IMR_RANGE_BOOT, (grub_addr_t)real_mode_mem, real_size);    
      ../quark.patch:12216: trailing whitespace.
          {
      ../quark.patch:12485: trailing whitespace.
      };
      ../quark.patch:12495: trailing whitespace.
        spi_asset_type type;
      error: patch failed: .gitignore:1
      error: .gitignore: patch does not apply
      error: Makefile.in: does not exist in index
      error: aclocal.m4: does not exist in index
      error: config.guess: does not exist in index
      error: patch failed: config.h.in:1
      error: config.h.in: patch does not apply
      error: config.sub: does not exist in index
      error: configure.in: does not exist in index
      error: docs/Makefile.in: does not exist in index
      error: docs/grub.info: does not exist in index
      error: docs/multiboot.info: does not exist in index
      error: efi/Makefile.am: does not exist in index
      error: efi/efidisk.c: does not exist in index
      error: efi/efimain.c: does not exist in index
      error: efi/ia32/loader/linux.c: does not exist in index
      error: grub/Makefile.in: does not exist in index
      error: grub/asmstub.c: does not exist in index
      error: lib/Makefile.in: does not exist in index
      error: netboot/Makefile.in: does not exist in index
      error: netboot/etherboot.h: does not exist in index
      error: netboot/pci.c: does not exist in index
      error: netboot/pci.h: does not exist in index
      error: netboot/timer.c: does not exist in index
      error: netboot/timer.h: does not exist in index
      error: stage1/Makefile.in: does not exist in index
      error: stage2/Makefile.in: does not exist in index
      error: stage2/boot.c: does not exist in index
      error: stage2/builtins.c: does not exist in index
      error: stage2/char_io.c: does not exist in index
      error: stage2/cmdline.c: does not exist in index
      error: stage2/common.c: does not exist in index
      error: stage2/shared.h: does not exist in index
      error: stage2/stage2.c: does not exist in index
      error: util/Makefile.in: does not exist in index
      Traceback (most recent call last):
        File "./gitsetup.py", line 130, in <module>
          main()
        File "./gitsetup.py", line 121, in main
          run_command('git apply --index "../%s"' % p)
        File "./gitsetup.py", line 52, in run_command
          subprocess.check_call(command, shell=True)
        File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command 'git apply --index "../quark.patch"' returned non-zero exit status 1

       

      I removed the extra spaces in the lines depicted. Now it is throwing EOF error.

      Running: git apply --index "../quark.patch"
      error: patch failed: .gitignore:1
      error: .gitignore: patch does not apply
      error: Makefile.in: does not exist in index
      error: aclocal.m4: does not exist in index
      error: config.guess: does not exist in index
      error: patch failed: config.h.in:1
      error: config.h.in: patch does not apply
      error: config.sub: does not exist in index
      error: configure.in: does not exist in index
      error: docs/Makefile.in: does not exist in index
      error: docs/grub.info: does not exist in index
      error: docs/multiboot.info: does not exist in index
      error: efi/Makefile.am: does not exist in index
      error: efi/efidisk.c: does not exist in index
      error: efi/efimain.c: does not exist in index
      error: efi/ia32/loader/linux.c: does not exist in index
      ../quark.patch:13244: new blank line at EOF.
      +
      ../quark.patch:13272: new blank line at EOF.
      +
      ../quark.patch:13742: new blank line at EOF.
      +
      ../quark.patch:13969: new blank line at EOF.
      +
      ../quark.patch:14698: new blank line at EOF.
      +
      error: grub/Makefile.in: does not exist in index
      error: grub/asmstub.c: does not exist in index
      error: lib/Makefile.in: does not exist in index
      error: netboot/Makefile.in: does not exist in index
      error: netboot/etherboot.h: does not exist in index
      error: netboot/pci.c: does not exist in index
      error: netboot/pci.h: does not exist in index
      error: netboot/timer.c: does not exist in index
      error: netboot/timer.h: does not exist in index
      error: stage1/Makefile.in: does not exist in index
      error: stage2/Makefile.in: does not exist in index
      error: stage2/boot.c: does not exist in index
      error: stage2/builtins.c: does not exist in index
      error: stage2/char_io.c: does not exist in index
      error: stage2/cmdline.c: does not exist in index
      error: stage2/common.c: does not exist in index
      error: stage2/shared.h: does not exist in index
      error: stage2/stage2.c: does not exist in index
      error: util/Makefile.in: does not exist in index
      Traceback (most recent call last):
        File "./gitsetup.py", line 130, in <module>
          main()
        File "./gitsetup.py", line 121, in main
          run_command('git apply --index "../%s"' % p)
        File "./gitsetup.py", line 52, in run_command
          subprocess.check_call(command, shell=True)
        File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command 'git apply --index "../quark.patch"' returned non-zero exit status 1

       

      What do I do? I am running this on Ubuntu 14.04 64 bit OS.

      P.S Compiled gnu-efi for 32 bit. (make ARCH="ia32")