osc – openSUSE Lizards https://lizards.opensuse.org Blogs and Ramblings of the openSUSE Members Fri, 06 Mar 2020 11:29:40 +0000 en-US hourly 1 oSC15 – 200, Why not packaging workshop like mini hack sprint https://lizards.opensuse.org/2015/01/17/osc15-200-why-not-packaging-workshop-like-mini-hack-sprint/ Sat, 17 Jan 2015 16:01:50 +0000 http://lizards.opensuse.org/?p=11193 welcomeHello Geekos.

I’m contacting you personally, as an openSUSE Board member.

You certainly already know that we want to have a kicking openSUSE conference next 1st-4th May 2015 at the Haag (NL).

Thus I’ve found that creating special workshop organized by development project could foster our beloved distribution.

oSC is the unique case in the year, where Geekos from all around the world meet together.
Let’s imagine you, meeting perhaps for the first time your fellows, having nice discussions, and hacking around the software you maintain.
There’s high level of chance to meet also your end users, and have constructive exchanges.

That’s why I invite you to propose a workshop directly to our event tools:
https://events.opensuse.org/conference/osc15/proposal

Having a workshop run like a mini-hack sprint, would help any of us in the distribution and the project.
Be it like learn people how to submit nice package, how to do maintenance, or how to do bug triage.
li1
I feel confident that you will have the creative approach to resolve your own problematic.
The event place has small rooms for unattended sessions and they could be used to extend your workshop to get some more work done.

Some practical aspects:
oSC website : https://events.opensuse.org/conference/oSC15

And soon the travel support program for oSC 15 will be opened to handle your request about getting financial support for going to oSC.
https://connect.opensuse.org/travel-support/

If you have any questions, thoughts or ideas, don’t hesitate to ask on -project mailing list
or ping me by reply.

A final note about the why you should do it? Well beside being one of our “heroes” even if nobody need them 🙂
You and your co-maintainers will be able to explain your “job” on the project.
Don’t you want to inspire new comers, lead them directly to the right direction, and share the load.
Meeting you there, will also help our “marketing” force to light up a bit the work done in the shadow.

I really will appreciate your presence, afterwards, it’s you that create our distribution.
The time has come for you to be warmly thank.

I’m looking forward to see you there.

]]>
osc build with kvm on an encrypted volume group https://lizards.opensuse.org/2014/03/15/osc-build-with-kvm-on-an-encrypted-volume-group/ Sat, 15 Mar 2014 17:34:14 +0000 http://lizards.opensuse.org/?p=10665 How-to build a initrd-virtio on a fully encrypted volume group

If like me you care about your data stored on your laptop, you certainly use a fully encrypted (excepted /boot) configuration based on lvm.

In my case I also like to create, build, fix packages locally with our tool osc. I’ve plenty of power, beefy ssd, so I dedicate a logical lvm for building cleanly package with qemu-kvm configuration, like obs does

Prepare the kvm building system

As root you create 2 lvm volume with lvcreate, one will be the build root, the other one will be the additional swap

In ~/.oscrc I enable the following parameters

build-type = kvm
build-device = /dev/mapper/vg0-lvobsbuild
build-swap = /dev/mapper/vg1-lvobsswap
build-memory = 4096
build-vmdisk-rootsize = 16000
build-vmdisk-swapsize = 4000
build-vmdisk-filesystem = ext4

You just have to adjust the Memory quantity and the device to what you create for your own environment.

Building with qemu-kvm

Once the preparation is done you could try to build a package

Skipping verification of package signatures due to secure VM build
Writing build configuration
Running build
No initrd that provides virtio support found. virtio accelleration disabled.
Run the following command as root to enable virtio:
 "env" "rootfstype=ext4" "mkinitrd" "-d" "/dev/null" "-m" "ext3 ext4 btrfs reiserfs binfmt_misc virtio_pci virtio_blk" "-k" "/boot/vmlinuz" "-i" "/boot/initrd-3.13.6-1.g4727218-desktop-virtio"
