Duncan Mac-Vicar P.


Archive for the ‘linux’ tag

How to gain root in a HTC Hero (aka G2 Touch) phone

with one comment

DISCLAIMER: I am not recommending you to root your phone and if you are not sure what for or what are the consequences of doing it (including your warranty), then don’t do it. This post is only an explanation on how to do it. Also I am not responsible for any damage to your phone, including bricking it.

First, download Android SDK 1.5 from here, unpack it and go to the tools/ directory.

My first problem:

./adb shell
error: device not found
./adb devices                        
List of devices attached                                                                  

Reading around I found out how to fix it, and then realized it was documented here

Create a file /etc/udev/rules.d/90-android.rules with the following content:

SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb",ATTR{idVendor}=="0bb4",ATTR{idProduct}=="0c02",SYMLINK+="android_adb"
SUBSYSTEM=="usb",ATTR{idVendor}=="0bb4",ATTR{idProduct}=="0c01",SYMLINK+="android_fastboot"

And restart udev by doing killall -HUP udevd, then unplug and plug the phone.

Now, get Recovery-RA-HERO-v1.2.2.img and fastboot (unpack and chmod +x this one), and put them somewhere, or as this example assumes, in the same tools/ directory.

Now boot the recovery image:

./adb shell reboot bootloader
./fastboot boot Recovery-RA-HERO-v1.2.2.img

You can use the NDroid Backup option to backup your phone to the SDCard.

Get Superuser.zip (requires registration in the xda-developers phorum) and unpack it. You will get two files from there: “Superuser.apk” and “su”.

./adb shell mount /system
./adb push su /system/bin/
./adb shell chmod 4755 /system/bin/su
./adb push Superuser.apk /system/app/
./adb shell reboot

Now confirm that it worked:

./adb shell
su

(Click Always allow on the phone)

And that is!.

If you need to restore your NDroid backup, I haven’t tried, but you can do it from the recovery image or manually pointing it to the images:

fastboot flash boot /boot.img
fastboot flash system /system.img
fastboot flash userdata /data.img
fastboot reboot

Written by duncan

September 29th, 2009 at 11:19 pm

Posted in Software

Tagged with , ,

Looking at DSP1023 (Software Inventory) and DSP1025 (Software Updates) CIM profiles

without comments

Yesterday I sat together with Stefan Haas in front of the whiteboard and analyzed the specification of the DSP1023 (Software Inventory) and DSP1025 (Software Updates) CIM profiles, from the DMTF.

Our goal was to understand it, and therefore we tried to map the concept to the knowledge we already have, which is Linux software management (which in turn can be reduced almost to packages :-) . Here are our notes:

(For simplicity, I am skipping the CIM_ prefix for all classes)

Packages

Packages are represented as usual NVRs (name, version, release) using the SoftwareIdentity class.

The url of the package is represented associating the SoftwareIdentity with url instances (SoftwareIdentityResources) trough a SAPAvailableForElement association. Products, subpackages and components can be modeled by using OrderedComponent class, which references the component and one member per instance.

One can associate hardware (or any managed element) with software using ElementSoftwareIdentity

Repositories

Repos are modeled by using SystemSpecificCollection and associated via HostedCollection to a system (that seems to be the local computer).

Packages are associated to the repository via the MemberOfCollection class.

Installed packages are represented by instances of InstalledSoftwareIdentity (which references the ComputerSystem where it is installed).

Groups, Patterns

Just another software identity (for the group itself), and references the grouped identities using OrderedComponent instances (which has two fields, the GroupComponent and PartComponent, which reference the respective instances).

Dependencies

If the target software does not have and instance, a SoftwareIdentity is created and isEntity set to false (kind of named dependency) For dependencies that exists software collection, then OrderedDependency is instantiated for each dependency and Antecedent and Dependent is filled)

For installing the packages, a SoftwareInstallationService is needed. Packages can be installed calling installFromSoftwareIdentity() (name, version release instance) or installFromByteStream() (like an rpm package).

