Changeset 2497 in /cluster/svnroot


Ignore:
Timestamp:
Jun 24, 2010 8:46:55 AM (10 years ago)
Author:
skylar
Message:

need to merge only the tmpdir stuff (#512)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bccd-ng/branches/skylar-devel/bin/build_livecd.pl

    r2496 r2497  
    1515use Readonly;
    1616
     17$ENV{LANGUAGE} = "C";
     18$ENV{LC_ALL} = "C";
     19$ENV{LANG} = "C";
     20
    1721my %opts;
    1822
     
    4953
    5054Readonly my $PROJECT => 'bccd';
    51 if(defined($opts{'nocleanup'})) {
    52         $ft = File::Temp->newdir("/tmp/$PROJECT.XXXXXXX",CLEANUP => 0);
    53 }
    54 else {
    55         $ft = File::Temp->newdir("/tmp/$PROJECT.XXXXXXX",DIR=>$dir,CLEANUP => 1);
    56 
    57 }
    58 $tmpdir = $ft->dirname();
     55$ft = new File::Temp();
    5956if(defined($opts{'dir'})) {
    6057        $dir = $opts{'dir'};
     
    6360}
    6461
     62if(defined($opts{'nocleanup'})) {
     63        $ft = File::Temp->newdir("/tmp/$PROJECT.XXXXXXX",CLEANUP => 0);
     64}
     65else {
     66        $ft = File::Temp->newdir("/tmp/$PROJECT.XXXXXXX",DIR=>$dir,CLEANUP => 1);
     67}
     68$tmpdir = $ft->dirname();
     69
    6570$Bccd = new Bccd();
    6671
     
    7075        $debmirror_host = "debmirror.cluster.earlham.edu";
    7176}
    72 $debmirror = "http://$debmirror_host/apt/mirror/bccd-ng/debian/";
     77$debmirror = "http://$debmirror_host";
    7378
    7479if(defined($opts{'websvn'})) {
    7580        $websvn = $opts{'websvn'};
    7681} else {
    77         $websvn = "http://bccd-ng.cluster.earlham.edu/svn/bccd-ng/trunk/";
     82        $websvn = "http://bccd-ng.cluster.earlham.edu/svn/bccd-ng/branches/skylar-devel/";
    7883}
    7984
     
    8691Readonly my $LIBFETCH   => "/root/liberate";
    8792$ENV{'DEBIAN_FRONTEND'} = "noninteractive";
    88 Readonly my $PACKAGES   => "screen openssh-client openssh-server less make gcc-4.2 g++-4.2 flex bison gdb alien lsb-rpm cvs bzip2 sudo yum debootstrap rsync dhcp3-server tftpd-hpa tcpdump syslinux syslinux-common subversion nfs-common nfs-kernel-server ncurses-base ncurses-bin libncurses5 libncurses5-dev psmisc vim iproute pciutils host bc ntp ntpdate debconf-utils dhcpcd rsh-client rsh-server xbase-clients libxt-dev lesstif2 lesstif2-dev ipcalc dialog lvm2 grub parted tzdata xserver-xorg-video-fbdev xfonts-100dpi xfonts-75dpi xfonts-scalable xserver-xorg-video-all fontconfig xfonts-base gpm udev vtwm aterm rxvt xbase-clients menu bbkeys libwww-mechanize-perl postgresql-client-common postgresql-client-8.3 libdbi-perl libdbd-pg-perl strace tcsh libnet-dhcp-perl libnetaddr-ip-perl libnet-ip-perl libstdc++5 pdnsd csh libterm-readkey-perl libsvn-perl libui-dialog-perl libreadonly-perl sshfs autofs libnet-dhcp-perl dnsutils libfile-touch-perl libnet-cidr-perl arping dosfstools gawk dc glutg3-dev libxi-dev wireless-tools snmp snmpd netpbm imagemagick libyaml-perl";
     93Readonly my $PACKAGES   => "screen openssh-client openssh-server less make gcc-4.2 g++-4.2 flex bison gdb alien lsb-rpm bzip2 sudo yum debootstrap rsync dhcp3-server tcpdump syslinux syslinux-common subversion nfs-common nfs-kernel-server ncurses-base ncurses-bin libncurses5 libncurses5-dev psmisc vim iproute pciutils host bc ntp ntpdate debconf-utils dhcpcd xbase-clients libxt-dev lesstif2 lesstif2-dev ipcalc dialog lvm2 grub parted tzdata xserver-xorg-video-fbdev xfonts-100dpi xfonts-75dpi xfonts-scalable xserver-xorg-video-all fontconfig xfonts-base gpm udev vtwm aterm rxvt xbase-clients menu bbkeys libwww-mechanize-perl postgresql-client-common postgresql-client-8.3 libdbi-perl libdbd-pg-perl strace tcsh libnet-dhcp-perl libnetaddr-ip-perl libnet-ip-perl libstdc++5 pdnsd csh libterm-readkey-perl libsvn-perl libui-dialog-perl libreadonly-perl sshfs autofs libnet-dhcp-perl dnsutils libfile-touch-perl libnet-cidr-perl arping dosfstools gawk dc glutg3-dev libxi-dev wireless-tools snmp snmpd netpbm imagemagick libyaml-perl tcl8.4 libc6-i386";
    8994Readonly my $EXTRA_PACKAGES => "fftw2 fftw-dev sfftw-dev sfftw2 automake1.7 console-tools libreadline5-dev hal libxmu-headers libxmu-dev gfortran ethtool libssl0.9.8 libblas-dev libblas-dev atlas3-base atlas3-base-dev atlas3-base refblas3 lapack3 atlas3-test libg2c0-dev libg2c0 apache2 iceweasel xpdf octave3.0 ruby sl robotfindskitten pvm xpvm emacs grac blender automake1.9 libtool libglu1-mesa-dev minicom lcd4linux insight joe grace libxpm-dev telnet lsof xresprobe fbset fluxbox xgalaga zenmap nedit eterm";
     95Readonly my $AMD64_PACKAGES => "libc6-dev-i386 ia32-libs";
    9096Readonly my $BAD_PACKAGES   => ""; # Packages that throw some fatal error during install but still work
    9197Readonly my $PERLDIR        => "/usr/local/lib/site_perl/";
     
    98104Readonly my $FORMAT_DATE    => ($TIME[5]+1900)."-".($TIME[4]+1)."-".$TIME[3];
    99105Readonly my $SPLASH_FILE    => 'bccd_logo_new.png';
     106Readonly my @MINIRT_MODS    => (
     107                                "BusLogic.ko",
     108                                "NCR53c406a.ko",
     109                                "a100u2w.ko",
     110                                "advansys.ko",
     111                                "aic7xxx.ko",
     112                                "cloop.ko",
     113                                "dc395x.ko",
     114                                "dtc.ko",
     115                                "eata.ko",
     116                                "ehci-hcd.ko",
     117                                "fdomain.ko",
     118                                "ff-memless.ko",
     119                                "forcedeth.ko",
     120                                "gdth.ko",
     121                                "ieee1394.ko",
     122                                "initio.ko",
     123                                "libusual.ko",
     124                                "loop.ko",
     125                                "mptbase.ko",
     126                                "mptscsih.ko",
     127                                "ohci-hcd.ko",
     128                                "ohci1394.ko",
     129                                "pas16.ko",
     130                                "psi240i.ko",
     131                                "sbp2.ko",
     132                                "sym53c8xx.ko",
     133                                "t128.ko",
     134                                "tmscsim.ko",
     135                                "u14-34f.ko",
     136                                "uhci-hcd.ko",
     137                                "ultrastor.ko",
     138                                "usb-storage.ko",
     139                                "usbcore.ko",
     140                                "usbhid.ko",
     141                                "wd7000.ko",
     142                                );
     143
    100144# Revision fetch
    101145
     
    115159    $svnrev = $opts{'svnrev'};
    116160} else {
    117     if($websvn !~ /^http/) {
    118         $svnrev = "BASE";
    119     } else {
    120         $svnrev = $Bccd->run_test(
    121             "getsvnrev",
    122             "",
    123             "Got subversion revision of $websvn.",
    124             "$websvn",
    125             );
    126     }
     161    $svnrev = $Bccd->run_test(
     162        "getsvnrev",
     163        "",
     164        "Got subversion revision of $websvn.",
     165        "$websvn",
     166        );
    127167}
    128168
     
    152192    "",
    153193    "Mounted /proc into $BUILDDIR.",
    154     "mount -t proc proc $BUILDDIR/proc",
     194    "mount -t proc none $BUILDDIR/proc",
     195    );
     196
     197$Bccd->run_test(
     198    "system",
     199    "",
     200    "Mounted /sys into $BUILDDIR.",
     201    "mount -t sysfs none $BUILDDIR/sys",
    155202    );
    156203
     
    229276    "regexsub_file",
    230277    "",
    231     "Changed DEBMIRROR template in sources list.",
     278    "Changed DEBMIRROR template in sources list to $debmirror_host.",
    232279    "$BUILDDIR/etc/apt/sources.list",
    233280    "!DEBMIRROR!",
     
    272319          "lam.conf", "init.d/bccd-nfs", "init.d/bccd-unite-sw", "init.d/bccd-nics",
    273320          "init.d/bccd-dhcp-conf", "init.d/bccd-route", "init.d/bccd-keyboard", "rc.local",
    274           "init.d/bccd-fsrw", "auto.master", "auto.sshfs", "ld.so.conf.d/CUDA.conf" ) {
     321          "init.d/bccd-fsrw", "auto.master", "auto.sshfs" ) {
    275322    $Bccd->run_test(
    276323        "revfetch",
     
    403450    "revfetch",
    404451    "",
    405     "Fetched gen_c3_conf autogen script.",
    406     $svnrev,
    407     "$websvn/packages/gen_c3_conf.sh",
    408     "$BUILDDIR/root/gen_c3_conf.sh",
    409     );
    410 
    411 $Bccd->run_test(
    412     "revfetch",
    413     "",
    414452    "Fetched liberate script.",
    415453    $svnrev,
    416454    "$websvn/packages/liberate.pl",
    417455    "$BUILDDIR/root/liberate.pl",
    418     );
    419 
    420 $Bccd->run_test(
    421     "chmod",
    422     "",
    423     "Set gen_c3_conf executable.",
    424     0754,
    425     "$BUILDDIR/root/gen_c3_conf.sh"
    426456    );
    427457
     
    458488    );
    459489
    460 $Bccd->run_test(
    461     "system",
    462     "0",
    463     "Fetched Debian packages.",
    464     "/usr/sbin/chroot $BUILDDIR aptitude -y install $PACKAGES $EXTRA_PACKAGES",
     490if($opts{'arch'} eq 'i386') {
     491        $Bccd->run_test(
     492            "system",
     493            "0",
     494            "Fetched Debian packages.",
     495            "/usr/sbin/chroot $BUILDDIR /usr/bin/aptitude --allow-untrusted -y install $PACKAGES $EXTRA_PACKAGES",
     496            );
     497}
     498elsif($opts{'arch'} eq 'amd64') {
     499        $Bccd->run_test(
     500            "system",
     501            "0",
     502            "Fetched Debian packages.",
     503            "/usr/sbin/chroot $BUILDDIR aptitude --allow-untrusted -y install $PACKAGES $EXTRA_PACKAGES $AMD64_PACKAGES",
     504            );
     505
     506}
     507
     508# Workaround for tftpd-hpa/inetd conflict
     509$Bccd->run_test(
     510    "system",
     511    "",
     512    "Removing inetutils-inetd to avoid conflict with tftpd-hpa.",
     513    "/usr/sbin/chroot $BUILDDIR /usr/bin/dpkg -r inetutils-inetd",
     514    );
     515
     516$Bccd->run_test(
     517    "system",
     518    100,
     519    "Fetching tftpd-hpa separately.",
     520    "/usr/sbin/chroot $BUILDDIR /usr/bin/apt-get --force-yes -y install tftpd-hpa",
    465521    );
    466522
     
    473529
    474530$Bccd->run_test(
    475     "system",
    476     "",
    477     "Stopped pdnsd.",
    478     "killall pdnsd",
    479     );
    480 
    481 $Bccd->run_test(
    482531    "revfetch",
    483532    "",
     
    502551    "Making $KERNREV modules directory.",
    503552    "$BUILDDIR/lib/modules/$KERNREV",
    504     );
    505 
    506 $cwd = getcwd();
    507 
    508 $Bccd->run_test(
    509     "chdir",
    510     "",
    511     "cd'ing to $KERNREV modules directory.",
    512     "$BUILDDIR/lib/modules/",
    513     );
    514 
    515 $Bccd->run_test(
    516     "recrevfetch",
    517     "",
    518     "Fetched Knoppix kernel modules.",
    519     $svnrev,
    520     "$websvn/trees/linux_aufs/lib/modules/$KERNREV",
    521     );
    522 
    523 $Bccd->run_test(
    524     "chdir",
    525     "",
    526     "Changing back to old directory.",
    527     "$cwd",
    528553    );
    529554
     
    573598    );
    574599
    575 # PAM fetch
    576 foreach my $file ( "rlogin", "rsh" ) {
    577     $Bccd->run_test(
    578         "revfetch",
    579         "",
    580         "Fetched /etc/pam.d/$file file.",
    581         $svnrev,
    582         "$websvn/packages/etc/pam.d/$file",
    583         "$BUILDDIR/etc/pam.d/$file",
    584         );
    585 }
    586 
    587600# Install software
    588601
     
    689702}
    690703
    691 foreach my $script ( "bccd-passwd","bccd-sshd", "bccd-nfs", "nfs-common", "vboxadd-service", "mpd" ) {
     704foreach my $script ( "nfs-common", "vboxadd-service", "mpd" ) {
    692705    $Bccd->run_test(
    693706        "system",
     
    699712
    700713# This must run before 20 (bccd-passwd) and autofs
    701 foreach my $script ( "bccd-keyboard", "bccd-unite-sw", "perfctr", ) {
     714foreach my $script ( "bccd-unite-sw", "perfctr", ) {
    702715    $Bccd->run_test(
    703716        "system",
     
    712725        "",
    713726        "Enabling home directory overlay cleaning.",
    714         "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-clean-home start 5 2 S .",
     727        "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-clean-home start 5 2 .",
    715728        );
    716729
     
    719732    "",
    720733    "Enabling bccd-nics config.",
    721     "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-nics defaults 39",
     734    "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-nics start 39 S .",
    722735    );
    723736
     
    726739    "",
    727740    "Enabling bccd-dhcp-conf config.",
    728     "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-dhcp-conf defaults 38",
     741    "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-dhcp-conf start 38 S .",
    729742    );
    730743
     
    733746    "",
    734747    "Enabling bccd-route config.",
    735     "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-route defaults 41",
     748    "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-route start 41 S .",
    736749    );
    737750
     
    740753    "",
    741754    "Enabling bccd-fsrw config.",
    742     "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-fsrw defaults 11",
     755    "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-fsrw start 11 S .",
     756    );
     757
     758$Bccd->run_test(
     759    "system",
     760    "",
     761    "Enabling bccd-keyboard config.",
     762    "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-keyboard start 18 S .",
    743763    );
    744764
     
    753773    "system",
    754774    "",
     775    "Enabling networking config.",
     776    "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d networking start 42 2 S .",
     777    );
     778
     779$Bccd->run_test(
     780    "system",
     781    "",
     782    "Enabling bccd-nfs config.",
     783    "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-nfs start 20 2 S .",
     784    );
     785
     786$Bccd->run_test(
     787    "system",
     788    "",
     789    "Enabling bccd-passwd config.",
     790    "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-passwd start 20 S .",
     791    );
     792
     793$Bccd->run_test(
     794    "system",
     795    "",
     796    "Enabling bccd-sshd config.",
     797    "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-sshd start 20 2 S .",
     798    );
     799
     800$Bccd->run_test(
     801    "system",
     802    "",
    755803    "Enabling bccd-dhcp config.",
    756     "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-dhcp defaults 40",
     804    "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-dhcp start 40 S .",
    757805    );
    758806
     
    10531101
    10541102$Bccd->run_test(
     1103    "recrevfetch",
     1104    "",
     1105    "Fetched architecure-specific items for $opts{'arch'}.",
     1106    $svnrev,
     1107    "$websvn/trees/arch/$opts{'arch'}",
     1108    );
     1109
     1110$Bccd->run_test(
     1111    "system",
     1112    "",
     1113    "Copied architecture-specific items from /$opts{'arch'} to /.",
     1114        "/usr/sbin/chroot $BUILDDIR /usr/bin/rsync -av --progress /$opts{'arch'}/ /",
     1115    );
     1116
     1117$Bccd->run_test(
     1118        "fmove",
     1119        "",
     1120        "Moved cloop.ko into $tmpdir.",
     1121        "$BUILDDIR/KNOPPIX/KNOPPIX/modules/cloop.ko",
     1122        "$tmpdir/cloop.ko",
     1123        );
     1124
     1125$Bccd->run_test(
    10551126    "chdir",
    10561127    "",
     
    11051176
    11061177$Bccd->run_test(
    1107     "recrevfetch",
    1108     "",
    1109     "Fetched $websvn/trees/linux_aufs over svn.",
    1110     $svnrev,
    1111     "$websvn/trees/linux_aufs/",
    1112     );
    1113 
    1114 $Bccd->run_test(
    11151178    "system",
    11161179    "",
    11171180    "Tar'd up linux_aufs.",
    1118     "tar -C $BUILDDIR/$LIBFETCH/linux_aufs -cjvf $BUILDDIR/$LIBFETCH/lib-linux.tar.bz2 .",
    1119     );
    1120 
    1121 $Bccd->run_test(
    1122     "rmtree",
    1123     "",
    1124     "Removing linux_aufs fetch.",
    1125     "linux_aufs",
     1181    "tar -C $BUILDDIR -cjvf $BUILDDIR/$LIBFETCH/lib-linux.tar.bz2 boot lib/modules var/lib/tftpboot",
    11261182    );
    11271183
     
    11831239
    11841240$Bccd->run_test(
     1241    "system",
     1242    "",
     1243    "Unmounted $BUILDDIR/sys.",
     1244    "umount -l $BUILDDIR/sys",
     1245    );
     1246
     1247$Bccd->run_test(
    11851248    "chdir",
    11861249    "",
     
    12181281        "",
    12191282        "Created minirt filesystem.",
    1220         "dd if=/dev/zero of=$tmpdir/minirt bs=1M count=4",
     1283        "dd if=/dev/zero of=$tmpdir/minirt bs=1k count=5400",
    12211284        );
    12221285
     
    12471310        "Copied minirt into loop filesystem.",
    12481311        "rsync -a $tmpdir/KNOPPIX/boot/isolinux/minirt/ $tmpdir/loop/",
     1312        );
     1313
     1314$Bccd->run_test(
     1315        "mkpath",
     1316        "",
     1317        "Made modules directory in loop filesystem.",
     1318        "$tmpdir/loop/modules/",
     1319        );
     1320
     1321foreach my $mod (@MINIRT_MODS) {
     1322        $Bccd->run_test(
     1323                "system",
     1324                "",
     1325                "Copied $mod into minirt loop filesystem.",
     1326                "find $BUILDDIR/lib/modules/$KERNREV/ -type f -name $mod -exec /bin/cp {} $tmpdir/loop/modules/$mod \\;",
     1327        );
     1328}
     1329
     1330$Bccd->run_test(
     1331        "fcopy",
     1332        "",
     1333        "Moved cloop.ko into $tmpdir.",
     1334        "$tmpdir/cloop.ko",
     1335        "$tmpdir/loop/modules",
    12491336        );
    12501337
     
    13001387    "Fetched knoppix kernel image.",
    13011388    $svnrev,
    1302     "$websvn/trees/linux_aufs/boot/vmlinuz-$KERNREV",
     1389    "$websvn/trees/arch/$opts{'arch'}/boot/vmlinuz-$KERNREV",
    13031390        "$KNOPDIR/boot/isolinux/linux",
    13041391    );
     
    13201407        "$BUILDDIR/etc/$PROJECT-build-date",
    13211408        "$FORMAT_DATE",
     1409        );
     1410
     1411$Bccd->run_test(
     1412        "rmtree",
     1413        "",
     1414        "Removing linux_aufs fetch for $BUILDDIR.",
     1415        "$BUILDDIR/$opts{'arch'}",
    13221416        );
    13231417
Note: See TracChangeset for help on using the changeset viewer.