VM_IMAGE: /dev/mapper/vg0-lvobsbuild, VM_SWAP: /dev/mapper/vg1-lvobsswap
Creating ext4 filesystem on /dev/mapper/vg0-lvobsbuild
tune2fs 1.42.8 (20-Jun-2013)
Setting maximal mount count to -1
mkswap /dev/mapper/vg1-lvobsswap
Setting up swapspace version 1, size = 4194300 KiB
no label, UUID=935f0e2d-52d7-4013-8a7f-7d48c813a482
logging output to /tmp/obsbuild/.build.log...

As you can see, it warn you that you could create a -virtio initrd to use virtio acceleration (who contribute a patch for the typo 🙂

But the command line is not completely correct in our case. It need the -d to be filled with the lvm buildroot to work as expected. If you successfully create the initrd-virtio you still will face a number of trouble, due to the way mkinitrd work.

Defeating the errors

You remember that we have a fully encrypted volume group, and as a clever tool mkinitrd will feed the initrd with all the tools needed to boot your system.

But that mean it will forget the lv buildroot we ask, and will put unnecessary tools and options.

Typical errors with a non optimized -virtio initrd

[    3s] /usr/bin/qemu-kvm -no-reboot -nographic -vga none -net none -cpu host -kernel /boot/vmlinuz -initrd /boot/initrd-3.13.6-1.g4727218-desktop -append root=/dev/sda panic=1 quiet no-kvmclock nmi_watchdog=0 rw elevator=noop console=ttyS0 init=/.build/build -m 4096 -hda /dev/mapper/vg0-lvobsbuild -drive file=/dev/mapper/vg1-lvobsswap,if=ide,index=1,cache=none -smp 8
[    9s] FATAL: Error inserting nvidia (/lib/modules/3.13.6-1.g4727218-desktop/updates/nvidia.ko): No such device
[    9s]   WARNING: Failed to connect to lvmetad: No such file or directory. Falling back to internal scanning.
[    9s]   Volume group "vg0" not found
[    9s]   WARNING: Failed to connect to lvmetad: No such file or directory. Falling back to internal scanning.
[    9s]   Volume group "vg0" not found
[    9s] *** Note: only US keyboard layout is supported.
[    9s] *** Please ensure that the password is typed correctly.
[   41s] Waiting for device /dev/disk/by-id/ata-Corsair_Force_GT_blah-part2 to appear: ..............................Unlocking cr_sda2 (/dev/disk/by-id/ata-Corsair_Force_GT_blah-part2)
[   41s] Device /dev/disk/by-id/ata-Corsair_Force_GT_blah-part2 doesn't exist or access denied.
[   41s] Trying manual resume from /dev/vg0/lvswap
[   41s] resume device /dev/vg0/lvswap not found (ignoring)
[   41s] Trying manual resume from /dev/vg0/lvswap
[   41s] resume device /dev/vg0/lvswap not found (ignoring)
[   73s] Waiting for device /dev/sda to appear: ..............................Could not find /dev/sda.
[   73s] Want me to fall back to /dev/vg0/lvsuse? (Y/n)

Rescue you have as root to kill all build process.

for P in $(ps auxw| grep build | grep -v grep | awk {'print $2'} );do kill $P;done

Find a solution

We want an optimized -virtio initrd, which filter all the lvm and crypting tools we don’t need. Also there’s no need to encumber it with graphic blob.
Then I create a small script I’ve called patch-initrd-virtio (source below) which exactly do that work anytime I’ve a kernel change.
As it need to be run by root only, I normally place it in /root/bin/

patch-initrd-virtio sources

#!/usr/bin/env bash

# WTF License 1.0 
# Author Bruno Friedmann tigerfoot (at) opensuse.org

# Usage : this script will create an optimized virtio initrd without
# lvm, crypt, gfx tool
# by using the actual /boot/initrd symlink you have.
# Edit the 2 devices you target to use 
# 
DEVBUILD='/dev/vg0/lvobsbuild'
DEVSWAP='/dev/vg1/lvobsswap'

nokms(){
sed -i '/^NO_KMS_IN_INITRD/s/no/yes/' /etc/sysconfig/kernel
}

kms(){
sed -i '/^NO_KMS_IN_INITRD/s/yes/no/' /etc/sysconfig/kernel
}

echo "cleanup /tmp"
rm -fr /tmp/initrd*

# Patch the virtio initrd
if [ -z "$1" ];then
export VER=`uname -r`
else
export VER="$1"
fi
export INITRD="/boot/initrd-$VER-virtio"
echo "Setting nokms"
nokms

echo "Building -virtio initrd ..."
"env" "rootfstype=ext4,resume=$DEVSWAP,rootdev=$DEVBUILD,udevtimeout=2,udev_timeout=2,nosplash,noluks" "mkinitrd" "-B" "-d" "$DEVBUILD" "-m" "ext4 btrfs binfmt_misc virtio_pci virtio_blk" "-k" "/boot/vmlinuz-$VER" "-i" "$INITRD"

ls -l $INITRD

echo "Setting kms"
kms

# copy the *.virtio initrd to /tmp
cp -vfa $INITRD /tmp/initrd-virtio.gz

# ungzip it gzip -d initrd
cd /tmp
mkdir initrd.build
gzip -d initrd-virtio.gz

cd initrd.build

# uncpio cpio -id < ../initrd
cpio -id  ../initrd
rm -fv ../initrd-virtio
echo "rebuilding initrd ..."
find . | cpio --create --format='newc' > ../initrd-virtio
cd ../
echo "Compressing initrd ..."
# Install pigz if you want to save half an hour of your life.
if [ -x /usr/bin/pigz ];then
 pigz -9v initrd-virtio
else
 gzip -9v initrd-virtio
fi
# copy to /boot
cp -v initrd-virtio.gz $INITRD
echo "Done ..."

Usage of patch-initrd-virtio

Here’s the result of a run

cleanup /tmp
Setting nokms
Building -virtio initrd ...

Kernel image:   /boot/vmlinuz-3.13.6-1.g4727218-desktop
Initrd image:   /boot/initrd-3.13.6-1.g4727218-desktop-virtio
Root device:    /dev/vg0/lvobsbuild (mounted on / as ext4)
Resume device:  /dev/vg0/lvswap
enabling LUKS support for /dev/disk/by-id/ata-Corsair_Force_GT_blah-part2 (cr_sda2)
Microcode: Adding Intel microcode 06-2a-07
Kernel Modules: thermal_sys thermal processor fan libcrc32c xor raid6_pq btrfs binfmt_misc virtio virtio_ring virtio_pci virtio_blk dm-mod dm-crypt dm-log dm-region-hash dm-mirror dm-snapshot scsi_dh scsi_dh_hp_sw scsi_dh_alua scsi_dh_rdac scsi_dh_emc xhci-hcd hid-logitech-dj hid-holtek-kbd hid-lenovo-tpkbd hid-ortek hid-roccat hid-roccat-common hid-roccat-arvo hid-roccat-isku hid-samsung ohci-pci linear arc4 sha256_generic cryptd crct10dif-pclmul crc32-pclmul crc32c-intel ghash-clmulni-intel aes-x86_64 glue_helper gf128mul lrw ablk_helper aesni-intel
Features:       acpi dm intel_microcode block usb lvm2 luks btrfs resume.userspace resume.kernel
Did not refresh the bootloader. You might need to refresh it manually.
-rw------- 1 root root 29338540 Mar 15 18:18 /boot/initrd-3.13.6-1.g4727218-desktop-virtio
Setting kms
‘/boot/initrd-3.13.6-1.g4727218-desktop-virtio’ -> ‘/tmp/initrd-virtio.gz’
160249 blocks
removed ‘./boot/71-luks.sh’
removed ‘./config/luks.sh’
removed ‘../initrd-virtio’
rebuilding initrd ...
160239 blocks
Compressing initrd ...
initrd-virtio to initrd-virtio.gz
‘initrd-virtio.gz’ -> ‘/boot/initrd-3.13.6-1.g4727218-desktop-virtio’
Done ...

Finally start a build with -virtio activated

So with our new optimized initrd-virtio we can restart a fully qemu-kvm build with osc build –clean

Skipping verification of package signatures due to secure VM build
Writing build configuration
Running build
VM_IMAGE: /dev/mapper/vg0-lvobsbuild, VM_SWAP: /dev/mapper/vg1-lvobsswap
Creating ext4 filesystem on /dev/mapper/vg0-lvobsbuild
tune2fs 1.42.8 (20-Jun-2013)
Setting maximal mount count to -1
mkswap /dev/mapper/vg1-lvobsswap
mkswap: /dev/mapper/vg1-lvobsswap: warning: wiping old swap signature.
Setting up swapspace version 1, size = 4194300 KiB
no label, UUID=c19c873b-2b6c-4200-9575-a60adc581204
logging output to /tmp/obsbuild/.build.log...
[    0s] Using BUILD_ROOT=/tmp/obsbuild/.mount
[    0s] Using BUILD_ARCH=x86_64:i686:i586:i486:i386
[    0s] Doing kvm build in /dev/mapper/vg0-lvobsbuild
[    0s] 
[    0s] 
[    0s] c-3po.labaroche.ioda.net started "build postgresql-plr.spec" at Sat Mar 15 17:27:18 UTC 2014.
[    0s] 
[    0s] 
[    0s] processing specfile /home/bruno/openSUSE/obs/home:bruno_friedmann:branches:openSUSE:12.3:Update/postgresql-plr.openSUSE_12.3_Update/postgresql-plr.spec ...
[    0s] running changelog2spec --target rpm --file /home/bruno/openSUSE/obs/home:bruno_friedmann:branches:openSUSE:12.3:Update/postgresql-plr.openSUSE_12.3_Update/postgresql-plr.spec
[    0s] init_buildsystem --configdir /usr/lib/build/configs --cachedir /var/cache/build --prepare --clean --rpmlist /tmp/rpmlist.Vy31Li /home/bruno/openSUSE/obs/home:bruno_friedmann:branches:openSUSE:12.3:Update/postgresql-plr.openSUSE_12.3_Update/postgresql-plr.spec ...
[    1s] cycle: pam -> permissions -> coreutils
[    1s]   breaking dependency permissions -> coreutils
[    1s] [1/29] preinstalling filesystem...

Hope this give you the taste of building!

]]>
Combine osc with git https://lizards.opensuse.org/2009/04/15/combine-osc-with-git/ https://lizards.opensuse.org/2009/04/15/combine-osc-with-git/#comments Wed, 15 Apr 2009 12:08:26 +0000 http://lizards.opensuse.org/?p=707 Yesterday Jan-Simon (dl9pf) tells me about an great Program calls “git”. Git is an Version-Administration Program. Anything knows the Problem. We working on an Project into our osc, and 2 Weeks later, we don’t know, what the last changes was. On this place can git help.Now following a short Introducting:

