diff options
-rwxr-xr-x | bin/g-i-installation.sh | 35 | ||||
-rw-r--r-- | etc/sudoers.d/jenkins | 2 |
2 files changed, 15 insertions, 22 deletions
diff --git a/bin/g-i-installation.sh b/bin/g-i-installation.sh index d0619b56..bdaaf9cf 100755 --- a/bin/g-i-installation.sh +++ b/bin/g-i-installation.sh @@ -420,35 +420,28 @@ save_logs() { # get logs and other files from the installed system # # remove set +e & -x once the code has proven its good - set +e set -x cd $WORKSPACE SYSTEM_MNT=/media/$NAME sudo mkdir -p $SYSTEM_MNT + # FIXME: bugreport guestmount: -o uid doesnt work: + # "sudo guestmount -o uid=$(id -u) -o gid=$(id -g)" would be nicer, bt it doesnt work: as root, the files seem to belong to jenkins, but as jenkins they cannot be accessed case $NAME in - debian-edu_*) sudo guestmount -o uid=$(id -u) -o gid=$(id -g) -a $NAME.raw -m /dev/vg_system/root --ro $SYSTEM_MNT || true - sudo guestmount -o uid=$(id -u) -o gid=$(id -g) -a $NAME.raw -m /dev/vg_system/var -o nonempty --ro $SYSTEM_MNT/var || true + debian-edu_*) sudo guestmount -a $NAME.raw -m /dev/vg_system/root --ro $SYSTEM_MNT || true + sudo guestmount -a $NAME.raw -m /dev/vg_system/var -o nonempty --ro $SYSTEM_MNT/var || true ;; - *) sudo guestmount -o uid=$(id -u) -o gid=$(id -g) -a $NAME.raw -m /dev/debian/root --ro $SYSTEM_MNT || true + *) sudo guestmount -a $NAME.raw -m /dev/debian/root --ro $SYSTEM_MNT || true ;; esac - ls - ls $NAME.raw -la - ls $SYSTEM_MNT - if [ -d $SYSTEM_MNT/var/log ] ; then - # - # copy logs - # - mkdir -p $RESULTS/log - cp -r $SYSTEM_MNT/var/log/installer $RESULTS/log/ - # - # get list of installed packages - # - chroot $SYSTEM_MNT dpkg -l > $RESULTS/dpkg-l - else - echo "Warning: cannot mount installed system to copy the logs..." - cp $NAME.raw $NAME.raw.bak - fi + # + # copy logs + # + mkdir -p $RESULTS/log + sudo cp -r $SYSTEM_MNT/var/log/installer $RESULTS/log/ + # + # get list of installed packages + # + sudo chroot $SYSTEM_MNT dpkg -l > $RESULTS/dpkg-l case $NAME in debian-edu_*) sudo umount -l $SYSTEM_MNT/var || true ;; diff --git a/etc/sudoers.d/jenkins b/etc/sudoers.d/jenkins index b77eff5f..1c03e0d3 100644 --- a/etc/sudoers.d/jenkins +++ b/etc/sudoers.d/jenkins @@ -1,4 +1,4 @@ -jenkins ALL= NOPASSWD: /usr/sbin/debootstrap *, /usr/sbin/chroot /chroots/*, /usr/sbin/chroot /media/*, /bin/rm -rf --one-file-system /chroots/*, /bin/umount -l /chroots/*, /bin/umount -l /media/*, /bin/mount -o loop*, /usr/bin/du *, /bin/kill -9 *, /usr/bin/qemu-system-x86_64 *, /bin/mkdir -p /media/*, /usr/bin/guestmount *, SETENV: NOPASSWD: /usr/sbin/pbuilder * +jenkins ALL= NOPASSWD: /usr/sbin/debootstrap *, /usr/sbin/chroot /chroots/*, /usr/sbin/chroot /media/*, /bin/rm -rf --one-file-system /chroots/*, /bin/umount -l /chroots/*, /bin/umount -l /media/*, /bin/mount -o loop*, /usr/bin/du *, /bin/kill -9 *, /usr/bin/qemu-system-x86_64 *, /bin/mkdir -p /media/*, /usr/bin/guestmount *, /bin/cp -r /media/*, SETENV: NOPASSWD: /usr/sbin/pbuilder * # keep these environment variables Defaults env_keep += "http_proxy", env_reset |