#!/bin/bash
-. /etc/grml/grml-buildd.conf
+MIRROR_DIRECTORY=$1
if [ -z "$MIRROR_DIRECTORY" ] ; then
- echo "Error: \$MIRROR_DIRECTORY is not set. Exiting." >&2
+ echo "Usage: jenkins-link_latest.sh path_to_public_directory flavour1 ... flavourN" >&2
exit 1
fi
+shift
-if [ -z "$FLAVOURS" ] ; then
- echo "Error: \$FLAVOURS is not set. Exiting." >&2
- exit 2
-fi
+FLAVOURS=$*
JOBS=/var/lib/jenkins/jobs
-cd $MIRROR_DIRECTORY/new || exit 1
+cd $MIRROR_DIRECTORY || exit 1
for f in $FLAVOURS; do
[ -d $JOBS/$f/builds ] || continue
[ -d ./$f ] && rm -r ./$f
- for link in ./$f*.iso*; do rm $link; done
mkdir $f
for buildpath in $JOBS/$f/builds/*_*; do
build=$(basename $buildpath)
done
[ -d $buildpath/archive/grml_logs ] && ln -s $buildpath/archive/grml_logs $f/$build/logs
done
- latest=$(basename $(readlink $JOBS/$f/lastStable))
+ latest=$(basename $(readlink $JOBS/$f/lastSuccessful))
+ mkdir ${f}/latest
if [ -e $f/$latest/*.iso ]; then
- ln -s $f/$latest/*.iso ${f}_latest.iso
- ln -s $f/$latest/*.iso.md5 ${f}_latest.iso.md5
- ln -s $f/$latest/*.iso.sha1 ${f}_latest.iso.sha1
+ latestname=$(basename ${f}/$latest/*.iso)
+ ln -s ../$latest/${latestname} ${f}/latest/${f}_latest.iso
+ ln -s ../$latest/${latestname}.md5 ${f}/latest/${f}_latest.iso.md5
+ ln -s ../$latest/${latestname}.sha1 ${f}/latest/${f}_latest.iso.sha1
fi
done
# none /proc/bus/usb usbfs defaults,nodev,noexec,nosuid,noauto,devgid=1001,devmode=664 0 0
# 192.168.1.101:/backups /mnt/nfs nfs defaults,user,wsize=8192,rsize=8192 0 0
#
-# Warning! Please do *not* change any lines below because they are auto-generated by rebuildfstab!
+# Warning! Please do *not* change any lines below because they are auto-generated by.
# If you want to disable rebuildfstab set CONFIG_FSTAB='no' in /etc/grml/autoconfig!
-# See 'man grml-rebuildfstab' for more details about the following entries.
+# See 'man grml-udev-rebuildfstab' for more details about the following entries.
echo "Action $FAI_ACTION of FAI (hooks/instsoft.GRMLBASE) via grml-live running"
if [ -r /etc/resolv.conf ] ; then
- case "$(readlink -f ${target}/etc/resolv.conf)" in
+ case "$(chroot $target readlink -f /etc/resolv.conf)" in
/run/*) # resolvconf with /run
mkdir -p $target/run/resolvconf
cat /etc/resolv.conf >> $target/run/resolvconf/resolv.conf
gptsync
hdparm
lvm2
+lsscsi
mdadm
mpt-status
multipath-tools
[ -r /etc/grml/grml-live.local ] && . /etc/grml/grml-live.local
[ -n "$HOSTNAME" ] || HOSTNAME=grml
- if [ -r /etc/resolv.conf ] ; then
- case "$(readlink -f ${target}/etc/resolv.conf)" in
- /run/*) # resolvconf with /run
- mkdir -p $target/run/resolvconf
- cat /etc/resolv.conf >> $target/run/resolvconf/resolv.conf
- ;;
- /lib/*) # resolvconf without /run
- # sanity check to avoid "input file is output file",
- # see http://bts.grml.org/grml/issue984
- if ! [ -L $target/etc/resolvconf/run/resolv.conf ] ; then
- cat /etc/resolv.conf >> $target/etc/resolvconf/run/resolv.conf
- else
- echo "Error: /etc/resolvconf/run/resolv.conf in chroot should not be a symlink." >&2
- echo " Looks like something is wrong, please fix manually." >&2
- exit 1
- fi
- ;;
- *) # no resolvconf
- if ! [ -L $target/etc/resolv.conf ] ; then
- cat /etc/resolv.conf >> $target/etc/resolv.conf
- else
- echo "Error: /etc/resolv.conf in chroot should not be a symlink (resolvconf not installed)." >&2
- exit 1
- fi
- ;;
- esac
- fi
-
if [ -x $target/usr/sbin/apt-listbugs -a -x $target/usr/bin/apt-show-source ] && \
[ -x $target/etc/apt/grml/listbugs ] ; then
for severity in critical grave serious ; do