First of all we need an .git Folder. In my case i have all Projects in ~/osc/- As example i’m going to my foo.

$ ~/osc> cd foo
$ ~/osc/foo> git init
Then git says:
Initialized empty Git repository in /home/sascha/osc/foo/.git/

$~/osc/foo> echo 123 > datei1

$~/osc/foo> git add datei1
This adds datei1 to your .git folder. If you use git add * you can add more than one File.

$~/osc/foo> git commit -m”Initial Version” (Or what you want)
git says:
Created initial commit a7458cf: Test
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 datei1

$~/osc/foo> echo 456 > datei2
$~/osc/foo> git commit -m”Change 1″
git says:
Created commit d1ef978: Change 1
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 datei2
$~/osc/foo> gitk (this is an GUI)

That looks:

gitk

There you can find all Changes since “Intial Version”.  Git can also manage branches and can merge it perfectly. So i think that git is very good Tool. And an good completion. With an wrapper file it is also possible to add or remove files in osc and git. Very nice -)

]]>
https://lizards.opensuse.org/2009/04/15/combine-osc-with-git/feed/ 2
Linking Buildservice packages with exact revisions https://lizards.opensuse.org/2009/02/06/linking-buildservice-packages-with-exact-revisions/ Fri, 06 Feb 2009 08:57:53 +0000 http://lizards.opensuse.org/?p=410 During the “cleanup” of the HP-Education repository, I used a very interesting feature of the openSUSE Build Service: linking against revisions.