To define an installation service, the SoftwareInstallationService class need to specify what it supports by instantiating SoftwareInstallationServiceCapabilities (which has properties like the supported URI schemes), and then this capabilities are associated back to the service using ElementCapabilities.

To define whether a package is compatible with a given target, one uses the TargetTypes array in the SoftwareIdentity class.

If a SoftwareIdentity is available and there is some SoftwareInstallationService that is compatible (or capable) of installing it, a instance of the ServiceAffectsElement needs to be instantiated.

Before actually installing or updating, the client checks if a SoftwareIdentity can be installed on a element, using the CheckSoftwareIdentity() method on the SoftwareInstallationService. You give this method the software itself, the collection and the target element. You get back a InstallCharacteristics with the details (for example if you need to reboot after installing or not).

Once you start the operation using InstallFromSoftwareIdentity(), you get back a Job instance that represent the task. Also true for InstallFromByteStream(), but here you pass an Image instance instead of a SoftwareIdentity. There is a similar InstallFromURI operation too. (jobs are only returned if the service has async capabilities).

The client can pass options to the install operation using InstallOptionValues.

TODO: figure out ElementSoftwareStatus more.

Additionally, you can see how HP has implemented the inventory profile with rpm. It has some useful information about which rpm tags belong to which classes properties for example.

Written by duncan

November 14th, 2008 at 6:15 pm

Posted in Software

Tagged with , , ,

Critical thermal shutdown on Thinkpad x60

without comments

At the beginning it looked like some material for the Linuxhater blog :-)

It happened a couple of times before, while working on my my X60 and suddenly the computer switched to shutdown mode and turned off. Uh? annoying!

Yesterday it happened again, and this time I was able to find the answer in the logs:

Sep 10 01:29:26 piscolita powersaved[2658]: WARNING (checkTemperatureStateChanges:217) 
Temperature state changed to critical.
Sep 10 01:29:26 piscolita kernel: Critical temperature reached (128 C), shutting down.
Sep 10 01:29:26 piscolita shutdown[15371]: shutting down for system halt

Then googling I found out it is a bug in the kernel (google groups link, prettier), and it seems there is a patch for it. I think this is a good backport candidate for 11.0 updates.

update: tracking as bug #425077

Written by duncan

September 10th, 2008 at 9:35 am

Posted in Software

Tagged with , ,

ZYpp stack on other distributions?

without comments

Keeping a permanent build of svn on the build service motivated me to try to build it on other non-SUSE based distros. On the way I discovered not only simple things as different package names, but linking problems, compile errors, etc.

In the past it did not make much sense to try libzypp outside of SUSE as we were trying to catchup with other tools speed. But now that libzypp speed outperforms any other tool in speed, while keeping it complete set of features, we may start thinking about taking over the world. May be other distros want to use libzypp, or why not, the small and powerful sat-solver library alone.

So, since today I got the first successful build of sat-solver/libzypp/zypper on Fedora 8. Mandriva is also close, but I still get a compiler error I should not get when compiling the rpm backend.

At the beginning, it may be a consuming effort, but once it is a continuous process, our software should adopt a more agnostic view of the world and just compile there out of the box. If anyone has the time to test it, I would be interested in the results ;-)

By the way, our colleagues at internal tools finished processing the FOSDEM talk’s videos we had in the openSUSE Developer’s room. You can find the ogg video files here. Also you can watch on google video here.

Written by duncan

March 14th, 2008 at 1:01 pm

Posted in uncategorized

Tagged with , , ,

fast package management

with 27 comments

I haven’t blogged since some time. We have been working hard to get package management stack changes in so we can have them in one of the next alphas. I wanted to make a small pause and write about it because communication is (sometimes) as important as coding ;-) .

See it yourself:

video link.

History

You know how was the package management stack on 10.1. On 10.3 we reached a point where we were fast enough, but with really bad performances in some cases, especially cold starts, and big lists of repositories, which is usually the usecase where the people complaining about speed are: factory users. Some of this bad performance was caused by design mistakes (like not using 1 db per repository), and others because sqlite horrible performance after fragmentation occurs.

