Linux system cut, make an extremely thin linux-3-for streamlined system to increase network function and shutdown restart function

Source: Internet
Author: User
Tags network function

Tag: Add network function and shutdown restart function for streamlined system

The 3rd chapter adds network function and switching power to the streamlined Linux system.

Before reading this blog post, it is recommended to read my last two blog posts, and preferably in order to read: (Otherwise I may think that I write unintelligible, hehe!) )

1th article: The Linux system is cut to make an extremely streamlined linux-1http://blog.51cto.com/linuxprince/2045703

2nd article: the Linux system cuts, making an extremely streamlined linux-2-script to automate the copying of commands and dependent library files http://blog.51cto.com/linuxprince/2046142


3.1 Increased network functionality for streamlined Minilinux systems

First perfect the frozen copy command and rely on the library file script, perfect after the complete program as follows:

[email protected] ~]# cat bincp.sh

#!/bin/bash

#

Despath=/mnt/sysroot

LIBCP () {

libpath=${1%/*}

[!-D $LIBPATH] && mkdir-p $LIBPATH

[!-e $DESPATH $] && CP $ $DESPATH $libpath

}

BINCP () {

binpath=${1%/*}

[!-D $BINPATH] && mkdir-p $DESPATH $binpath

[!-e $DESPATH $] && CP $ $DESPATH $binpath

Deplibs= ' LDD $ | Grep-o "/lib\ (64\) \{0,1\}/[^[:space:]]\{1,\}" '

For LIB in $DEPLIBS;

Do libcp $LIB;

Done

}

Read-p "Input command what is want to copy to Minilinux:" CMD

until [$CMD = = ' Q '];d o

! Which $CMD &>/dev/null && echo "Your input Command is not found." && read-p "input agent:" CMD &A mp;& continue

Command= ' which $CMD | Grep-v "^alias" | Sed ' s/\t//g '

BINCP $COMMAND

echo "Copy $COMMAND finishd."

Read-p "Continue input command to Minilinux:" CMD

Done

Linux system cut, make an extremely thin linux-3-for streamlined system to increase network function and shutdown restart function

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.