Error with gen_initramfs_list.sh when creating initramfs_data.cpio.gz

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tvnaidu
    Contributor
    • Oct 2009
    • 365

    Error with gen_initramfs_list.sh when creating initramfs_data.cpio.gz

    I am getting these Two lines 112 and 113 errors when running this shell script, any idea what is wrong with this script, also I have HTML link for full script, I pointed to 2.6.x code:

    GEN usr/initramfs_data. cpio.gz

    Linux-2.6.20.21/scripts/gen_initramfs_l ist.sh line:112 [: ../temp/rootfs/lib/libblk.so.1.1 integer expression expected
    Linux-2.6.20.21/scripts/gen_initramfs_l ist.sh line:113 [: ../temp/rootfs/lib/libblk.so.1.1 integer expression expected

    gen_initramfs_l ist.sh lines 112 and 113
    --------------------------------------------------

    [ "$root_uid" = "squash" ] && uid=0 || [ "$uid" -eq "$root_uid" ] && uid=0

    [ "$root_gid" = "squash" ] && gid=0 || [ "$gid" -eq "$root_gid" ] && gid=0


    http://lxr.free-electrons.com/source/scripts/gen_initramfs_l ist.sh
  • ashitpro
    Recognized Expert Contributor
    • Aug 2007
    • 542

    #2
    are you specifying -u and -g options while running your script?

    Comment

    • tvnaidu
      Contributor
      • Oct 2009
      • 365

      #3
      This gets run automatically through Makefile, I have issuing only "make", then it gets called this script.

      do you want me to change Makefile?.

      Comment

      • ashitpro
        Recognized Expert Contributor
        • Aug 2007
        • 542

        #4
        problem is script is expecting $uuid and $guid as numeric values, but some how it is not getting initialized to proper values...

        First, edit that script and print those variables and see if they are actually numbers. If not check make file. see how it is getting called from makefile.

        Comment

        • tvnaidu
          Contributor
          • Oct 2009
          • 365

          #5
          I added print $uid and $gid in script, I get zero for both. any other clues?. appreciated.

          Comment

          • ashitpro
            Recognized Expert Contributor
            • Aug 2007
            • 542

            #6
            Change these statements...

            [ "$root_uid" = "squash" ] && uid=0 || [ "$uid" -eq "$root_uid" ] && uid=0

            [ "$root_gid" = "squash" ] && gid=0 || [ "$gid" -eq "$root_gid" ] && gid=0

            to

            [ "$root_uid" = "0" ] && uid=0 || [ "0" -eq "0" ] && uid=0

            [ "$root_gid" = "0" ] && gid=0 || [ "0" -eq "0" ] && gid=0

            basically, expression [ "$uid" -eq "$root_uid" ] expects numbers..
            And make sure that you are running this script as root user.

            Comment

            • tvnaidu
              Contributor
              • Oct 2009
              • 365

              #7
              Thanks a lot. I found the issue, issue is with Makefile where I copy all shared libs, one extra file gets created, that is why this error came.

              appreciated for quick help

              Comment

              Working...