Capping off a week of good news for fans of Linux, shares of

Red Hat

(RHAT)

rose sharply Thursday, after the company restated its financials at the high end of the expected range.

At one point, shares were up nearly 8%, but the market's downward move at the end of the day cut the gains to 69 cents, or 4.3%, to $16.59, well off the day's high of $17.13.

In a note to clients, Credit Suisse First Boston analyst Michael Laverty said the restatement "will significantly reduce two major sources of uncertainty and thereby act as a positive catalyst for Red Hat stock."

The pending restatement, combined with the company's clumsy handling of the resignation of its CFO and a first-quarter earnings miss, have hurt the stock. Before Thursday's rally, Red Hat shares had declined 32% since the beginning of April, while the

Nasdaq

as a whole was off just 8%.

Of longer-term significance, though, was a pledge by

IBM

(IBM) - Get Report

on Wednesday that it will not use its hefty patent portfolio against Linux or other so-called open-source software.

"IBM has no intention of asserting its patent portfolio against the Linux kernel, unless of course we are forced to defend ourselves," Nick Donofrio, senior vice president for technology and manufacturing, said during a speech at the LinuxWorld trade show in San Francisco.

Also making those perky penguins (the Linux mascot) dance:

Hewlett-Packard's

(HPQ) - Get Report

announcement on Tuesday that it will begin shipping notebooks running the Linux operating system. Although the market for those computers is not expected to be very large, it's another step toward the computing mainstream for Linux, which just five years ago was seen as a niche product for geeks.

Still, all is not entirely well in Linux land. Intramural snipping and competition is getting more serious, and open-source advocates fear that

Microsoft

(MSFT) - Get Report

, which sees Linux as a significant threat to its Windows franchise, will pick up the patent weapon.

Patents and related intellectual property rights issues have hung over Linux for some time, most notably in the form of lawsuits launched by the

SCO Group

(SCOX)

. SCO has maintained that the Linux operating system is built on Unix software code, to which SCO says it owns the copyrights.

Microsoft holds 27 patents that could conceivably give the software giant grounds to sue a user or distributor of Linux, said Dan Ravicher, an outside attorney for startup Open Source Risk Management, which plans to sell insurance against just such an eventuality. IBM, he said, holds 60 such patents, while other companies hold another 151.

Ravicher, a long-time open-source advocate and patent attorney, readily admits he has a vested interest in the problem and says that SCO aside, there have been no patent infringement suits brought against Linux vendors or users. But if one should occur, the unlucky company on the receiving end will likely spend $2 million or $4 million to defend itself.

Microsoft has not commented directly on the patent issue, but it has in the past indicated that it plans "to work creatively" to license its technology. But that's cold comfort for many in the open-source community who view Microsoft with deep animosity and mistrust.

Bruce Perens, a well-known figure in the open-source community, has called for large Linux-using companies such as IBM and Hewlett-Packard to not only promise not to sue Linux developers or users, but to pledge to provide legal defense against such a suit. "We're approaching a time when only the largest companies can engage in software development -- if we let the software patenting situation go on."

Interestingly, though, what appeared to be a significant patent challenge to open source in Germany turned out to be exactly the opposite, Perens said during an interview.

The government of Munich recently decided to displace Windows from 14,000 desktops in favor of Linux, a significant win. But earlier this week, a city official raised the patent issue, causing consternation in open-source circles. However, the alderman is a member of the Green Party, which is an ally of the open-source movement. "The goal of the Greens is for the government of Munich to oppose the expansion of European software patenting," not damage the deal, Perens said. "It's been reported backwards."

Meanwhile, Red Hat, a close ally of IBM, earlier this week announced that it would begin selling application servers, which puts them in competition with -- IBM.

Red Hat claims its application server (software that ties Web-based applications together) is a low-end product that won't compete with IBM's heavy-duty WebSphere application server. Even so, the deal raised eyebrows, and was quickly seized upon by

Sun Microsystems

(SUNW) - Get Report

, a bitter rival of IBM and now of Red Hat.

"Sure, this is 'competition,'" said Sun Senior Vice President Larry Singer. "But Red Hat isn't going to stop with the application server. They'll go where the margins are," he said. Singer's opinion would be less noteworthy if he hadn't taken the somewhat unusual step to call reporters and generally blast Red Hat. "I want to explode the myth that Red Hat is free, and is a synonym for Linux. It's neither," he said in an interview.

Sun is in the somewhat difficult position of being a major reseller of Red Hat's version of Linux, while also selling Solaris, its own operating system. Singer quickly reiterated the Sun party line, saying "Sun is a major supporter of Linux."

Sound a bit contradictory? "Yes, it does," admitted Singer. "There is some dispute within Sun about how to handle this issue." But Singer made it clear that his part of Sun, at least, was going on the offensive, and claimed that once a customer pays Sun or Red Hat for support, Solaris is actually cheaper to own than Linux, which started out as a free product.

The issue for Sun, of course, is how to hold on to the lucrative Linux server business without damaging sales of its flagship product.

All in all, though, the penguins had plenty to celebrate this week.