Archive for the ‘Fedora Tips & Tricks’ Category

Grub 2

As I noted in the previous post, Fedora 16 now uses Grub 2 on some architectures. Thanks to this, one of my long standing bug reports against grub2 in Fedora is finally fixed (all it needed was to add os-prober dependency to grub2 which, unfortunately, was unnoticed for a long time). The other bug, which is also very easy to fix, is unfortunately not solved yet… (sorry, but I’m really disappointed to see this bug is still open).
Grub 2 comes with a number of interesting features. One of them is auto-detecting other installed OSes using os-prober (as I have written here, you can do the same for Legacy Grub using my script). This means that now Fedora will detect other installed OSes when installed… well, not completely. Currently, Fedora doesn’t recognize OSes installed on LVM partitions during the installation (apparently because LVM volumes are not active when it is run). Therefore, you should run grub2-mkconfig again after Fedora 16 installation if you have any OSes installed on LVM partitions. Also, there is another problem with os-prober itself: it doesn’t recognize OSes installed on MD RAID partitions. The bug, with the possible fix, is reported upstream and I hope to see it fixed soon too.

Unfortunately, Grub 2 in Fedora doesn’t come with any artwork. You’ll see an ugly black and white grub menu (I never liked the look of Grub2 in Ubuntu and I hoped that it won’t happen in Fedora too). Hopefully, it’ll be fixed soon; but for the time being you can do it yourself. With the pointers given here (Hey! Ask Fedora is also officially launched!), I came up with the following:
First, you should create a font file for Grub 2 using any TTF fonts. I did the following:

grub2-mkfont --output=/boot/grub2/unicode.pf2 \
           /usr/share/fonts/dejavu/DejaVuSansMono.ttf

Then, you need appropriate settings in /etc/default/grub:

GRUB_GFXMODE=1024x768x32
GRUB_GFXPAYLOAD_LINUX=keep
GRUB_BACKGROUND=/usr/share/backgrounds/verne/default/normalish/verne.png

 

Yes, it sets the default Fedora 16 background for Grub and it automatically scales the image to the Grub’s resolution! Finally, don’t forget to regenerate your grub’s config file (remember that the following command completely overwrites the existing config. Therefore, if you have manually edited /boot/grub2/grub.cfg all of your changes will be overwritten by it):

grub2-mkconfig -o /boot/grub2/grub.cfg

 

A part of the result is given below (for whatever reason (see Update 2 for the reason and the fix!), grub 2 selects a very high resolution in qemu, so I was forced to crop the image):

A sample image of Grub 2 with Fedora 16 background and BiDi (Persian) Text

Grub 2 with Fedora 16 background and BiDi (Persian) Text

And yes, Grub 2 supports UTF-8 BiDi (right-to-left) text automatically (It’d be great if it was also possible to right align the menu entries, but apparently it is not supported). And notice that you should use qxl or vmware vga driver for qemu if you are using Grub 2′s graphical menu.

This is just the begining, and I’m at the beginning too! Grub 2 supports themes, and I hope to see great themes for Fedora. A Fedora theme for grub 2, along with a new Plymouth theme (which has not been changed for a long time) could be very interesting for Fedora 17…

Update: I forgot to say that since Grub 2 can be installed on an LVM partition, you no longer need to have a separate /boot partition in LVM setups. While anaconda still suggests that, you are not forced to do so.

Update 2: Use lower case ‘x’ in GFXMODE variable. Initially I used upper case X so it was actually ignored!

Fedora 16

Finally, I finished my M.Sc a few days ago and therefore I’m going to be more active after finishing some postponed tasks. But, all that didn’t prevent me from jumping to Fedora 16 early around Beta release and afterwards. And this is my mini-review now:

Fedora Robotics Spin
First of all, we at Fedora Robotics SIG are proud to announce the first official release of Fedora Robotics Spin. This is a LiveDVD spin providing many usable tools, libraries and frameworks usable in robotics such as Eclipse development environment, MRPT libraries, Player/Stage/Gazebo and RoboCup soccer simulator 2D and 3D. Fawkes was supposed to be included too but IIRC it is not included in this version due to some problems. There are still a lot to be done and we will provide more interesting stuff in future.

Gnome 3.2.1
Fedora 16 comes with Gnome 3.2.1. To summarize, it is better than Gnome 3.0 (surprisingly!;)). It felt a bit faster (if I’m not mistaken!), and more polished. It also comes with a number of bug fixes that annoyed me in Fedora 15: the renaming problem in nautilus in non-English locales is solved, and while the problem with tray icons of Java applications is not solved (and it fact it is a bit worse since you cannot get the icon back even by restarting gnome-shell), it doesn’t cause gnome shell to use 100% CPU anymore. So, you still cannot see Java icons but at least it won’t heat up your system. Good news is that a fix for Java is already applied to JDK 8 (thanks to Danesh Dadachanji) and hopefully it will be backported to JDK 6 & 7 soon. Apparently, it fixes another problem too: Java windows will be grouped in Gnome Shell as a single application (currently each window appears as a separate application).