This started sometime last year, when Michael Schröder started to show some people a new solver which was much faster than current libzypp solver. At the same time, he designed some memory and cpu efficient structures and file formats to deal with the huge amounts of metadata. The solver operated later over this optimized pool.

One of the features of the solver is its simplicity. Current libzypp operates over a dependency problem at the resolvable level while the sat solver converts the pool into a set of rules and then operates the problem as a boolean satisfiability problem, which makes it codebase concentrate only on this, making it much smaller and simpler. The error messages on conflicts are supposed to be more human friendly too.

The Road

During the YaST workshop times, coolo started to try the libzypp testsuite with the solver, by creating tools to use the existing testcases with it, and making sure it could serve as our solver.

Once coolo came and said, “ok, all testcases pass”. So we met and agreed on some milestones to see the feasibility of integration with libzypp. One of the milestones was to use the new solver without replacing all the infrastructure libzypp had. That is, taking libzypp pool, converting the transactions into rules, solve, convert them back. Stefan Schubert did a great work in this area, and actually if you are using factory you are already using the sat solver.

To familiarize myself with the solver at that time, I ported it to build with cmake and implemented swig bindings (focusing on ruby ones), which later Klaus started to enhance and experiment new concepts on top of them.

There was one part the sat solver did not take into account and it was the huge amount of non-solvable data you need to have cached. It is easy to claim to be fast if you ignore 95% of the data, so Michael Matz started to enhance the sat library by designing a special attribute store for repository metadata. The final concept and implementation was submited some weeks ago and it is really fast.

During January, Michael Andres got rid of thousands of lines of code in libzypp, keeping the nice APIs but trying to build everything on top of the sat library. I ported some classes like RepoManager, and later this week the final pieces were connected when Michael connected our Pool class with the sat pool which allows to “see” the packages “world” to applications. I ported zypper and YaST package bindings and Michael Matz told us yesterday he actually installed packages using zypper.

The whole stack is now designed as unix tools, so this will allow our repositories to ship solv files, which can in turn be downloaded by libzypp. So you don’t need to generate a cache locally if the solv file is already available on the server. This is not implemented yet.

There also other open issues. We don’t parse translations and only the suse media parser stores attributes like descriptions. Patches and packages are not installed (but this has also another reason I will talk about it later). The package management user interface won’t compile (I haven’t tried) yet.

This new level of performance would allow us to bring package management on openSUSE not to the smart or yum level, but a complete new generation ahead. And this will open the door for smooth integration with CIM and PackageKit and will bring fresh air during the road to the next generation of SLES and SLED.

If you are an openSUSE contributor, we do need help with testing, and there are lot of “mechanical” jobs to do which don’t require much experience with the platform (but compiling). If you want to see this in 11.0 and can contribute, please contact us .

Written by duncan

February 7th, 2008 at 11:04 am

Posted in uncategorized

Tagged with ,

Nokia To Acquire Trolltech

with 4 comments

From OSNews:

Trolltech, the originator of Qt, which forms the basis of the Linux KDE desktop environment, is being acquired by Nokia, the world’s number-one mobile phone vendor. Nokia expects its acquisition of Trolltech to accelerate its cross-platform software strategy for mobile devices and desktop applications, and to enhance its Internet services business. The original press release is also available. Update: “We will continue to actively develop Qt and Qtopia. We also want to underline that we will continue to support the open source community by continuing to release these technologies under the GPL.”

Some gnomies are already starting to panic. What will happen to Maemo? Has Symbian reason to panic too? ;-)

Was this move motivated by Android ?

Written by duncan

January 28th, 2008 at 6:37 am

Posted in uncategorized

Tagged with , , , ,

Cool things in a cold day

with 2 comments

Nice surprise today:

