source: /cluster/svnroot/bccd-ng/branches/skylar-devel/bin/build_livecd.pl @ 2593

Last change on this file since 2593 was 2593, checked in by skylar, 10 years ago

adding xvfb for testing (#520)

  • Property svn:executable set to *
File size: 33.8 KB
Line 
1#!/usr/bin/perl
2
3use strict;
4use warnings;
5use Getopt::Long;
6use Pod::Usage;
7use File::Path;
8use File::Temp;
9use File::Copy;
10use WWW::Mechanize;
11use POSIX;
12use Bccd;
13use Cwd;
14use Bccd::TestDb qw/open_db insert_results/;
15use Readonly;
16
17$ENV{LANGUAGE} = "C";
18$ENV{LC_ALL} = "C";
19$ENV{LANG} = "C";
20
21my %opts;
22
23my($debmirror,$websvn,$rc,$out,$ft,$tmpdir,$cwd,$svnrev,
24   $Bccd,$allout,$rpkgs,$nouid,$nogid,$debmirror_host,
25   $debmirror_name,$debsecmirror,$dir);
26my(@lsof,@pids,@rd);
27
28GetOptions(
29    'arch=s' => \$opts{'arch'},
30    'outiso=s' => \$opts{'outiso'},
31    'suite=s' => \$opts{'suite'},
32    'nocleanup' => \$opts{'nocleanup'},
33    'updatedb=s' => \$opts{'updatedb'},
34    'svnrev=i' => \$opts{'svnrev'},
35    "debug" => \$opts{'debug'},
36    "info" => \$opts{'info'},
37    "debmirror=s" => \$opts{'debmirror'},
38    "websvn=s" => \$opts{'websvn'},
39    "dir=s" => \$opts{'dir'},
40    'help' => \$opts{'help'}
41    );
42
43if($opts{'help'}) {
44    pod2usage(1);
45}
46
47if(!$opts{'arch'} ||
48   !$opts{'outiso'} ||
49   !$opts{'suite'}
50    ) {
51    pod2usage(2);
52}
53
54Readonly my $PROJECT => 'bccd';
55$ft = new File::Temp();
56if(defined($opts{'dir'})) {
57        $dir = $opts{'dir'};
58} else {
59        $dir = File::Spec->tmpdir;
60}
61
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
70$Bccd = new Bccd();
71
72if(defined($opts{'debmirror'})) {
73        $debmirror_host = $opts{'debmirror'};
74} else {
75        $debmirror_host = "debmirror.cluster.earlham.edu";
76}
77$debmirror = "http://$debmirror_host";
78
79if(defined($opts{'websvn'})) {
80        $websvn = $opts{'websvn'};
81} else {
82        $websvn = "http://bccd-ng.cluster.earlham.edu/svn/bccd-ng/branches/skylar-devel/";
83}
84
85Readonly my $BUILDDIR   => $tmpdir."/build-bccd/";
86Readonly my $SOFTWARE   => "/bccd/software/";
87Readonly my $PROJDIR    => $BUILDDIR."/diskless/bccd/";
88Readonly my $BCCDCLIENT => $BUILDDIR."/diskless/clients/";
89Readonly my $NEWHOME    => "$BUILDDIR/bccd/home";
90Readonly my $CHECKIN    => "$NEWHOME/meta/nodes/";
91Readonly my $LIBFETCH   => "/root/liberate";
92Readonly my $KERNREV    => "2.6.31.12-aufs";
93$ENV{'DEBIAN_FRONTEND'} = "noninteractive";
94Readonly 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 initramfs-tools linux-image-$KERNREV xvfb";
95Readonly 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";
96Readonly my $AMD64_PACKAGES => "libc6-dev-i386 ia32-libs";
97Readonly my $BAD_PACKAGES   => ""; # Packages that throw some fatal error during install but still work
98Readonly my $PERLDIR        => "/usr/local/lib/site_perl/";
99Readonly my $TESTNAME       => "build_livecd";
100Readonly my $STAGE          => $Bccd->get_stage();
101Readonly my $KNOPDIR        => "$tmpdir/KNOPPIX";
102Readonly my $USER           => "$PROJECT";
103Readonly my @TIME           => localtime();
104Readonly my $FORMAT_DATE    => ($TIME[5]+1900)."-".($TIME[4]+1)."-".$TIME[3];
105Readonly 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                                "usb-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
144# Revision fetch
145
146if($opts{'info'}) {
147    $Bccd->set_debug('INFO');
148}
149
150if($opts{'debug'}) {
151    $Bccd->set_debug('DEBUG');
152}
153
154if($opts{'updatedb'}) {
155    $Bccd->redirect_stdio("$tmpdir");
156}
157
158if($opts{'svnrev'}) {
159    $svnrev = $opts{'svnrev'};
160} else {
161    $svnrev = $Bccd->run_test(
162        "getsvnrev",
163        "",
164        "Got subversion revision of $websvn.",
165        "$websvn",
166        );
167}
168
169$Bccd->run_test(
170    "chdir",
171    "",
172    "cd'd into $tmpdir.",
173    "$tmpdir",
174    );
175
176$Bccd->run_test(
177    "system",
178    "",
179    "Built initial install tree.",
180    "debootstrap --arch $opts{'arch'} $opts{'suite'} $BUILDDIR $debmirror",
181    );
182
183$Bccd->run_test(
184    "system",
185    "",
186    "Copied /dev to $BUILDDIR/dev.",
187    "cp -R /dev $BUILDDIR/dev",
188    );
189
190$Bccd->run_test(
191    "system",
192    "",
193    "Mounted /proc into $BUILDDIR.",
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",
202    );
203
204$Bccd->run_test(
205    "fwrite",
206    "",
207    "Disabled apt-get package authentication.",
208    "a",
209    "$BUILDDIR/etc/apt/apt.conf",
210    "APT::Get::AllowUnauthenticated 1 ;",
211    );
212
213$Bccd->run_test(
214    "system",
215    "",
216    "Installed Perl testing modules in install tree.",
217    "chroot $BUILDDIR apt-get -y install libtest-base-perl",
218    );
219
220$Bccd->run_test(
221    "system",
222    "",
223    "Installed Perl testing modules in install tree.",
224    "chroot $BUILDDIR apt-get -y install libtest-base-perl",
225    );
226
227foreach my $file ( "$BUILDDIR/etc/apt/sources.list","$BUILDDIR/etc/apt/apt.conf","$BUILDDIR/etc/network/interfaces","$BUILDDIR/etc/dhcp3/dhcpd.conf","$BUILDDIR/etc/dhcp3/dhclient.conf","$BUILDDIR/etc/ssh/ssh_config","$BUILDDIR/etc/ssh/sshd_config","$BUILDDIR/etc/profile","$BUILDDIR/etc/defaultdomain","$BUILDDIR/etc/default/nis","$BUILDDIR/etc/default/useradd","$BUILDDIR/etc/default/tftpd-hpa","$BUILDDIR/etc/rc.local" ) {
228    if( -f $file ) {
229        $Bccd->run_test(
230            "unlink",
231            "",
232            "rm'd existing cfg file $file",
233            "$file",
234            );
235    }
236}
237
238foreach my $dir ( $BCCDCLIENT, $PROJDIR, "$BUILDDIR/etc/network", "$BUILDDIR/etc/dhcp3", "$BUILDDIR/etc/ssh", "$BUILDDIR/$SOFTWARE", "$BUILDDIR/root/.ssh", "$BUILDDIR/nfs",
239                  "$BUILDDIR/$LIBFETCH", "$BUILDDIR/var/run" ) {
240    if( !(-d $dir) ) {
241        $Bccd->run_test(
242            "mkpath",
243            "",
244            "Made $dir directory.",
245            "$dir",
246            );
247    }
248}
249
250$Bccd->run_test(
251    "revfetch",
252    "",
253    "Fetched debconf preseed file.",
254    $svnrev,
255    "$websvn/packages/debconf.preseed",
256    "$BUILDDIR/root/debconf.preseed",
257    );
258
259$Bccd->run_test(
260    "system",
261    "",
262    "Set debconf selections.",
263    "/usr/sbin/chroot $BUILDDIR debconf-set-selections /root/debconf.preseed",
264    );
265
266$Bccd->run_test(
267    "revfetch",
268    "",
269    "Fetched apt source list.",
270    $svnrev,
271    "$websvn/packages/etc/apt/sources.list",
272    "$BUILDDIR/etc/apt/sources.list",
273    );
274
275$Bccd->run_test(
276    "regexsub_file",
277    "",
278    "Changed DEBMIRROR template in sources list to $debmirror_host.",
279    "$BUILDDIR/etc/apt/sources.list",
280    "!DEBMIRROR!",
281    "$debmirror_host",
282    );
283
284foreach my $file ( "interfaces", "interfaces.compute" ) {
285    $Bccd->run_test(
286        "revfetch",
287        "",
288        "Fetched network $file cfg.",
289        $svnrev,
290        "$websvn/packages/etc/network/$file",
291        "$BUILDDIR/etc/network/$file",
292        );
293}
294
295$Bccd->run_test(
296    "mkpath",
297    "",
298    "mkdir /etc/X11/xinit",
299    "$BUILDDIR/etc/X11/xinit",
300    );
301
302# Make apt work
303
304foreach my $dir ( "/var/cache/apt/archives", "/var/cache/apt/archives/partial" ) {
305    $Bccd->run_test(
306        "mkpath",
307        "",
308        "mkdir $dir",
309        "$BUILDDIR/$dir",
310        );
311}
312
313# /etc fetch
314foreach my $file ( "hosts", "hosts.compute", "hosts.allow", "hosts.deny", "profile", "modules", "modules.net",
315          "passwd.compute", "group.compute", "shadow.compute", "exports.compute",
316          "nsswitch.conf", "unionfs.conf", "X11/xinit/xinitrc", "X11/xinit/xserverrc",
317          "dpkg/dpkg.cfg", "ld.so.conf.d/software.conf", "sudoers", "init.d/bccd-networking",
318          "init.d/bccd-passwd", "init.d/bccd-dhcp", "init.d/bccd-sshd", "X11/xorg.conf",
319          "lam.conf", "init.d/bccd-nfs", "init.d/bccd-unite-sw", "init.d/bccd-nics",
320          "init.d/bccd-dhcp-conf", "init.d/bccd-route", "init.d/bccd-keyboard", "rc.local",
321          "init.d/bccd-fsrw", "auto.master", "auto.sshfs" ) {
322    $Bccd->run_test(
323        "revfetch",
324        "",
325        "Fetched /etc/$file file.",
326        $svnrev,
327        "$websvn/packages/etc/$file",
328        "$BUILDDIR/etc/$file",
329        );
330}
331
332$Bccd->run_test(
333    "chmod",
334    "",
335    "Set $BUILDDIR/etc/sudoers user/group readable only.",
336    0440,
337    "$BUILDDIR/etc/sudoers",
338    );
339
340foreach my $file ( "bccd-networking", "bccd-passwd", "bccd-dhcp", "bccd-sshd", "bccd-nfs", "bccd-unite-sw",
341          "bccd-nics", "bccd-dhcp-conf", "bccd-route", "bccd-keyboard", "bccd-fsrw" ) {
342    $Bccd->run_test(
343        "chmod",
344        "",
345        "Set $BUILDDIR/etc/init.d/$file executable.",
346        0755,
347        "$BUILDDIR/etc/init.d/$file",
348        );
349}
350
351$cwd = getcwd();
352
353$Bccd->run_test(
354    "chdir",
355    "",
356    "cd $BUILDDIR",
357    "$BUILDDIR",
358    );
359
360$Bccd->run_test(
361    "recrevfetch",
362    "",
363    "Fetched lib directory.",
364    $svnrev,
365    "$websvn/trees/lib/",
366    );
367
368$Bccd->run_test(
369    "recrevfetch",
370    "",
371    "Fetched bin directory.",
372    $svnrev,
373    "$websvn/trees/bin/",
374    );
375
376$Bccd->run_test(
377    "recrevfetch",
378    "",
379    "Fetched sbin directory.",
380    $svnrev,
381    "$websvn/trees/sbin/",
382    );
383
384$Bccd->run_test(
385    "recrevfetch",
386    "",
387    "Fetched etc tree.",
388    $svnrev,
389    "$websvn/trees/etc/",
390    );
391
392$Bccd->run_test(
393    "recrevfetch",
394    "",
395    "Fetched root home directory.",
396    $svnrev,
397    "$websvn/trees/root/",
398    );
399
400
401$Bccd->run_test(
402    "chdir",
403    "",
404    "cd $BUILDDIR/etc",
405    "$BUILDDIR/etc",
406    );
407
408$Bccd->run_test(
409    "recrevfetch",
410    "",
411    "Fetched skel profile.",
412    $svnrev,
413    "$websvn/packages/etc/skel",
414    );
415
416foreach my $file ( "$BUILDDIR/etc/skel/.firstlogin", "$BUILDDIR/etc/skel/.bash_profile", ) {
417    $Bccd->run_test(
418        "chmod",
419        "",
420        "chmod 0755 $file",
421        0755,
422        "$file",
423        );
424}
425
426if(-f "$BUILDDIR/etc/skel/.bashrc") {
427    $Bccd->run_test(
428        "unlink",
429        "",
430        "Removed default .bashrc",
431        "$BUILDDIR/etc/skel/.bashrc",
432        );
433}
434
435$Bccd->run_test(
436    "chdir",
437    "",
438    "cd'ing into $BUILDDIR/etc/skel",
439    "$BUILDDIR/etc/skel",
440    );
441
442$Bccd->run_test(
443    "chdir",
444    "",
445    "cd $cwd",
446    "$cwd",
447    );
448
449$Bccd->run_test(
450    "revfetch",
451    "",
452    "Fetched liberate script.",
453    $svnrev,
454    "$websvn/packages/liberate.pl",
455    "$BUILDDIR/root/liberate.pl",
456    );
457
458$Bccd->run_test(
459    "revfetch",
460    "",
461    "Fetched /etc/default/useradd file.",
462    $svnrev,
463    "$websvn/packages/etc/default/useradd",
464    "$BUILDDIR/etc/default/useradd",
465    );
466
467$Bccd->run_test(
468    "fwrite",
469    "",
470    "Allowing initrd kernel upgrade.",
471    "a",
472    "$BUILDDIR/etc/kernel-img.conf",
473    "do_initrd=yes",
474    );
475
476$Bccd->run_test(
477    "system",
478    "",
479    "Updated apt cache.",
480    "/usr/sbin/chroot $BUILDDIR apt-get update",
481    );
482
483$Bccd->run_test(
484    "system",
485    "",
486    "Fetched pre-install dependencies.",
487    "/usr/sbin/chroot $BUILDDIR apt-get -y --allow-unauthenticated  install debian-archive-keyring initramfs-tools",
488    );
489
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
508if($opts{'arch'} eq 'amd64') {
509    $Bccd->run_test(
510        "system",
511        "",
512        "Symlinking IA32 libstdc++ compatibility library.",
513        "/usr/sbin/chroot $BUILDDIR ln -s /usr/lib32/libstdc++.so.6 /usr/lib32/libstdc++.so",
514        );
515}
516
517# Workaround for tftpd-hpa/inetd conflict
518$Bccd->run_test(
519    "system",
520    "",
521    "Removing inetutils-inetd to avoid conflict with tftpd-hpa.",
522    "/usr/sbin/chroot $BUILDDIR /usr/bin/dpkg -r inetutils-inetd",
523    );
524
525$Bccd->run_test(
526    "system",
527    100,
528    "Fetching tftpd-hpa separately.",
529    "/usr/sbin/chroot $BUILDDIR /usr/bin/apt-get --force-yes -y install tftpd-hpa",
530    );
531
532$Bccd->run_test(
533    "system",
534    "",
535    "Deleted cached deb packages.",
536    "/usr/sbin/chroot $BUILDDIR apt-get clean",
537    );
538
539$Bccd->run_test(
540    "revfetch",
541    "",
542    "Fetched tftpd-hpa configuration.",
543    $svnrev,
544    "$websvn/packages/etc/default/tftpd-hpa",
545    "$BUILDDIR/etc/default/tftpd-hpa",
546    );
547
548$Bccd->run_test(
549    "revfetch",
550    "",
551    "Fetched NIS default domain.",
552    $svnrev,
553    "$websvn/packages/etc/defaultdomain",
554    "$BUILDDIR/etc/defaultdomain",
555    );
556
557$Bccd->run_test(
558    "mkpath",
559    "",
560    "Making $KERNREV modules directory.",
561    "$BUILDDIR/lib/modules/$KERNREV",
562    );
563
564$Bccd->run_test(
565    "revfetch",
566    "",
567    "Fetched ssh_config file.",
568    $svnrev,
569    "$websvn/packages/etc/ssh/ssh_config",
570    "$BUILDDIR/etc/ssh/ssh_config",
571    );
572
573$Bccd->run_test(
574    "revfetch",
575    "",
576    "Fetched sshd_config file.",
577    $svnrev,
578    "$websvn/packages/etc/ssh/sshd_config",
579    "$BUILDDIR/etc/ssh/sshd_config",
580    );
581
582$Bccd->run_test(
583    "mkpath",
584    "",
585    "mkdir $BUILDDIR/etc/udev/rules.d",
586    "$BUILDDIR/etc/udev/rules.d",
587    );
588
589$Bccd->run_test(
590    "revfetch",
591    "",
592    "Fetched USB automounting udev rule.",
593    $svnrev,
594    "$websvn/packages/etc/udev/rules.d/99-automount_usb.rules",
595    "$BUILDDIR/etc/udev/rules.d/99-automount_usb.rules",
596    );
597
598# Revision write
599
600$Bccd->run_test(
601    "fwrite",
602    "",
603    "Opened $BUILDDIR/etc/$PROJECT-revision for writing.",
604    "w",
605    "$BUILDDIR/etc/$PROJECT-revision",
606    "$svnrev",
607    );
608
609# Install software
610
611$Bccd->run_test(
612    "mkpath",
613    "",
614    "Created node checkin directory.",
615    "$CHECKIN",
616    );
617
618
619$nouid = $Bccd->run_test(
620    "getuseruid",
621    "",
622    "Got uid for nobody user.",
623    "nobody",
624    );
625
626$nogid = $Bccd->run_test(
627    "getusergid",
628    "",
629    "Got gid for nobody user.",
630    "nobody",
631    );
632
633$Bccd->run_test(
634    "chown",
635    "",
636    "chown'd checkin directory $CHECKIN to $nouid:$nogid.",
637    "$nouid",
638    "$nogid",
639    "$CHECKIN",
640    );
641
642if( ! -f "$BUILDDIR/usr/bin/python2" ) {
643    $Bccd->run_test(
644        "system",
645        "",
646        "Linked python->python2 for C3 tools.",
647        "/usr/sbin/chroot $BUILDDIR ln -s /usr/bin/python2.5 /usr/bin/python2",
648        );
649}
650
651$Bccd->run_test(
652    "system",
653    "",
654    "Linked VBoxService into /usr/sbin.",
655    "/usr/sbin/chroot $BUILDDIR ln -s /opt/VBoxGuestAdditions-3.2.8/sbin/VBoxService /usr/sbin/VBoxService",
656    );
657
658foreach my $vb ("VBoxClient","VBoxControl") {
659    $Bccd->run_test(
660        "system",
661        "",
662        "Linked $vb into /usr/bin.",
663        "/usr/sbin/chroot $BUILDDIR ln -s /opt/VBoxGuestAdditions-3.2.8/bin/$vb /usr/bin/$vb",
664        );
665}
666
667$Bccd->run_test(
668    "fcopy",
669    "",
670    "Copied pxelinux to tftpboot.",
671    "$BUILDDIR/usr/lib/syslinux/pxelinux.0",
672    "$BUILDDIR/var/lib/tftpboot/pxelinux.0",
673    );
674
675$Bccd->run_test(
676    "mkpath",
677    "",
678    "Made $BUILDDIR/var/lib/tftpboot/pxelinux.cfg",
679    "$BUILDDIR/var/lib/tftpboot/pxelinux.cfg",
680    );
681
682foreach my $file ( "dhcpd.conf", "dhclient.conf", "dhclient.conf-bccd", "dhclient.conf-any" ) {
683    $Bccd->run_test(
684        "revfetch",
685        "",
686        "Fetched DHCP $file configuration.",
687        $svnrev,
688        "$websvn/packages/etc/dhcp3/$file",
689        "$BUILDDIR/etc/dhcp3/$file",
690        );
691}
692
693# Needed down here to prevent hang with debconf
694foreach my $file ( "exports", "hosts.equiv", "gpm.conf", "inittab" ) {
695    $Bccd->run_test(
696        "revfetch",
697        "",
698        "Fetched /etc/$file file.",
699        $svnrev,
700        "$websvn/packages/etc/$file",
701        "$BUILDDIR/etc/$file",
702        );
703}
704
705$Bccd->run_test(
706    "system",
707    "",
708    "Setting LSB parsing of init scripts.",
709    "touch $BUILDDIR/etc/update-rc.d-lsbparse",
710    );
711
712$Bccd->run_test(
713    "system",
714    "",
715    "Disabling hardware-optimized ld.so directories.",
716    "touch $BUILDDIR/etc/ld.so.nohwcap",
717    );
718
719foreach my $script ("nis", "ssh-host-keys", "nfs-kernel-server", "ssh",
720                    "dhcp3-server", "dbus", "hal", "apache2",) {
721    $Bccd->run_test(
722        "system",
723        "",
724        "Disabled $script.",
725        "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d -f $script remove",
726        );
727}
728
729foreach my $script ("nfs-common", "mpd", "bccd-mount-devs",) {
730    $Bccd->run_test(
731        "system",
732        "",
733        "Enabling $script at boot time.",
734        "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d $script defaults",
735        );
736}
737
738# This must run before 20 (bccd-passwd) and autofs
739foreach my $script ("bccd-unite-sw", "perfctr",) {
740    $Bccd->run_test(
741        "system",
742        "",
743        "Enabling $script config.",
744        "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d $script defaults 18",
745        );
746}
747
748# Based on virtualbox install script
749foreach my $script ("vboxadd","vboxadd-x11",) {
750    $Bccd->run_test(
751        "system",
752        "",
753        "Enabling $script config.",
754        "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d $script defaults 30",
755        );
756}
757
758$Bccd->run_test(
759    "system",
760    "",
761    "Enabling vboxadd-service config.",
762    "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d vboxadd-service defaults 35",
763    );
764
765$Bccd->run_test(
766        "system",
767        "",
768        "Enabling home directory overlay cleaning.",
769        "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-clean-home start 5 2 .",
770        );
771
772$Bccd->run_test(
773    "system",
774    "",
775    "Enabling bccd-nics config.",
776    "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-nics start 39 S .",
777    );
778
779$Bccd->run_test(
780    "system",
781    "",
782    "Enabling bccd-dhcp-conf config.",
783    "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-dhcp-conf start 38 S .",
784    );
785
786$Bccd->run_test(
787    "system",
788    "",
789    "Enabling bccd-route config.",
790    "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-route start 41 S .",
791    );
792
793$Bccd->run_test(
794    "system",
795    "",
796    "Enabling bccd-fsrw config.",
797    "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-fsrw start 11 S .",
798    );
799
800$Bccd->run_test(
801    "system",
802    "",
803    "Enabling bccd-keyboard config.",
804    "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-keyboard start 18 S .",
805    );
806
807$Bccd->run_test(
808    "system",
809    "",
810    "Enabling bccd-networking config.",
811    "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-networking start 42 2 S .",
812    );
813
814$Bccd->run_test(
815    "system",
816    "",
817    "Enabling networking config.",
818    "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d networking start 42 2 S .",
819    );
820
821$Bccd->run_test(
822    "system",
823    "",
824    "Enabling bccd-nfs config.",
825    "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-nfs start 20 2 S .",
826    );
827
828$Bccd->run_test(
829    "system",
830    "",
831    "Enabling bccd-passwd config.",
832    "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-passwd start 20 S .",
833    );
834
835$Bccd->run_test(
836    "system",
837    "",
838    "Enabling bccd-sshd config.",
839    "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-sshd start 20 2 S .",
840    );
841
842$Bccd->run_test(
843    "system",
844    "",
845    "Enabling bccd-dhcp config.",
846    "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d bccd-dhcp start 40 S .",
847    );
848
849$Bccd->run_test(
850    "system",
851    "",
852    "Added root password.",
853    "/usr/sbin/chroot $BUILDDIR /usr/sbin/usermod -p '\$1\$erNdlHdL\$EV6C0eBbe6M3bVaK9m4If0' root",
854    );
855
856# User creation
857
858# Manual writes to keep NIS from interfering with static uid/gid
859
860$Bccd->run_test(
861    "fwrite",
862    "",
863    "Wrote out sshd user.",
864    "a",
865    "$BUILDDIR/etc/passwd",
866    "sshd:x:103:65534::/var/run/sshd:/usr/sbin/nologin",
867    );
868
869$Bccd->run_test(
870    "fwrite",
871    "",
872    "Wrote out sshd group.",
873    "a",
874    "$BUILDDIR/etc/shadow",
875    "sshd:!:13625:0:99999:7:::",
876    );
877
878$Bccd->run_test(
879    "system",
880    "",
881    "Creating non-root-group account.",
882    "/usr/sbin/chroot $BUILDDIR /usr/sbin/groupadd -g 1000 bccd",
883    );
884
885$Bccd->run_test(
886    "system",
887    "",
888    "Created non-root user account.",
889    "/usr/sbin/chroot $BUILDDIR /usr/sbin/useradd -s /bin/bash -G fuse,adm -u 1000 -g 1000 -d /home/$USER -m -p '\$1\$Agm0SXPB\$JnObEvwBQdg4WCovvMKST1' $USER",
890    );
891
892$Bccd->run_test(
893    "system",
894    "",
895    "Created vbox user account.",
896    "/usr/sbin/chroot $BUILDDIR /usr/sbin/useradd -s /bin/sh -G daemon -d /var/run/vboxadd vboxadd",
897    );
898
899$Bccd->run_test(
900    "system",
901    "",
902    "Altered non-root account directory for KNOPPIX.",
903    "/usr/sbin/chroot $BUILDDIR /usr/sbin/usermod -d /UNIONFS/home/$USER $USER",
904    );
905
906# Bccd perl modules
907
908$Bccd->run_test(
909    "mkpath",
910    "",
911    "mkdir $BUILDDIR/$PERLDIR",
912    "$BUILDDIR/$PERLDIR",
913    );
914
915$Bccd->run_test(
916    "chdir",
917    "",
918    "cd'd to $BUILDDIR/$PERLDIR/../",
919    "$BUILDDIR/$PERLDIR/../",
920    );
921
922
923$Bccd->run_test(
924    "recrevfetch",
925    "",
926    "Checked out Bccd perl modules.",
927    $svnrev,
928    "$websvn/trees/$PERLDIR/",
929    );
930
931$Bccd->run_test(
932    "chdir",
933    "",
934    "cd'd to $tmpdir.",
935    "$tmpdir",
936    );
937
938$Bccd->run_test(
939    "recrevfetch",
940    "",
941    "Checked out hardware autodetect stuff.",
942    $svnrev,
943    "$websvn/trees/hwsetup/",
944    );
945
946$Bccd->run_test(
947    "system",
948    "",
949    "Copied hardware autodetect into $BUILDDIR.",
950    "cp -R $tmpdir/hwsetup/* $BUILDDIR/",
951    );
952
953# Starting hwsetup init scripts
954foreach my $script ( "knoppix-autoconfig", "xserver-xorg" ) {
955    $Bccd->run_test(
956        "system",
957        "",
958        "Enabled $script.",
959        "/usr/sbin/chroot $BUILDDIR /usr/sbin/update-rc.d $script start 20 2 3 4 5 .",
960        );
961}
962
963# Software install
964
965$Bccd->run_test(
966    "chdir",
967    "",
968    "cd'd to $BUILDDIR",
969    "$BUILDDIR",
970    );
971
972$Bccd->run_test(
973    "recrevfetch",
974    "",
975    "Fetched software tree.",
976    $svnrev,
977    "$websvn/trees/software/bccd/",
978    );
979
980$Bccd->run_test(
981    "system",
982    "",
983    "Changed $SOFTWARE to bccd:bccd.",
984    "/usr/sbin/chroot $BUILDDIR /bin/chown -R bccd:bccd $SOFTWARE",
985    );
986
987foreach my $prog ( <$BUILDDIR/bccd/software/*/bin/*> ) {
988    $Bccd->run_test(
989        "chmod",
990        "",
991        "chmod 0755 $prog",
992        0755,
993        "$prog",
994        );
995}
996
997$Bccd->run_test(
998        "mkpath",
999        "",
1000        "mkdir $BUILDDIR/usr/lib/iceweasel/plugins",
1001        "$BUILDDIR/usr/lib/iceweasel/plugins", 
1002        );
1003
1004$Bccd->run_test(
1005        "fcopy",
1006        "",
1007        "cp $BUILDDIR//bccd/software/jre1.6.0_13/plugin/i386/ns7/libjavaplugin_oji.so $BUILDDIR/usr/lib/iceweasel/plugins",
1008        "$BUILDDIR//bccd/software/jre1.6.0_13/plugin/i386/ns7/libjavaplugin_oji.so",
1009        "$BUILDDIR/usr/lib/iceweasel/plugins",
1010        );
1011
1012$Bccd->run_test(
1013    "chdir",
1014    "",
1015    "cd $BUILDDIR/",
1016    "$BUILDDIR/",
1017    );
1018
1019$Bccd->run_test(
1020    "recrevfetch",
1021    "",
1022    "Fetched test tree.",
1023    $svnrev,
1024    "$websvn/trees/home",
1025    );
1026
1027$Bccd->run_test(
1028    "system",
1029    "",
1030    "chown'd $BUILDDIR/home/bccd to bccd:bccd",
1031    "/usr/sbin/chroot $BUILDDIR chown -R $USER:$USER /home/bccd",
1032    );
1033
1034$Bccd->run_test(
1035    "chmod",
1036    "",
1037    "chmod 0600 $BUILDDIR/home/bccd/.mpd.conf",
1038    0600,
1039    "$BUILDDIR/home/bccd/.mpd.conf",
1040    );
1041
1042$Bccd->run_test(
1043    "chmod",
1044    "",
1045    "chmod 0755 $BUILDDIR/root/.ssh/",
1046    0755,
1047    "$BUILDDIR/root/.ssh/",
1048    );
1049
1050$Bccd->run_test(
1051    "chmod",
1052    "",
1053    "chmod 0755 $BUILDDIR/home/$USER/.ssh",
1054    0755,
1055    "$BUILDDIR/home/$USER/.ssh",
1056    );
1057
1058$Bccd->run_test(
1059                "chmod",
1060                "",
1061                "chmod 0755 $BUILDDIR/home/$USER",
1062                0755,
1063                "$BUILDDIR/home/$USER",
1064                );
1065
1066foreach my $file ( "$BUILDDIR/root/.ssh/bccd", "$BUILDDIR/root/.ssh/config" ) {
1067    $Bccd->run_test(
1068        "chmod",
1069        "",
1070        "chmod 0600 $file",
1071        0600,
1072        "$file",
1073        );
1074}
1075
1076foreach my $key ( <$BUILDDIR/etc/ssh/ssh*key*> ) {
1077    $Bccd->run_test(
1078        "unlink",
1079        "",
1080        "Removed ssh key $key.",
1081        "$key",
1082        );
1083}
1084
1085$Bccd->run_test(
1086    "system",
1087    "",
1088    "Requiring bccd ssh start script for ssh start.",
1089    "perl -wpli -e 's/^(#\\s+Required-Start:\\s+.*\$)/\$1 bccd-sshd/' $BUILDDIR/etc/init.d/ssh",
1090    );
1091
1092$Bccd->run_test(
1093    "system",
1094    "",
1095    "Requiring bccd nic start script for networking start.",
1096    "perl -wpli -e 's/^(#\\s+Required-Start:\\s+.*\$)/\$1 bccd-nics/' $BUILDDIR/etc/init.d/networking",
1097    );
1098
1099$Bccd->run_test(
1100    "system",
1101    "",
1102    "Allowing pdnsd to listen on all interfaces.",
1103    "perl -wpli -e 's!(server_ip = )!// \$1!g' $BUILDDIR/usr/share/pdnsd/pdnsd-resolvconf.conf",
1104    );
1105
1106$Bccd->run_test(
1107    "system",
1108    "",
1109    "Fixing cstddef for openmpi.",
1110    "perl -wpli -e 's/#include_next/#include/g' $BUILDDIR/usr/include/c++/4.3/cstddef",
1111    );
1112
1113# Make us LIVE
1114
1115$Bccd->run_test(
1116    "fwrite",
1117    "",
1118    "Made us LIVE.",
1119    "w",
1120    "$BUILDDIR/etc/$PROJECT-stage",
1121    "LIVE",
1122    );
1123
1124# Setting up menus
1125
1126foreach my $file (<$BUILDDIR/usr/share/menu/*>) {
1127    $Bccd->run_test(
1128        "unlink",
1129        "",
1130        "rm'd X menu item $file",
1131        "$file",
1132        );
1133}
1134
1135$cwd = getcwd();
1136
1137$Bccd->run_test(
1138    "chdir",
1139    "",
1140    "cd $BUILDDIR/",
1141    "$BUILDDIR/",
1142    );
1143
1144$Bccd->run_test(
1145    "recrevfetch",
1146    "",
1147    "Fetched /usr items.",
1148    $svnrev,
1149    "$websvn/trees/usr/",
1150    );
1151
1152$Bccd->run_test(
1153    "recrevfetch",
1154    "",
1155    "Fetched architecure-specific items for $opts{'arch'}.",
1156    $svnrev,
1157    "$websvn/trees/arch/$opts{'arch'}",
1158    );
1159
1160$Bccd->run_test(
1161    "system",
1162    "",
1163    "Copied architecture-specific items from /$opts{'arch'} to /.",
1164        "/usr/sbin/chroot $BUILDDIR /usr/bin/rsync -av --progress /$opts{'arch'}/ /",
1165    );
1166
1167$Bccd->run_test(
1168        "fcopy",
1169        "",
1170        "Copied cloop.ko into $tmpdir.",
1171        "$BUILDDIR/KNOPPIX/KNOPPIX/modules/cloop.ko",
1172        "$tmpdir/cloop.ko",
1173        );
1174
1175$Bccd->run_test(
1176    "chdir",
1177    "",
1178    "Changed back to old directory.",
1179    "$cwd",
1180    );
1181
1182$Bccd->run_test(
1183    "system",
1184    "",
1185    "Updated desktop menus.",
1186    "/usr/sbin/chroot $BUILDDIR /usr/bin/update-menus",
1187    );
1188
1189# Software end
1190
1191# Pre-fetching liberation stuff
1192
1193$Bccd->run_test(
1194    "revfetch",
1195    "",
1196    "Fetched LVM fdisk script.",
1197    $svnrev,
1198    "$websvn/packages/fdisk_lvm.input",
1199    "$BUILDDIR/$LIBFETCH/fdisk_lvm.input",
1200    );
1201
1202$Bccd->run_test(
1203    "revfetch",
1204    "",
1205    "Fetched BCCD splash screen.",
1206    $svnrev,
1207    "$websvn/packages/$SPLASH_FILE",
1208    "$BUILDDIR/$LIBFETCH/$SPLASH_FILE",
1209    );
1210
1211$Bccd->run_test(
1212    "revfetch",
1213    "",
1214    "Fetched liberation exports file.",
1215    $svnrev,
1216    "$websvn/packages/etc/exports.liberate",
1217    "$BUILDDIR/$LIBFETCH/exports",
1218    );
1219
1220$Bccd->run_test(
1221    "chdir",
1222    "",
1223    "cd'ing to $BUILDDIR/$LIBFETCH/.",
1224    "$BUILDDIR/$LIBFETCH",
1225    );
1226
1227$Bccd->run_test(
1228    "system",
1229    "",
1230    "Tar'd up linux_aufs.",
1231    "tar -C $BUILDDIR -cjvf $BUILDDIR/$LIBFETCH/lib-linux.tar.bz2 boot lib/modules var/lib/tftpboot",
1232    );
1233
1234foreach my $file (grep(-f $_, <$BUILDDIR/var/lib/apt/lists/*>)) {
1235        $Bccd->run_test(
1236            "unlink",
1237            "",
1238            "Removed apt file lists.",
1239            "$file",
1240            );
1241}
1242
1243$Bccd->run_test(
1244    "recrevfetch",
1245    "",
1246    "Fetched $websvn/trees/diskless over svn.",
1247    $svnrev,
1248    "$websvn/trees/diskless",
1249    );
1250
1251$Bccd->run_test(
1252    "chdir",
1253    "",
1254    "Reverted to $cwd.",
1255    "$cwd",
1256    );
1257
1258$Bccd->run_test(
1259    "revfetch",
1260    "",
1261    "Fetched grub menu.",
1262    $svnrev,
1263    "$websvn/packages/boot/grub/menu.lst",
1264    "$BUILDDIR/$LIBFETCH/grub_menu.lst",
1265    );
1266
1267$Bccd->run_test(
1268    "lsofkill",
1269    "",
1270    "Killing procs in $BUILDDIR: ",
1271    "$BUILDDIR",
1272    );
1273
1274# Make here so automount doesn't destroy it
1275
1276$Bccd->run_test(
1277    "mkpath",
1278    "",
1279    "mkdir $BUILDDIR/mnt/ssh",
1280    "$BUILDDIR/mnt/ssh",
1281    );
1282
1283$Bccd->run_test(
1284    "system",
1285    "",
1286    "Unmounted $BUILDDIR/proc.",
1287    "umount -l $BUILDDIR/proc",
1288    );
1289
1290$Bccd->run_test(
1291    "system",
1292    "",
1293    "Unmounted $BUILDDIR/sys.",
1294    "umount -l $BUILDDIR/sys",
1295    );
1296
1297$Bccd->run_test(
1298    "chdir",
1299    "",
1300    "cd'd to $tmpdir for Knoppix fetch.",
1301    "$tmpdir",
1302    );
1303
1304$Bccd->run_test(
1305    "recrevfetch",
1306    "",
1307    "Fetched KNOPPIX sans root filesystem.",
1308    $svnrev,
1309    "$websvn/trees/KNOPPIX/",
1310    );
1311
1312$Bccd->run_test(
1313        "fcopy",
1314        "",
1315        "Copying Linux kernel into KNOPPIX image.",
1316        "$BUILDDIR/boot/vmlinuz-$KERNREV",
1317        "$tmpdir/KNOPPIX/boot/isolinux/linux",
1318        );
1319
1320$Bccd->run_test(
1321        "revfetch",
1322        "",
1323        "Fetched minirt device configuration.",
1324        $svnrev,
1325        "$websvn/packages/mknod.y",
1326        "$tmpdir/mknod.y",
1327        );
1328
1329$Bccd->run_test(
1330        "mknods",
1331        "",
1332        "Created minirt device nodes.",
1333        "$tmpdir/mknod.y",
1334        "$tmpdir/KNOPPIX/boot/isolinux/minirt",
1335        );
1336
1337$Bccd->run_test(
1338        "system",
1339        "",
1340        "Created minirt filesystem.",
1341        "dd if=/dev/zero of=$tmpdir/minirt bs=1k count=5400",
1342        );
1343
1344$Bccd->run_test(
1345        "system",
1346        "",
1347        "Made ext2 filesystem in minirt filesystem.",
1348        "/sbin/mke2fs -F $tmpdir/minirt",
1349        );
1350
1351$Bccd->run_test(
1352        "mkpath",
1353        "",
1354        "Made loop directory.",
1355        "$tmpdir/loop",
1356        );
1357
1358$Bccd->run_test(
1359        "system",
1360        "",
1361        "Mounted minirt on loop directory.",
1362        "/bin/mount -t ext2 -o loop $tmpdir/minirt $tmpdir/loop",
1363        );
1364
1365$Bccd->run_test(
1366        "system",
1367        "",
1368        "Copied minirt into loop filesystem.",
1369        "rsync -a $tmpdir/KNOPPIX/boot/isolinux/minirt/ $tmpdir/loop/",
1370        );
1371
1372$Bccd->run_test(
1373        "mkpath",
1374        "",
1375        "Made modules directory in loop filesystem.",
1376        "$tmpdir/loop/modules/",
1377        );
1378
1379foreach my $mod (@MINIRT_MODS) {
1380        $Bccd->run_test(
1381                "system",
1382                "",
1383                "Copied $mod into minirt loop filesystem.",
1384                "find $BUILDDIR/lib/modules/$KERNREV/ -type f -name $mod -exec /bin/cp -v {} $tmpdir/loop/modules/$mod \\;",
1385        );
1386}
1387
1388$Bccd->run_test(
1389        "fcopy",
1390        "",
1391        "Copied cloop.ko into $tmpdir.",
1392        "$tmpdir/cloop.ko",
1393        "$tmpdir/loop/modules",
1394        );
1395
1396$Bccd->run_test(
1397        "fmove",
1398        "",
1399        "Moved cloop.ko into KNOPPIX directory.",
1400        "$tmpdir/cloop.ko",
1401        "$tmpdir/KNOPPIX/KNOPPIX/modules/cloop.ko",
1402        );
1403
1404$Bccd->run_test(
1405        "system",
1406        "",
1407        "Unmounted loop filesystem.",
1408        "umount $tmpdir/loop/",
1409        );
1410
1411$Bccd->run_test(
1412        "rmtree",
1413        "",
1414        "Removed minirt tree.",
1415        "$tmpdir/KNOPPIX/boot/isolinux/minirt/",
1416        );
1417
1418$Bccd->run_test(
1419        "system",
1420        "",
1421        "Placed minirt in KNOPPIX tree.",
1422        "gzip -c $tmpdir/minirt > $tmpdir/KNOPPIX/boot/isolinux/minirt.gz",
1423        );
1424
1425$Bccd->run_test(
1426    "revfetch",
1427    "",
1428    "Fetched background image.",
1429    $svnrev,
1430    "$websvn/packages/$SPLASH_FILE",
1431    "$tmpdir/$SPLASH_FILE",
1432    );
1433
1434$Bccd->run_test(
1435    "system",
1436    "",
1437    "Creating isolinux splash image.",
1438    "pngtopnm $tmpdir/$SPLASH_FILE | ppmtolss16 > $tmpdir/KNOPPIX/boot/isolinux/logo.16",
1439    );
1440
1441$Bccd->run_test(
1442    "regexsub_file",
1443    "",
1444    "Adding revision to KNOPPIX boot file.",
1445    "$tmpdir/KNOPPIX/boot/isolinux/boot.msg",
1446    "==REVISION==",
1447    "$svnrev",
1448    );
1449
1450$Bccd->run_test(
1451    "fcopy",
1452    "",
1453    "Copying AUFS kernel into KNOPPIX.",
1454    "$BUILDDIR/boot/vmlinuz-$KERNREV",
1455    "$tmpdir/KNOPPIX/boot/isolinux/linux",
1456    );
1457
1458$Bccd->run_test(
1459    "regexsub_file",
1460    "",
1461    "Adding date to KNOPPIX boot file.",
1462    "$tmpdir/KNOPPIX/boot/isolinux/boot.msg",
1463    "==DATE==",
1464    "$FORMAT_DATE",
1465    );
1466
1467$Bccd->run_test(
1468        "fwrite",
1469        "",
1470        "Writing out date to /etc/$PROJECT-build-date.",
1471        "w",
1472        "$BUILDDIR/etc/$PROJECT-build-date",
1473        "$FORMAT_DATE",
1474        );
1475
1476$Bccd->run_test(
1477        "rmtree",
1478        "",
1479        "Removing linux_aufs fetch for $BUILDDIR.",
1480        "$BUILDDIR/$opts{'arch'}",
1481        );
1482
1483$Bccd->run_test(
1484    "system",
1485    "",
1486    "Created compressed root filesystem.",
1487    "bash -c 'genisoimage -R -U -V BCCD-NG -publisher ccg -hide-rr-moved -cache-inodes -no-bak -pad $BUILDDIR | create_compressed_fs  - 65536 > $tmpdir/KNOPPIX/KNOPPIX/KNOPPIX'",
1488    );
1489
1490$Bccd->run_test(
1491    "system",
1492    "",
1493    "Created bootable ISO image.",
1494    "genisoimage -pad -l -r -J -v -V BCCD-NG -no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -hide-rr-moved -o $opts{'outiso'} $tmpdir/KNOPPIX",
1495    );
1496
1497print "Passed ".$Bccd->get_passed()." out of ".$Bccd->get_total()." total tests.\n";
1498
1499if($opts{'updatedb'}) {
1500    my $dbh = open_db("$opts{'updatedb'}");
1501    if( $Bccd->get_passed() < $Bccd->get_total() ) {
1502        insert_results($TESTNAME,$STAGE,$svnrev,$Bccd->snarf_file("$tmpdir/allout"),"FAILURE",$dbh);
1503    } else {
1504        insert_results($TESTNAME,$STAGE,$svnrev,$Bccd->snarf_file("$tmpdir/allout"),"SUCCESS",$dbh);
1505    }
1506    $Bccd->close_stdio();
1507    $dbh->disconnect;
1508}
1509
1510chdir $ENV{'HOME'};
1511
1512exit $Bccd->get_total()-$Bccd->get_passed();
1513
1514__END__
1515
1516build_livecd.pl - Build process based on Knoppix Live CD creation
1517
1518=head1 - SYNOPSIS
1519
1520This script is based on KNOPPIX project documentation for creating a
1521Debian-based Live CD using cloop.
1522
1523=head1 - OPTIONS
1524
1525=over 8
1526
1527=item B<--builddir> I<path-to-dir>
1528
1529Path to build directory for live CD. Will be cleaned up after the work is
1530done.
1531
1532=item B<--arch> I<arch>
1533
1534Architecture to build for.
1535
1536=item B<--outiso> I<path-to-file>
1537
1538Where to output the bccd ISO image.
1539
1540=item B<--websvn> I<websvn-url>
1541
1542Path to bccd's websvn branch, i.e. http://cluster.earlham.edu/svn/bccd-ng/trunk.
1543
1544=item B<--suite> I<release-name>
1545
1546Name of the Debian release suite to download.
1547
1548=item B<--nocleanup>
1549
1550Preserve the /tmp directory for investigation.
1551
1552=item B<--help>
1553
1554This message.
1555
1556=cut
Note: See TracBrowser for help on using the repository browser.