Showing posts with label YaST. Show all posts
Showing posts with label YaST. Show all posts

Nov 10, 2015

Arabic Text Bugfix

Can you spot the difference?

Before:
 After:
If this rings a bell but you can't quite remember why, here's an English version of the screen, and the spoiler for the puzzle is below it:
Spoiler: The line containing "passwd" is clipped at the (left) end, showing only "المحا" instead of "المحلي۔". This bug got popular in the YaST team because the localization testers dutifully reported every instance of a truncated label so the bug accumulated 22 duplicates. It only happened for the Arabic script which made it a bit more challenging to work with, but luckily I know the script and a few words.

Thanks to Max Lin who pointed me to a problem between the Qt UI library and the HarfBuzz text shaping engine, the problem is now fixed.

Aug 2, 2013

YaST in Ruby


As already announced on Factory, yast-devel, and by Lukáš: YaST, the SUSE installation and configuration tool, has been automatically translated from YCP, an in-house custom language, to Ruby. In the past 6 months, we have built a tool to translate 600.000 lines of code developed over the course of 12 years.

My role in the project was mainly shedding light on ancient details of the YCP language and its interpreter. Stop pulling my beard, kids! Also, knowing Bison (the tool used to implement the YCP parser in C++) I designed a part that transfers the comments. Mind you, not only at the function or statement level, but from inside of expressions too. Fun!

Thanks to the team, it was great working on the project with you!

Nov 2, 2009

The suse-ncc User

Got a question about the purpose of suse-ncc:x:106:110:Novell Customer Center User:/var/lib/YaST2/suse-ncc-fakehome:/bin/bash, and Google did not know, so I asked the usual suspects.

Answer: It comes from yast2-registration.rpm and is used to switch away from root when we spawn the web browser and let you register your SUSE Linux Enterprise product.

Thanks, mc.

May 18, 2009

Bugzilla Fables: Serving Two Masters

You may know this: spending a few hard days, or even minutes, figuring out a bug and in the end the result is a one line change. What an injustice! So let's expand one such case for the amusement and education of the audience. Fable #501758:

For certain tasks, YaST uses external helpers (agents) communicating via pipes. One of them was causing YaST to hang when cleaning up. Actually no, it was two of them. Either one was not enough, but if two of them had been used, they would both keep on running and YaST would not exit.

It turns out the bug is in YaST not closing unnecessary file descriptors before spawning the agents. So the second child inherits a copy of the pipe that controls the first child. Then YaST closes the first child's commands pipe, expecting it to see EOF and exit. But the pipe is still open in the second child, uselessly. And they all wait. And wait...(*)

Moral: close unnecessary FDs before exec.

If you wonder why we did not see the problem earlier, it is because both agents contained another bug, a banal one of not responding to an explicit Exit message.

*) Actually, only YaST wait(2)s. The other two read(2) ;-)

Jan 10, 2009

YaST UI table usability

