[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RFC: specification for probing other OSes



This will eventually be README in tools/os-prober if it seems to be OK.
Please comment!

os-prober
--------

This is a small shell library that may be depended on by any bootloader
installer package to detect other filesystems with operating systems on
them.

(What follows below is more of a design plan/proposal than anything.)

All one has to do is Depend on os-prober, and then source
/usr/share/os-prober/lib.sh to make the probe_oses function available.
This function takes no arguments: it will scan all disks available on
the system for other operating systems, and return a list of strings such
as:

"/dev/discs/.../part1:Windows NT/2000/XP:chain"
 ^------------------^ ^----------------^ ^---^
      partition        OS name for boot   May change: type of boot loader
                       loader's pretty    required. Usually there is only
		       output             a 'linux' style bootloader or
		                          a chain one for other partitions
					  with their own boot sectors.

Adding tests is easy. Just look in the directory for the architecture you
are concerned with, and create a shell script in there with the format
[0-9][0-9]name. The numbers determine in what order the script will be run.
All of the scripts are passed a path in /dev to a single partition and should
return one of the above strings if a match was encountered, and no further
processing will occur for that partition.

Bootloader installer packages will then have to process this output (fairly
trivial) to create valid configuratoin entries for the bootloader. lib.sh
will also include a function make_short that takes a 'long' OS name and
makes a shorter one (for example, Windows 98 -> Win98) for bootloaders
that can't afford to use spaces in boot names.

-- 
Joshua Kwan

Attachment: signature.asc
Description: Digital signature


Reply to: