“UbuntuHelp:MOLModulesHowto”的版本间的差异
来自Ubuntu中文
小 |
小 |
||
(未显示2个用户的6个中间版本) | |||
第1行: | 第1行: | ||
{{From|https://help.ubuntu.com/community/MOLModulesHowto}} | {{From|https://help.ubuntu.com/community/MOLModulesHowto}} | ||
− | {{Languages| | + | {{Languages|UbuntuHelp:MOLModulesHowto}} |
== Introduction == | == Introduction == | ||
− | + | If you are running a versions of Ubuntu release previous to 6.06 [[UbuntuHelp:DapperDrake|DapperDrake]], then you need to build the MOL module for your kernel before installing Mac On Linux. This is not longer necessary in [[UbuntuHelp:DapperDrake|DapperDrake]] as the module are included in the kernel. | |
− | If you are running a versions of Ubuntu release previous to 6.06 DapperDrake, then you need to build the MOL module for your kernel before installing Mac On Linux. This is not longer necessary in DapperDrake as the module are included in the kernel. | + | |
− | + | ||
== Preparing your system == | == Preparing your system == | ||
− | + | You will need to enable the universe and multiverse, see [[UbuntuHelp:AddingRepositoriesHowto|AddingRepositoriesHowto]] for details. | |
− | You will need to enable the universe and multiverse, see AddingRepositoriesHowto for details. | + | |
− | + | ||
The following packages are required for building the MOL Modules. | The following packages are required for building the MOL Modules. | ||
<pre><nowiki> | <pre><nowiki> | ||
mol-modules-source build-essential linux-headers-$(uname -r) | mol-modules-source build-essential linux-headers-$(uname -r) | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
You can install them with the command | You can install them with the command | ||
<pre><nowiki> | <pre><nowiki> | ||
bash:~$ sudo apt-get install mol-modules-source build-essential linux-headers-$(uname -r) | bash:~$ sudo apt-get install mol-modules-source build-essential linux-headers-$(uname -r) | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
If you are running Breezy you will also need gcc-3.4 | If you are running Breezy you will also need gcc-3.4 | ||
<pre><nowiki> | <pre><nowiki> | ||
第31行: | 第25行: | ||
bash:~$ sudo ln -sf /usr/bin/gcc-4.0 /usr/bin/gcc | bash:~$ sudo ln -sf /usr/bin/gcc-4.0 /usr/bin/gcc | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
<code><nowiki>mol-modules-source</nowiki></code> | <code><nowiki>mol-modules-source</nowiki></code> | ||
− | + | This package contains the source for the mol kernel modules. | |
− | + | ||
<code><nowiki>build-essential</nowiki></code> | <code><nowiki>build-essential</nowiki></code> | ||
− | + | A metapackage that depends on the applications and tools necessary to build Ubuntu packages. | |
− | + | ||
<code><nowiki>linux-headers</nowiki></code> | <code><nowiki>linux-headers</nowiki></code> | ||
− | |||
just do | just do | ||
<pre><nowiki> | <pre><nowiki> | ||
$ uname -r | $ uname -r | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
and it will resolve to your current kernel version insuring that your kernel and headers source version match. | and it will resolve to your current kernel version insuring that your kernel and headers source version match. | ||
− | |||
== Editing the kernel headers == | == Editing the kernel headers == | ||
A bug in the Ubuntu kernel headers maycause the compilation of the Mac-on-Linux to fail. | A bug in the Ubuntu kernel headers maycause the compilation of the Mac-on-Linux to fail. | ||
− | |||
This seems to be fixed in version 2.6.12.9-powerpc, but in case of problem, this issue is reported in Bugzilla as [https://bugzilla.ubuntu.com/show_bug.cgi?id=2728 bug #2728] | This seems to be fixed in version 2.6.12.9-powerpc, but in case of problem, this issue is reported in Bugzilla as [https://bugzilla.ubuntu.com/show_bug.cgi?id=2728 bug #2728] | ||
− | |||
Only a small change is needed to make sure the modules will compile. | Only a small change is needed to make sure the modules will compile. | ||
− | |||
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconNote.png | https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconNote.png | ||
− | |||
<!> '''Note''' | <!> '''Note''' | ||
− | + | This is a hack. It just bypasses a bug in the kernel headers. You do not have to do this in Hoary. Only the Warty kernel headers have this problem. (The hack may be necessary if you upgraded from Warty to Hoary but kept the old kernel.) | |
− | + | ||
You'll need to edit a file called setup.h within the hierarchy of the linux kernel headers. | You'll need to edit a file called setup.h within the hierarchy of the linux kernel headers. | ||
<pre><nowiki> | <pre><nowiki> | ||
bash:~$ gksudo gedit /usr/src/linux-headers-2.6.8.1-4-powerpc/include/asm/setup.h | bash:~$ gksudo gedit /usr/src/linux-headers-2.6.8.1-4-powerpc/include/asm/setup.h | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
In this file, you need to comment out the line <code><nowiki>#include <asm-m68k/setup.h></nowiki></code> so the file will look like this: | In this file, you need to comment out the line <code><nowiki>#include <asm-m68k/setup.h></nowiki></code> so the file will look like this: | ||
− | |||
<pre><nowiki> | <pre><nowiki> | ||
− | #ifdef | + | #ifdef __KERNEL__ |
#ifndef _PPC_SETUP_H | #ifndef _PPC_SETUP_H | ||
#define _PPC_SETUP_H | #define _PPC_SETUP_H | ||
第80行: | 第61行: | ||
#endif /* _PPC_SETUP_H */ | #endif /* _PPC_SETUP_H */ | ||
− | #endif /* | + | #endif /* __KERNEL__ */ |
</nowiki></pre> | </nowiki></pre> | ||
− | |||
Now you are ready to start compiling the kernel modules. | Now you are ready to start compiling the kernel modules. | ||
− | |||
== Building the mol modules == | == Building the mol modules == | ||
− | |||
<!> '''Note''' | <!> '''Note''' | ||
Before building the package you need to make sure you have <code><nowiki>debhelper</nowiki></code> and <code><nowiki>m4</nowiki></code> packages. If you don't the build will fail. So, to be sure : | Before building the package you need to make sure you have <code><nowiki>debhelper</nowiki></code> and <code><nowiki>m4</nowiki></code> packages. If you don't the build will fail. So, to be sure : | ||
第92行: | 第70行: | ||
bash:~$ sudo apt-get install debhelper m4 | bash:~$ sudo apt-get install debhelper m4 | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
− | |||
The package <code><nowiki>mol-modules-source</nowiki></code> installed a file <code><nowiki>mol-modules.tar.gz</nowiki></code> in the directory <code><nowiki>/usr/src</nowiki></code>. Unpack the file with the commands | The package <code><nowiki>mol-modules-source</nowiki></code> installed a file <code><nowiki>mol-modules.tar.gz</nowiki></code> in the directory <code><nowiki>/usr/src</nowiki></code>. Unpack the file with the commands | ||
− | |||
<pre><nowiki> | <pre><nowiki> | ||
bash:~$ cd /usr/src | bash:~$ cd /usr/src | ||
bash:~$ sudo tar xzvf mol-modules.tar.gz | bash:~$ sudo tar xzvf mol-modules.tar.gz | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
Next, set some environment variables. These are needed for the compilation. | Next, set some environment variables. These are needed for the compilation. | ||
<pre><nowiki> | <pre><nowiki> | ||
第107行: | 第81行: | ||
bash:/usr/src$ export KEMAIL="[email protected]" | bash:/usr/src$ export KEMAIL="[email protected]" | ||
bash:/usr/src$ export KMAINT="Your Name" | bash:/usr/src$ export KMAINT="Your Name" | ||
− | + | bash:/usr/src$ export KDREV="ubuntu0" | |
</nowiki></pre> | </nowiki></pre> | ||
− | + | https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconNote.png | |
− | https://help.ubuntu.com/community/ | + | |
− | + | ||
<!> '''Note''' | <!> '''Note''' | ||
− | + | You should, of course, replace <code><nowiki>[email protected]</nowiki></code> and <code><nowiki>Your Name</nowiki></code> with your actual email address and your name. These are used for the Maintainer field in the debian package you're about to create. | |
− | + | ||
Use the following commands to actually build the modules: | Use the following commands to actually build the modules: | ||
<pre><nowiki> | <pre><nowiki> | ||
第120行: | 第91行: | ||
bash:/usr/src/modules/mol$ sudo debian/rules build | bash:/usr/src/modules/mol$ sudo debian/rules build | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
After compiling the modules, create a debian package of the modules with the command | After compiling the modules, create a debian package of the modules with the command | ||
<pre><nowiki> | <pre><nowiki> | ||
bash:/usr/src/modules/mol$ sudo debian/rules binary-mol-modules | bash:/usr/src/modules/mol$ sudo debian/rules binary-mol-modules | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
This will result in a debian package <code><nowiki>mol-modules-2.6.12-9-powerpc_0.9.70+ubuntu0_powerpc.deb</nowiki></code> in the directory <code><nowiki>/usr/src</nowiki></code> | This will result in a debian package <code><nowiki>mol-modules-2.6.12-9-powerpc_0.9.70+ubuntu0_powerpc.deb</nowiki></code> in the directory <code><nowiki>/usr/src</nowiki></code> | ||
− | |||
== Installing the Modules == | == Installing the Modules == | ||
− | |||
Now you can install the modules that you built. They provide the virtual package <code><nowiki>mol-modules</nowiki></code> on which the ''mol'' package depends. | Now you can install the modules that you built. They provide the virtual package <code><nowiki>mol-modules</nowiki></code> on which the ''mol'' package depends. | ||
− | + | <pre><nowiki> | |
− | <pre><nowiki> | + | bash:~$ sudo dpkg -i /usr/src/mol-modules-2.6.12-9-powerpc_0.9.70+ubuntu0_powerpc.deb |
</nowiki></pre> | </nowiki></pre> | ||
− | + | https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconNote.png | |
− | + | ||
− | + | ||
<!> '''Note''' | <!> '''Note''' | ||
− | + | The file name will change as modifications are made to the *mol* source, so, make sure that you change the above line to match the file name as it exists on your computer. As of December,1st 2005, the file name is called <code><nowiki>mol-modules-2.6.12-9-powerpc_0.9.70+ubuntu0_powerpc.deb</nowiki></code>. | |
− | + | ---- | |
− | + | [[category:CategoryDocumentation]] | |
− | + | ||
− | CategoryDocumentation | + | |
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2007年12月6日 (四) 10:43的最新版本
点击翻译: |
English |
请不要直接编辑翻译本页,本页将定期与来源同步。 |
目录
Introduction
If you are running a versions of Ubuntu release previous to 6.06 DapperDrake, then you need to build the MOL module for your kernel before installing Mac On Linux. This is not longer necessary in DapperDrake as the module are included in the kernel.
Preparing your system
You will need to enable the universe and multiverse, see AddingRepositoriesHowto for details. The following packages are required for building the MOL Modules.
mol-modules-source build-essential linux-headers-$(uname -r)
You can install them with the command
bash:~$ sudo apt-get install mol-modules-source build-essential linux-headers-$(uname -r)
If you are running Breezy you will also need gcc-3.4
bash:~$ sudo apt-get install gcc-3.4
To set gcc-3.4 as the default compiler run
bash:~$ sudo ln -sf /usr/bin/gcc-3.4 /usr/bin/gcc
at the end of the building process you will need to set the default compiler back to gcc-4.0 using the command
bash:~$ sudo ln -sf /usr/bin/gcc-4.0 /usr/bin/gcc
mol-modules-source
This package contains the source for the mol kernel modules.
build-essential
A metapackage that depends on the applications and tools necessary to build Ubuntu packages.
linux-headers
just do
$ uname -r
and it will resolve to your current kernel version insuring that your kernel and headers source version match.
Editing the kernel headers
A bug in the Ubuntu kernel headers maycause the compilation of the Mac-on-Linux to fail. This seems to be fixed in version 2.6.12.9-powerpc, but in case of problem, this issue is reported in Bugzilla as bug #2728 Only a small change is needed to make sure the modules will compile. <!> Note This is a hack. It just bypasses a bug in the kernel headers. You do not have to do this in Hoary. Only the Warty kernel headers have this problem. (The hack may be necessary if you upgraded from Warty to Hoary but kept the old kernel.) You'll need to edit a file called setup.h within the hierarchy of the linux kernel headers.
bash:~$ gksudo gedit /usr/src/linux-headers-2.6.8.1-4-powerpc/include/asm/setup.h
In this file, you need to comment out the line #include <asm-m68k/setup.h>
so the file will look like this:
#ifdef __KERNEL__ #ifndef _PPC_SETUP_H #define _PPC_SETUP_H #define m68k_num_memory num_memory #define m68k_memory memory /* #include <asm-m68k/setup.h> */ /* We have a bigger command line buffer. */ #undef COMMAND_LINE_SIZE #define COMMAND_LINE_SIZE 512 #endif /* _PPC_SETUP_H */ #endif /* __KERNEL__ */
Now you are ready to start compiling the kernel modules.
Building the mol modules
<!> Note
Before building the package you need to make sure you have debhelper
and m4
packages. If you don't the build will fail. So, to be sure :
bash:~$ sudo apt-get install debhelper m4
The package mol-modules-source
installed a file mol-modules.tar.gz
in the directory /usr/src
. Unpack the file with the commands
bash:~$ cd /usr/src bash:~$ sudo tar xzvf mol-modules.tar.gz
Next, set some environment variables. These are needed for the compilation.
bash:/usr/src$ export KVERS="$(uname -r)" bash:/usr/src$ export KSRC="/usr/src/linux-headers-$(uname -r)" bash:/usr/src$ export KEMAIL="[email protected]" bash:/usr/src$ export KMAINT="Your Name" bash:/usr/src$ export KDREV="ubuntu0"
<!> Note
You should, of course, replace [email protected]
and Your Name
with your actual email address and your name. These are used for the Maintainer field in the debian package you're about to create.
Use the following commands to actually build the modules:
bash:/usr/src$ cd modules/mol bash:/usr/src/modules/mol$ sudo debian/rules build
After compiling the modules, create a debian package of the modules with the command
bash:/usr/src/modules/mol$ sudo debian/rules binary-mol-modules
This will result in a debian package mol-modules-2.6.12-9-powerpc_0.9.70+ubuntu0_powerpc.deb
in the directory /usr/src
Installing the Modules
Now you can install the modules that you built. They provide the virtual package mol-modules
on which the mol package depends.
bash:~$ sudo dpkg -i /usr/src/mol-modules-2.6.12-9-powerpc_0.9.70+ubuntu0_powerpc.deb
<!> Note
The file name will change as modifications are made to the *mol* source, so, make sure that you change the above line to match the file name as it exists on your computer. As of December,1st 2005, the file name is called mol-modules-2.6.12-9-powerpc_0.9.70+ubuntu0_powerpc.deb
.