3 # Create a working chroot for snapshot building
8 set ncpu
= `sysctl -n hw.ncpu`
12 echo "`$xdate` - SNAPSHOTS DOBUILD BEGIN"
16 set nrelease_args
= "release"
23 set nrelease_args
= "realquick"
27 set nrelease_args
= "quick"
30 echo "`$xdate` - Unknown option $arg"
31 echo "`$xdate` - SNAPSHOTS DOBUILD END"
36 echo "`$xdate` - Setting up chroot environment"
37 if ( ! -e $build/root
/dev
/null
) then
38 mount_devfs dummy
$build/root
/dev
41 umount
$build/root
/usr
/pkgsrc
/distfiles
>& /dev
/null
42 mount_null
$build/distfiles
$build/root
/usr
/pkgsrc
/distfiles
44 setenv PKGSRC_PATH
/usr
/pkgsrc
46 echo "`$xdate` - Build is running nrelease, tail -f $build/nrelease-build.out"
47 chroot
$build/root csh
-c "cd /usr/src/nrelease; make -DNOPROFILE -DWITHOUT_SRCS img $nrelease_args" >& $build/nrelease-build.out
50 echo "`$xdate` - NRelease build had a problem, see $build/nrelease-build.out"
51 echo "`$xdate` - SNAPSHOTS DOBUILD END"
55 # Figure out the filename
58 if ( "$arch" == "i386" ) then
59 set kobjs
= $build/root
/usr
/obj
/usr
/src
/sys
/GENERIC
61 set kobjs
= $build/root
/usr
/obj
/usr
/src
/sys
/X86_64_GENERIC
64 if ( ! -f $kobjs/vers.txt
) then
65 echo "`$xdate` - nrelease build did not generate $kobjs/vers.txt"
66 echo "`$xdate` - SNAPSHOTS DOBUILD END"
70 # Store the snapshots. Make sure the files are inaccessible until
71 # completely written out.
73 set basename = `cat $kobjs/vers.txt`
74 mkdir
-p $snapshots/$arch/images
75 mkdir
-p $snapshots/$arch/kernels
76 set filepath
= $snapshots/$arch
78 bzip2 < $build/root
/usr
/release
/dfly.iso
> $filepath/images
/$basename.iso.bz2
79 bzip2 < $build/root
/usr
/release
/dfly.img
> $filepath/images
/$basename.img.bz2
80 (cd $build/root
/usr
/release
/root
; tar cf
- boot |
bzip2 > $filepath/kernels
/$basename.boot.
tar.bz2
)
81 chmod 644 $filepath/images
/$basename.iso.bz2
82 chmod 644 $filepath/images
/$basename.img.bz2
83 chmod 644 $filepath/kernels
/$basename.boot.
tar.bz2
85 pushd $filepath/images
86 md5
$basename.iso.bz2
>> CHECKSUM.MD5
87 md5
$basename.img.bz2
>> CHECKSUM.MD5
90 pushd $filepath/kernels
91 md5
$basename.boot.
tar.bz2
>> CHECKSUM.MD5
94 # Only adjust the 'latest' softlink shortcuts for
95 # development snapshots. Release shortcuts have
96 # to be done manually.
98 if ( "$relsname" == "DEV" ) then
100 rm -f DragonFly-
${arch}-LATEST-ISO.iso.bz2.new
101 rm -f DragonFly-
${arch}-LATEST-IMG.img.bz2.new
102 rm -f DragonFly-
${arch}-LATEST-BOOT.
tar.bz2.new
103 ln -s images
/$basename.iso.bz2 DragonFly-
${arch}-LATEST-ISO.iso.bz2.new
104 ln -s images
/$basename.img.bz2 DragonFly-
${arch}-LATEST-IMG.img.bz2.new
105 ln -s kernels
/$basename.boot.
tar.bz2 DragonFly-
${arch}-LATEST-BOOT.
tar.bz2.new
106 mv -f DragonFly-
${arch}-LATEST-ISO.iso.bz2.new \
107 DragonFly-
${arch}-LATEST-ISO.iso.bz2
108 mv -f DragonFly-
${arch}-LATEST-IMG.img.bz2.new \
109 DragonFly-
${arch}-LATEST-IMG.img.bz2
110 mv -f DragonFly-
${arch}-LATEST-BOOT.
tar.bz2.new \
111 DragonFly-
${arch}-LATEST-BOOT.
tar.bz2
117 echo "`$xdate` - SNAPSHOTS DOBUILD END"