[opensuse-packaging] XEN/kvm for "osc build"
Hi, Is there some documentation for configuring osc to use kvm for building? I tried yesterday, but was not successful. The only doc I could find was the sermon that was written into the .oscrc of a new user, and it was not too helpful. This is what's in my .oscrc: seife@susi:~/buildservice/testing/bluez> egrep -v '^(#|$)' ~/.oscrc [general] apiurl = https://api.opensuse.org packagecachedir = /local/osbuild-packagecache su-wrapper = sudo build-root = /local/abuild/osc/%(repo)s build-type = kvm build-device = /local/abuild/kvm/root.img build-swap = /local/abuild/kvm/swap.img build-memory = 512 [https://api.opensuse.org] user=seife email = seife@opensuse.org That's the result: seife@susi:~/buildservice/testing/bluez> osc build bluez.spec Building bluez.spec for openSUSE_Factory/x86_64 Getting buildinfo from server and store to /local/buildservice/home:seife/home:seife:testing/bluez/.osc/_buildinfo-openSUSE_Factory-x86_64.xml Getting buildconfig from server and store to /local/buildservice/home:seife/home:seife:testing/bluez/.osc/_buildconfig-openSUSE_Factory-x86_64 Updating cache of required packages 0.0% cache miss. 132/132 dependencies cached. Skipping verification of package signatures due to secure VM build Writing build configuration Running build sudo "/usr/bin/build" --root="/local/abuild/osc/openSUSE_Factory/.mount" --rpmlist="/tmp/rpmlist.d_Ekq9" --dist="/local/buildservice/home:seife/home:seife:testing/bluez/.osc/_buildconfig-openSUSE_Factory-x86_64" --arch=x86_64 --kvm /local/abuild/kvm/root.img --swap /local/abuild/kvm/swap.img --memory 512 --norootforbuild --changelog --jobs 2 --debug "/local/buildservice/home:seife/home:seife:testing/bluez/bluez.spec" mkswap /local/abuild/kvm/swap.img mkswap: /local/abuild/kvm/swap.img: warning: don't erase bootbits sectors on whole disk. Use -f to force. Setting up swapspace version 1, size = 524284 KiB no label, UUID=38b9f02d-81a6-4716-b692-8d6cf6487daa BUILD_ROOT=/local/abuild/osc/openSUSE_Factory/.mount must be owned by root. Exit... The buildroot was: /local/abuild/osc/openSUSE_Factory/.mount of course, the error is wrong: seife@susi:~/buildservice/testing/bluez> ls -ld /local/abuild/osc/openSUSE_Factory/.mount drwxr-xr-x 2 root root 6 28. Apr 13:25 /local/abuild/osc/openSUSE_Factory/.mount but I did add debug output to the build script and indeed, at the moment the test is performed, that directory belongs to me... :-( Bug? Feature? Has anybody ever used this successfully? -- Stefan Seyfried "Any ideas, John?" "Well, surrounding them's out." -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Stefan Seyfried wrote:
[...] BUILD_ROOT=/local/abuild/osc/openSUSE_Factory/.mount must be owned by root. Exit...
The buildroot was: /local/abuild/osc/openSUSE_Factory/.mount
of course, the error is wrong:
seife@susi:~/buildservice/testing/bluez> ls -ld /local/abuild/osc/openSUSE_Factory/.mount drwxr-xr-x 2 root root 6 28. Apr 13:25 /local/abuild/osc/openSUSE_Factory/.mount
but I did add debug output to the build script and indeed, at the moment the test is performed, that directory belongs to me... :-(
Did you run mkfs on the image as your user? mkfs sets the owner of the root directory to the calling user. Run with --clean to have the build script re-create the file system. Also make sure that there are no stale loop mounts of aborted builds hanging around (shouldn't happen, but, you know...).
Has anybody ever used this successfully?
/me :-) cu Ludwig -- (o_ Ludwig Nussel //\ V_/_ http://www.suse.de/ SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Thu, 29 Apr 2010 13:13:33 +0200 Ludwig Nussel <ludwig.nussel@suse.de> wrote:
Stefan Seyfried wrote: Did you run mkfs on the image as your user? mkfs sets the owner of the root directory to the calling user.
Yes, I thought it would be a good idea to "prepare" everything with mkfs and mkswap. It obviously wasn't ;)
Run with --clean to have the build script re-create the file system.
... and that seems to be doing the trick. Now another question came up: Why do I need root rights to build in kvm? I can start a complete OS image without root rights, so why do I need it for build?
Has anybody ever used this successfully?
/me :-)
I could have guessed that ;) Thanks, seife -- Stefan Seyfried "Any ideas, John?" "Well, surrounding them's out." -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Stefan Seyfried wrote:
Now another question came up:
Why do I need root rights to build in kvm? I can start a complete OS image without root rights, so why do I need it for build?
The build script needs to loop mount the image so it can install a bootstrap environment inside and copy all needed packages for installation. Provided that your osc and build script is recently new you can build as regular user nevertheless if you have access to /dev/kvm. Just mkdir and chown that .mount directory you had trouble with previously to your user and run osc build. osc detects write access to /dev/kvm and omits sudo (check the command line it prints). The build script will now fail to mount the image and print an fstab line you need to add. re-run osc build (probably with --clean). With some luck that's all you need :-) cu Ludwig -- (o_ Ludwig Nussel //\ V_/_ http://www.suse.de/ SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
participants (2)
-
Ludwig Nussel
-
Stefan Seyfried