I've just watched my wife delete a repository in the YaST Qt UI: She right-clicked the table item, nothing. She pressed Delete, nothing. Only then she noticed the Delete push-button below the table.
Obviously we can improve the usability: Delete should be handled the same way as a function key so that YCP receives the `delete event. That would be quite easy. Maybe the context menu is doable too.

Jul 8, 2008

Cultural Exchange 4: First YaST

Managed to compile and run YaST up to nfs-client and ntp-client. Of course it does not work properly, but makes for a nice Potemkin hamlet.

Fresh libzypp needs cmake 2.6 but there is only 2.4 in .debs. Fortunately the cmake authors provide a binary tarball with 2.6, only one has to know where to put the contained directories.

Notes for clean-up: Libzypp should say it needs hal-storage and boost-filesystem too. Python-bindings should check for python-dev, should use python-config. Perl does not seem to respect vendor_arch for ycp.pm?

Jul 7, 2008

Cultural Exchange 3: First .deb

Started to build YaST. Managed to compile yast2-core. Now going to make it repeatable by properly packaging the dependencies. The first one is blocxx. Bleeding edge stuff is in the Build Service: home:mvidner:debian. The post How to make debian standard debs from scratch was much helpful.

Tried to print and failed miserably. The setup tool would not work with a remote CUPS printer, kept asking for my password. Switching AppArmor from enforcement to complain mode did not help, nor did disabling it.

The development package for openssl is libssl-dev (openSUSE: libopenssl-devel). http://packages.debian.org/ helps with that.

Perl packages, named perl-Foo-Bar on openSUSE, are usually named libfoo-bar-perl on Debian.

Packaging system started to complain that packages cannot be verified.

(Cultural Exchange is my long term project of working with Ubuntu instead of openSUSE. TODO: make a permanent index page.)

YaST Workshop 2008

We had the annual YaST workshop last week. The people in the team boldly went to explore new APIs and one of the results is experimental integration of PolicyKit into YaST. If you really want to break your system, you can try the current code.

Jun 17, 2008

Addressing Lines in Plain Text Files

Jirka suggested a possibility to enhance YCP documentation with real-life code examples. For that, we'd need to point to numbered lines within the source code. I thought that ViewVC can do it but apparently not (maybe annotate has it, but it is broken at our site). But there is a new generic way: RFC 5147: URI Fragment Identifiers for the text/plain Media Type. Only none of the browsers seems to support it today...

This points to line 13, with the prototype of main:
http://svn.opensuse.org/svn/yast/trunk/libyui/examples/HelloWorld.cc#line=,13

May 6, 2008

YaST from the Command Line

The Automatic Configuration in openSUSE 11.0 installation is good because you don't have to click Next so much, but now I am missing the button for opening SSH in the firewall.
Here's a one-liner to do it using YaST:
# yast2 firewall services add zone=EXT service=service:sshd
Try also:
# yast2 firewall help
# yast2 firewall longhelp
# yast2 firewall summary
# yast2 firewall services list
# yast2 -l
# yast2 FOO help
(Saying "yast" instead of "yast2" should work too, but there is bug 374259.)

Apr 18, 2008

openSUSE 11.0 Beta 1: Is that the murderer's name and address in the victim's hand?

As Beta 1 is getting mirrored, I am excited to tell you about obscure parts of the installation that I hope you will never see.

YaST does not crash. Never. Well, only rarely. Especially not during the initial installation. Seldom. So what do we do when it does? We want the backtrace and the debugging logs. So before 11.0 we would ask you to please let it crash again, but with some special options to produce the backtrace and the debugging info. Spoils the fun.

Since Alpha 2 YaST will take care of the backtrace. Since Beta 1, it will also produce tons of the debugging messages, but throw most of them away and only show the last few of them in case of a crash. Reporting a bug has become much easier!

This has actually helped us already in debugging one crash that blocked the release of Beta 1, bug 380283. If you want to see for yourself, search the log for "got signal". The next line says "Liberating suppressed debugging messages" and afterwards there is "Back trace".

References: FATE#302167, FATE#302166.

Apr 8, 2008

iogrind in openSUSE Build Service

iogrind is Michael Meeks' I/O profiler and visualizer. I wanted to see if it can help me with improving YaST performance, and I was surprised to find that there are no RPMs.

Well now there are: iogrind in openSUSE Build Service. The packaging is very crude for now, but it appears to work. Now I have to make some sense of the tool :-)

Jun 28, 2007

YaST User Interface Library Useable From Perl

It has been possible for some time now to write YaST modules in Perl. But to call the UI code you had to use YCP. For the Hack Week I decided to finish Stano's earlier work on the subject and make the UI callable from Perl or any of the soon to be available languages. This is a first step on the way to completely liberate the YaST UI from YCP.

Want to try it out? It works alongside your stock YaST on openSUSE 10.2. Install the binary tarball to /home/martin (really there, the binaries have the path hardwired!)

wget http://www.suse.de/~mvidner/hackweek/yast-ui-from-perl.tar.bz2
sudo sh -c "mkdir /home/martin && bzcat yast-ui-from-perl.tar.bz2 | tar x -C /home/martin"

Here's an example perl script. Note the links to the UI reference.


#! /usr/bin/perl -w
use YaST::YCP qw(:DATA);
YaST::YCP::Import "UI";
YaST::YCP::init_ui ($ARGV[0] || "qt");

my $c = Term("VBox",
Term("Label", "Now we can call YaST UI from other languages!"),
Term("PushButton", "&So What?")
);

UI->OpenDialog($c);
UI->UserInput();
UI->CloseDialog();
Let's try with the stock YaST
sh$ perl /home/martin/pfx/bin/helloui.pm
Nothing happens. If you are interested in the error messages, they are in ~/.y2log

Now let's use the new and improved environment and retry

sh$ /home/martin/pfx/bin/pfxsh
STARTING A NEW SHELL
sh$ perl /home/martin/pfx/bin/helloui.pm

sh$ perl /home/martin/pfx/bin/helloui.pm ncurses


Remember, this is just a preview. It is not packaged properly and has bugs. The source is at svn.opensuse.org.

Mar 26, 2007

YaST Log Summarizer

When dealing with YaST logs, it happens every now and then that you wade through the voluminous output only to discover that you are looking at the wrong run and the bug happened three days after the start of the log file.

So I wrote a simple log summarizer y2logpids, that shows the first and last lines for each process ID in the log. And as a side feature, it also measures time differences for the case where the reporter says "and then it hangs for 30 minutes".

$ y2logpids -h
Usage:
y2logpids -h|--help
y2logpids [-m] [-d [<seconds>]] [log-files]

Options and Arguments:
-m, --maximum
Show the maximum time difference between log lines, within a single
PID.

-d [seconds], --difference[=seconds]
Show where the time difference is larger than seconds (60 if
unspecified), within a single PID

$ wc -l logs/255012-y2log
23501 logs/255012-y2log
$ y2logpids logs/255012-y2log
2007-03-20 11:13:31 <1> e111(4034) [liby2] genericfrontend.cc(main):200 Launched YaST2 component 'y2base' 'inst_suse_register' 'qt' ''
2007-03-20 11:13:45 <1> e111(4034) [media] MediaManager.cc(restoreAutoMounter):248 Restored HAL volume handling (automounter)
2007-03-20 11:14:15 <1> e111(4222) [liby2] genericfrontend.cc(main):200 Launched YaST2 component 'y2base' 'inst_suse_register' 'qt' ''
2007-03-20 11:29:07 <1> e111(4222) [media] MediaManager.cc(restoreAutoMounter):248 Restored HAL volume handling (automounter)
2007-03-20 11:32:51 <1> e111(5265) [liby2] genericfrontend.cc(main):200 Launched YaST2 component 'y2base' 'online_update' 'qt' ''
2007-03-20 11:33:12 <1> e111(5265) [media] MediaManager.cc(restoreAutoMounter):248 Restored HAL volume handling (automounter)
2007-03-20 11:34:07 <1> e111(5310) [liby2] genericfrontend.cc(main):200 Launched YaST2 component 'y2base' 'online_update' 'qt' ''
2007-03-20 12:02:02 <1> e111(5310) [YCP] OnlineUpdateCallbacks.ycp:50 PatchProgressCallback 100
2007-03-20 12:02:18 <1> e111(7003) [liby2] genericfrontend.cc(main):200 Launched YaST2 component 'y2base' 'print-product' 'qt' ''
2007-03-20 12:03:51 <1> e111(7003) [zypp] ZYppFactory.cc(unLockFile):139 unlocked
2007-03-20 12:03:55 <0> e111(5310) [zypp] ExternalProgram.cc(checkStatus):333 pid 5881 successfully completed
2007-03-20 12:24:22 <1> e111(5310) [media] MediaManager.cc(restoreAutoMounter):248 Restored HAL volume handling (automounter)
2007-03-20 12:35:41 <1> e111(8715) [liby2] genericfrontend.cc(main):200 Launched YaST2 component 'y2base' 'online_update' 'qt' ''
2007-03-20 12:38:51 <1> e111(8715) [media] MediaManager.cc(restoreAutoMounter):248 Restored HAL volume handling (automounter)


Download the script.

Mar 7, 2007

XML Package Metadata Verifier

I needed to check the consistency of a RPM repository that I created by hand, in the XML Package Metadata format ("YUM"). So I wrote a verifier in bash using xsltproc and sha1sum.
Here: verify-repodata
Greetings to Harald and Matt.