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

Linux OS Probing Bug



hey guys

I'm not sure if i'm right here, but i think i have found a bug in the os probing process of os-prober, more precisely in the "90linux-distro" script. I'm working on a Ubuntu 12.04 and the bug doesn't seem to be resolved right now in Debian testing in my VM.
Should i also file a bug in the Ubuntu bug tracking system?

The experienced problem is that modern Fedora distributions (at least version 17, maybe 16 too) don't get recognised as Linux by os-prober.

The script code in concern is the following:
if ls "$dir"/lib*/ld*.so* >/dev/null 2>/dev/null; then
    # the os mounted on $dir is a linux !!
fi
The "ls"-command tries to find the ld-linux or something like that.
But this search fails on a modern Fedora because the location of it has moved from /lib64/ld-*.so to /usr/lib64/ld-*.so. The provided compat symlink from /lib64 to /usr/lib64 isn't sufficient for successful os detection because symlinks are not visible when the partition is mounted with 'grub-mount', which is the default tool to mount.

here's the extract from the mounting script, '50mounted-tests':
mounted=
if type grub-mount >/dev/null 2>&1 && \
   type grub-probe >/dev/null 2>&1 && \
   grub-mount "$partition" "$tmpmnt" 2>/dev/null; then
       mounted=1
    ...
else
    ...
    if mount -o ro -t "$type" "$partition" "$tmpmnt" 2>/dev/null; then
        mounted=1
fi

So the fallback is the normal 'mount' command. But when i tried this fallback, the unmounting wasn't successful because the filesystem was busy.
Adding the option '--no-mtab' to the mount command solved the problem.
Could this be a valid solution?

A simple solution for the os probing with 'grub-mount' would be to simple expand the extract posted above: if ls "$dir"/lib*/ld*.so* >/dev/null 2>/dev/null || ls "$dir"/usr/lib*/ld*.so* >/dev/null 2>/dev/null; then
    # the os mounted on $dir is a linux !!
fi
With this fix my os-prober is working properly again.

So what is now the next step to solve the (two) problem(s) in ubuntu and in general?


Reply to: