Posts Tagged 'archlinux'

Using kexec for a fast reboot in Archlinux

If you ever wondered how some distros achieve the trick of bypassing the BIOS when rebooting, it’s done using something called kexec, which wikipedia defines as:

[…]a mechanism of the Linux kernel that allows “live” booting of a new kernel “over” the currently running kernel. kexec skips the bootloader stage (hardware initialization phase by the firmware or BIOS) and directly loads the new kernel into memory, where it starts executing immediately.

In archlinux, you can achieve this with the package kexec-tools, which you can install as usual with:
pacman -S kexec-tools

kexec-tools is integrated with the archlinux initscripts, so that the kexec command line tool will by default go through the normal shutdown procedure before rebooting. You can find more information as ever on the excellent Archlinux Wiki. There are some scripts there which look pretty useful, but I started using kexec direct from the command line after reading the man page, and then wrote a short script to cover the form I was using each time.

#!/bin/dash

imgname=/boot/kernel26${1:+-$1}
krnname=/boot/vmlinuz26${1:+-$1}

exec kexec --type=bzImage --reuse-cmdline --initrd=$imgname.img $krnname

I saved this as ~/bin/kxreboot. You can either just use this without parameters to boot the default kernel, or you can add a single parameter – for example, if you do kxreboot mainline it will boot vmlinuz26-mainline with initrd kernel26-mainline.img

You might also ask, “Why would I want a fast reboot? I never reboot!”. Fair comment. I run the testing repos, so kernel and udev upgrades come along quite frequently. Also, my motherboard doesn’t recognise my USB keyboard on boot, which makes a BIOS boot a bit of a pain as I have to find a PS/2 keyboard. Last but not least, everyone loves faster, right?

Using LXDE or PCManFM? Desktop vanished?

Some changes in the most recent version may have caused your desktop icons and wallpaper to vanish. As the author notes here this is down to major changes going on behind the scenes.

To get get your desktop back, you need to run “pcmanfm –desktop”. To configure the settings which used to be in the Edit->Preferences menu, right-click on the desktop area and select Properties.

If you use openbox or similar, you’ll need to tick the option in there which causes the window manager’s menu to appear when the desktop is clicked. That then hides the pcmanfm desktop config! Luckily there’s an answer to that. Add an option to your WM menu (e.g. Openbox’s rc.xml) with an entry that calls “pcmanfm –desktop-pref”. This will allow you to edit the settings again.


Top artists this week from Last.fm

My Twitter feed