Home Home
Sign up | Login

Author Archive

Fun things to do with driver updates

February 16th, 2017 by

Today: update the update process!

Yesterday a colleague asked me if it would be possible to apply a driver update (DUD) to the rescue system. He wanted to use a new btrfsprogs package.

My immediate reaction was: no, you can’t do it. But then, there’s no technical reason why it shouldn’t be possible – it actually nearly works. The updates are downloaded as usual – just not applied to the rescue system.

So I thought: “Why not make a driver update so driver updates work also for the rescue system?”

Here’s how I did it.

First, let’s find out how driver updates are usually applied. The code is here:

https://github.com/openSUSE/installation-images/blob/master/data/root/etc/inst_setup#L84-L87

We need just these three lines:

for i in /update/[0-9]*/inst-sys ; do
  [ -d "$i" ] && adddir "$i" /
done

linuxrc downloads the driver updates and stores them in an /update directory. One (numbered) subdirectory for each update.

It obviously uses some adddir script. So we’ll need it as well. Luckily, it’s not far away:

https://github.com/openSUSE/installation-images/blob/master/data/root/etc/adddir

Next, we’ll have to find the spot where the rescue system is set up. It’s done in this script:

https://github.com/openSUSE/installation-images/blob/master/data/initrd/scripts/prepare_rescue

Let’s do some copy-and-paste programming and insert the above code near the end of the script. It then might look like this

# driver update: add files to rescue system
if [ -d /mounts/initrd/update ] ; then
  cp -r /mounts/initrd/update /
  for i in /update/[0-9]*/inst-sys ; do
    [ -d "$i" ] && /mounts/initrd/scripts/adddir "$i" /
  done
fi

Some notes:

  • You have to know that prepare_rescue is run as the last thing before we exec to init. So everything is already in place, the left-over files from initrd are mounted at /mounts/initrd and will be removed at the end of the script.
  • This means we have to copy our updates into the new root directory, else they will be lost.
  • Also, we plan to make the adddir script available at /scripts/adddir by our driver update (see below).

Now let’s create the driver update:

mkdud --create dud_for_rescue.dud \
  --dist tw --dist leap42.1 --dist leap42.2 --dist sle12 \
  --name 'Apply DUD also to rescue system' \
  --exec 'cp adddir prepare_rescue /scripts' \
  adddir prepare_rescue

Here’s what this call does, line-by-line:

  • the fix works for all current SUSE distributions, so let’s support them
  • give the driver update some nice name
  • this command is run right after the driver update got loaded; we copy the scripts out of the driver update to their final location
  • add adddir and our modified prepare_rescue script

Here is the result: dud_for_rescue.dud.

Now, back to the original problem: how to use this to update a package in the rescue system? That’s easy:

mkdud --create new_btrfs.dud \
  --dist sle12 \
  dud_for_rescue.dud btrfsprogs.rpm

creates a driver update (for SLE12) that updates btrfsprogs also in the rescue system.

Bootloader gets chattier

November 6th, 2008 by

Since openSUSE 11.0. we have some basic speech support in our bootloader. This enables visually impaired people to use the bootloader as there is usually no other output device available at that time (BIOS doesn’t really support braille displays).

It uses the PC-speaker for output (which has the benefit that you don’t need specialized sound drivers for every hardware).

If you didn’t try it yet: press F9 at the boot screen.

I’ve reworked that a good deal in openSUSE 11.1 RC1 (2MB sound samples) and now it reads all menus and dialogs to you and spells all chars you enter in input dialogs (actually it speaks the char left from cursor).

The sound samples are pre-generated with espeak. But you are of course free to replace them with your own voice if you like that more. 😉

Installation over serial line

September 12th, 2008 by

It’s now possible to install openSUSE if you only have a serial line (without additional tricks). Our graphical bootloader frontend used to ignore serial input. That’s now (starting with 11.1 beta1) changed.

In the default setting it monitors com1/com2 (the first two bios configured serial ports) for input. Baud rate is autodetected (you have to press a few keys until it catches on). Output is sent to all lines it receives input from.

When it works, the first screen looks like:

(more…)

FirmwareUpdateKit

June 16th, 2008 by

[PS. I coudn’t resist. I just had to name the package ‘*Kit’. 😉 ]

Need to do a firmware update with a DOS program?

Can get tricky if you don’t have a DOS system around. We used to provide a bootable floppy image for that in the past (package dosbootdisk). But who has a floppy drive anyway?

So, here comes the new
FirmwareUpdateKit
package. Install it and run run, e.g. fuk --grub foobar.exe That’s it. The next reboot gives you the option to start DOS and run foobar.exe.

fuk can also create bootable ISOs and, of course, even floppy images.

Find Your Monitor

June 6th, 2008 by

Quite often I get bugreports that the hardware detection doesn’t find the monitor. Well, what should I do? We run a Video BIOS function for it, and if the BIOS can’t see the monitor, we’re out of luck.

But maybe not? It can well be that running BIOS code in Linux is not the best idea either.

To shed some light I wrote a small (6.5k if you must know) DOS-program and put it on a bootable CD. If that can’t detect the monitor it’s probably the BIOS’s fault, if it works blame, well, someone else. 😉

On a side note, the program was created with the usual gcc. It’s really surprising what you can do with a nice include file and a linker script.