Install the unmount file system

  
in module mode under Linux system. Take the minix file system installed under Fedora8 as an example: In order to ensure the matching with the system kernel, you must first obtain the corresponding version of the minix source code. First, query the kernel version of the machine through uname -r. : [cocobear@cocobear ~]$ uname -r 2.6.24.4-64.fc8 The source code of the 2.6.24.4-64 kernel is available on the Kernel.org homepage. In fact, we only need linux-2.6.24.4/fs/minix /code in the directory. Because we don't need to recompile the entire kernel, we only need to write a Makefile in the linux-2.6.24.4/fs/minix/directory and generate the corresponding minix.ko. Before starting to write the Makefile, make sure the following packages are installed:
[cocobear@cocobear ~]$ rpm -qa |
  Grep kernelkernel-devel-2.6.24.4-64.fc8kernel-headers-2.6.24.4-64.fc8kernel-2.6.24.4-64.fc8 is needed during module compilation. There is already a Makefile in the source code: 
## Makefile for the Linux minix filesystem routines.#obj-$(CONFIG_MINIX_FS) += minix.ominix-objs := bitmap.o itree_v1.o itree_v2.o namei.o Inode.o file.o dir.o modify the file to: 
## Makefile for the Linux minix filesystem routines.# make minix fs as kernel moduleobj-m += minix.ominix-objs := bitmap.o itree_v1. o itree_v2.o namei.o inode.o file.o dir.oKERNELDIR:=/lib/modules/$(shell uname -r)/buildPWD:=$(shell pwd)default:make -C $(KERNELDIR) M= $(PWD) modulesclean:rm -rf *.o *.mod.c *.ko *.symvers Here is a simple explanation, obj-m means that the file will be compiled as a module; because this module consists of multiple files The module's component file is defined by the module name plus the –objs(minix-objs) suffix. KERNELDIR defines the location of the code tree, PWD defines the current folder location; the -C option in the make command specifies the location of the code tree (given by KERNELDIR), and M=$(PWD) specifies the current build work. . The last line cleans up the files generated by the compilation process. After completing the Makefile, we can start compiling the file system module. Just type make and start compiling: 
[cocobear@cocobear minix]$ makemake -C /lib/modules/2.6.24.4-64.fc8/build M=/home/cocobear/minix modulesmake[1]: Entering directory `/usr/src/kernels/2.6.24.4-64.fc8-i686'CC [M] /home/cocobear/minix/bitmap.oCC [M] /home/cocobear/minix/itree_v1.oCC [M] /home/cocobear/minix/itree_v2.oCC [M] /home/cocobear/minix/namei.oCC [M] /home/cocobear/minix/inode.oCC [ ,null,null,3],M] /home/cocobear/minix/file.oCC [M] /home/cocobear/minix/dir.oLD [M] /home/cocobear/minix/minix.oBuilding modules, stage 2.MODPOST 1 modulesCC /home/cocobear /minix/minix.mod.oLD [M] /home/cocobear/minix/minix.komake[1]: Leaving directory `/usr/src/kernels/2.6.24.4-64.fc8-i686' meets after the compilation Currently generating the minix.ko file, this is what we need, you can use the insmod command to install the minix file system module. Of course, you need to have root privileges here. Let's demonstrate the loading of the minix module: [cocobear@cocobear minix]$ cat /proc/modules |
  Grep minix [cocobear@cocobear minix]$ Here you can see that minix is ​​not loaded, we use the insmod minix.ko command: [cocobear@cocobear minix]$ sudo insmod minix.ko [cocobear@cocobear minix]$ cat /proc/Modules |
  Grep minix minix 28676 0 - Live 0xd0e7d000 insmod After we can see from the above information that the minix module has been loaded, we can also easily uninstall it if you don't need to use this module: [cocobear@cocobear minix]$ sudo rmmod minix .ko [cocobear@cocobear minix]$ cat /proc/modules |
  Grep minix [cocobear@cocobear minix]$ At this point we have successfully completed the compilation, installation and uninstallation of the file system. BTW: I encountered some problems in the middle. After writing the Makefile, type make prompt: "make: Nothing to be done for `default'.", found the reason on the Internet, use tab before the make command, instead of spaces, and my Just a good space, depressed, I have encountered it before 

Copyright © Windows knowledge All Rights Reserved