Gnome 3.2.1 comes with some enhancements and new features too: Sushi, a quick previewer for Nautilus. Highlight a file (e.g. image or video) and press Space bar button. You should see a preview of the file.
Another enhancement is in NetworkManager, whch provides a “HotSpot” feature. In Gnome 3.0, there were no straight forward way to do wireless sharing in the new NetworkManager interface and you were forced to create it manually using Netowrk Connections dialog. But in Gnome 3.2 there is a HotSpot button in the Wireless section which creates an ad-hoc wireless connection and shares internet over it easier than ever (just press the button and a few seconds later others can connect you with the provided password). But NetworkManager still lacks some basic functionality, for example while you can enter network proxy information, there is no (clear) way to add authentication information (probably you can add your username and password in the URL box, but it is not a good solution specially as the password is visible to everyone). I hope that NetworkManager can have a kind of “Location” (or Connection) concept which makes it possible to assiosiate some network settings with network Locations (e.g. separate proxy information for different Locations/Connections).

Unfortunately, on my ThinkPad X61 the suspend button (Fn+F4) no longer works. I have not looked into this problem yet. Also, some of the gnome shell extensions in Fedora 16 repository are not compatible with Gnome Shell 3.2.x but they are installable (they should require gnome shell 3.0.x so that you cannot install them in Fedora 16).

Personal File Sharing
In Fedora 15 and 16, you might have noticed that there is no longer any “Personal File Sharing” in Gnome 3. I mostly wanted it to enable receiving files using bluetooth since my mobile didn’t see my laptop to send any files to it. Fortunately, it is not gone forever and you can easily get it back: just install gnome-user-share package and you’ll get it back. :)

Gnome Fallback + Compiz Session
And a final note about Gnome in Fedora 15/16: if you would like to use gnome fallback mode rather than Gnome Shell, you can install Compiz 0.9.5 and specially compiz-gnome package. It’ll add a new session (“Classic Gnome with Compiz”) in the login window which you can select to run Gnome Fallback mode with compiz. So, you can select the desired environment in the login window.

Grub 2
Another notable feature of Fedora 16 is replacing lagacy Grub with Grub 2 (not for all architectures currently). But I’ll talk more about it in a separate post since this one is long enough already. :P
Fedora 16 comes with more interesting features like USB support in KVM. See other features in Fedora 16 feature page.

Parsidora 16

Since Fedora 16 is out, we are going to release our Parsidora 16 soon, specially that it seems that have less problems than Fedora 15. Fedora 16 is better than Fedora 15, so Parsidora 16 will be better too! ;)

Have fun!

AntiAliasing and Java

Whenever I ran a Swing Java application on my Fedora, I really hated its ugly appearance of fonts and I was always wondering why Java doesn’t support font anti aliasing in Linux. But I’ve never searched for it in the web, since I thought that if such support exists, it should be enabled already! Today, I’ve decided to look for it, and I found the answer very quickly!! Java already supports font anti-aliasing in Linux, it is simply disabled by default (at least in OpenJDK, in Fedora!). And the solution is simple, just set the desired option in the _JAVA_OPTIONS environment variable. e.g.:

export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on"

and then run your Java application. The GUI will be much more desirable then! I’d suggest adding this option globally. You can simply put the above line in your ~/.bashrc (if you are using bash!), or put it in a file in the /etc/profile.d/ directory. For example, this is the contents of my /etc/profile.d/tune.sh:

export HISTCONTROL=ignoredups
export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on"

(The first option is not related to the current discussion, but I think it is desirable for most users. With this option, bash will merge same sequential history contents into one history item)

I also like to talk about an interesting application but I keep it for a separate post! :P

Have fun!

Update: I think it is fair to mention the original link which helped me: Java Swing anti-aliasing. Also, fortunately there is already an update for openjdk package in fedora updates-testing repository which has anti-aliasing enabled by default (at least for Swing apps. You might still need to use the above option for Awt applications).

Conexant HSF modem driver on Fedora 12

Previously, I wrote a document on the installation of a full speed driver for Conexant HSF modems on Fedora 11. That guide is valid for Fedora 12 too. However, some people have told me that their Fedora 12 is unable to boot after installing the driver using that guide. I’ve tried it and I successfully installed and used the driver under Fedora 12. However, as I’ve stated in that guide, I used the latest version of the Linuxant driver (which is 7.80.02.05 rather than 7.80.02.04 which was available on that time). As those guys who have booting problems both used 7.80.02.04 version, that might be a problem with that version. So I highly suggest everybody to always use the latest version of Linuxant driver with my script.

Also, I’ve updated my script to detect the version of the Linuxant driver beside it rather than hardcoding the version number in the script, so you don’t need to modify the script to use the latest version. Just download the latest version and put it beside the script, and run the script. For complete instructions, refer to the original guide.

