IBM / ibmichroot

A set of scripts to facilitate the use of chroot-based containers for IBM i
MIT License
21 stars 9 forks source link

/QOpenSys/opt/freeware/lib/librpm.so.0.0.0 not found #10

Closed abmusse closed 9 years ago

abmusse commented 9 years ago

Original report by PHPDave (Bitbucket: PHPDave, GitHub: PHPDave).


Was wondering if you guys ran into the same issue.

I tried to run

#!shell

$ ./pkg_setup.sh pkg_perzl_gcc-4.6.2.lst 

But its having a problem loading librpmbuild.so. librpmbuild.so is a symbolic link to librpm.so.0.0.0 . That file (librpm.so.0.0.0) isn't copied into the chroot directory when you run

#!shell

$ ./chroot_setup.sh chroot_minimal.lst /QOpenSys/ranger

I also had to run

#!shell

PATH=$PATH:/QOpenSys/opt/freeware/lib 

to get the librpm.so to be included since the path is only set to /QOpenSys/usr/bin

Full output w/ error

#!shell

$ ./pkg_setup.sh pkg_perzl_gcc-4.6.2.lst 
message: libiconv-1.14-2.aix5.1.ppc.rpm - previously downloaded
install libiconv-1.14-2.aix5.1.ppc.rpm ...
Could not load program rpm:
        Dependent module librpmbuild.so could not be loaded.
Could not load module librpmbuild.so.
System error: No such file or directory
fixing /opt/freeware/lib/libiconv.a ...

Notes

To find out librpmbuild.so was a symlink

#!shell

ls -l /QOpenSys/opt/freeware/lib/

To find out the librpm.so.0.0.0 is missing

#!shell

$ ls -l /QOpenSys/opt/freeware/lib/librpm.so.0.0.0
/QOpenSys/opt/freeware/lib/librpm.so.0.0.0 not found

RPM binary is found here: /QOpenSys/usr/bin/rpm

abmusse commented 9 years ago

Original comment by PHPDave (Bitbucket: PHPDave, GitHub: PHPDave).


Closing issue #10. The problem was apparently user error (me) or old documentation.

abmusse commented 9 years ago

Original comment by PHPDave (Bitbucket: PHPDave, GitHub: PHPDave).


Thanks @rangercairns and @aaronbartell I got through the quick example and verified i can compile with GCC! Time to see about compiling PHP7

#!shell

bash-4.3$ cat hello.c 
/* hello.c -- The most famous program of them all ..
 */

#include <stdio.h>

int main(void) {
  printf("Hello World!\n");
  // return 0; 
}
bash-4.3$ gcc hello.c
bash-4.3$ ls
a.out    hello.c
bash-4.3$ ./a.out
Hello World!
abmusse commented 9 years ago

Original comment by Aaron Bartell (Bitbucket: aaronbartell, GitHub: aaronbartell).


Similar to Tony I've created groupings of commands I can use to quickly/iteratively test our work. Here's mine:

5250> CRTUSRPRF USRPRF(E01) PASSWORD(DCVER32R1) INLMNU(*SIGNOFF) USRCLS(*USER) HOMEDIR('/QOpenSys/download/ibmichroot/spaces/e01/./home/E01') LOCALE(*NONE) TEXT('ibmichroot tests')

env_name=e01
usr_name=E01
env_path=/QOpenSys/download/ibmichroot/spaces/$env_name
./chroot_setup.sh chroot_minimal.lst $env_path
mkdir -p $env_path/home/$usr_name
# Copy my `aaron` profile .ssh for password-less ssh login into E01's folder.
cp -R ~/.ssh $env_path/home/$usr_name
# ssh doesn't work unless directories/files have specific permissions
chmod 700 $env_path/home/$usr_name/.ssh
chmod 600 $env_path/home/$usr_name/.ssh/id_rsa
chmod 644 $env_path/home/$usr_name/.ssh/id_rsa.pub
chmod 644 $env_path/home/$usr_name/.ssh/authorized_keys
# Copy in necessary ibmichroot stuff to install packages.
mkdir -p $env_path/home/ibmichroot
cp pkg_setup.sh $env_path/home/ibmichroot
cp pkg_perzl_bash-4.3.lst $env_path/home/ibmichroot
cp pkg_perzl_utils.lst $env_path/home/ibmichroot
cp pkg_perzl_git-1.8.5.4.lst $env_path/home/ibmichroot
cp rpm.rte $env_path/home/ibmichroot
cp wget-1.9.1-1.aix5.1.ppc.rpm $env_path/home/ibmichroot
# I pre-download many `xxxx.rpm` files and copy them all in, and the delete them when done.
cp -R rpm/* $env_path/home/ibmichroot

# Single command to do install of particular pkg_xxxx.lst
chroot $env_path /usr/bin/sh -c 'cd /home/ibmichroot && ./pkg_setup.sh pkg_perzl_utils.lst'
chroot $env_path /usr/bin/sh -c 'cd /home/ibmichroot && ./pkg_setup.sh pkg_perzl_git-1.8.5.4.lst'
chown -Rh $usr_name:0 $env_path

Then to clear it out and try again:

rm -rf /QOpenSys/download/ibmichroot/spaces/e01
abmusse commented 9 years ago

Original comment by Tony Cairns (Bitbucket: rangercairns, GitHub: rangercairns).


Understand ...

I use this to destroy (careful) ...

#!shell

rm -R /QOpenSys/ranger

or more safely ...

cd /QOpenSys
rm -R ranger
abmusse commented 9 years ago

Original comment by PHPDave (Bitbucket: PHPDave, GitHub: PHPDave).


@rangercairns Might be nice to have a chroot_remove.sh to uninstall the symlinks and remove the copied files for cases where you want to start from scratch again

abmusse commented 9 years ago

Original comment by Tony Cairns (Bitbucket: rangercairns, GitHub: rangercairns).


And again yips chroot and pkg

abmusse commented 9 years ago

Original comment by Tony Cairns (Bitbucket: rangercairns, GitHub: rangercairns).


Bonkers, still not use to the issues link stuff, try again yips chroot and pkg beta

abmusse commented 9 years ago

Original comment by PHPDave (Bitbucket: PHPDave, GitHub: PHPDave).


Thanks! Will do!

abmusse commented 9 years ago

Original comment by Tony Cairns (Bitbucket: rangercairns, GitHub: rangercairns).


I over hauled documentation at [http://yips.idevcloud.com/wiki/index.php/PASE/OpenSourceBeta]()

Please try this out from scratch and see if you have better results???

abmusse commented 9 years ago

Original comment by Tony Cairns (Bitbucket: rangercairns, GitHub: rangercairns).


here is a complete sequence that worked fine for my machine ...

#!shell

============
outside chroot
============
bash-4.3$ cd /QOpenSys/QIBM/ProdData/OPS/GCC  (where you downloaded)
bash-4.3$ PATH=/QOpenSys/usr/bin
bash-4.3$ LIBPATH=/QOpenSys/usr/lib
bash-4.3$ echo $PATH
/QOpenSys/usr/bin
bash-4.3$ echo $LIBPATH
/QOpenSys/usr/lib
bash-4.3$ ./chroot_setup.sh chroot_minimal.lst /QOpenSys/ranger3
:
bash-4.3$ ./chroot_setup.sh chroot_OPS_GCC.lst /QOpenSys/ranger3
:
=============
inside chroot
=============
bash-4.3$ chroot /QOpenSys/ranger3 /QOpenSys/usr/bin/bsh
$ cd /QOpenSys/QIBM/ProdData/OPS/GCC
$ ./pkg_setup.sh pkg_perzl_utils.lst
setup rpm.rte ...
setup wget-1.9.1-1.aix5.1.ppc.rpm ...
:
libidn                      ##################################################
zlib                        ##################################################
pcre                        ##################################################
readline                    ##################################################
openssl                     ##################################################
libssh2                     ##################################################
openldap                    ##################################################
info                        ##################################################
bash                        ##################################################
sed                         ##################################################
grep                        ##################################################
nedit                       ##################################################
bzip2                       ##################################################
gzip                        ##################################################
unzip                       ##################################################
zip                         ##################################################
tar                         ##################################################
$ rpm --version
RPM version 3.0.5
abmusse commented 9 years ago

Original comment by Tony Cairns (Bitbucket: rangercairns, GitHub: rangercairns).


we did change the rpm setup in chroot_setup.sh ... so maybe post a little more about the order of events ...

abmusse commented 9 years ago

Original comment by Tony Cairns (Bitbucket: rangercairns, GitHub: rangercairns).


Nothing meant to be offensive, just trying to see if we have a script issue or a doicumentation issue.

abmusse commented 9 years ago

Original comment by Tony Cairns (Bitbucket: rangercairns, GitHub: rangercairns).


I am also having a lot of difficulty understanding if you are inside/outside your chroot with /pkg_setup.sh???

abmusse commented 9 years ago

Original comment by Tony Cairns (Bitbucket: rangercairns, GitHub: rangercairns).


completely confusing ...

#!shell

Do not use PATH=$PATH:/QOpenSys/opt/freeware/lib
instead use ...
PATH=$PATH:/QOpenSys/opt/freeware/bin
LIBPATH=$LIBPATH:/QOpenSys/opt/freeware/lib

Mmm , rpm should sort of always work, but, not sure what to make of anything after watching the PATH/LIBPATH issue.

abmusse commented 9 years ago

Original comment by PHPDave (Bitbucket: PHPDave, GitHub: PHPDave).


Must of been a permissions issue or something. I just copied the missing files from /QOpenSys/opt/freeware/lib to /QOpenSys/username/QOpenSys/opt/freeware/lib