cookutils annotate init.d/cooker @ rev 899

Some important changes:
* cook: better die handling; cook can now mark packages as broken by itself; less chatty zip extracting; rename internal function copy() to scopy(); new copy() is the main tool to copy files from $install to $fs (docs to come); automatic patching (if patches are in $stuff/patches and patch list is $stuff/patches/series); better local packages handling; update packages.info database after each successful build, virtual packages are accessible immediately after build.
* doc/cookopts.txt: added "!perlz" and "!rmpod" options description.
* modules/compressor: strip Perl files.
* modules/pkgdb: calculate estimated time for cook:pkgdb too (as well as for cook:package).
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu May 11 00:36:43 2017 +0300 (2017-05-11)
parents 4f9d23e13883
children e58a083722aa
rev   line source
pankso@163 1 #!/bin/sh
pankso@163 2 # /etc/init.d/cooker: Start, stop or restart Cooker daemon.
pankso@163 3 #
pankso@165 4
paul@168 5 # This is the only real path we need for the daemon and it makes it independent
pankso@165 6 # from cookutils itself.
pankso@165 7 SLITAZ="/home/slitaz"
pankso@163 8
pankso@163 9 case "$i" in
pankso@163 10 start)
pankso@165 11 # When 4.0: version: stable cooking undigest
pankso@163 12 for version in cooking
pankso@163 13 do
pankso@163 14 if [ -d "$SLITAZ/$version/chroot" ]; then
pankso@163 15 echo "Starting $version cooker..."
pankso@163 16 rootfs=$SLITAZ/$version/chroot
pankso@163 17 if [ ! -d $rootfs/proc/1 ]; then
al@862 18 mount -t proc proc $rootfs/proc
al@862 19 mount -t sysfs sysfs $rootfs/sys
pankso@163 20 mount -t devpts devpts $rootfs/dev/pts
al@862 21 mount -t tmpfs shm $rootfs/dev/shm
pankso@163 22 fi
pankso@193 23 if [ ! $(mount | grep -q ${rootfs}$SLITAZ/src) ]; then
pankso@163 24 mount -o bind $SLITAZ/src ${rootfs}$SLITAZ/src
pankso@163 25 mount -o bind $SLITAZ/$version/packages \
pankso@163 26 ${rootfs}$SLITAZ/packages
pankso@163 27 fi
pankso@163 28 # Start cron in chroot.
pankso@163 29 chroot $rootfs /etc/init.d/cron start
pankso@163 30 fi
pankso@163 31 done ;;
pankso@163 32 stop)
pankso@165 33 # When 4.0: version: stable cooking undigest
pankso@163 34 for version in cooking
pankso@163 35 do
pankso@163 36 rootfs=$SLITAZ/$version/chroot
pankso@163 37 if [ -d "$SLITAZ/$version/chroot" ]; then
paul@342 38 echo "Stopping $version cooker..."
pankso@163 39 # Stop cron in chroot.
pankso@163 40 chroot $rootfs /etc/init.d/cron stop
pankso@163 41 for i in /dev/shm /dev/pts /sys /proc $SLITAZ/src $SLITAZ/packages
pankso@163 42 do
pankso@163 43 umount ${rootfs}$i
pankso@163 44 done
pankso@163 45 fi
pankso@163 46 done ;;
pankso@163 47 restart)
pankso@163 48 $0 stop && sleep 2 && $0 start ;;
pankso@163 49 *)
pankso@163 50 echo "Usage: $0 [start|stop|restart]" ;;
pankso@163 51 esac
pankso@163 52
pankso@163 53 exit 0