Build your own Linux 3 (providing network functions, etc)

Source: Internet
Author: User
Build your own Linux 3 Preliminary improvement (providing network functions) 1 add profile file

# Ash profile # VIM: syntax = sh # No core files by default # ulimit-s-c 0>/dev/null 2> & 1 # user = "'id-UN'" // not supported yet user Login function, user = "root" LOGNAME = $ userps1 = '[$ user @ $ hostname $ PWD] #' // prompt Path = $ PATH hostname = '/ bin/hostname' // host name Export user LOGNAME PS1 path // export the environment variable
2. Enrich the RFM File

#! /Bin/sh Path =/sbin:/bin:/usr/sbin:/usr/bin:/lib:/usr/local/trolltech/QtEmbedded-x86/lib: /usr/librunlevel = sprevlevel = numask 022 export path runlevel prevlevel # trap CTRL-C & C only in this shell so we can interrupt subprocesse. for more information about the Mount-amkdir/dev/ptsmount-T devpts/dev/PTS // code, see the previous article (mdev principles ). Echo/sbin/mdev>/proc/sys/kernel/hotplugmdev-smkdir-P/var/lock/bin/hostname-F/etc/sysconfig/hostname insmod/lib/MII. ko // The two kernel modules required for inserting the NIC, insmod/lib/pcnet32.koifconfig eth0 up // enable the DHCP function of the NIC udhcpc // busybox, obtain the IP address echo-e "\ t \ twelcome to \ 033 [31membeddedce123 \ 033 [0 m Linux"

The effect is as follows:

3. Additional knowledge

Modinfo: view the detailed information, "dependency information", and "path" of the module.
All modules loaded when the/etc/modprobe. conf system is started, and parameter information is transmitted to the module. You can edit it to learn how to transmit information to the module when it is started.
Alias alias
Options Parameters
Modprobe-r // Uninstall a module. You only need to specify the module name and load a removed module without adding R.
Modprobe-r floppy // remove a floppy disk
Ls/lib/modules/'uname-R' // modproce find the module here
Insmod insert Module
Insmod/path/to/module_file it must specify the full path of the module
Lsmod displays all modules
Rmmod removes the module and does not need to specify the path
Depmod is used to automatically generate dependency files and ing files for all modules.
Modules. Dep map. Dep

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.