Have fun

Installing Conexant full speed modem driver on Fedora 11 and later

I found that some people have problem installing this driver on Fedora 11 (using available guidelines in Internet for Ubuntu), so I decided to try installing it on my system (which has a Conexant HSF modem chipset). I could install and use the driver successfully, but I think its license doesn’t allow me to distribute the final modified RPM package. So, I decided to create a simple shell script to create the package and put it here. (I wonder if we should put such documents inside Fedora wiki or not. Maybe I should communicate with Fedora Documentation people about it or read about contributing there?! Or maybe it is as easy as creating a new Wiki page there…)

Anyway, These are the steps to build a free full speed Conexant modem driver:

1. Download .tar.gz file of the free full speed driver release by dell from http://linux.dell.com/files/ubuntu/hardy/modem-drivers/hsf/ (Download this file for 64 bit Fedora systems(x86_64) and this one for 32 bit(Fedora-i386,i586 or i686) systems)

2. Download the latest modem driver from Linuxant (.tar.gz version). However notice that the following script is written for version 7.80.02.04, for later versions this script should be modified. So, to use this script without modification, you should download this file for 64bit Fedora and this one for 32 bit ones. Edit: download the latest version from here.

3. Download this script, put it beside those downloaded files and run the script  (If you run it as a regular user – which is recommended – you might need to run rpmdev-setuptree command first).

4. Now, you should be able to find the final RPM in ~/rpmbuild/RPMS/x86_64 (or ~/rpmbuild/RPMS/i586).

5. If you have an HDA modem, you must install Linuxant alsa driver from http://www.linuxant.com/alsa-driver/. *Update: If you did not install this package and encountered sound problems after installing the hsf modem driver, you should probably install this package.

6. Now, you can install the generated rpm package. You might need to restart the system before using your modem. You can check your modem by running minicom to see if it can communicate with your modem.

Update: This script works fine on Fedora 11 and later. It has been successfully tested on Fedora 12 and Fedora 13. I’ll try to make sure that it works on future version of Fedora too.

Good luck!

Another problem with Fedora package management for offline users

Previously, I talked about the problem of Fedora package management (yum in that case) for offline users: lack of out-of-box support for using installation media to install programs. Then, I provided a simple rpm package to make the process of enabling Fedora DVD as a repository for yum a bit easier.
Today, I remembered another so annoying problem with PackageKit (not yum in this case): it does not distinguish between online and offline repositories (with “file://” at the beginning of their baseurl), and so, with default configuration it doesn’t let you install any packages from your offline repositories if you are not connected to any networks. It says: cannot install packages when offline!
This is not acceptable at all. First, I want to install a package in an offline repository (like Fedora DVD) and so I don’t need network connection for it. Second, PackageKit is satisfied when you are connected to ANY networks, like a simple local LAN between 2 computers (one of them could be a virtual one, so you have 1 real computer anyway!).  In such cases, you can’t still access the online repositories.
Therefore, I think the current effort of PackageKit in detecting network availability is not so bright, and also doesn’t provide almost any benefit (it is not useful). On the other hand, it is problematic in the case I mentioned (using offline repositories). I wonder why such a facility, which not only doesn’t provide much goodness but also is problematic, should be turned on be default.
Personally, I think it should be disabled until it is at least not “in the way”.

Anyway, if you face such problem now, you can work around it using the following options in /etc/PackageKit/PackageKit.conf:

UseNetworkManager=false
UseNetworkHeuristic=false

I filled a bug against it long time ago, but if I remember correctly that bug was closed saying that such options are available. But I should probably reopen it, since I still think that it is definitely a bug.

Using Fedora DVD; not a solution, but a bit better!

As I said before, the current state of Fedora package management in regard to using its installation media is so undesirable. Sooner or later, every new Fedora user will ask you about it except if it doesn’t want to use the media at all!
Interestingly, he can’t find any guides in his DVD about installing software from DVD after Fedora installation. Also, there is nothing in the official Fedora pages (at fedoraproject.org) as far as I know! Certainly, you can find about it in many places, but such basic guide should be in a more accessible place. (?!)
Anyway, just to make it a little easier for new users, I decided to create a small RPM package containing the required yum configuration file. At least I have a better answer for new users on phone! You can find the RPM package here: http://hedayat.fedorapeople.org/dvdrepo/fedora-dvd-repo-0.1-1.fc10.noarch.rpm
This RPM should work on Fedora 9, 10, and later for users which use Fedora DVD. It might work on other versions too!
No configuration should be needed, just install the package and run yum or Add/Remove Software.
Maybe someone liked to use it!

Have fun
:)
Update: This RPM package works on Fedora 11 and should work on Fedora 12 and later. If it didn’t, please let me know so I’ll provide an updated RPM for that.

Follow

Get every new post delivered to your Inbox.

Join 620 other followers