Schnee

  • ITO time spent on YaST. No success yet with Wt. It does not provide something like Qt’s QSocketNotifier, or glib’s gioadd_watch which integrate themselves with the event loop. Did a hack with a standard select and a timeout, did not work. Even worse, Wt crashes on processEvents().

  • Will hosted a hack session on Saturday. While I did not get any code done, I got motivated by the Kopete 4.x state to continue working on it at home. Yesterday I commited my chat window participants view code for Kopete. It simplifies the code and the signal battle a lot. I still have to fix some issues.

  • The Android stuff is so cool. Read this post about Dalvik: how Google routed around Sun’s IP-based licensing restrictions on Java ME. The Activity, Services and Intents model seems natural for other scenarios, not only mobiles.

Written by duncan

November 14th, 2007 at 4:14 am

Posted in uncategorized

Tagged with , , , , ,

Random comments of openSUSE 10.3 on Slashdot

with 2 comments

One:

I’m using it, and yes, its fixed. It’s cached, and at each package manager startup it checks the cache versus the online version, and even if it needs update the cache update is an order of magnitude faster than a normal startup of the package manager used to be.

It’s quite useable now; time from clicking “software manager” to a usable interface is similar to using SMART.

Speed s ems to be one of the primary focuses of this release; from the package manager to the boot sequence.

Two:

I’ve just installed a new OpenSUSE. All these little bugs from previous releases are gone. Yast software installer finally works with a good speed. Desktop responsiveness is amazing – KDE 3.7 works faster than GUI of Windows 2000. The default green artwork is very nice and gives a distinct feeling to this distro. Hardware detection is very good. My graphic card – nvidia 7600 and audio card – Creative Audigy 2 were working out of the box. Even installation of ADSL modem was a breeze – it is a cheap Sagem modem, used by the all telcos controlled by France Telecom, and most linux distros has problems with it.

What is especially important to people in countries with stupid law (read USA) – OpenSUSE gives you mp3 playback out of box, due to legal fluendo gstreamer plugins. In addition, there are provided Flash 9, newest Java runtimes, RealPlayer and seamless Wi-Fi support.

In the last year I’ve tried quite a few linux distros – Fedora, Ubuntu, Sabayon, Mint, Mandriva… nothing even come close to the OpenSUSE. Quality of Deutsch engineering.

Another:

I installed it last night……..it’s beautiful. Definitely worth checking out :) .

More!:

YaST was borked for 10.1 and 10.2. It made sense to try and use an alternative package manager.

As 10.2 matured, YaST started to work properly, but was slow.

In 10.3, YaST is quite speedy, very capable, and runs very solidly. Plus, the one-click-install thing works really well.

Written by duncan

October 4th, 2007 at 6:34 pm

Posted in uncategorized

Tagged with

yast2-ruby-bindings user interface support

without comments

I just commited support for using the user interface (yes, that is Qt, GTK or ncurses) from the ruby language:

require 'yast'
ui = YaST::Module.new("UI")
YaST::Ui::init("qt")
include YaST::Ui

t = HBox( Label("Welcome to Ruby!"), PushButton("Push me") )

puts "#{t.to_s} #{t.class}"

ui.OpenDialog(t)
ui.UserInput()

Result: Image Hosted by ImageShack.us

Written by duncan

September 19th, 2007 at 11:56 am

Posted in uncategorized

Tagged with , ,

Darl McBride interview

with one comment

Interesting interview to the most hated man in software, the CEO and president of the litigation and former software company SCO, Darl McBride.

Best quote:

Then in the “excluded assets” it says, “excluding copyrights and patents.” Well, that’s the thing that never made sense. So when I first hired on (at) the company, we had intellectual property attorneys look at that, and they said, “This makes no sense.” You can’t buy software without the copyright. It’s like buying a book without the words. It doesn’t make any sense at all….

What are millions of users doing with proprietary software? Buying licenses. Buying “some rights” (to use, for example), not the copyright. When you buy a book. It comes with the words, but you don’t get the copyright.

Even with free software, you get a super-combo of rights which allow you to do anything except restricting those rights to someone. But still you don’t get the copyright ;-) .

Written by duncan

September 11th, 2007 at 4:37 am