cb62bae9b8
Qemu-nbd does not perform well with older versions of qemu due to the lack of writeback caching mode. It also only builds qcow2 images and there is a desire for raw image support. Finally, qemu-nbd makes it very difficult to build images concurrently due to the somewhat opaque nature of how it selects a /dev/nbd# device. losetup, on the other hand, makes this process very straight forward. Change-Id: I309fad8af4fd1e8d1720c17b65e1897a76d5e897 Co-Author: Clint Byrum <clint@fewbar.com>
59 lines
3.2 KiB
Plaintext
59 lines
3.2 KiB
Plaintext
# Copyright 2012 Hewlett-Packard Development Company, L.P.
|
|
# All Rights Reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
ALL ALL=(root) NOPASSWD: /bin/chmod * /tmp/*/mnt/*
|
|
ALL ALL=(root) NOPASSWD: /bin/dd of=/tmp/*/mnt/*
|
|
ALL ALL=(root) NOPASSWD: /bin/ln -sf * /tmp/*/mnt/*
|
|
ALL ALL=(root) NOPASSWD: /bin/mkdir -p /tmp/*/mnt/*
|
|
ALL ALL=(root) NOPASSWD: /bin/mkdir /tmp/*/mnt/*
|
|
ALL ALL=(root) NOPASSWD: /bin/mount --bind /dev /tmp/*/mnt/dev
|
|
ALL ALL=(root) NOPASSWD: /bin/mount --bind /tmp/*/hooks /tmp/*/mnt/tmp/in_target.d
|
|
ALL ALL=(root) NOPASSWD: /bin/mount -o remount\,ro\,bind /tmp/*/hooks /tmp/*/mnt/tmp/in_target.d
|
|
ALL ALL=(root) NOPASSWD: /bin/mount -t proc none /tmp/*/mnt/proc
|
|
ALL ALL=(root) NOPASSWD: /bin/mount -t sysfs none /tmp/*/mnt/sys
|
|
ALL ALL=(root) NOPASSWD: /bin/mount /dev/nbd0* /tmp/*/mnt
|
|
ALL ALL=(root) NOPASSWD: /bin/mount /dev/loop* /tmp/*/mnt
|
|
ALL ALL=(root) NOPASSWD: /bin/mv /tmp/*/mnt/* /tmp/*/mnt/*
|
|
ALL ALL=(root) NOPASSWD: /bin/mv -t /tmp/*/mnt /tmp/*/built/*
|
|
ALL ALL=(root) NOPASSWD: /bin/rm -* /tmp/*/mnt
|
|
ALL ALL=(root) NOPASSWD: /bin/rm -* /tmp/*/mnt/*
|
|
ALL ALL=(root) NOPASSWD: /bin/rm -* /tmp/*/built
|
|
ALL ALL=(root) NOPASSWD: /bin/rmdir /tmp/*/mnt/*
|
|
ALL ALL=(root) NOPASSWD: /bin/tar -C /tmp/*/mnt -xzf /*/.cache/image-create/*
|
|
ALL ALL=(root) NOPASSWD: /bin/umount -f /tmp/*/mnt
|
|
ALL ALL=(root) NOPASSWD: /bin/umount -f /tmp/*/mnt/dev
|
|
ALL ALL=(root) NOPASSWD: /bin/umount -f /tmp/*/mnt/proc
|
|
ALL ALL=(root) NOPASSWD: /bin/umount -f /tmp/*/mnt/sys
|
|
ALL ALL=(root) NOPASSWD: /bin/umount -f /tmp/*/mnt/tmp/in_target.d
|
|
ALL ALL=(root) NOPASSWD: /sbin/mkfs -i 4096 -t ext4 -L cloudimg-rootfs /dev/loop*
|
|
ALL ALL=(root) NOPASSWD: /sbin/modprobe nbd max_part=16
|
|
ALL ALL=(root) NOPASSWD: /sbin/sfdisk /dev/nbd*
|
|
ALL ALL=(root) NOPASSWD: /sbin/sfdisk /dev/loop*
|
|
ALL ALL=(root) NOPASSWD: /usr/bin/qemu-nbd -c /dev/nbd0 --cache=writeback /tmp/*/image
|
|
ALL ALL=(root) NOPASSWD: /usr/bin/qemu-nbd -d /dev/nbd0
|
|
ALL ALL=(root) NOPASSWD: /usr/bin/touch /tmp/*/mnt/*
|
|
ALL ALL=(root) NOPASSWD: /usr/bin/unlink /tmp/*/mnt/*
|
|
ALL ALL=(root) NOPASSWD: /bin/cp -t /tmp/*/mnt/etc/ -a /tmp/*/hooks/first-boot.d
|
|
ALL ALL=(root) NOPASSWD: /usr/bin/install -m 0755 -o root -g root -D */dib-run-parts /tmp/*/mnt/usr/local/bin/dib-run-parts
|
|
ALL ALL=(root) SETENV: NOPASSWD: /usr/sbin/chroot /tmp/*/mnt *
|
|
ALL ALL=(root) NOPASSWD: /sbin/losetup --show -r -f /tmp/*/*.raw
|
|
ALL ALL=(root) NOPASSWD: /sbin/losetup --show -f /tmp/*/*.raw
|
|
ALL ALL=(root) NOPASSWD: /sbin/losetup -d /dev/loop*
|
|
ALL ALL=(root) NOPASSWD: /sbin/partprobe /dev/loop*
|
|
ALL ALL=(root) NOPASSWD: /usr/bin/du --block-size=* -x -s /tmp/*/built
|
|
ALL ALL=(root) NOPASSWD: /bin/mount -t tmpfs tmpfs /tmp/image.*
|
|
ALL ALL=(root) NOPASSWD: /bin/umount /tmp/image.*
|
|
ALL ALL=(root) NOPASSWD: /bin/chown *\:* /tmp/image.*
|