Lines 1725-1874
Link Here
|
1725 |
sub check_answer_headerdir { |
1725 |
sub check_answer_headerdir { |
1726 |
my $answer = shift; |
1726 |
my $answer = shift; |
1727 |
my $source = shift; |
1727 |
my $source = shift; |
1728 |
my $pattern = '@@VMWARE@@'; |
|
|
1729 |
my $header_version_uts; |
1730 |
my $header_smp; |
1731 |
my $header_page_offset; |
1732 |
|
1733 |
$answer = dir_remove_trailing_slashes($answer); |
1734 |
|
1735 |
if (not (-d $answer)) { |
1736 |
if ($source eq 'user') { |
1737 |
print wrap('The path "' . $answer . '" is not an existing directory.' |
1738 |
. "\n\n", 0); |
1739 |
} |
1740 |
return ''; |
1741 |
} |
1742 |
|
1743 |
if ($answer =~ m|^/usr/include(/.*)?$|) { #/# Broken colorizer. |
1744 |
if ($source eq 'user') { |
1745 |
if (get_answer('The header files in /usr/include are generally for C ' |
1746 |
. 'libraries, not for the running kernel. If you do not ' |
1747 |
. 'have kernel header files in your /usr/src directory, ' |
1748 |
. 'you probably do not have the kernel-source package ' |
1749 |
. 'installed. Are you sure that /usr/include contains ' |
1750 |
. 'the header files associated with your running kernel?', |
1751 |
'yesno', 'no') eq 'no') { |
1752 |
return ''; |
1753 |
} |
1754 |
} |
1755 |
} |
1756 |
|
1757 |
if ( (not (-d $answer . '/linux')) |
1758 |
|| (not (-d $answer . '/asm')) |
1759 |
|| (not (-d $answer . '/net'))) { |
1760 |
if ($source eq 'user') { |
1761 |
print wrap('The path "' . $answer . '" is an existing directory, but it ' |
1762 |
. 'does not contain at least one of these directories ' |
1763 |
. '"linux", "asm", "net" as expected.' . "\n\n", 0); |
1764 |
} |
1765 |
return ''; |
1766 |
} |
1767 |
|
1768 |
# |
1769 |
# Check that the running kernel matches the set of header files |
1770 |
# |
1771 |
|
1772 |
if (not (-r $answer . '/linux/version.h')) { |
1773 |
if ($source eq 'user') { |
1774 |
print wrap('The path "' . $answer . '" is a kernel header file ' |
1775 |
. 'directory, but it does not contain the file ' |
1776 |
. '"linux/version.h" as expected. This can happen if the ' |
1777 |
. 'kernel has never been built, or if you have invoked the ' |
1778 |
. '"make mrproper" command in your kernel directory. In any ' |
1779 |
. 'case, you may want to rebuild your kernel.' . "\n\n", 0); |
1780 |
} |
1781 |
return ''; |
1782 |
} |
1783 |
$header_version_uts = direct_command( |
1784 |
shell_string($gHelper{'echo'}) . ' ' |
1785 |
. shell_string('#include <linux/version.h>' . "\n" . $pattern |
1786 |
. ' UTS_RELEASE') . ' | ' . shell_string($gHelper{'gcc'}) |
1787 |
. ' ' . shell_string('-I' . $answer) . ' -E - | ' |
1788 |
. shell_string($gHelper{'grep'}) . ' ' . shell_string($pattern)); |
1789 |
chomp($header_version_uts); |
1790 |
$header_version_uts =~ s/^$pattern \"([^\"]*)\".*$/$1/; |
1791 |
if (not ($header_version_uts eq $gSystem{'uts_release'})) { |
1792 |
if ($source eq 'user') { |
1793 |
print wrap('The directory of kernel headers (version ' |
1794 |
. $header_version_uts . ') does not match your running ' |
1795 |
. 'kernel (version ' . $gSystem{'uts_release'} . '). Even ' |
1796 |
. 'if the module were to compile successfully, it would not ' |
1797 |
. 'load into the running kernel.' . "\n\n", 0); |
1798 |
} |
1799 |
return ''; |
1800 |
} |
1801 |
|
1802 |
if (not (-r $answer . '/linux/autoconf.h')) { |
1803 |
if ($source eq 'user') { |
1804 |
print wrap('The path "' . $answer . '" is a kernel header file ' |
1805 |
. 'directory, but it does not contain the file ' |
1806 |
. '"linux/autoconf.h" as expected. This can happen if the ' |
1807 |
. 'kernel has never been built, or if you have invoked the ' |
1808 |
. '"make mrproper" command in your kernel directory. In any ' |
1809 |
. 'case, you may want to rebuild your kernel.' . "\n\n", 0); |
1810 |
} |
1811 |
return ''; |
1812 |
} |
1813 |
$header_smp = direct_command(shell_string($gHelper{'grep'}) . ' CONFIG_SMP ' |
1814 |
. shell_string($answer . '/linux/autoconf.h')); |
1815 |
if (not ($header_smp eq '')) { |
1816 |
# linux/autoconf.h contains the up/smp information |
1817 |
$header_smp = direct_command( |
1818 |
shell_string($gHelper{'echo'}) . ' ' |
1819 |
. shell_string('#include <linux/autoconf.h>' . "\n" . $pattern |
1820 |
. ' CONFIG_SMP') . ' | ' . shell_string($gHelper{'gcc'}) |
1821 |
. ' ' . shell_string('-I' . $answer) . ' -E - | ' |
1822 |
. shell_string($gHelper{'grep'}) . ' ' . shell_string($pattern)); |
1823 |
chomp($header_smp); |
1824 |
$header_smp =~ s/^$pattern (\S+).*$/$1/; |
1825 |
$header_smp = ($header_smp eq '1') ? 'yes' : 'no'; |
1826 |
if (not (lc($header_smp) eq lc($gSystem{'smp'}))) { |
1827 |
if ($source eq 'user') { |
1828 |
print wrap('The kernel defined by this directory of header files is ' |
1829 |
. (($header_smp eq 'yes') ? 'multiprocessor' |
1830 |
: 'uniprocessor') . ', while ' |
1831 |
. 'your running kernel is ' |
1832 |
. (($gSystem{'smp'} eq 'yes') ? 'multiprocessor' |
1833 |
: 'uniprocessor') . '.' |
1834 |
. "\n\n", 0); |
1835 |
} |
1836 |
return ''; |
1837 |
} |
1838 |
} |
1839 |
|
1840 |
if (not (-r $answer . '/asm/page.h')) { |
1841 |
if ($source eq 'user') { |
1842 |
print wrap('The path "' . $answer . '" is a kernel header file ' |
1843 |
. 'directory, but it does not contain the file "asm/page.h" ' |
1844 |
. 'as expected.' . "\n\n", 0); |
1845 |
} |
1846 |
return ''; |
1847 |
} |
1848 |
$header_page_offset = direct_command( |
1849 |
shell_string($gHelper{'echo'}) . ' ' |
1850 |
. shell_string('#define __KERNEL__' . "\n" . '#include <asm/page.h>' |
1851 |
. "\n" . $pattern . ' __PAGE_OFFSET') . ' | ' |
1852 |
. shell_string($gHelper{'gcc'}) . ' ' . shell_string('-I' . $answer) |
1853 |
. ' -E - | ' . shell_string($gHelper{'grep'}) . ' ' |
1854 |
. shell_string($pattern)); |
1855 |
chomp($header_page_offset); |
1856 |
$header_page_offset =~ s/^$pattern \(?0x([0-9a-fA-F]{8,}).*$/$1/; |
1857 |
if ($header_page_offset =~ /[0-9a-fA-F]{8,}/) { |
1858 |
# We found a valid page offset |
1859 |
if (defined($gSystem{'page_offset'}) and |
1860 |
not (lc($header_page_offset) eq lc($gSystem{'page_offset'}))) { |
1861 |
if ($source eq 'user') { |
1862 |
print wrap('The kernel defined by this directory of header files does ' |
1863 |
. 'not have the same address space size as your running ' |
1864 |
. 'kernel.' . "\n\n", 0); |
1865 |
} |
1866 |
return ''; |
1867 |
} |
1868 |
} |
1869 |
|
1870 |
return $answer; |
1728 |
return $answer; |
1871 |
} |
1729 |
} |
|
|
1730 |
|
1872 |
$gAnswerSize{'headerdir'} = 20; |
1731 |
$gAnswerSize{'headerdir'} = 20; |
1873 |
$gCheckAnswerFct{'headerdir'} = \&check_answer_headerdir; |
1732 |
$gCheckAnswerFct{'headerdir'} = \&check_answer_headerdir; |
1874 |
|
1733 |
|
Lines 2722-2756
Link Here
|
2722 |
$gcc_version = direct_command(shell_string($gHelper{'gcc'}) |
2581 |
$gcc_version = direct_command(shell_string($gHelper{'gcc'}) |
2723 |
. ' -dumpversion'); |
2582 |
. ' -dumpversion'); |
2724 |
chomp($gcc_version); |
2583 |
chomp($gcc_version); |
2725 |
if ($gcc_version =~ /^(egcs-)?(\d+(\.\d+)*)/) { |
|
|
2726 |
$gSystem{'gcc_version'} = $2; |
2727 |
} else { |
2728 |
print wrap('Your compiler "' . $gHelper{'gcc'} . '" version "' . |
2729 |
$gcc_version . '" is not supported ' . |
2730 |
'by this version of ' . vmware_product_name() . '.' . |
2731 |
"\n\n", 0); |
2732 |
return 'no'; |
2733 |
} |
2734 |
|
2735 |
if (check_gcc_version($gSystem{'gcc_version'}) eq 'no') { |
2736 |
return 'no'; |
2737 |
} |
2738 |
|
2739 |
# When installing the modules, kernels 2.4+ setup a symlink to the kernel |
2740 |
# source directory |
2741 |
$headerdir = $cKernelModuleDir . '/preferred/build/include'; |
2742 |
if (check_answer_headerdir($headerdir, 'default') eq '') { |
2743 |
$headerdir = $cKernelModuleDir . '/' . $gSystem{'uts_release'} |
2744 |
. '/build/include'; |
2745 |
if (check_answer_headerdir($headerdir, 'default') eq '') { |
2746 |
# Use a default usual location |
2747 |
$headerdir = '/usr/src/linux/include'; |
2748 |
} |
2749 |
} |
2750 |
get_persistent_answer('What is the location of the directory of C header ' |
2751 |
. 'files that match your running kernel?', |
2752 |
'HEADER_DIR', 'headerdir', $headerdir); |
2753 |
|
2584 |
|
|
|
2585 |
$headerdir = '/usr/src/linux/include'; |
2754 |
$gFirstModuleBuild = 0; |
2586 |
$gFirstModuleBuild = 0; |
2755 |
} |
2587 |
} |
2756 |
|
2588 |
|
Lines 2882-2933
Link Here
|
2882 |
|
2714 |
|
2883 |
if ($gOption{'compile'} == 1) { |
2715 |
if ($gOption{'compile'} == 1) { |
2884 |
db_add_answer('BUILDR_' . $name, 'yes'); |
2716 |
db_add_answer('BUILDR_' . $name, 'yes'); |
2885 |
} else { |
|
|
2886 |
my @mod_list; |
2887 |
|
2888 |
print wrap('Trying to find a suitable ' . $name |
2889 |
. ' module for your running kernel.' . "\n\n", 0); |
2890 |
@mod_list = get_suitable_modules($mod_dir . '/binary'); |
2891 |
while ($#mod_list > -1) { |
2892 |
my $candidate = shift(@mod_list); |
2893 |
my $modversion = shift(@mod_list); |
2894 |
|
2895 |
# Note: When using the force flag, |
2896 |
# Non-versioned modules can load into a versioned kernel. |
2897 |
# Versioned modules can load into a non-versioned kernel. |
2898 |
# |
2899 |
# Consequently, it is only safe to use the force flag if _both_ the |
2900 |
# kernel and the module are versioned. |
2901 |
# This is not always the case as demonstrated by bug 18371. |
2902 |
|
2903 |
if (try_module($name, |
2904 |
$mod_dir . '/binary/' . $candidate . '/objects/' |
2905 |
. $name . '.o', |
2906 |
($gSystem{'versioned'} eq 'yes') |
2907 |
&& ($modversion eq 'yes'), 1)) { |
2908 |
print wrap('The module ' . $candidate . ' loads perfectly in the ' |
2909 |
. 'running kernel.' . "\n\n", 0); |
2910 |
return 'yes'; |
2911 |
} |
2912 |
} |
2913 |
|
2914 |
if ($gOption{'prebuilt'} == 1) { |
2915 |
db_add_answer('BUILDR_' . $name, 'no'); |
2916 |
print wrap('None of the pre-built ' . $name . ' modules for ' |
2917 |
. vmware_product_name() . ' is suitable for your ' |
2918 |
. 'running kernel.' . "\n\n", 0); |
2919 |
return 'no'; |
2920 |
} |
2921 |
|
2922 |
if (get_persistent_answer('None of the pre-built ' . $name . ' modules for ' |
2923 |
. vmware_product_name() . ' is suitable ' |
2924 |
. 'for your running kernel. Do you want this ' |
2925 |
. 'program to try to build the ' . $name |
2926 |
. ' module for your system (you need to have a ' |
2927 |
. 'C compiler installed on your system)?', |
2928 |
'BUILDR_' . $name, 'yesno', 'yes') eq 'no') { |
2929 |
return 'no'; |
2930 |
} |
2931 |
} |
2717 |
} |
2932 |
|
2718 |
|
2933 |
if (build_module($name, $mod_dir . '/source') eq 'no') { |
2719 |
if (build_module($name, $mod_dir . '/source') eq 'no') { |