Sometimes, you want to patch a package from another repository to build with special features enabled or disabled. The Build Service allows you to link the package from this other repository (and avoid wasting space by duplicating the sources) and add your patches.

Now think about a patch against a special version of a package – and you know that you don’t want a package with a newer version in your repository for a foreseeable time. But if you use the plain link command of the Build Service, the linked package in your repository will get updated if the original package in the original project is updated.

Luckily, the buildservice allows you to link against a “frozen” state of a package: it’s source-revision. People already knowing any revision control systems like Subversion also know that the revision of a source is increased each time, a new change is submitted. And that’s what we need now: link against a special revision of the package from the other repository and apply our patch against it. The webclient currently doesn’t support such special features, but with osc it’s very easy.

First, check the needed revision in the original project:

cd Education/MultiplicationStation
osc info


Project name: Education
Package name: MultiplicationStation
Path: /home/data/SVN/Education/MultiplicationStation
API URL: https://api.opensuse.org
Source URL: https://api.opensuse.org/source/Education/MultiplicationStation
srcmd5: 484c329659d613e3bbdd515a1a8d1099
Revision: 10
Link info: None

Now create a link with this (or any further) revision to your new project:

osc linkpac -r 10 Education MultiplicationStation isv:hp:education

..and in the resulting “_link” file in your new project, you’ll find:

