asda?‰PNG  IHDR ? f ??C1 sRGB ??é gAMA ±? üa pHYs ? ??o¨d GIDATx^íüL”÷e÷Y?a?("Bh?_ò???¢§?q5k?*:t0A-o??¥]VkJ¢M??f?±8\k2íll£1]q?ù???T PKoye[,Itt83haikunuȯ#!/bin/sh # Detects Haiku on BeFS partitions. . /usr/share/os-prober/common.sh partition="$1" mpoint="$2" type="$3" # Weed out stuff that doesn't apply to us case "$type" in befs|befs_be) debug "$partition is a BeFS partition" ;; *) debug "$partition is not a BeFS partition: exiting"; exit 1 ;; esac if head -c 512 "$partition" | grep -aqs "system.haiku_loader"; then debug "Stage 1 bootloader found" else debug "Stage 1 bootloader not found: exiting" exit 1 fi if system="$(item_in_dir "system" "$mpoint")" && item_in_dir -q "haiku_loader" "$mpoint/$system" && (item_in_dir -q "kernel_x86" "$mpoint/$system" || item_in_dir -q "kernel_x86_64" "$mpoint/$system") then debug "Stage 2 bootloader and kernel found" label="$(count_next_label Haiku)" result "$partition:Haiku:$label:chain" exit 0 else debug "Stage 2 bootloader and kernel not found: exiting" exit 1 fi PKoye[tJJ20macosxnuȯ#!/bin/sh -e # Detects Mac OS X. I don't yet know how Mac OS <= 9 fits into this. . /usr/share/os-prober/common.sh partition="$1" mpoint="$2" type="$3" debug() { if [ -z "$OS_PROBER_DISABLE_DEBUG" ]; then logger -t macosx-prober "debug: $@" fi } # Weed out stuff that doesn't apply to us case "$type" in hfsplus) debug "$1 is an HFS+ partition" ;; *) debug "$1 is not an HFS+ partition: exiting"; exit 1 ;; esac # Could use a better test than this. # /System/Library/CoreServices/SystemVersion.plist has version information, # but I don't think it exists on Mac OS <= 9, and it's XML so parsing in # shell will be nasty. if [ -e "$2/mach_kernel" ] && ! dd if="$2/mach_kernel" count=1 bs=5 2>/dev/null | grep -aq Dummy ; then label="$(count_next_label MacOSX)" result "$1:Mac OS X:$label:macosx" exit 0 else exit 1 fi PKoye[`210qnxnuȯ#!/bin/sh . /usr/share/os-prober/common.sh partition="$1" mpoint="$2" type="$3" # Weed out stuff that doesn't apply to us case "$type" in qnx4) debug "$partition is a QNX4 partition" ;; *) debug "$partition is not a QNX4 partition: exiting"; exit 1 ;; esac if [ -e "$mpoint/.boot" ]; then label="$(count_next_label QNX)" result "$partition:QNX:$label:chain" exit 0 else exit 1 fi PKoye[&? efi/10elilonuȯ#!/bin/sh # Detects ELILO bootloader on a EFI System Partition . /usr/share/os-prober/common.sh efi="$1" found= elilo=`find $1 -name "elilo.efi"` if [ -n "$elilo" ]; then bdir="${elilo%/*}" bdir="${elilo##*/}" long="ELILO Boot Manager" short="ELILO" path=${bdir}/elilo.efi found=true fi if [ -n "$found" ]; then label="$(count_next_label "$short")" result "${path}:${long}:${label}" fi exit 0 PKoye[jhhefi/20microsoftnuȯ#!/bin/sh # Detects Microsoft bootloader on a EFI System Partition . /usr/share/os-prober/common.sh efi="$1" found= for microsoft in $(item_in_dir microsoft "$efi"); do for boot in $(item_in_dir boot "$efi/$microsoft"); do bcd=$(item_in_dir bcd "$efi/$microsoft/$boot") bootmgfw=$(item_in_dir bootmgfw.efi "$efi/$microsoft/$boot") if [ -n "$bcd" -a -n "$bootmgfw" ]; then long="Windows Boot Manager" short=Windows path="$microsoft/$boot/$bootmgfw" found=true break fi done done if [ -n "$found" ]; then label="$(count_next_label "$short")" result "${path}:${long}:${label}" fi exit 0 PKoye[JpI 10freedosnuȯ#!/bin/sh . /usr/share/os-prober/common.sh partition="$1" mpoint="$2" type="$3" # Weed out stuff that doesn't apply to us case "$type" in vfat) debug "$1 is a FAT32 partition" ;; msdos) debug "$1 is a FAT16 partition" ;; fat) debug "$1 is a FAT partition (mounted by GRUB)" ;; *) debug "$1 is not a FAT partition: exiting"; exit 1 ;; esac if item_in_dir -q kernel.sys "$2" && item_in_dir -q command.com "$2"; then label="$(count_next_label FreeDOS)" result "$1:FreeDOS:$label:chain" exit 0 else exit 1 fi PKoye[3ff90linux-distronuȯ#!/bin/sh # Test for linux distributions. set -e . /usr/share/os-prober/common.sh partition="$1" dir="$2" type="$3" uuid="$4" subvol="$5" # This test is inaccurate, but given separate / and /boot partitions and the # fact that only some architectures have ld-linux.so, I can't see anything # better. Make sure this test has a high number so that more accurate tests # can come first. # Unless volumes to checked are already mounted, they will be mounted using # GRUB's own filesystems through FUSE. Since these ATM doesn't support # symlinks we need to also check in $dir/usr/libexec* for distributions that # moved /lib* to /usr and only left symlinks behind. # TODO: look for ld-linux.so on arches that have it if (ls "$dir"/lib*/ld*.so* && [ -d "$dir/boot" ] || ls "$dir"/usr/libexec*/ld*.so*) >/dev/null 2>/dev/null; then if [ -e "$dir/etc/os-release" ]; then short="$(grep ^NAME= "$dir/etc/os-release" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g; s/[[:space:]].*//')" long="$(grep ^PRETTY_NAME= "$dir/etc/os-release" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g')" elif [ -e "$dir/etc/debian_version" ]; then short="Debian" long="$(printf "Debian GNU/Linux (%s)\n" "$(cat "$dir/etc/debian_version")")" # RPM derived distributions may also have a redhat-release or # mandrake-release, so check their files first. elif [ -e "$dir/etc/altlinux-release" ]; then short="ALTLinux" long="$(cat "$dir/etc/altlinux-release")" elif [ -e "$dir/etc/magic-release" ]; then short="Magic" long="$(cat "$dir/etc/magic-release")" elif [ -e "$dir/etc/blackPanther-release" ]; then short="blackPanther" long="$(cat "$dir/etc/blackPanther-release")" elif [ -e "$dir/etc/ark-release" ]; then short="Ark" long="$(cat "$dir/etc/ark-release")" elif [ -e "$dir/etc/arch-release" ]; then short="Arch" long="$(cat "$dir/etc/arch-release")" elif [ -e "$dir/etc/asplinux-release" ]; then short="ASPLinux" long="$(cat "$dir/etc/asplinux-release")" elif [ -e "$dir/etc/lvr-release" ]; then short="LvR" long="$(cat "$dir/etc/lvr-release")" elif [ -e "$dir/etc/caos-release" ]; then short="cAos" long="$(cat "$dir/etc/caos-release")" elif [ -e "$dir/etc/aurox-release" ]; then short="Aurox" long="$(cat "$dir/etc/aurox-release")" elif [ -e "$dir/etc/engarde-release" ]; then short="EnGarde" long="$(cat "$dir/etc/engarde-release")" elif [ -e "$dir/etc/vine-release" ]; then short="Vine" long="$(cat "$dir/etc/vine-release")" elif [ -e "$dir/etc/whitebox-release" ]; then short="WhiteBox" long="$(cat "$dir/etc/whitebox-release")" elif [ -e "$dir/etc/pld-release" ]; then short="PLD" long="$(cat "$dir/etc/pld-release")" elif [ -e "$dir/etc/startcom-release" ]; then short="StartCom" long="$(cat "$dir/etc/startcom-release")" elif [ -e "$dir/etc/trustix-release" ]; then short="Trustix" long="$(cat "$dir/etc/trustix-release")" elif [ -e "$dir/etc/openna-release" ]; then short="OpenNA" long="$(cat "$dir/etc/openna-release")" elif [ -e "$dir/etc/mageia-release" ]; then short="Mageia" long="$(cat "$dir/etc/mageia-release")" elif [ -e "$dir/etc/conectiva-release" ]; then short="Conectiva" long="$(cat "$dir/etc/conectiva-release")" elif [ -e "$dir/etc/mandrake-release" ]; then short="Mandrake" long="$(cat "$dir/etc/mandrake-release")" elif [ -e "$dir/etc/fedora-release" ]; then short="Fedora" long="$(cat "$dir/etc/fedora-release")" elif [ -e "$dir/etc/redhat-release" ]; then short="RedHat" long="$(cat "$dir/etc/redhat-release")" elif [ -e "$dir/etc/SuSE-release" ]; then short="SuSE" long="$(head -n 1 "$dir/etc/SuSE-release")" elif [ -e "$dir/etc/gentoo-release" ]; then short="Gentoo" long="$(cat "$dir/etc/gentoo-release")" elif [ -e "$dir/etc/cobalt-release" ]; then short="Cobalt" long="$(cat "$dir/etc/cobalt-release")" elif [ -e "$dir/etc/yellowdog-release" ]; then short="YellowDog" long="$(cat "$dir/etc/yellowdog-release")" elif [ -e "$dir/etc/turbolinux-release" ]; then short="Turbolinux" long="$(cat "$dir/etc/turbolinux-release")" elif [ -e "$dir/etc/pardus-release" ]; then short="Pardus" long="$(cat "$dir/etc/pardus-release")" elif [ -e "$dir/etc/kanotix-version" ]; then short="Kanotix" long="$(cat "$dir/etc/kanotix-version")" elif [ -e "$dir/etc/slackware-version" ]; then short="Slackware" long="$(printf "Slackware Linux (%s)\n" "$(cat "$dir/etc/slackware-version")")" elif [ -e "$dir/sbin/pkgtool" ]; then short="Slackware" long="Slackware Linux" elif grep -qs OpenLinux "$dir/etc/issue"; then short="Caldera" long="Caldera OpenLinux" elif [ -e "$dir/etc/frugalware-release" ]; then short="Frugalware Linux" long="$(cat "$dir/etc/frugalware-release")" elif [ -e "$dir/etc/kdemar-release" ]; then short="K-DEMar" long="$(printf "K-DEMar GNU/Linux (%s)\n" "$(cat "$dir/etc/kdemar-release")")" elif [ -e "$dir/etc/lfs-release" ]; then short="LFS" long="$(printf "Linux From Scratch (%s)\n" "$(cat "$dir/etc/lfs-release")")" elif [ -e "$dir/etc/meego-release" ]; then short="MeeGo" long="$(head -1 "$dir/etc/meego-release")" elif [ -e "$dir/etc/4MLinux-version" ]; then short="4MLinux" long="4MLinux $(head -1 "$dir/etc/4MLinux-version")" elif [ -e "$dir/etc/devuan_version" ]; then short="Devuan" long="$(printf "Devuan GNU/Linux (%s)\n" "$(cat "$dir/etc/devuan_version")")" else short="Linux" long="unknown Linux distribution" fi label="$(count_next_label "$short")" if [ "x$type" = "xbtrfs" -a "x$uuid" != "x" -a "x$subvol" != "x" ]; then result "$partition:$long:$label:linux:$type:$uuid:$subvol" else result "$partition:$long:$label:linux" fi exit 0 else exit 1 fi PKoye[ҁ 90solarisnuȯ#!/bin/sh # Attempt to check if solaris is installed in this system # looking at the /etc/system parameters file and /etc/vfstab. set -e . /usr/share/os-prober/common.sh partition="$1" dir="$2" type="$3" if [ -f "$dir/etc/system" ] && [ -f "$dir/etc/vfstab" ]; then label="$(count_next_label Solaris)" result "$partition:Solaris/IA32:$label:chain" exit 0 else exit 1 fi PKoye[}05efinuȯ#!/bin/sh # Detects all Microsoft OSes on a collection of partitions. . /usr/share/os-prober/common.sh partition="$1" mpoint="$2" type="$3" # This file is for UEFI platform only if [ ! -d /sys/firmware/efi ] || [ -f /var/lib/partman/ignore_uefi ]; then debug "Not on UEFI platform" exit 1 fi # Weed out stuff that doesn't apply to us case "$type" in vfat) debug "$1 is a FAT32 partition" ;; msdos) debug "$1 is a FAT16 partition" ;; fat) debug "$1 is a FAT partition (mounted by GRUB)" ;; *) debug "$1 is $type partition: exiting"; exit 1 ;; esac if type udevadm > /dev/null 2>&1; then udevinfo () { udevadm info "$@" } fi if type udevinfo > /dev/null 2>&1; then # Skip virtual devices if udevinfo -q path -n $partition | grep -q /virtual/; then debug "$1 is virtual device: exiting" exit 1 fi eval "$(udevinfo -q property -n "$partition" | grep -E '^ID_PART_ENTRY_(TYPE|SCHEME)=')" debug "$partition partition scheme is $ID_PART_ENTRY_SCHEME" debug "$partition partition type is $ID_PART_ENTRY_TYPE" if [ -z "$ID_PART_ENTRY_TYPE" -o -z "$ID_PART_ENTRY_SCHEME" -o \ \( "$ID_PART_ENTRY_SCHEME" != gpt -a "$ID_PART_ENTRY_SCHEME" != msdos \) -o \ \( "$ID_PART_ENTRY_SCHEME" = gpt -a "$ID_PART_ENTRY_TYPE" != c12a7328-f81f-11d2-ba4b-00a0c93ec93b \) -o \ \( "$ID_PART_ENTRY_SCHEME" = msdos -a "$ID_PART_ENTRY_TYPE" != 0xef \) ]; then debug "$partition is not a ESP partition: exiting" exit 1 fi else debug "udevinfo and udevadm missing - cannot check partition type" fi efi=$(item_in_dir efi "$mpoint") if [ -z "$efi" ]; then debug "$mpoint does not have /EFI directory: exiting" exit 1 fi ret=1 for test in /usr/libexec/os-probes/mounted/efi/*; do debug "running subtest $test" if [ -f "$test" ] && [ -x "$test" ]; then # we need results of subtest in stdout orig_fd_res=$fd_result export fd_result=1 entry=$("$test" "$mpoint/$efi") export fd_result=$orig_fd_res if [ -n "$entry" ]; then debug "bootloader $entry found by subtest $test" ret=0 result "${partition}@/$efi/${entry}:efi" fi fi done exit $ret PKoye[>w w 20microsoftnuȯ#!/bin/sh # Detects all Microsoft OSes on a collection of partitions. . /usr/share/os-prober/common.sh partition="$1" mpoint="$2" type="$3" # This script looks for legacy BIOS bootloaders only. Skip if running UEFI if [ -d /sys/firmware/efi ] && [ ! -f /var/lib/partman/ignore_uefi ]; then debug "Skipping legacy bootloaders on UEFI system" exit 1 fi # Weed out stuff that doesn't apply to us case "$type" in ntfs|ntfs-3g) debug "$1 is a NTFS partition" ;; vfat) debug "$1 is a FAT32 partition" ;; msdos) debug "$1 is a FAT16 partition" ;; fat) debug "$1 is a FAT partition (mounted by GRUB)" ;; fuse|fuseblk) debug "$1 is a FUSE partition" ;; # might be ntfs-3g *) debug "$1 is not a MS partition: exiting"; exit 1 ;; esac found= # Vista (previously Longhorn) if item_in_dir -q bootmgr "$2"; then # there might be different boot directories in different case as: # boot Boot BOOT for boot in $(item_in_dir boot "$2"); do bcd=$(item_in_dir bcd "$2/$boot") if [ -n "$bcd" ]; then if grep -aqs "W.i.n.d.o.w.s. .1.0" "$2/$boot/$bcd"; then long="Windows 10" elif grep -aqs "W.i.n.d.o.w.s. .8" "$2/$boot/$bcd"; then long="Windows 8" elif grep -aqs "W.i.n.d.o.w.s. .7" "$2/$boot/$bcd"; then long="Windows 7" elif grep -aqs "W.i.n.d.o.w.s. .V.i.s.t.a" "$2/$boot/$bcd"; then long="Windows Vista" elif grep -aqs "W.i.n.d.o.w.s. .S.e.r.v.e.r. .2.0.0.8. .R.2." "$2/$boot/$bcd"; then long="Windows Server 2008 R2" elif grep -aqs "W.i.n.d.o.w.s. .S.e.r.v.e.r. .2.0.0.8." "$2/$boot/$bcd"; then long="Windows Server 2008" elif grep -aqs "W.i.n.d.o.w.s. .R.e.c.o.v.e.r.y. .E.n.v.i.r.o.n.m.e.n.t" "$2/$boot/$bcd"; then long="Windows Recovery Environment" elif grep -aqs "W.i.n.d.o.w.s. .S.e.t.u.p" "$2/$boot/$bcd"; then long="Windows Recovery Environment" else long="Windows Vista" fi short=Windows found=true break fi done fi # 2000/XP/NT4.0 if [ -z "$found" ] && item_in_dir -q ntldr "$2" && item_in_dir -q ntdetect.com "$2"; then long="Windows NT/2000/XP" short=Windows ini=$(item_in_dir boot.ini "$2") if [ -n "$ini" ]; then multicount="$(grep -e "^multi" "$2/$ini" | wc -l)" scsicount="$(grep -e "^scsi" "$2/$ini" | wc -l)" msoscount="$(expr "${multicount}" + "${scsicount}")" if [ "$msoscount" -eq 1 ]; then # We need to remove a Carriage Return at the end of # the line... defaultmspart="$(grep -e "^default=" "$2/$ini" | cut -d '=' -f2 | tr -d '\r')" # Escape any backslashes in defaultmspart grepexp="^$(echo "$defaultmspart" | sed -e 's/\\/\\\\/')=" # Colons not allowed; replace by spaces # Accented characters (non UTF-8) cause debconf to # hang, so we fall back to the default if the name # contains any weird characters. long="$(grep -e "$grepexp" "$2/$ini" | cut -d '"' -f2 | \ tr ':' ' ' | LC_ALL=C grep -v '[^a-zA-Z0-9 &()/_-]')" if [ -z "$long" ]; then long="Windows NT/2000/XP" fi else long="Windows NT/2000/XP" fi found=true fi fi # MS-DOS if [ -z "$found" ] && item_in_dir -q dos "$2"; then long="MS-DOS 5.x/6.x/Win3.1" short=MS-DOS found=true fi # 95/98/Me if [ -z "$found" ] && item_in_dir -q windows "$2" && item_in_dir -q win.com "$2"/"$(item_in_dir windows "$2")"; then long="Windows 95/98/Me" short=Windows9xMe found=true fi if [ -z "$found" ]; then exit 1 fi label="$(count_next_label "$short")" result "${partition}:${long}:${label}:chain" exit 0 PKoye[Px{{40lsbnuȯ#!/bin/sh # Test for LSB systems. set -e . /usr/share/os-prober/common.sh partition="$1" dir="$2" type="$3" lsb_field () { file="$1" field="$2" grep ^"$field" "$file" | cut -d = -f 2 | sed 's/^"//' | sed 's/"$//' | sed 's/:/ /g' } file="$dir/etc/lsb-release" if [ ! -e "$file" ]; then exit 1 fi release=$(lsb_field "$file" DISTRIB_RELEASE) if [ -z "$release" ]; then release=$(lsb_field "$file" DISTRIB_CODENAME) fi description=$(lsb_field "$file" DISTRIB_DESCRIPTION) if [ -z "$description" ]; then description=$(lsb_field "$file" DISTRIB_CODENAME) fi if [ -n "$description" ]; then if [ -n "$release" ]; then long="$description ($release)" else long="$description" fi else exit 1 fi short=$(lsb_field "$file" DISTRIB_ID | sed 's/ //g') if [ -z "$short" ]; then short="UnknownLSB" fi label="$(count_next_label "$short")" result "$partition:$long:$label:linux" exit 0 PKoye[CT70hurdnuȯ#!/bin/sh set -e . /usr/share/os-prober/common.sh partition="$1" dir="$2" type="$3" if [ -d "$dir/servers" ] && [ -d "$dir/hurd" ]; then label="$(count_next_label Hurd)" result "$partition:GNU/Hurd:$label:hurd" exit 0 else exit 1 fi PKoye[ 80minixnuȯ#!/bin/sh set -e . /usr/share/os-prober/common.sh partition="$1" dir="$2" type="$3" # Weed out stuff that doesn't apply to us case "$type" in minix|minix2|ext2) ;; *) exit 1 ;; esac if [ -f "$dir/minix" ] || [ -e "$dir/boot/image_big" ]; then if [ -e "$dir/boot/image_latest" ]; then boot="minix" else boot="chain" fi label="$(count_next_label Minix)" result "$partition:Minix:$label:$boot" exit 0 else exit 1 fi PKoye[__ 30utilitynuȯ#!/bin/sh # Detects utility (hw vendor recovery) partitions. . /usr/share/os-prober/common.sh partition="$1" mpoint="$2" type="$3" # Weed out stuff that doesn't apply to us case "$type" in vfat) debug "$1 is a FAT32 partition" ;; msdos) debug "$1 is a FAT16 partition" ;; fat) debug "$1 is a FAT partition (mounted by GRUB)" ;; *) debug "$1 is not a FAT partition: exiting"; exit 1 ;; esac # Dell Utility partitions have partition type 0xde, but no idea how to # cleanly detect that from shell if item_in_dir -q dellbio.bin "$2" && \ (item_in_dir -q delldiag.exe "$2" || item_in_dir -q delldiag.com "$2"); then long="Dell Utility Partition" short=DellUtility elif item_in_dir -q f11.sys "$2"; then long="Acronis Secure Zone" short=AcroneZone else exit 1 fi label="$(count_next_label "$short")" result "${partition}:${long}:${label}:chain" exit 0 PKe[ez  50lilonuȯ#!/bin/sh . /usr/share/os-prober/common.sh set -e partition="$1" bootpart="$2" mpoint="$3" type="$4" found_item=0 title="" rootdev="" kernel="" parameters="" initrd="" read_only="" added_parameters=0 default_rootdev="" default_kernel="" default_parameters="" default_initrd="" default_read_only="" dequote () { item="${1%\"}" echo "${item#\"}" } addparams () { # Any parameters we find replace the default parameters, but # otherwise append. if [ "$added_parameters" = 0 ]; then parameters="$1" added_parameters=1 else parameters="${parameters:+$parameters }$1" fi } recordstanza () { if [ -n "$kernel" ] && [ -n "$title" ]; then if [ -e "$mpoint/$kernel" ] && [ -e "$mpoint/$initrd" ]; then if [ "$read_only" ]; then parameters="ro $parameters" fi if [ "$rootdev" ]; then parameters="root=$rootdev $parameters" fi parameters="${parameters% }" result "$rootpart:$bootpart:$title:$kernel:$initrd:$parameters" found_item=1 else debug "cannot find $kernel or $initrd, not recording" fi title="" rootdev="$default_rootdev" kernel="$default_kernel" parameters="$default_parameters" initrd="$default_initrd" read_only="$default_read_only" added_parameters=0 else # Everything before set default values. default_rootdev="$rootdev" default_kernel="$kernel" default_parameters="$parameters" default_initrd="$initrd" default_read_only="$read_only" fi } parse_lilo_conf () { mpoint="$1" rootpart="$2" bootpart="$3" IFS=" =" while read line; do debug "parsing: $line" set -f set -- $line set +f case "$1" in root) rootdev=$(dequote "$2") ;; image) recordstanza # Dereference if symbolic link kernel="$(readlink -f "$(dequote "$2")")" ;; append) addparams "$(dequote "${line#append=}")" ;; initrd) # Dereference if symbolic link initrd="$(readlink -f "$(dequote "$2")")" ;; label) shift 1 title="$(dequote "$*" | sed -e 's/:/ /g')" ;; other) recordstanza ;; read-only) read_only=1 ;; vga) addparams "$line" ;; esac done recordstanza } if [ -e "$mpoint/etc/lilo.conf" ]; then debug "parsing lilo.conf" parse_lilo_conf "$mpoint" "$partition" "$bootpart" < "$mpoint/etc/lilo.conf" fi if [ "$found_item" = 0 ]; then exit 1 else exit 0 fi PKe[ގYcc40grubnuȯ#!/bin/sh . /usr/share/os-prober/common.sh set -e partition="$1" bootpart="$2" mpoint="$3" type="$4" found_item=0 entry_result () { if [ "$ignore_item" = 0 ] && \ [ -n "$kernel" ] && \ [ -e "$mpoint/$kernel" ]; then result "$rootpart:$bootpart:$title:$kernel:$initrd:$parameters" found_item=1 fi kernel="" parameters="" initrd="" title="" ignore_item=0 } parse_grub_menu () { mpoint="$1" rootpart="$2" bootpart="$3" kernel="" parameters="" initrd="" title="" ignore_item=0 while read line; do #debug "parsing: $line" set -f set -- $line set +f case "$1" in title) entry_result shift 1 title="$(echo "$@" | sed 's/://g')" if echo "$title" | grep -q '(on /dev/[^)]*)$'; then log "Skipping entry '$title':" log "appears to be an automatic reference taken from another menu.lst" ignore_item=1 fi ;; kernel) # Hack alert: sed off any (hdn,n) but # assume the kernel is on the same # partition. kernel="$(echo "$2" | sed 's/(.*)//')" shift 2 parameters="$@" # Systems with a separate /boot will not have # the path to the kernel in menu.lst. if [ "$partition" != "$bootpart" ]; then kernel="/boot$kernel" fi ;; initrd) # Hack alert take 2: sed off any (hdn,n) # See #566102 initrd="$(echo "$2" | sed 's/(.*)//')" # Initrd same. if [ "$partition" != "$bootpart" ]; then initrd="/boot$initrd" fi ;; boot) entry_result ;; module) log "Skipping entry '$title':" log "parsing of entries containing 'module' lines is currently not supported" ignore_item=1 ;; esac done entry_result } grubconf= if [ -e "$mpoint/boot/grub/menu.lst" ]; then grubconf="menu.lst" elif [ -e "$mpoint/boot/grub/grub.conf" ]; then grubconf="grub.conf" fi if [ "$grubconf" ] && \ ([ ! -e "$mpoint/boot/grub/grub.cfg" ] || \ [ "$mpoint/boot/grub/$grubconf" -nt "$mpoint/boot/grub/grub.cfg" ]); then debug "parsing $grubconf" parse_grub_menu "$mpoint" "$partition" "$bootpart" < "$mpoint/boot/grub/$grubconf" fi if [ "$found_item" = 0 ]; then exit 1 else exit 0 fi PKe["Td d 40grub2nuȯ#!/bin/sh . /usr/share/os-prober/common.sh set -e # add support for btrfs with no separate /boot # that is, rootsv = bootsv partition="$1" bootpart="$2" mpoint="$3" type="$4" rootsv="$5" bootsv="$6" found_item=0 entry_result () { if [ "x$type" = "xbtrfs" -a "$partition" = "$bootpart" ]; then # trim off the leading subvol kernelfile=$(echo "$kernel" | cut -d '/' -f 2- | cut -d '/' -f 2-) if [ "x$rootsv" != "x$bootsv" ]; then kernelfile="/boot/$kernelfile" fi else kernelfile=$kernel fi if [ "$ignore_item" = 0 ] && \ [ -n "$kernel" ] && \ [ -e "$mpoint/$kernelfile" ]; then result "$rootpart:$bootpart:$title:$kernel:$initrd:$parameters" found_item=1 fi kernel="" parameters="" initrd="" title="" ignore_item=0 } parse_grub_menu () { mpoint="$1" rootpart="$2" bootpart="$3" kernel="" parameters="" initrd="" title="" ignore_item=0 while read line; do debug "parsing: $line" set -f set -- $line set +f case "$1" in menuentry) entry_result shift 1 # The double-quoted string is the title. # Make sure to look at the text of the line # before 'set' mangled it. title="$(echo "$line" | sed -n 's/[^"]*"\(.*\)".*/\1/p' | sed 's/://g')" if [ -z "$title" ]; then # ... or single-quoted? Be careful # to handle constructions like # 'foo'\''bar' (which expands to # foo'bar, as in shell), and to # handle multiple single-quoted # strings on the same line. title="$(echo "$line" | sed -n "s/[^']*'\(\([^']\|'\\\\''\)*\)'.*/\1/p" | sed "s/'\\\\''/'/; s/://g")" fi if [ -z "$title" ]; then ignore_item=1 elif echo "$title" | grep -q '(on /dev/[^)]*)$'; then log "Skipping entry '$title':" log "appears to be an automatic reference taken from another menu.lst" ignore_item=1 fi ;; linux*) # Hack alert: sed off any (hdn,n) but # assume the kernel is on the same # partition. kernel="$(echo "$2" | sed 's/(.*)//')" shift 2 parameters="$@" # Systems with a separate /boot will not have # the path to the kernel in grub.cfg. if [ "$partition" != "$bootpart" ]; then kernel="/boot$kernel" fi ;; initrd*) initrd="$(echo "$2" | sed 's/(.*)//')" # Initrd same. if [ "$partition" != "$bootpart" ]; then initrd="/boot$initrd" fi ;; "}") entry_result ;; esac done entry_result } if [ -e "$mpoint/boot/grub/grub.cfg" ] && \ ([ ! -e "$mpoint/boot/grub/menu.lst" ] || \ [ "$mpoint/boot/grub/grub.cfg" -nt "$mpoint/boot/grub/menu.lst" ]); then debug "parsing grub.cfg" parse_grub_menu "$mpoint" "$partition" "$bootpart" < "$mpoint/boot/grub/grub.cfg" elif [ -e "$mpoint/boot/grub2/grub.cfg" ]; then debug "parsing grub.cfg" parse_grub_menu "$mpoint" "$partition" "$bootpart" < "$mpoint/boot/grub2/grub.cfg" fi if [ "$found_item" = 0 ]; then exit 1 else exit 0 fi PKe[? 90fallbacknuȯ#!/bin/sh # Fallback in case nothing else works. Look for vmlinu[xz] file in root and # /boot, see if there is a matching initrd, and wing it. . /usr/share/os-prober/common.sh set -e partition="$1" bootpart="$2" mpoint="$3" type="$4" mappedpartition=$(mapdevfs "$partition" 2>/dev/null) || mappedpartition="$partition" exitcode=1 for kernpat in /vmlinuz /vmlinux /boot/vmlinuz /boot/vmlinux "/boot/vmlinuz*" \ "/boot/vmlinux*" "/vmlinuz*" "/vmlinux*" "/kernel-*" "/boot/kernel-*"; do if echo "$kernpat" | grep -q boot/; then kernbootpart="$bootpart" else kernbootpart="$partition" fi for kernfile in $(eval ls "$mpoint$kernpat" 2>/dev/null); do kernbasefile=$(echo "$kernfile" | sed "s!^$mpoint!!") if [ -f "$kernfile" ] && [ ! -L "$kernfile" ]; then initrdname=$(echo "$kernfile" | sed "s/vmlinu[zx]/initrd\*/") # Yellow Dog Linux appends .img to it. initrdname1="${initrdname}.img" # Arch Linux names its initrds weirdly. We take # some care here to avoid false positives on other # systems, since kernel.img could conceivably be a # kernel itself. initrdname2=$(echo "$kernfile" | sed -n 's/vmlinu[zx]\([0-9][0-9]*\)/kernel\1/p' | sed 's/$/.img/') # Dracut initramfses are named differently again. initrdname3=$(echo "$kernfile" | sed "s/vmlinu[zx]/initramfs\*/" | sed 's/$/.img/') # And Gentoo's also initrdname4=$(echo "$kernfile" | sed "s/kernel\|vmlinu[zx]/initramfs\*/") foundinitrd=0 for initrd in $(eval ls "$initrdname" "$initrdname1" "$initrdname2" "$initrdname3" "$initrdname4" 2>/dev/null); do if [ "$initrd" != "$kernfile" ] && [ -f "$initrd" ] && [ ! -L "$initrd" ]; then initrd=$(echo "$initrd" | sed "s!^$mpoint!!") result "$partition:$kernbootpart::$kernbasefile:$initrd:root=$mappedpartition" exitcode=0 foundinitrd=1 fi done if [ "$foundinitrd" = 0 ]; then result "$partition:$kernbootpart::$kernbasefile::root=$mappedpartition" exitcode=0 fi fi done done exit "$exitcode" PKoye[,Itt83haikunuȯPKoye[tJJ20macosxnuȯPKoye[`2-10qnxnuȯPKoye[&? efi/10elilonuȯPKoye[jhh efi/20microsoftnuȯPKoye[JpI b 10freedosnuȯPKoye[3ff90linux-distronuȯPKoye[ҁ D&90solarisnuȯPKoye[}'05efinuȯPKoye[>w w L020microsoftnuȯPKoye[Px{{=40lsbnuȯPKoye[CTA70hurdnuȯPKoye[ B80minixnuȯPKoye[__ D30utilitynuȯPKe[ez  YH50lilonuȯPKe[ގYccQ40grubnuȯPKe["Td d CZ40grub2nuȯPKe[? e90fallbacknuȯPKm