Changeset 1812 in ProjectBuilder


Ignore:
Timestamp:
Jan 2, 2014, 12:15:42 PM (10 years ago)
Author:
Bruno Cornec
Message:
  • Improve fedora rpmbootstrap VE (still need now correct deps list)
Location:
devel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/etc/pb.conf

    r1802 r1812  
    334334#
    335335rbsmindep fedora-17 = ConsoleKit-libs,audit-libs,basesystem,bash,bzip2-libs,c-ares,chkconfig,coreutils,cpio,cracklib,cracklib-dicts,crontabs,cyrus-sasl-lib,db4,dbus,dbus-libs,device-mapper,device-mapper-libs,dhclient,e2fsprogs,e2fsprogs-libs,elfutils-libelf,expat,fedora-release,fedora-release-notes,file,file-libs,filesystem,findutils,gamin,gawk,gdbm,glib2,glibc,glibc-common,gnupg2,gpgme,grep,info,initscripts,iproute,iputils,keyutils-libs,krb5-libs,libacl,libattr,libcap,libcom_err,libcurl,libgcc,libgcrypt,libgpg-error,libidn,libselinux,libsepol,libssh2,libstdc++,libusb,libxml2,linux-atm-libs,logrotate,lua,mingetty,module-init-tools,ncurses,ncurses-base,ncurses-libs,net-tools,nspr,nss,nss-softokn,nss-softokn-freebl,nss-util,openldap,openssl,pam,passwd,pcre,pinentry,popt,procps,psmisc,pth,pygpgme,python,python-iniparse,python-libs,python-pycurl,python-urlgrabber,readline,rpm,rpm-libs,rpm-python,rsyslog,sed,setup,shadow-utils,sqlite,sysvinit-tools,tzdata,udev,vim-minimal,xz-libs,yum,yum-metadata-parser,zlib
     336#
     337rbsmindep fedora-18 = ConsoleKit-libs,audit-libs,basesystem,bash,bzip2-libs,c-ares,chkconfig,coreutils,cpio,cracklib,cracklib-dicts,crontabs,cyrus-sasl-lib,db5,dbus,dbus-libs,device-mapper,device-mapper-libs,dhclient,e2fsprogs,e2fsprogs-libs,elfutils-libelf,expat,fedora-release,fedora-release-notes,file,file-libs,filesystem,findutils,gamin,gawk,gdbm,glib2,glibc,glibc-common,gnupg2,gpgme,grep,info,initscripts,iproute,iputils,keyutils-libs,krb5-libs,libacl,libattr,libcap,libcom_err,libcurl,libgcc,libgcrypt,libgpg-error,libidn,libselinux,libsepol,libssh2,libstdc++,libusb,libxml2,linux-atm-libs,logrotate,lua,mingetty,module-init-tools,ncurses,ncurses-base,ncurses-libs,net-tools,nspr,nss,nss-softokn,nss-softokn-freebl,nss-util,openldap,openssl,pam,passwd,pcre,pinentry,popt,psmisc,pth,pygpgme,python,python-iniparse,python-libs,python-pycurl,python-urlgrabber,readline,rpm,rpm-libs,rpm-python,rsyslog,sed,setup,shadow-utils,sqlite,systemd,tzdata,vim-minimal,xz-libs,yum,yum-metadata-parser,zlib
     338#
    336339#
    337340rbsmindep centos-4 = MAKEDEV,SysVinit,audit-libs,basesystem,bash,beecrypt,bzip2-libs,centos-release,coreutils,cracklib,cracklib-dicts,db4,device-mapper,e2fsprogs,elfutils-libelf,ethtool,expat,filesystem,findutils,gawk,gdbm,glib2,glibc,glibc-common,grep,info,initscripts,iproute,iputils,krb5-libs,libacl,libattr,libcap,libgcc,libidn,libselinux,libsepol,libstdc++,libtermcap,libxml2,libxml2-python,mingetty,mktemp,module-init-tools,ncurses,neon,net-tools,openssl,pam,pcre,popt,procps,psmisc,python,python-elementtree,python-sqlite,python-urlgrabber,readline,rpm,rpm-libs,rpm-python,sed,setup,shadow-utils,sqlite,sysklogd,termcap,tzdata,udev,util-linux,yum,yum-metadata-parser,zlib
  • devel/rpmbootstrap/bin/rpmbootstrap

    r1802 r1812  
    303303# Get the list of packages and their URL in this hash
    304304my %url;
     305my %done;
    305306foreach my $l (@list_pkg) {
    306307    my ($url,$desc) = rbs_find_pkg($l,$parch,"pkg");
     
    309310    } else {
    310311        pb_log(3,"not a package, maybe a dir containing packages\n");
    311         my $response1 = $ua->get("$mirror/Packages");
    312         # Check if we have a fedora 17/18 type of repo
    313         if ($response1->is_success) {
    314             foreach my $d (split(/\n/,$response1->as_string())) {
    315                 ($url,$desc) = rbs_find_pkg($d,$parch,"dir");
    316                 if (defined $url) {
    317                     # Here we have the dir in which are packages
    318                     my $response2 = $ua->get("$mirror/Packages/$desc");
    319                     foreach my $p (split(/\n/,$response2->as_string())) {
    320                         ($url,$desc) = rbs_find_pkg($d,$parch,"dir");
    321                         if (defined $url) {
    322                             $url{$p} = "$mirror/$desc";
    323                         } else {
    324                             pb_log(3,"not a package, and not a dir containing packages\n");
    325                         }
     312        ($url,$desc) = rbs_find_pkg($l,$parch,"dir");
     313        if ((defined $desc) and (not defined $done{$desc})) {
     314            my $response1 = $ua->get("$mirror/$desc");
     315            # Check if we have a fedora 17/18 type of repo
     316            if ($response1->is_success) {
     317                $done{$desc} = "true";
     318                foreach my $d (split(/\n/,$response1->as_string())) {
     319                    my ($url2,$desc2) = rbs_find_pkg($d,$parch,"pkg");
     320                    if (defined $url2) {
     321                        # Here we have the dir in which are packages
     322                        $url{$url2} = "$mirror/$desc/$desc2";
     323                    } else {
     324                        pb_log(3,"not a package, and not a dir containing packages\n");
    326325                    }
    327                 } else {
    328326                }
     327            } else {
    329328            }
    330         } else {
    331329        }
    332330    }
     
    477475pb_system("mknod -m 666 $vepath/dev/null c 1 3","Creating $vepath/dev/null") if (! -c "$vepath/dev/null");
    478476
     477# Where is bash
     478my $bash = "/usr/bin/bash";
     479if (! -x "$vepath/$bash" ) {
     480    $bash = "/bin/bash";
     481    if (! -x "$vepath/$bash" ) {
     482        die "No bash found in usual places. Please report to dev team";
     483    }
     484}
     485   
     486
    479487my $minipkglist;
    480488
     
    503511    # Setup the repo
    504512    if ($pbos->{'version'} eq "10.2") {
    505         pb_system("chroot $vepath /bin/bash -c \"yes | /usr/bin/zypper sa $baseurl $pbos->{'name'}-$pbos->{'version'}\"","Bootstrapping Zypper");
     513        pb_system("chroot $vepath $bash -c \"yes | /usr/bin/zypper sa $baseurl $pbos->{'name'}-$pbos->{'version'}\"","Bootstrapping Zypper");
    506514    } else {
    507515        # don't care if remove fails if add succeeds.
    508         pb_system("chroot $vepath /bin/bash -c \"/usr/bin/zypper rr $pbos->{'name'}-$pbos->{'version'}\"","Bootstrapping Zypper","mayfail");
    509         pb_system("chroot $vepath /bin/bash -c \"/usr/bin/zypper ar $baseurl $pbos->{'name'}-$pbos->{'version'}\"","Bootstrapping Zypper");
     516        pb_system("chroot $vepath $bash -c \"/usr/bin/zypper rr $pbos->{'name'}-$pbos->{'version'}\"","Bootstrapping Zypper","mayfail");
     517        pb_system("chroot $vepath $bash -c \"/usr/bin/zypper ar $baseurl $pbos->{'name'}-$pbos->{'version'}\"","Bootstrapping Zypper");
    510518    }
    511519    #print REPO << "EOF";
     
    523531    # Setup the repo
    524532    my $baseurl = dirname(dirname(dirname($mirror)));
    525     pb_system("chroot $vepath /bin/bash -c \"urpmi.addmedia --distrib $baseurl\"","Bootstrapping URPMI");
     533    pb_system("chroot $vepath $bash -c \"urpmi.addmedia --distrib $baseurl\"","Bootstrapping URPMI");
    526534    # TODO here too ?
    527535    $minipkglist = "ldconfig urpmi passwd vim-minimal dhcp-client";
     
    560568
    561569# Keep redhat variants from destroying nis domain on install
    562 #pb_system("chroot $vepath /bin/bash -e -c \"ln -snf /bin/true /bin/domainname\"");
     570#pb_system("chroot $vepath $bash -e -c \"ln -snf /bin/true /bin/domainname\"");
    563571
    564572#if ($pbos->{'name'} =~ /fedora/i) { # hack to prevent fedora from destroying NIS settings on host
     
    567575#   close(AUTH);
    568576#}
    569 pb_system("chroot $vepath /bin/bash -c \"$pbos->{'install'} $minipkglist \"","Bootstrapping OS by running $pbos->{'install'} $minipkglist");
     577pb_system("chroot $vepath $bash -c \"$pbos->{'install'} $minipkglist \"","Bootstrapping OS by running $pbos->{'install'} $minipkglist");
    570578
    571579# CentOS6 will replace the yum.repos.d files; oddly it will leave the yum.conf file alone and make the new one ".rpmnew"
     
    585593# TODO: Not generic enough to be done like that IMHO
    586594# In case it was changed during the install
    587 #pb_system("chroot $vepath /bin/bash -e -c \"ln -snf /bin/true /bin/domainname\"");
    588 pb_system("chroot $vepath /bin/bash -c \"if [ -x /usr/bin/authconfig ]; then /usr/bin/authconfig --enableshadow --update --nostart; fi\"","Calling authconfig");
     595#pb_system("chroot $vepath $bash -e -c \"ln -snf /bin/true /bin/domainname\"");
     596pb_system("chroot $vepath $bash -c \"if [ -x /usr/bin/authconfig ]; then /usr/bin/authconfig --enableshadow --update --nostart; fi\"","Calling authconfig");
    589597
    590598# Installed additional packages we were asked to
    591599if (defined $opts{'a'}) {
    592600    $opts{'a'} =~ s/,/ /g;
    593     pb_system("chroot $vepath /bin/bash -c \"$pbos->{'install'} $opts{'a'} \"","Adding packages to OS by running $pbos->{'install'} $opts{'a'}");
     601    pb_system("chroot $vepath $bash -c \"$pbos->{'install'} $opts{'a'} \"","Adding packages to OS by running $pbos->{'install'} $opts{'a'}");
    594602}
    595603
Note: See TracChangeset for help on using the changeset viewer.