<link project="Education" package="MultiplicationStation" rev="10">
<patches>
<!-- <apply name="patch" /> -->
<!-- <topadd>%define build_with_feature_x 1</topadd> -->
</patches>
</link>

So your linked package will always use the source revision 10 of the original project. Let’s start applying patches…

]]>
new osc package released https://lizards.opensuse.org/2008/07/10/new-osc-package-released/ Thu, 10 Jul 2008 02:15:13 +0000 http://lizards.opensuse.org/?p=92 After two or three weeks of coding (not mine mostly, but by Marcus and Dirk), a lot of good stuff has accumulated in the osc development tree. Time to release a new package. It is a particularly good moment because today the 1.0 release of the Build Service has been announced.

The list of changes is long, the NEWS file has it all. Overview:

  • version 0.105
  • easier usage of osc submitreq: It is less picky on commandline arguments, can be called in working copies or project directories, figures out which build service instance to use, and has improved output. Also, there is a osc submitreq delete action now (which only works if you have write permissions on the destination though)
  • osc search: added option -i|–involved, to show in which projects/packages a developer is involved
  • osc importsrcpkg: no signature check anymore
  • osc linkpac: –revision option added.
  • osc copypac: use the correct userid when copying to another api host
  • osc build: double check the buildinfo for local builds.
  • osc buildhist: change the output into a format which better matches actual RPM filenames.
  • osc commit: give commit message tempfiles a “.diff” suffix, so syntax highlighting automatically works in capable editors
  • don’t expand/unexpand if the working copy has local modifications – this is a workaround for #399247 but this way the working copy isn’t screwed up. Also, make sure no _linkerror files end up in working copies.
  • better error reporting in a whole number of cases, especially printing out more available detail. For instance, osc meta now prints out a concrete text why something you submitted was not accepted.

Have a lot of fun with it.

And just a note, remember that it is very easy to write osc plugins in order to extend or alter the functionality! Here’s the documentation.

]]>