3 # Create a working chroot for snapshot building
8 set ncpu
= `sysctl -n hw.ncpu`
12 # needed for ports 'ex' script execution
16 echo "`$xdate` - SNAPSHOTS DOBUILD BEGIN"
20 set nrelease_args
= "release"
27 set nrelease_args
= "realquick"
31 set nrelease_args
= "quick"
34 echo "`$xdate` - Unknown option $arg"
35 echo "`$xdate` - SNAPSHOTS DOBUILD END"
40 echo "`$xdate` - Setting up chroot environment"
41 if ( ! -e $build/root
/dev
/null
) then
42 mount_devfs dummy
$build/root
/dev
46 umount
$build/root
/usr
/distfiles
>& /dev
/null
47 umount
$build/root
/usr
/src
>& /dev
/null
48 umount
$build/root
/usr
/dports
>& /dev
/null
50 mount_null
$build/distfiles
$build/root
/usr
/distfiles
51 mount_null
$build/src
$build/root
/usr
/src
52 mount_null
$build/dports
$build/root
/usr
/dports
54 echo "`$xdate` - Build is running nrelease, tail -f $build/nrelease-build.out"
55 chroot
$build/root csh
-c "cd /usr/src/nrelease; make -DNOPROFILE -DWITHOUT_SRCS MAKE_JOBS=1 img $nrelease_args" >& $build/nrelease-build.out
58 echo "`$xdate` - NRelease build had a problem, see $build/nrelease-build.out"
59 echo "`$xdate` - SNAPSHOTS DOBUILD END"
63 # Figure out the filename
66 if ( "$arch" == "i386" ) then
67 set kobjs
= $build/root
/usr
/obj
/usr
/src
/sys
/GENERIC
69 set kobjs
= $build/root
/usr
/obj
/usr
/src
/sys
/X86_64_GENERIC
72 if ( ! -f $kobjs/vers.txt
) then
73 echo "`$xdate` - nrelease build did not generate $kobjs/vers.txt"
74 echo "`$xdate` - SNAPSHOTS DOBUILD END"
78 # Store the snapshots. Make sure the files are inaccessible until
79 # completely written out.
81 set basename = `cat $kobjs/vers.txt`
82 mkdir
-p $snapshots/$arch/images
83 mkdir
-p $snapshots/$arch/kernels
84 set filepath
= $snapshots/$arch
86 bzip2 < $build/root
/usr
/obj
/release
/dfly.iso
> $filepath/images
/$basename.iso.bz2
87 bzip2 < $build/root
/usr
/obj
/release
/dfly.img
> $filepath/images
/$basename.img.bz2
88 (cd $build/root
/usr
/obj
/release
/root
; tar cf
- boot |
bzip2 > $filepath/kernels
/$basename.boot.
tar.bz2
)
89 chmod 644 $filepath/images
/$basename.iso.bz2
90 chmod 644 $filepath/images
/$basename.img.bz2
91 chmod 644 $filepath/kernels
/$basename.boot.
tar.bz2
94 pushd $filepath/images
95 md5
$basename.iso.bz2
>> CHECKSUM.MD5
96 md5
$basename.img.bz2
>> CHECKSUM.MD5
97 chmod 644 CHECKSUM.MD5
100 pushd $filepath/kernels
101 md5
$basename.boot.
tar.bz2
>> CHECKSUM.MD5
102 chmod 644 CHECKSUM.MD5
105 # Only adjust the 'latest' softlink shortcuts for
106 # development snapshots. Release shortcuts have
107 # to be done manually.
109 if ( "$relsname" == "DEV" ) then
111 rm -f DragonFly-
${arch}-LATEST-ISO.iso.bz2.new
112 rm -f DragonFly-
${arch}-LATEST-IMG.img.bz2.new
113 rm -f DragonFly-
${arch}-LATEST-BOOT.
tar.bz2.new
114 ln -s images
/$basename.iso.bz2 DragonFly-
${arch}-LATEST-ISO.iso.bz2.new
115 ln -s images
/$basename.img.bz2 DragonFly-
${arch}-LATEST-IMG.img.bz2.new
116 ln -s kernels
/$basename.boot.
tar.bz2 DragonFly-
${arch}-LATEST-BOOT.
tar.bz2.new
117 mv -f DragonFly-
${arch}-LATEST-ISO.iso.bz2.new \
118 DragonFly-
${arch}-LATEST-ISO.iso.bz2
119 mv -f DragonFly-
${arch}-LATEST-IMG.img.bz2.new \
120 DragonFly-
${arch}-LATEST-IMG.img.bz2
121 mv -f DragonFly-
${arch}-LATEST-BOOT.
tar.bz2.new \
122 DragonFly-
${arch}-LATEST-BOOT.
tar.bz2
127 umount
$build/root
/usr
/distfiles
>& /dev
/null
128 umount
$build/root
/usr
/src
>& /dev
/null
129 umount
$build/root
/usr
/dports
>& /dev
/null
130 umount
$build/root
/dev
>& /dev
/null
132 echo "`$xdate` - SNAPSHOTS DOBUILD END"