DOM production process
The project is basically over. This is a summary document in which the system is cut. I don't know if anyone is interested:) ========================== ================== Preface: In order to complete the user's needs, it is necessary to make a complete environment for AP operation and there are some constraints. Keywords: DOM KERNEL BUSYBOX X-WINDOW WINDOW-Manager Interbase NVIDIA CUTDOWN Target Description: Establish an environment constraints that can run a complete AP on a 64M DOM (Disk On Module): 1, the total space available is 64m, Provided by the DOM, but the actual space is only 53-59m. The reason may be related to the device file and the DOM itself. Undetermined 2, the graphics card is NVIDIA series 3, kernel selection 2.4.20, did not use the REDHAT own version. Driver of the capture card is currently compiled under the 2.4.20 kernel. Due to the poor transplantability, it has begun to consider all KERNELVERSION greater than 2.4.25, and the latest implementation of the BTTV 4. Database option Interbase series, currently used for Firebird-1.5 (Firebird's open source implementation, interface, and interbase). 5, other affiliates, there will be explained production processes in the following documents: the principle and implementation of some parts are very comprehensive, but basically provide some URL connections for relevant personnel. Basically, in accordance with the production process, the portion that is mutually implicated before and after will not be specifically described. I. Choice and compilation of kernel: Due to Driver, only 2.4.20 Kernel can be used. 2.4.20 and 2.4.25 have trials for Driver, and other versions of Kernel have not tried it, it should be possible, not confirmed. Can't compile on 2.6, which is currently determined because there is a problem with makefile. It is estimated that some corresponding modifications are still available, and you can refer to BTTV's makefile (http://linux.bytesex.org/v4l2/bttv.html). Go back to KERNEL, basic compilation principle is to minimize unwanted parts, and do not do Module as much as possible in addition to some of the Driver that requires temporary loading. Due to the reason that the above mentioned, Kernel used in DOM is the original 2.4.20, which can be downloaded from http://www.kernel.org, and this document can also be found. In addition, due to the demand definition, the SPLASH screen needs to be displayed when the system starts, so Kernel also needs to join the bootsplash function, which is the third party, and the Kernel is added as a patch. The practices are as follows: 1, built the kernel patch and compile the internal nuclear and the kernel source file is installed in / usr / src / linux /.
Download Bootsplash 3.07 (Address: ftp://ftp.suse.com), then: Yourbox: ~ # Cd / usr / src / linuxyourbox: / usr / src / linux # patch -p1 "Frame-Buffer Support" or other Drive with your graphics card. Open "Use Splash Screen INSTEAD OF Boot Logo. Open" Initial RamDisk Support "in" Block Devices ", save the configuration and compile the kernel, copy the generated kernel to / boot and modify the LILO or GRUB configuration file to use The new core came to start. 2, add pictures to download and install Splash tools: ftp://ftp.suse.com/pub/people/# cd ~ / splash # tar xvjf splashutils.tar.bz2splashutils / splashutils / makefilesplashostils / splash.c [.] SplashUtils / ChangelogsplashUtils / Copying # cd splashutils # make splashgcc -os -wall -c -o splash.o splash.c gcc -os -wall -o splash splash/ous / # cd .. Picture and related Information Add to Initrd to: / Sbin / Splash -s -f /etc/bootsplash/themes/yourtheme/config/bootsplash-1024x768.cfg >> /boot/initrd.splash picture in the attachment file 3, runlo update The configuration file (GRUB is not updated), restart, if everything is normal, you can see the startup screen. At the same time there is some information about this: vesafb: framebuffer at 0xf0000000, mapped to 0xdc816000, size 65472k vesafb: mode is 1024x768x16, linelength = 2048, pages = 41 vesafb: protected mode interface info at c000: 5137 vesafb: scrolling: redrawvesafb: directcolor: Size = 0: 5: 6: 5, shift = 0: 11: 5: 0 look for splash picture .... Silenjpeg Size 11165 Bytes, Found (1024x768, 4912 Bytes, V3) Got Silent Jpeg.kernel Config file comparison Big, in the attachment, it is not listed here.
Compilation process: 1. Get 2.4.20's original kernel compression package (Linux-2.4.20.tar.bz2) 2, TAR XVJPF Linux-2.4.20.tar.bz23, CP Config-2.4.20 (KernelSource) /. Config # Copy Config-2.4.20 into the directory in Kernel Source and in .config for new file name 4, CD (kernelSource) 5, make menuconfig # do not need to do any changes, exit 6, make DEP && Make Bzimage && Make Modules && Make Install 7, if there is no problem, continue next, if there is a problem, please check if the compilation environment is correct, repeat STEP 6 8, then Kernel has compiled, you need to do two things, one is Save the future of the DOM in the future, the second is to replace the Kernel of the current release to 2.4.20 so that the back NVIDIA graphics card Dirver is correctly compiled. 9. Create a save directory, such as ~ / kernelbackup 10, CP (kernelSource) / Arch / i386 / boot / bzimage ~ / kernelbackup # save kernel 11, cp /lib/modules/2.4.20 ~ / kernelbackup / -arf # save All modules 12 compiled, if the current release is GRUB, modify /boot/grub/grub.conf (if this file can be modified / boot/grub/menu.lst, if It is lilo, modify /etc/lilo.conf. Below is a modification of GRUB, LILO's modification can be referred to related documentation: # add below to your grub.conftitle new kernel (2.4.20) # Title Just, u can modify it anywhereroot (HD0, 0) # Root Setupkernel (HD0 , 0) /Boot/bzimage-2.4.20 Ro Root = / dev / hda1 VGA = 791 Splash = Silent # Just ..... Initrd (HD0, 0) /Boot/initrd.splash # splash That show when booting of OS13, Reboot14, select the new startup option, check if it is correct, shell's selection and compile: So far, KERNEL's cut is basically end, below is the choice and compilation of the shell. For Linux, kernel just provides a system call interface, which cannot be used directly, requiring support for external shell. There are several options such as Bash, ASH, BusyBox, etc., as BSH, ASH, BusyBox, etc., because BusyBox is smaller, and provides basic complete features, so select Busybox as the system's shell. Details See WWW.BUSYBOX.NET, there is a busybox version currently used in the attachment. Busybox's process is mainly compiled and installed, thus combining Kernel to form a basic system. Busybox's profile is in the attachment, not listed here.
Compiling the process: and kernel basically similar 1, extract BusyBox2, copy the config to the busybox source directory 3. Make menuconfig # can exit 4, make DEP && Make III, basic system installation: To this point, busybox and kernel All are already ready, then you need a partition to install them. Whether it is using a separate partition or a complete DOM, it is possible to return to a complete target partition for use. Assume that the target partition is / DEV / HDC1, the following description will be based on this. The point to explain is that try not to use DOM directly on the start, because the speed and capacity is very bad, it will cause debugging, until the time of debugging is a relatively good idea.
Now entering the basic system assembly: # fdisk / dev / hdc1 and format it with ext2 or ket3. My suggest is ext3.mount / dev / hdc1 / mnt / dom # mount target partition MKDIR / MNT / DOM / BOOTMKDIR / MNT / DOM / boot / grubcp (kernelbackup) / bzimage / mnt / dom / boot # copy kernel to domcp (kernelbackup) /initrd.splash / mnt / dom / boot # Copy Initrd Splash to Dom MKDIR / MNT / DOM / LIBMKDIR / MNT / DOM / lib / modulescp (kernelbackup) /2.4.20 / mnt / dom / lib / modules -arf # copy all modules to DOM CD (busyboxpath) make prefix = / mnt / dom install # install busybox to DOM now, a basic system basics After installation, the next is the configuration problem: MKDIR / MNT / DOM / ETC # all config hermkdir / mnt / Dom / dev # device filemkdir / mnt / dom / mntmkdir / mnt / Dom / Procmkdir / MNT / DOM / TMPMKDIR / MNT / DOM / VARMKDIR / MNT / DOM / LIBMKDIR / MNT / DOM / ROOT # Home of Rootmkdir / MNT / DOM / USR # x window-manager lib, etc cp (busyboxpath) / examples / bootfloppy / etc / * / mnt / dom / Etc -arf # base config cp / dev / * / mnt / dom / dev -arf # device file. Will Cutdown Part of All is Add a required connection library: 1, LDD busybox2, see Busybox uses which connection libraries, copy Under the same path in the target partition, generally / lib 3, then use LDD to view the library if there is also a library file, if there is a copy to the target partition 4 , Repeat the third step 5, cp / dev / * / mnt / dom / dev / -arf # will also do some cut GRUB configuration in the later period: # Add Below to your grub.conftitle new kernel (2.4.20) # Title Just, u can modify it anywhereroot (HD0, 0) # Root setupkernel (HD0, 0) /Boot/bzimage-2.4.20 Ro root = / dev / hda1 VGA = 791 splash = Silent # Just ..... Initrd (HD0, 0) /boot/initrd.splash # Splash That show when booting OF OS can now do some tests, see if the basic system is working properly. Execute the following command cd / mntmkdir Dommount / dev / hdc1 Dom # mount itchroot / mnt / dom / bin / sh If you see the successful information indicating that the basic system has no problem. Restart the machine and select the new startup option to see if the basic system is normal, if there is a problem, re-check whether the previous step is done. If it is normal, then the basic system is basically complete, it can continue later.
Fourth, Xfree86's cut and installation: The basic system has been working properly, which is the clipping and installation of XFree86, first switch to the target partition and determine the system in normal operation. Here, you need to explain the directory distribution and role of Linux. First, "LS /" lists the partitions, which will have the following directory: bin boot dev etc home lib mnt opt program Next description: bin: SHELL work directory, such as Sh, Bash, mount and other orders Boot: kernel, ramdisk file, and GRUB (Lilo) stored, some releases create a partition separately to this directory to prevent the impact of the system crash. It is not considered in the DOM. DEV: All device files are placed here, such as / dev / video0, / dev / hda, etc. All equipment files are probably occupied by 400K, but it seems that all copies will come over, and DOM always reports the space, but it actually has space. The reason is unknown. The current approach is to adjust the device files, and remove the unwanted part, refer to the list of files later. ETC: AP configuration and system configuration storage directory Home: Ordinary users' work catalog root lib: Basic inventory Putalog MNT: Mountopt: Look at the situation, currently use to store FirebirdProc: The directory required for system work Root: generally root work Directory, you can switch the SBIN: General command Store Directory TMP: General Temporary Directory USR: All extended commands and XFree86, and Window-Manager are located, is the largest directory of the system, including the most content. For DOM, it is mainly to store connection libraries, Xfree86, font, Window-Manager, etc. VAR: Temporary Directory, generally in the release of WebSite files, installation files, and some log information, only as a general distribution of the general distribution in the DOM, next is the specific clipping work. In fact, Xfree86 has some alternative implementations, such as FreeDesktop, FB, etc., or even FrameBuffer is also a direction that can be considered, but because the AP uses the OpenGL 1.3 interface provided by the NVIDIA graphics card, the current unique choice is XFree86. There may be other smaller implementations, I hope to improve in the future. Enter the topic, the main program of XFree86 is actually a xfree86, located in / usr / x11r6 / bin, some release X is a connection pointing to Xfree86, some is a complete program, but no matter what, Xfree86 is The most important procedure. Now, in the target partition, you can copy what we need: CD / MNTMKDIR DIST # Create Mount path of distribute mount / dev / hda1 dist # / dev / hda1 is root partition of Your Distribute. Check it. Now / MNT / DIST is the location where the release is located. MKDIR / USR / X11R6MKDIR / USR / X11R6 / BINMKDIR / USR / LIBMKDIR / USR / X11R6 / lib create some of the needs of the directory. CP / MNT / DIST / USR / X11R6 / bin / xfree86 / usr / x11r6 / bin -Arf copy Xfree86 main program.
CP / MNT / DIST / USR / BIN / LDD / SBIN # COPY LDD THAT / SBIN # CUTDOWN LDD is used to make a cut work in a DOM environment, directly enter the LDD to see if it can be run, if there is a problem, general It is the relevant connection library, and it can be replicated according to the previous method. Now, to see which connection libraries and configuration files need to be viewed to ensure that they can run. CD / USR / X11R6 / BINLDD XFree86 will see a lot of connect libraries at this time, then you need to copy all of them from the release, you can copy directly to the corresponding directory, such as / usr / lib / or / Unsr / x11r6 / lib / under, it is important to note that some libraries itself require other libraries, can be out of the layer of LDD, some people do automated work automatically, but still manual cut is more reliable. After all the libraries are imported, try running / usr / x11r6 / bin / xfree86, you will see some error information, prompt / etc / x11 / xf86config does not exist, then copy all the / etc / x11 directory in the release to all In the target partition: CP / MNT / DIST / ETC / X11 / etc -arfre actually requires all in this directory, some parts can be deleted, but I don't have specific experiments, and the size is not very big, just All is used. Now execute / usr / x11r6 / bin / xfree86, it will prompt some libraries to be found, but it is actually copied before it is, the reason is that the library required by the command is obtained from the following ways from the shell. : 1. Search / lib2, Search / Tc/Ld.so.cache Previous replicated reservoir is placed under / usr / lib and / usr / x11r6 / lib, and now there is no LD under the current / ETC .so.cache file, if you want to generate this file, you need ldconfig this command: cp / mnt / dist / sbin / ldconfig / sbin -arf now LDConfig is there, but it also needs to be related to configuration files /etc/ld.so .conf, so: vi /etc/ld.so.conf/usr/lib/usr/x11r6/lib now executes LDConfig, an LD.SO.CACHE will appear in / etc /. If there is a newly added library file, it is not stored in / lib / down, it is imported in this step. Now, execute / usr / x11r6 / bin / xfree86, the error prompts that occur are unmatted / var / kdb and / var / log.
Here, you need to explain a modification on the configuration. CAT / etc / fstab will see the current FSTAB only one sentence: None / Proc Proc Defaults 0 0 Now add some new configuration, the new fstabs are as follows: Proc / Proc Proc Defaults 0 0none / var TMPFS Defaults 0 0none / TMP TMPFS DEFAULTS 0 0none / dev / Pts Devpts GID = 5, Mode = 620 0 0 None / Data TMPFS Defaults 0 0 Now / var, / tmp and / data are all in memory / Data is where the mount disk will be manually MKDIR: MKDIR / DATA is now modified /etc/init.d/rcs:!! / Bin / sh / bin / mount -amkdir / var / logmkdir / var / libmkdir / var / lib / xkb restarted DOM, there should be / var / log, / var / lib, / var / xkb directory, of course, these directories are only stored in memory, so you need to be temporarily created each time you start. Running XFree86, you should see an error message, indicating that some connection libraries of OpenGL will be copied from the release from the release. Try executing / usr / x11r6 / bin / xfree86 in the target partition, if you do not enter the X interface, you need to check if there is any place to do it. V. WINDOW-Manager selection installation: So far, X has been fully ported to the DOM, but a system containing basic systems and X can not meet the requirements of the AP, next is the selection and installation of Window-Manager. KDE and GNOME are unable to be installed in the DOM, the size is too large, and possible choices include TWM, Fluxbox, WindowMaker, ICEWM, etc., but need to meet the following conditions: 1, there is caption, and Modal Dialog can't be cut to the background, With the user's operating habits, there is no extra part, that is, in addition to the AP, there is no UI, such as Taskbar 3, the size is small 4, it is best not to have SYSTEM MENU and SYSTEM Buttons to choose, final The WINDOW-Manager for the DOM was selected as the DOM, and the size relatively large (10m) relatively WINDOW Manager, but better satisfies the above conditions. Installation process: 1. Download FluxBox2,. / Configure3, make4, make install5, copy related files to the same directory of the DOM 6, test, if there is a problem, repeat the first step, etc. After the Window Manager installation is complete, a basic system and Window's environment is created. Next is the cut and installation of some subsidiary components. Sixth, cutting and installation of other components: switched to the release. The final defined database engine is Firebird 1.5, so download Firebird 1.5 (http://prdownloads.sourcefort.net/...0-0.i686.tar.gz), then install it first on the release.
Firebird is installed in the / Opt directory, copy / opt / firebird to the target partition: CP / OPT / Firebird / MNT / DOM / OPT -ARF then modify the configuration file: vi /mnt/Dom/etc/init.d/ RCS #! / bin / sh / bin / mount -amkdir / var / logmkdir / var / ipmkdir / var / lib / xkb / opt / firebird / bin / fb_lock_mgr & / opt / firebird / bin / fb_inet_server & now switch to the target partition In the process list, there is a FB_LOCK_MGR in the list of processes, which shows that Firebird is already installed. Some aspects are involved in a variety of problems during the actual clipping process, so that there is no way to explain alone, so it is some of the problems that may encounter: 1. NVIDIA drivers need to be issued Unlock, then perform Make && Make Install> Install, then modify the target path in Install to install the relevant files to the DOM, such as CP libgl.so / usr / lib change to CP libgl.so / mnt / DOM / USR / LIB. Specific operations are not listed. 2, busybox's mount has problems, can't mount -o loop, so Cramfs files need to use the release of Mount, so there is a mount in the DOM / mnt / cramfs directory, and / bin also has a mount3, in order to facilitate debugging, Add Telnet Server and FTP Client in the DOM, use Utelnetd and CMDFTP, you can search for 4, GRUB installation can be used through Google Search 4, because Firebird and other modules require at least one root user, and busybox is missing The province is no user, so you need to copy two files under / etc: shadow and passwd6, the DHCP Client is used to UDHCPC7, the font is mainly related to the following directory: / usr / lib / gconv, / usr / lib / locale, / USR / X11R6 / LIB / X11 / FONT and / USR / X11R6 / lib / x11 / local (limited to redhat, other issues will have some differences, but the specific content is the same) 8. HWSetup is used by hardware self-examination, and Some modifications have been made to the source code, only the detection of Audio and Network Card, there is two versions of the original and modified version in the attachment, which can be compared to the reference 9. The web site feature is implemented by Kylix, no Apache10, Since DOM is not enough to focus all files, / usr The following files are all appeared in the format of a CRAMFS file, see the list of files later.