酷派大神f2内置软件下载软件软件包在哪里看

当前位置: >
酷派大神f2有电信版吗?大神f2电信版上市时间
酷派大神f2有电信版吗?大神f2电信版上市时间
时间: 07:31 来源: 作者:
  酷派大神f2有电信版吗?有很多机友在问酷派大神f2电信版上市时间的消息,使用电信卡的用户还是很多的,那么酷派大神f2会有电信版本吗?大家可以通过下文来了解详情。
  根据目前的曝光消息来看,大神F2将率先搭载联发科的4G八核芯片,而该芯片将于本月15日正式发布,此外大神F2还将是首款4G双卡八核的产品,目前大多数4G八核手机均为单卡设计。
  但是关于酷派大神f2有电信版吗,目前还没有消息。
猜你还喜欢:
本文由翱翔软件制作网原创首发,转载请保留链接地址:
售前咨询QQ
加入VIP会员
终身技术服务阅读排行榜
评论排行榜你的位置: &
> 大神F2什么时候上市?大神F2上市时间
大神F2什么时候上市?大神F2上市时间
更新时间:
收藏本页(Ctrl+D)
手机扫描查看
扫描二维码
  大神F2什么时候上市?相信很多用户对于大神F2什么时候上市还不太清楚,下面统一小编来跟大家分享一下大神F2上市时间详情,感兴趣的可以过来看一下。
  酷派发出的官方消息称,旗下的大神将首发MT6595处理器,搭载它的产品是大神F2,支持双卡双待功能,会在8月发布上市。
  对于这款产品,酷派明确表示,大神F2售价在千元以内档位(作为参考大神F1 888元,很有可能一代降价,二代维持原来的价格。)。
【上一篇】
【下一篇】
看完这篇文章有何感觉?
统一文章资讯频道声明
1、 所有来源标注为统一下载站或统一文章的内容版权均为本站所有,若您需要引用、转载,请注明来源及原文链接即可,如涉及大面积转载,请来信告知,获取授权。
2、 本站所提供的文章资讯等内容均为作者提供、网友推荐、互联网整理而来,仅供学习参考,如有侵犯您的版权,请及时联系我们,并提供原文出处等,本站将在三个工作日内修正。
3、 若您的网站或机构从本站获取的一切资源进行商业使用,除来源为本站的资料需与本站协商外,其他资源请自行联系版权所有人。
4、 未经统一下载站允许,不得盗链、盗用本站资源;不得复制或仿造本网站,不得在非统一下载站所属的服务器上建立镜像,站长之家对其自行开发的或和他人共同开发的所有内容、技术手段和服务拥有全部知识产权,任何人不得侵害或破坏,也不得擅自使用。
手机资讯分类
Copy . All Rights Reserved.
本站资源均收集整理于互联网,其著作权归原作者所有,如果有侵犯您权利的资源,请来信告知,我们将及时撤销相应资源。参考报价:¥16000
商家报价:
上市时间:
您可能还需要
大家都在说注册时间 00:25:00
最后登录 04:14:26
用户头衔:资深版主
状态:我不在线
用 package user(软件包用户)来获得更多的控制和进行软件包管理(v0.8)
LFS 版本: 3.1 (对以后的版本应该也适用,不过可能要作些小改动)
作者:
Matthias S. Benkmann &m.s.&
-你想知道系统里的文件属于哪个软件包么?
-你想删除那些不能用 make uninstall的软件么?
-你对系统里存在的那些 setuid root 的程序感到不安么?
-你不想让某个软件包覆盖其他软件包安装过的文件吧?
-你不喜欢 RPM 那样的软件包管理器吧?
-你想只使用 UNIX 内建的功能就获得完全的控制吧?
法律声明: The author does not take responsibility for any damage of any kind
caused directly or indirectly by applying the methods described below.
There is no warranty of any kind, not even the implied warranty of fitness for
the purposes mentioned in the text, on any of the programs/scripts/commands
listed below and the author may not be held liable for any damage of any kind
caused by the execution of said programs/scripts/commands.
Proceed at your own risk!
###########################################################################
变动说明
###########################################################################
-added Changelog
-moved "chown 0.10000 `cat /tmp/installdirs`" command up (before
glibc package user is created)
-add_package_user: create home directory with "mkdir -p"
use $grpfile everywhere instead of /etc/group
-improved mammoth sentence in Introduction
-added note about possibility to have user name==group name
-source bashrc_basic in bashrc_package
-minor textual changes
-added section "Security issues with NFS"
-submitted v0.7
-added note, that on Linux make doesn't need to be setgid kmem
-changed LFS VERSION header to be more conservative
-added &br& tags to the synopsis for the sake of the hints
-added group mmedia to the list of suggested groups
-submitted v0.8
###########################################################################
介绍
###########################################################################
假设我写了一个程序,正好你需要它。为了你的方便,我过来帮你安装。你会把 root 帐号给我,然后就离开房间么?不会?那你为什么会把它给一个一辈子没见过的陌生人呢?(指安装从 Internet上下载的没有任何保证甚至连内容都没有在 README 里说清楚的软件包,结果搞得系统里到处都是乱七八糟的文件。)真奇怪,Unix的管理员对于他们的雇主甚至都不会给超过普通用户权限的帐号,却会把 root 的权限给那些复杂得难以理解的安装脚本。
用户和组的概念是 Unix 系统中最基本的安全原则。多年来,人们成功地运行它们来控制谁创建了某个文件,哪些人允许修改或删除这个文件。但这种控制只是用在普通用户的文件上,多浪费啊!我建议把它用在系统里所有的文件上。
#############################################################################
Package users
#############################################################################
这种策略的基本思想很容易解释。每一个软件包属于某个确定的"package user"(软件包用户)。这是一个特殊的用户,HOME 目录是 /usr/src/&软件包& (或任何你存放源码压缩包的地方).
通常这个用户没有密码,所以只有 root 能用 su 命令切换到某个 package
user,这就保证了你不会在系统里留下安全隐患。
当然你*可以* 设置密码,以允许某个协助你的管理员安装和维护这个软件包,而不需要真正的 root 权限。比如,这个管理员可以安装,删除,为他的工作组改变某些库文件。然而,他不能删除或修改不属于他的库文件,例如 libc.
每个 package user 都属于一个反映软件包用途的组,如最基本的软件包属于 "system"组,开发工具属于"devel"组等等。当然还有一些有用的组织策略。你可能想让组反映出上面提到的协同管理员。或者为每一个软件包都创建唯一的组,名称与用户名称相同,这样即使有些程序需要 setuid root (因此它会属于 root 用户),这些程序的组也能告诉你它属于哪个软件包.
除了上面的那个组(我们称为首要组)以外,所有的 package user 还属于同一个次要组,叫做"install"组。所有允许安装东东的目录都属于 install 组。这包括 /bin 和 /usr/bin 这样的目录,但不包括 /root 或 /. 属于 install 组的目录是同组可写的。如果没有额外的措施,那还不能保证安全和控制,因为每个软件包都能覆盖另一个软件包的文件(尽管这种变化可以用ls -la命令观察到)。因此,我们把所有install组的目录都加上sticky位。sticky 属性允许用户在目录里创建新文件,删除或修改属于自己的文件,但不允许用户写或删除其他用户的文件。
############################################################################
如何安装软件包
############################################################################
上面说的太单调乏味了?如果你用这个脚本就不会了:
-------------------- begin $LFS/sbin/install_package ------------------------
if [ $# -ne 3 ]; then
echo USAGE: install_package description name group
echo "!!Don't forget to put description in quotes if it contains spaces.!!"
echo "This will create a new package user name in group. This will set up"
echo "a home directory for this package user. After that, this script will"
echo "automatically su to the new user so that you can begin with the"
echo "installation right away. "
if [ $UID -ne 0 ]; then echo Please run this script as root. ; exit 1; fi
add_package_user "${1}" $2
------------------- end $LFS/sbin/install_package ----------------------------
上面给出的脚本是下面脚本的快捷方式,而下面的这个脚本才是执行具体任务,在特定的 UID 和 GID 范围内添加 package user:
LFS全套中文文档:http://lfs.linuxsir.org(主力)&br /&
LFS 英文站点镜像:http://lfs.&br /&
二笔输入法 for Linux: http://ebf.
注册时间 00:25:00
最后登录 04:14:26
用户头衔:资深版主
状态:我不在线
-------------------- begin $LFS/sbin/add_package_user -----------------------
if [ $# -lt 7 ]; then
echo 'Copyright (c) 2000 Matthias Benkmann'
echo 'USAGE: '
echo 'add_package_user description name minuid maxuid group mingid maxgid [-d home]'
echo Don\'t forget to put description in quotes.
echo description must be valid for a /etc/passwd entry, that means especially
echo that it must not contain \":\".
echo If group doesn\'t exist, it will be added.
echo group will be the user\'s main group.
echo 'The user will also belong to group "install" (created if necessary).'
echo 'A home directory /usr/src/name (or home if -d home specified)
echo will be created if it doesn\'t exist
echo 'and the files from /etc/skel-package will be copied into it (existing'
echo 'target files will *not* be overwritten)'
echo 'minuid (incl.) and maxuid (excl.)
determine'
echo 'the range of UIDs used by this script. The script will pick the first'
echo 'UID greater than all UIDs from this range already in use.'
echo 'If that UID is out of range (i.e. equal to maxuid), the'
echo 'script will pick the first available UID in this range. If the range is'
echo 'full, the script will give up. This process ensures that UIDs for packages'
echo that have been removed, don\'t get reassigned unless really necessary.
echo 'This avoids trouble if some files were overlooked when removing the package.'
echo 'Otherwise these files might be assigned to the wrong package.'
echo 'mingid (incl.) and maxgid (excl.) define'
echo 'the permissible range for the GID of group if it has to be added (and '
echo 'the install group if it must be added).'
grpfile=/etc/group
passwd=/etc/passwd
homebase=/usr/src
skel=/etc/skel-package
description=$1
home=$homebase/$name
set -- "$@" _eNd_OF_lisT_
while [ "$1" != "_eNd_OF_lisT_" ]; do
case "$1" in
-d) shift 1
if [ "$1" = "_eNd_OF_lisT_" ]; then
echo 1&&2 "-d directory name missing!"
*) temp="$1"
set -- "$@" "$temp"
shift 1 #throw away _eNd_OF_lisT_
if [ $UID -ne 0 ]; then echo Please run this script as root. ; exit 1; fi
#test if user already exists
grep "^$name:.*" $passwd
if [ $? -eq 0 ]; then
echo 'Package user does already exist! Do su '$name' to do maintenance work.'
#test if minuid, maxuid, mingid and maxgid are integers, otherwise set
#to defaults.
expr ${minuid} + 1 2&/dev/null 1&&2 || error=1
expr ${maxuid} + 1 2&/dev/null 1&&2 || error=1
expr ${mingid} + 1 2&/dev/null 1&&2 || error=1
expr ${maxgid} + 1 2&/dev/null 1&&2 || error=1
if [ $error -eq 1 ]; then
echo Error: Illegal numeric value!
if [ $minuid -ge $maxuid ]; then
echo 'Error: minuid must be less than maxuid !'
if [ $mingid -ge $maxgid ]; then
echo 'Error: mingid must be less than maxgid !'
uidlist=`cut -d : -f 3 $passwd | sort -n`
#find last used UID within range
for i in $uidlist
if [ $i -ge $maxuid ]; fi
if [ $i -ge $minuid ]; then u=$i; fi
#if no UID from the range is used, pick the first, otherwise pick the one
#immediately following the last UID in use.
if [ $u -eq 0 ]; then u=$ else u=`expr $u + 1`; fi
#if the last UID used from the range is maxuid-1, i.e. we may
#not use its successor as UID, then we look for the first unused uid
#in the range.
if [ $u -ge $maxuid ]; then
for i in $uidlist
if [ $u -eq $i ]; then u=`expr $u + 1` ; fi
if [ $i -ge $maxuid ]; fi
if [ $u -ge $maxuid ]; then
echo Error: UID range is full!
echo Will create user $name with uid: $u
unset uidlist
#############################################################################
#############################################################################
#execute the following for gname and "install" to get gids for those 2 groups
creategroup=0
for group in install $gname
oldg=$g #save gid from previous run
createinstall=$creategroup
creategroup=0
#test if group already exists and extract gid if so
g=`grep ^${group}:.\* $grpfile | cut -d : -f 3 -`
#if group does not exist, then check range for a free gid
if [ z$g = z ]; then
creategroup=1
gidlist=`cut -d : -f 3 $grpfile | sort -n`
#find last used GID within range
for i in $gidlist
if [ $i -ge $maxgid ]; fi
if [ $i -ge $mingid ]; then g=$i; fi
#if no GID from the range is used, pick the first, otherwise pick the one
#immediately following the last GID in use.
if [ $g -eq 0 ]; then g=$ else g=`expr $g + 1`; fi
#don't reuse gid from previous run
if [ $g -eq $oldg ]; then g=`expr $g + 1`; fi
#if the last GID used from the range is maxgid-1, i.e. we may
#not use its successor as GID, then we look for the first unused gid
#in the range.
if [ $g -ge $maxgid ]; then
for i in $gidlist
if [ $g -eq $i ]; then g=`expr $g + 1` ; fi
if [ $g -eq $oldg ]; then g=`expr $g + 1` ; fi
if [ $i -ge $maxgid ]; fi
if [ $g -ge $maxgid ]; then
echo Error: GID range is full!
unset gidlist
if [ $createinstall -eq 1 ]; then
echo Creating group install with gid $oldg
groupadd -g $oldg install || exit 1
echo Group install has gid $oldg
if [ $creategroup -eq 1 ]; then
echo Creating group $gname with gid $g
groupadd -g $g $gname || exit 1
echo Group $gname has gid $g
useradd -c "${description}" -d ${home} -g ${gname} -G install \
-s /bin/bash -u ${u} ${name}
mkdir -p $home || exit 1
yes n|cp -ai -R ${skel}/{[^.],.[^.],..?}* ${home} 2&/dev/null &/dev/null
cd ${home}
chown --recursive ${u}.${g} .
-------------------- end $LFS/sbin/add_package_user -----------------------
LFS全套中文文档:http://lfs.linuxsir.org(主力)&br /&
LFS 英文站点镜像:http://lfs.&br /&
二笔输入法 for Linux: http://ebf.
注册时间 00:25:00
最后登录 04:14:26
用户头衔:资深版主
状态:我不在线
如果你用上面的两个脚本,安装软件包时可以这样:
install_package 'Foo description' foo foogroup
就会创建 package user:foo,并自动地用 su 命令切换到这个用户,进入它的 HOME 目录里。接下来把源码压缩包拷贝到这个目录下,解压并安装,与以 root 用户安装没什么区别了。
############################################################################
陷阱和解决方法
############################################################################
在使用这个系统时有一些陷阱,常见的如下:
1. 某个软件包的安装脚本写得不好,执着地改变系统目录或它自身文件的属主或权限。
2. 某个软件包的安装脚本有合理的原因,要改变它安装的文件的属主或权限。
3. 软件包 A 包含的某个程序已经被软件包 B 安装过了。
4. 某个软件包需要测试安装它的是不是 root 用户,如果不是,就不安装某些组件。
5. 某个软件包创建了一个目录,而其它的软件包要往里面写东西。
1-3 在 make install 阶段通常会造成"Operation not permitted"的错误。注意,这并不是 package user 策略的缺陷,正相反,这是一个有用的特性。正是为了这个,我们才把安装目录设置成 sticky 并使用 package user.我们不希望这种事情在没有自己(神:-)允许的情况下发生。修正这几个问题通常很简单:
1. 观察"make install"的输出。在"Operation not permitted"的前一行通常有肇事的命令,如"install --owner root foo /bin"。用 grep 查找这个软件包的 Makefiles,把肇事的参数(这里是"--owner foo")删掉。有时你可能不想删掉它,那就需要改成某种无害的东西。比如"install -m 4755 ..."想设置 setuid 位,就需要改成"install -m 755 ...".
你可以用一个sed脚本或包装脚本(后面会说),来自动进行这样的改动,省得手动的改 Makefiles.注意,你可以在 configure 阶段后改,也可以修改 Makefiles 的原型 (通常是 Makefile.in 或 Makefile.am).
2. 这种情况基本与 1 相同,但这时软件包有合理的要求(你会接受的)。这种情况很少见,但的确有些软件包要安装 setuid root 的程序,并且这些程序需要 setuid root 才能使用,比如 ping. 这时,就要像 1 一样安装它,在安装了以后再用 root 来改变程序的属性,达到它的运行要求,如:chown root.root /bin/ping && chmod 4755 /bin/ping.
3. 这时你就要决定,你需要的到底是哪个软件包里的程序。如果你要替换掉软件包 B 的程序,手动把它删掉就行了。如果你保留想软件包 B 里面的程序,用 grep 在 Makefiles 中查找这个出问题的程序(以及它的 man 手册页). 通常你能找到像这样的一行:
PROGRAMS=foo bar fubar barfu
把要删除的那个程序从上面的列表里去掉就行了。在极为少见的情况下,你可能需要从 Makefiles 中删除一些"install &programname& &destination&"这样的行。
4. 这种情况通常在软件包的 INSTALL 文档里会说到,并会为剩下的那些组件留出一个编译目标,比如"install-root". 所以通常就没有什么问题了。
5. 这种情况好办,把那个出问题的目录属主改成 install 组,权限设置成同组可写,并设置 sticky 位。要做这些并不需要 root 的权限,创建这个目录的用户就能改变它的属性。所以你可以在 Makefile 里加上合适的命令。
手动修改 Makefiles 很麻烦,虽然只是偶而才发生。sed 脚本能帮忙,但它们必须根据每个软件包的不同情况而改动。有一个更好的解决方法。在用 package user 策略来编译 LFS 时,我注意到虽然在 Makefile 中有很多可能的命令会导致"Operation not permitted"错误,但它们中间只有很少的几个用到了。到目前为止,我只遇到了与 mkdir, chgrp,
chown 和 install 命令相关的问题。
我写了下列的包装脚本来自动处理出错问题。如果你能确定,这些脚本所在的目录(我的在/usr/src/lfs)在每个 package user 的 PATH 变量里是第一个,你就能安装绝大多数的 LFS 软件包,而无须手动修改 Makefiles.
注意! 这些包装脚本允许"make install"完成,而不会由于"Operation not permitted"错误而中断。然而,禁止掉的命令中有些是正当的(看上面第 2 点).
所以,包装脚本把禁止掉的命令那一行以"***"开头显示在标准错误 stderr 上。
你必须检查这些行,如果有的是合理的操作,你就要手动执行,否则出问题的程序就不能正常运行了。下面是你应该找的东西,以及应该采取的行动:
1. "*** install -m 4xxx -o root" : 这个命令把一个程序设置成 setuid root 的。这里重要的是"-m 4x".很多安装脚本试图使用"install -m 755 -o root"或类似的东西,这可以忽略掉。属主(用"-o owner"指明) 只对 权限为 4xxx(用"-m 4xxx")的程序才重要。如果你确定那个程序真的需要 setuid root(对于 LFS 基础软件包通常是这样),就必须:
chown root.root &binaryname&
chmod u+s &binaryname&
2. "*** chgrp xxx" : 这个命令改变程序的组。通常情况下,只有对于 setgid 的程序才需要这样做。你用"ls -l"命令可以看到
rwxr-sr-x
1 util-lin tty
2000 write
这里的"s"(在group那一位上)就表示这个程序是 setgid 的。
目前,下面的包装脚本chgrp只拦截 xxx=tty 中的 chgrp 操作,因为这是安装 LFS 系统时能遇到的唯一例子。如果这样的命令被拦截了,并且你需要让那个程序 setgid,就这样:
chgrp xxx &binaryname&
chmod g+s &binaryname&
使用 package user 策略来安装软件包的时候,很重要的一点就是要认真的分析出错日志,尤其是使用下面的包装脚本时。
为了简化这一过程,用下面的命令安装软件
make install 3&&1 1&&2 2&&3 | tee install.err
这个命令把平常见到的编译信息输出(比如错误和正常的信息)到屏幕,还把所有的错误输出到install.err文件里。在安装了以后,你就可以用"cat install.err"来检查错误信息。
注意"make install | tee install.err" 不能工作,因为它只是拷贝所有的正常信息,而不包括出错信息。
如果你要重定向屏幕信息(比如保存到install log文件里,包含错误和非错误信息)到一个文件,就这样:
{ make install 3&&1 1&&2 2&&3 | tee install.} &&install.log
你可能需要创建一个 shell 函数,免得每次打这么多命令。
下面是包装脚本:
------------- begin $LFS/usr/src/lfs/wrappers/mkdir --------------------------
DAISY_CHAIN=""
for p in $(type -ap mkdir) ; do
if [ ! $p -ef $0 ]; then DAISY_CHAIN=$ fi
if [ ! -n "$DAISY_CHAIN" ]; then
echo Cannot find real ${0##*/} command
if [ $UID == 0 ]; then
exec $DAISY_CHAIN "$@"
watchdir=/usr/share/locale
cmdline="$@"
for((i=$#; $i&0;))
shift 1; i=$(($i-1))
case "$a" in
$watchdir/*) dirs="$dirs ""`expr $a : "$watchdir/\(.*\)"`"
set -- "$@" "$a"
*) set -- "$@" "$a" ;;
$DAISY_CHAIN "$@" || exit $?
test z"$dirs" != z &&
echo 1&&2 '***' mkdir "$cmdline"
for dir in $ do
cumuldir=""
for d in `echo $dirs | sed 's#/# #g' -` ; do
cumuldir=$cumuldir$d/
chgrp install $watchdir/$cumuldir
chmod g+w,o+t $watchdir/$cumuldir
------------ end $LFS/usr/src/lfs/wrappers/mkdir --------------------------
------------ begin $LFS/usr/src/lfs/wrappers/chgrp ------------------------
DAISY_CHAIN=""
for p in $(type -ap chgrp) ; do
if [ ! $p -ef $0 ]; then DAISY_CHAIN=$ fi
if [ ! -n "$DAISY_CHAIN" ]; then
echo Cannot find real ${0##*/} command
if [ $UID == 0 ]; then
exec $DAISY_CHAIN "$@"
if [ "$1" == "tty" ]; then
echo 1&&2 '***' chgrp "$@"
$DAISY_CHAIN "$@" || exit $?
------------ end $LFS/usr/src/lfs/wrappers/chgrp --------------------------
------------ begin $LFS/usr/src/lfs/wrappers/chown ------------------------
DAISY_CHAIN=""
for p in $(type -ap chown) ; do
if [ ! $p -ef $0 ]; then DAISY_CHAIN=$ fi
if [ ! -n "$DAISY_CHAIN" ]; then
echo Cannot find real ${0##*/} command
if [ $UID == 0 ]; then
exec $DAISY_CHAIN "$@"
if [ "$1" == "root.root" ]; then
echo 1&&2 '***' chown "$@"
$DAISY_CHAIN "$@" || exit $?
-------------- end $LFS/usr/src/lfs/wrappers/chown ------------------------
------------ begin $LFS/usr/src/lfs/wrappers/install ----------------------
localedir=/usr/share/locale
cmdline="$@"
manpagesowner=man-pages
DAISY_CHAIN=""
for p in $(type -ap install) ; do
if [ ! $p -ef $0 ]; then DAISY_CHAIN=$ fi
if [ ! -n "$DAISY_CHAIN" ]; then
echo Cannot find real ${0##*/} command
if [ $UID == 0 ]; then
exec $DAISY_CHAIN "$@"
#********** test if we create directories ********************
if [ \( z"$1" = z"-d" \) -o \( z"$1" = z"-m" -a z"$3" = z"-d" \) ]; then
locdirs=""
for((i=$#; $i&0; ))
shift 1; i=$(($i-1))
case "$a" in
-o|-g|--owner|--group) notify=1
shift 1; i=$(($i-1))
set -- "$@"
$localedir/*) if [ ! -d "$a" ]; then
locdirs="$locdirs ""`expr $a : "$localedir/\(.*\)"`"
set -- "$@" "$a"
set -- "$@"
*/*|/sbin) if [ ! -d "$a" ]; then
set -- "$@" "$a"
set -- "$@"
*) set -- "$@" "$a" ;;
test $notify -eq 1 -o z"$locdirs" != z && \
echo 1&&2 '***' install "$cmdline"
test $havedir -eq 0 && exit 0
$DAISY_CHAIN "$@" || exit $?
test z"$locdirs" != z &&
for dir in $ do
cumuldir=""
for d in `echo $locdirs | sed 's#/# #g' -` ; do
cumuldir=$cumuldir$d/
if [ -d $localedir/$cumuldir ]; then
chgrp install $localedir/$cumuldir
chmod g+w,o+t $localedir/$cumuldir
#if "$1" != "-d"
,i.e. we do not create directories *****************
for((i=$# ; $i&0; ))
shift 1; i=$(($i-1))
case "$a" in
set -- "$@" "$a"
shift 1; i=$(($i-1))
case "$a" in
4755) notify=1 ; set -- "$@" "755" ;;
*) set -- "$@" "$a";
-m4755) notify=1 ; set -- "$@" "-m755" ;;
-o|-g|--owner|--group)
shift 1; i=$(($i-1))
set -- "$@"
*/man/man?/*)
if [ -e "$a" -a ! -O "$a" ]; then
if [ `find "$a" -printf \%u` = $manpagesowner ]; then
set -- "$@" not_installed
set -- "$@" "$a"
set -- "$@" "$a"
*) set -- "$@" "$a" ;;
test $notify -eq 1 && echo 1&&2 '***' install "$cmdline"
$DAISY_CHAIN "$@" || exit $?
----------- end $LFS/usr/src/lfs/wrappers/install --------------------------
如果你改进了上面的脚本,能寄给我一份就太好了,最好说明一下是哪个包提示你作出这样的改进。注意这些脚本尽量作出最少的改动,所以输入一个"-m*)"而不是"-m4755"就不行了。
这些脚本只能处理(我)已经遇到过的问题,而不是所有可能的问题。
LFS全套中文文档:http://lfs.linuxsir.org(主力)&br /&
LFS 英文站点镜像:http://lfs.&br /&
二笔输入法 for Linux: http://ebf.
注册时间 00:25:00
最后登录 04:14:26
用户头衔:资深版主
状态:我不在线
#############################################################################
对于 LFS 的专门指导
#############################################################################
对于 package user 的用户名,我通常使用软件包的名称,不包含版本号,但包含横线,名字可以长于8个字符,比如"util-linux".
除了 ls -l 会去掉用户名中最后的字符以外,我还没有碰到什么问题。我测试过的其他程序都能正确处理这样的用户名。如果你遇到了问题,请告诉我。
那么,我们应该怎样在编译 LFS 系统的时候用上面的方法呢?
##########################################################################
chroot 以前的阶段
##########################################################################
在 chroot 前我们不使用 package users.但这并不意味着我们要用 root 来安装。我建议用普通用户来安装 chroot 前的系统。这样,在最后你就能分辨在 chroot 环境中创建的文件 (它们的 uid 是 0 或 某个 package user 的 uid) 和剩下来的在chroot前创建的文件(它们带着你主系统里的正常用户id). 作为普通用户编译还能保证不会因为失误而覆盖主系统里的文件。
在 chroot 前的命令不需要改变,但你需要加一些东西。第一个问题是我们在 chroot 中安装了 glibc 后马上就需要 find。最好的办法是在 chroot 前编译一个静态的 find:
./configure --prefix=$LFS/usr --disable-nls &&
make LDFLAGS=-static CPPFLAGS=-Dre_max_failures=re_max_f2 &&
make libexecdir=$LFS/usr/bin install
另一个问题是,在glibc安装前,某些程序比如chown,不能解释用户名称。幸运的是多数程序都接受数字形式的 UID 或 GID. 只有一个例外: su. 使用 package user 的基础竟然不能接受数字形式的 id:-|
那么我们在安装 glibc 前要怎样成为一个 package user 呢?你可能以为我写了一个脚本来代替它,你猜 ...
... 错了 :-) 我写了一个 C 程序来代替它.
碰巧 sh-utils 也包含了一个 su 程序,LFS里面没有用它。在 chroot 前静态编译安装了这个程序,但从来就没有用到(假设是标准的 LFS 安装), 在动态编译 sh-utils 时被替换,最后又被 shadow 中的 su 替换掉,这个才是最后的 LFS 系统里用到的 su 程序。所以你需要做的就是,在第五章编译 sh-utils 前,把 sh-utils 源码树下 src/su.c 用下面的内容替换。
注意如果你用普通用户编译第五章,你需要在"make install"后再运行"make install-root",要不然 sh-utils 就不会安装 su.
-------- begin $LFS/usr/src/sh-utils/sh-utils-&version&/src/su.c ------------
#include &stdio.h&
#include &sys/types.h&
#include &unistd.h&
#include &stdlib.h&
#include &errno.h&
#include &string.h&
#include &ctype.h&
#include &grp.h&
#define NUMGIDS 1024
int main(int argc,char* argv[])
char Buffy[4096];
uid_t tuid=-1,
char* command=NULL;
char* HOME;
gid_t gid_list[NUMGIDS];
ssize_t NumGids=0;
if (argc&1)
if (strcmp(argv[1],"--help")==0)
{ fprintf(stdout,"There is no help!\n"); exit(0);}
if (strcmp(argv[1],"--version")==0) {fprintf(stdout,"0.6\n"); exit(0); }
if ((argc==4) && (strcmp(argv[2],"-c")==0)) command=argv[3]; else
if (argc!=2)
fprintf(stdout,"USAGE: su username|uid [-c command]\n");
while(isdigit(argv[1][i])) ++i;
if (argv[1][i]==0) tuid=atol(argv[1]);
File=fopen("/etc/passwd","rb");
if (File==NULL) {perror("/etc/passwd"); return 1;};
Res=fgets(Buffy,1024,File);
if (Res==NULL) {
if (errno!=0) perror("/etc/passwd");
else fprintf(stderr,"su: User not found!\n");
Res=strtok(Buffy,":");
if (Res==NULL)
strtok(NULL,":");
uid=atol(strtok(NULL,":"));
gid=atol(strtok(NULL,":"));
strtok(NULL,":");
HOME=strtok(NULL,":");
shell=strtok(NULL,":");
if (tuid==uid) {argv[1]=strdup(Buffy);}
if (strcmp(argv[1],Buffy)==0)
HOME=strdup(HOME);
shell=strdup(shell);
File=fopen("/etc/group","rb");
if (File==NULL) {perror("/etc/group"); return 1;};
ContinueReadingEtcGroup:
Res=fgets(Buffy,1024,File);
if (Res==NULL) {
if (errno!=0) {perror("/etc/group"); return 1;}
Res=strtok(Buffy,":,\n");
if (Res==NULL)
strtok(NULL,":,\n");
gid_list[NumGids]=atol(strtok(NULL,":,\n"));
Res=strtok(NULL,":,\n");
while(Res!=NULL)
if (strcmp(Res,argv[1])==0)
if (NumGids&=NUMGIDS) goto SetNewI
else goto ContinueReadingEtcG
Res=strtok(NULL,":,\n");
SetNewIdentity:
if (command==NULL) command=
setenv("HOME",HOME,1);
setgroups(NumGids,gid_list);
setgid(gid);
setuid(uid);
i=system(command);
if (((i&0) || (i==127)) && (errno!=0)) {perror("/bin/sh"); return 1;};
-------- end $LFS/usr/src/sh-utils/sh-utils-&version&/src/su.c ------------
这个 su 程序能接受用户名,也能接受数字形式的UID. 它使用 /etc/passwd 来进行独立的名称解释,所以在 glibc 安装前也能工作。
注意 sh-utils 安装 su 程序时会设置成 setuid 的。
如果你用普通用户来做第五章(为了安全,你应该这样), 即使是 root 来执行,su也不能工作。只要去掉 setuid 位就行了:
chmod u-s $LFS/bin/su
我们一进入 chroot 环境(这时是root身份),就能正常的使用 su. 注意你可以从 root 切换到某个 package user,但不能反着来。如果你想从 package user 用 su 切换到 root,就必须设置 su 为 setuid root(比如 chown root.root $LFS/bin/su && chmod u+s $LFS/bin/su). 确保你不会在其他人能接触到的系统里放这样的程序.
上面的 su 不检查密码,所以如果你让它setuid root,任何人都能成为 root,而无需密码!
LFS全套中文文档:http://lfs.linuxsir.org(主力)&br /&
LFS 英文站点镜像:http://lfs.&br /&
二笔输入法 for Linux: http://ebf.
注册时间 00:25:00
最后登录 04:14:26
用户头衔:资深版主
状态:我不在线
##########################################################################
Chroot 阶段 - 准备 LFS 系统:
##########################################################################
这是一个棘手的阶段。在我们刚一进入 chroot 时,我们必须把安装目录分配给 install 组,并让它们是同组可写的。然而,因为 glibc 还没有安装,我们不能使用用户名,更麻烦的是,groupadd 和 useradd 属于 shadow 软件包,我们还没有装。
这就意味着如果不手动编辑 /etc/group 和 /etc/passwd 文件,我们就不能创建 package user.
但别绝望,下面的脚本能在没有安装 shadow 软件包的情况下完美的代替 useradd 和 groupadd.注意它们只能接受 add_package_user 脚本里的那种 useradd 和 groupadd 命令格式。我假定你将使用 add_package_user 脚本来为系统添加 package user.下面是脚本:
--------------------- begin $LFS/usr/sbin/useradd ----------------------------
if [ $# -ne 13 -o z$1 != z-c -o z$3 != z-d -o z$5 != z-g -o z$7 != z-G -o z$9 != z-s -o z${11} != z-u ]; then
echo 1&&2 USAGE: useradd -c description -d home -g maingroup -G addgroup -s shell -u uid login
#test if user already exists
grep "^${13}:.*" /etc/passwd
if [ $? -eq 0 ]; then
echo 1&&2 $0: User does already exist
g=`grep ^${6}:.\* /etc/group | cut -d : -f 3 -`
if [ z${g} = z ]; then
echo 1&&2 $0: Group ${6} does not exist!
grep ^${8}:.\* /etc/group &/dev/null || \
echo 1&&2 $0: Group ${8} does not exist!
cp /etc/passwd /tmp/passwd123456
echo "${13}:x:${12}:$g:$2:$4:/bin/bash" \
| sort -t : -k3,3n -m /tmp/passwd123456 - & /etc/passwd
cp /etc/group /tmp/group123456
-e 's/^\('"${8}"':[^:]*:[0-9]*:..*\)$/\1,'"${13}"'/' \
-e 's/^\('"${8}"':[^:]*:[0-9]*\):$/\1:'"${13}"'/' \
/tmp/group123456 &/etc/group
---------------------- end $LFS/usr/sbin/useradd ----------------------------
--------------------- begin $LFS/usr/sbin/groupadd --------------------------
if [ $# -ne 3 -o z$1 != z-g ]; then
echo 1&&2 USAGE: groupadd -g gid groupname
#test if group already exists
grep "^${3}:.*" /etc/group
if [ $? -eq 0 ]; then
echo 1&&2 $0: Group does already exist
cp /etc/group /tmp/group123456
echo ${3}:x:${2}: | sort -t : -k3,3n -m /tmp/group123456 - & /etc/group
--------------------- end $LFS/usr/sbin/groupadd ----------------------------
这些脚本克服了缺少 shadow 软件包的问题。
用上面的脚本和 su 程序,我们就能开始 chroot 阶段了。
###########################################################################
进入 chroot 前的技巧
###########################################################################
当 add_package_user 创建一个新的 package user 时,会拷贝所有 /etc/skel-package (如果你创建了这个目录的话)目录下的文件到那个 package user 的 home 目录。 符号链接也会作为符号链接来拷贝。
可以在 /etc/skel-package 下创建一个有用的符号链接:
.bashrc -& /etc/bashrc_package
------------------ begin $LFS/etc/bashrc_package --------------------------
#first load basic configuration to make system work normal
source /etc/bashrc_basic
export PATH=/usr/src/lfs/wrappers:$PATH
#make prompt reflect that we are a package user. Do it via USER_PROMPT_COMMAND
#rather than PROMPT_COMMAND because we want to keep root's prompt if we su to root
export USER_PROMPT_COMMAND='PS1="package \u:"`pwd`"& "'
alias mafobu='make -f /usr/src/lfs/mafobu'
#The following command will put us in the home directory.
------------------ end $LFS/etc/bashrc_package ----------------------------
------------------ begin $LFS/etc/bashrc_basic ----------------------------
#This file should be sourced by all users' .bashrc files
if [ $UID -eq 0 ]; then
export PATH=/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin
export PATH=/usr/local/bin:/bin:/usr/bin
#set a red prompt when user is root. If a user wants to override this
#s/he should use USER_PROMPT_COMMAND instead of PROMPT_COMMAND in order to
#root's prompt when su'ed to root. If a user wants to change PS1 directly
#s/he should do "unset USER_PROMPT_COMMAND".
export PROMPT_COMMAND='if [ $UID -eq 0 ]; then \
PS1="\[\033[0;31m\]root@\h:"`pwd -P`"# \[\033[0m\]" ; \
else eval $USER_PROMPT_COMMAND ; fi'
#make PROMPT_COMMAND read-only to protect against careless users
declare -r PROMPT_COMMAND
#set a reasonable default USER_PROMPT_COMMAND
export USER_PROMPT_COMMAND='PS1="\u@\h:"`pwd`"& "'
#make keys (del, bs, home, end,...) work normal
export INPUTRC=/etc/inputrc
bind -f $INPUTRC
------------------ end $LFS/etc/bashrc_basic ------------------------------
另一个可以放在 /etc/skel-package 下的有用文件是 .project,比如:
------------------ begin $LFS/etc/skel-package/.project ------------------
DESCRIPTION:
bogus package
foo,bar,fubar
LAST UPDATED:
30 Feb 2042
DOWNLOAD LOCATION:
[url]ftp://ftp.gnu.org/gnu/foo/[/url]
INSTALL NOTES:
GENERAL NOTES:
----------------- end $LFS/etc/skel-package/.project ------------------
每安装或重新安装一个软件包的时候都更新一下这个文件。当你运行"finger &package&" 或 "pinky -l &package&"命令时,就会显示出这个文件的内容。
###########################################################################
在 chroot 环境中
###########################################################################
当你进入 chroot 环境后,运行
groupadd -g 10000 install
会创建一个 install 组。再运行:
chown 0.10000 `cat /tmp/installdirs`
chmod ug=rwx,o=rx `cat /tmp/installdirs`
来给 install 组分配目录。注意,我们还没有设置目录的 sticky 位。这是因为它们还包含了 root 或某个未知用户的文件(如果你在 chroot 前是用普通用户来安装的话). 这些文件必须是可以覆盖的。/tmp/installdirs 文件如下:
----------------- begin $LFS/tmp/installdirs ------------------------------
/usr/include
/usr/man/man?
/usr/local/man/man?
/usr/local/doc
/usr/share
/usr/share/dict
/usr/share/doc
/usr/share/info
/usr/share/locale
/usr/share/man/man1
/usr/share/man/man2
/usr/share/man/man3
/usr/share/man/man4
/usr/share/man/man5
/usr/share/man/man6
/usr/share/man/man7
/usr/share/man/man8
/usr/share/nls
/usr/share/misc
/usr/share/terminfo
/usr/share/zoneinfo
/usr/share/i18n
/usr/share/aclocal
/usr/local/bin
/usr/local/etc
/usr/local/include
/usr/local/lib
/usr/local/sbin
/usr/local/share
/usr/local/share/dict
/usr/local/share/doc
/usr/local/share/info
/usr/local/share/locale
/usr/local/share/man/man1
/usr/local/share/man/man2
/usr/local/share/man/man3
/usr/local/share/man/man4
/usr/local/share/man/man5
/usr/local/share/man/man6
/usr/local/share/man/man7
/usr/local/share/man/man8
/usr/local/share/nls
/usr/local/share/misc
/usr/local/share/terminfo
/usr/local/share/zoneinfo
----------------- end $LFS/tmp/installdirs --------------------------------
chown 0.10000 /usr/share/info/dir
chmod ug=rw,o=r /usr/share/info/dir
将使软件包能安装它们的 info 页。
#########################################################################
Chroot 阶段 - 安装软件包
#########################################################################
现在我们能安装 glibc 了。以 root 身份用下列命令创建 /dev/null
mknod -m 0666 /dev/null c 1 3
install_package "GNU C library" glibc system
这会创建 system 组和 glibc 用户,还会用 su 命令切换到 glibc 软件包用户。注意mkdir 和 install 包装脚本在安装 glibc 时不适用,因为它们使用"install"而不是 gid.所以我们在安装完 glibc 后要这样:
find /usr/share/locale/* -type d -user glibc -exec chmod ug=rwx,o=rxt \{\} \;\
-exec chgrp install \{\} \;
以回到 root,并继续安装剩下的软件包。使用命令
install_package &description& &packagename& &group&
来创建和切换到 package user. 然后在用户的目录里解压源码包,并结合下面的说明与 LFS BOOK 里的指导来安装每个软件包。
############################################################################
用户组的指导方针
############################################################################
我推荐对于 package user 使用下面的用户组:
devel: 开发相关的东西,如编译器。并不局限于软件开发,Tex 也可以属于这个组。
utils: 多数软件包属于这个组,甚至一些很基础的软件包如 grep 和文本编辑器。
net: 网络相关的东西如 ftp 守护进程或网络浏览器。这个组在很大程度上与其他组重叠。当某个软件包主要是用在 Internet, LAN, WWW,... 时,应该优先用这个组。比如像 wget 这样的工具应该属于 net 而不是 utils 组。例外,对于 docs, addons, games 和 mmedia 组,如果有一个软件包属于它们与 net 的交界,优先不用 net 组。
docs: 文档相关的软件包,如 Linux howto 的压缩包。注意,创建文档的软件包如 XML 处理器可能应该属于 devel 组,用来看文档和后期处理的程序如 man 和 groff 应该属于 utils 组。
system: 重要的系统软件包,如 bash. 这个组只应该用于非常重要的软件包。多数你想放到这里面的程序应该放到"utils"里。比如 vi 就属于 utils.如果某个软件包不属于 LFS 的基本系统,那它就不太可能属于 system 组。
libs: 就是库文件啦。与其他类别关系不密切的库文件就应该属于这个组,如 zlib 或 libpng.最基础的系统库文件,如 glibc, ncurses 或 gettext,应该属于 system 组。libs 组也应该包含运行时间库环境(run-time environments)如 Java 虚拟机,dosemu 和 wine. 其他的模拟器如 MAME 应该属于 games 组。
games: 你期待的东东;-)
mmedia: 包含音频,视频编辑器,mp3播放器等。
apps: 电子表格或字处理程序(不是文本编辑器)以及 CAD 程序和图像程序如 Gimp 都属于这个组。apps 组有点像 utils,但它包含的程序更用户友好,比 utils 更流程化和具体化。apps 感觉起来不像 utils 那么野和令人讨厌。例如 Emacs 就应该属于 utils.
addons: 插件,过滤器以及类似的东东,特征是它们都需要与其他软件包一起使用。
x: 与整个 X Window 系统相关的软件,并且不符合其他组,比如 X 服务器本身以及窗口管理器。多数 X 软件应该放到更具体的组里。如 xmine 这样的游戏应该属于 games 组,有图形界面的文本编辑器应该属于 utils 组。
kde: 与 KDES 相关并且不属于任何其他组的软件包。应该谨慎的使用这个组,不要把所有的 KDE 软件包都放在这个组里。比如 K Office 就属于 apps 组。Konqueror 属于 net.
gnome: 与 GNOME 相关并且不属于任何其他组的软件包。应该谨慎的使用这个组,不要把所有的 GNOME 软件包都放在这个组里。比如 Gimp 属于 apps. GNOME 兼容的窗口管理器,如果能用在单纯的 X 下,属于 x 组。
下面是我认为比较合适的 LFS 软件包分组列表。通常用户名称应该是源码压缩包去掉后缀名和版本号后的名字。下面的分组尽量符合上面的规则,但有的时候真的很难找出"正确"的组。列表里还包含了我在安装它们时做的一些记录。如果你使用 mkdir, chgrp 和 install 包装脚本,你就应该没什么问题了。
glibc.system:
MAKEDEV: 不要安装成 package user
man-pages.docs
findutils.utils
mawk.devel:
rm /usr/bin/mawk /usr/share/man/man1/mawk.1
as root before `make install'
ncurses.system
vim.utils
ed.utils
gcc.devel:
在运行`make install'前把 /usr/lib/gcc-lib 和 /usr/include/g++ 分配给 gcc package user,命令如下(作为root)
chown -R gcc. /usr/lib/gcc-lib /usr/include/g++
bison.devel
less.utils
groff.utils
man.utils
perl.utils
m4.devel
texinfo.utils
autoconf.devel
automake.devel:
创建目录 /usr/share/aclocal. 这个目录是其他软件包可写的,所以安装后要用 chgrp 和 chmod g+w,o+t 来改变属组和权限.
bash.system:
当以 package user 身份运行 ./configure 时(更确切的说是在 su 环境里时),它会不能正常检测到 /dev/stdin. 这会让 bash 编译成 /dev/std* 和 /dev/fd/* 的模拟(emulation)。我实际上更喜欢这种模拟,因为它符合 man 手册页上的描述,但不能完全正常的工作(如打开各自的设备)。如果你想要一个正常的 bash,就用 sed 来修改 configure 脚本,把 "test -r /dev/stdin" 换成 "test -e /dev/stdin" (对 /dev/fd 也一样).[这是对于 bash 2.05 来说,我已经报告了这个问题,所以在以后的版本里可能已经修正了。]
flex.devel
file.utils
libtool.devel
bin86.devel
binutils.devel
bzip2.utils
gettext.system
kbd.system
diffutils.utils
e2fsprogs.utils
fileutils.system
grep.utils
gzip.utils
lilo.system
make.devel:
make 想设置成 setgie kmem,以使 -l 参数可用。如果你不是知道这个参数作用的开发者,就不需要它,不用为 make 设置这个特殊权限。
[更新] 在 Linux 系统上,即使不 setgid kmem,-l 参数也能工作。
linux kernel: 不作为 package user 安装
modutils.system:
modutils 在使用模块前会检测模块是否属于 root.这就是用 root 而不是 package user 来编译和安装内核的原因。
netkit-base.net
patch.utils
procinfo.utils
procps.utils
psmisc.utils
sed.utils
sh-utils.system
net-tools.net
shadow.system:
这个软件包会安装比较多的 setuid 程序。如果你对 package user 不是宗教一样的信仰,可能应该用 root.root 来安装,这样简单些。如果你作为 package user 来安装,在安装后别忘了手动把出问题的程序设置成 setuid root 的。在安装了 shadow 后,确定一下 useradd 和 groupadd 脚本已经被正确的替换了。运行
find / -maxdepth 3 -name groupadd
来确定你没有两个程序(比如一个在 /sbin 目录下而另一个在 /usr/sbin 目录下)
sysklogd.system
这个软件包里的 /usr/bin/install 是硬编码的,所以用
make INSTALL=install install
来安装,可以保证它使用包装脚本.
sysvinit.system:
这个包最棘手。在执行"make install"前,你必须作为 root 手动创建 /dev/initctl,因为一个 package user 没有 /dev 目录下的写权限。作为 root 运行下列命令:
rm -f /dev/initctl
mknod -m 600 /dev/initctl p
tar.utils
textutils.utils
util-linux.system:
在安装了这个软件包后别忘了手动把 mount 和 umount 设置成 setuid root 的。write 程序需要设置成 setgid tty 的。
###########################################################################
最后的步骤
###########################################################################
在安装完所有东东后,设置 install 目录为 sticky 的:
chmod ug=rwx,o=rxt `cat /tmp/installdirs`
如果你在进入 chroot 前是用普通用户来安装的,那么现在就会有一些目录的属主是那个用户,而它们本应属于某个 package user. 会这样是因为这些 package user 没有或不能重新创建这些目录。下列脚本能修正这个问题。它查找不属于已注册用户的目录(-nouser 参数)。在一个 for 循环里处理这些目录。对于每一个找到的目录,都查找属于某个已注册用户的文件,并列出这些用户。通过"sort -u" (unique) 我们就能得到已注册用户的列表,wc 告诉我们有多少个这样的用户。如果只有一个这样的用户(比如某个目录下所有文件都要么属于一个没有注册的用户,要么属于我们能认出的一个注册用户)那么就把这个目录分给找出的那个注册用户。.
----------------- begin $LFS/usr/src/lfs/fixowner -------------------------
#find all directories owned by an unknown user (i.e. the normal user
#account you installed pre-chroot with, if you installed as a normal
#user) and assign those that have an unambiguous intended owner (i.e.
#only files belonging to a single owner aside from the unknown one
#are found in the directory) to that owner.
get_dir_owners()
owners=`find $1 -not -nouser -printf "%u\n" | sort -u `
num=`echo $owners | wc -w | tr -d " "`
for dir in `find / -path "/proc" -prune -or -type d -nouser -print`
get_dir_owners $dir
if [ $num == 1 ]; then
chown `echo $owners | tr -d " "`. $dir
chmod u=rwx,go=rx $dir
echo "Assigning $dir to $owners"
----------------- end $LFS/usr/src/lfs/fixowner ---------------------------
最后你需要用 find 来查找那些仍然属于 chroot 前所用用户的文件。你也可以用 find 来查找任何同组可写而又没有设置 sticky 位的目录。你还应该找出那些设置了 setuid
和 setgid 而属主又不是 root 的程序。使用常规方法来处理这些文件(或者给我一封信,我就能在这里提到你所遇到的问题)。
find / -path "/proc/*" -prune -or -perm +u+s -printf "%p: suid %u\n"
find / -path "/proc/*" -prune -or -perm +g+s -printf "%p: sgid %g\n"
find / -path "/proc/*" -prune -or \
-type d -perm +o+w -not -perm +o+t -printf "%p: world-writeable\n"
find / -path "/proc/*" -prune -or -type d -perm +g+w -not -perm +o+w \
-not -perm +o+t -printf "%p: group-writeable\n"
find / -path "/proc/*" -prune -or \
-not -type d -not -type l -perm +o+w -printf "%p: world-writeable\n"
find / -path "/proc/*" -prune -or -path "/dev/*" -prune -or \
-not -type d -not -type l -perm +g+w -not -perm +o+w \
-printf "%p: group-writeable\n"
find / -path "/proc/*" -prune -or -nouser -printf "%p: unknown user: %u\n"
find / -path "/proc/*" -prune -or -nogroup -printf "%p: unknown group: %g\n"
###########################################################################
使用 NFS 时的安全问题
###########################################################################
如果你使用网络文件系统 NFS,要用本文描述的 package user 系统,需要注意下面几件事情。NFS 中最基本的安全问题在于它盲目的相信客户端的 uid 和 gid。如果攻击者能取得网络中某个能加载服务器上 NFS 的系统的 root 帐号,或者攻击者把自己的机子连到了你的网络上,那么它就能假装成任何人。NFS 会高兴地允许攻击者在 NFS 共享的目录里以任何用户的身份来工作,除了 root 身份。缺省情况下,NFS 用 root_squash 参数导出目录,把从 uid 0 收到的所有请求映射到 anonuid (如果没有在 /etc/exports 中设置的话就是65534)同时把 gid 0 映射到 anongid(如果没有在 /etc/exports 中设置的话就是65534).这样能保护 root.root拥有的文件。在正常的系统里,这样差不多就包含了所有 /bin, /etc, /lib
以及其他目录下的文件,除了/home. 但是如果你使用 package user 策略,大多数文件都是 package users 拥有的,这些文件不会被 root_squash 参数保护。为了使 NFS 导出更安全,你需要在 /etc/exports 的每一个项目里都加上参数"all_squash",以导出一个包含了 package user 文件的目录。注意 all_squash 总是个好主意,因为即使系统不使用 package user,通常也会有一些程序属主为其他用户,比如守护进程和 bin,还有些程序的属主是其他组,比如 tty,因为它们需要 setuid 或 setgid.
LFS全套中文文档:http://lfs.linuxsir.org(主力)&br /&
LFS 英文站点镜像:http://lfs.&br /&
二笔输入法 for Linux: http://ebf.
注册时间 00:27:20
最后登录 10:16:45
用户头衔:注册会员
状态:我不在线
精品!这种玩法才有意思,除了LFS在其它linux发布版下应该也可以用,管理自己的“小金库”,我去在Debian下试试..........
http://211.92.88.40/~lyoo/bookmark/bookmark.html
注册时间 00:25:00
最后登录 04:14:26
用户头衔:资深版主
状态:我不在线
没错,这个东西挺有意思的,研究中……
相关资源,是tushar T自己做的脚本,思路基本与上面的hint一致,不过增加了一些特性,比如记录编译啊这些,还能下载,自动安装。越看越像 portage 了。还没看懂怎么装……
LFS全套中文文档:http://lfs.linuxsir.org(主力)&br /&
LFS 英文站点镜像:http://lfs.&br /&
二笔输入法 for Linux: http://ebf.
注册时间 00:25:00
最后登录 04:14:26
用户头衔:资深版主
状态:我不在线
写信问了tushar,他给了一点指导,继续研究……
下面是信的内容:
Xinkui Hao wrote:
&I've read the pkg user hint and your pkg-user-bridge scripts.I found
&there are so many enhancement and want to immediately use your scripts
&in my system.
&But,how do I install the first two package:pkg-user-bridge and
&lfs-scripts?I've noticed that there is a script named Bootstrap,but it's
&bootstrap to a new plfs build.In order to do that,firstly I need
&lfs-scripts.Is it possibe that I simply copy files according to the
&lfs-scripts.build file and don't undermine the ownerships etc?
Sorry, I have been putting off writing documentation for the build
system:( But in my defense, there is a lot of "events" at my end and I
didn't know anyone would be interested:) Hopefully this e-mail will act
in lieu of a complete doc till I get time to make a formal doc with more
detailed explainations.
The first task would be to follow the Bootstrap script to create the
stage1 build. This script in the data/lfs/lfs-scripts.tar.bz2 tarball.
Since the Bootstrap command is coded to begin from a Pkg-user based
system, it would be easiest to execute the commands manually to create
the stage1 directory (PS: I renamed the /stage1 to /bootstrap).
Once the /bootstrap directory is complete, create the partition for LFS,
format it and move /bootstrap to $LFS/bootstrap.
Also copy over the entire data directory from the website to
/var/lib/pkg-user/data. I think the BootStrap hint does that, but I am
Now follow the instructions in the ChrootLFS script to chroot into the
LFS partition.
Inside the chroot, run the Genesis script which will create all the
things that you need to do before you begin with the installation of the
first package (glibc).
Following the order of the PLFS packages, install each package similar
to the glibc installation discussed below.
* PkgInstall "GNU C Library" glibc -& This will create the pkg-user
for the package and set up the home directory, link to its build
directories, etc. Note that you will have to use the same pkg
names I used. Also you will need to copy the pkg tarballs over to
the home directory for each user after it is created.
* StandardBuild glibc 2.3.2 -& This will build glibc using the
instructions in glibc.build file. Check the Build command to
figure out how it does that. It creates installation logs, etc.
The order you would need to follow is:
* linux (The build file recognizes that this is the first time
installing and hence only installs the headers).
Note: The pkg-user user is the user that replaces the install user in
MSB's pkg-user hint.
Once you are done installing the packages, configure and install the
bootloader.
Note that I have replaced some of the packages in LFS with my choice of
packages (pcre + metalog) for syslogd, inetutils for netkit, grub for
(bin86 + lilo).
Check out the scripts in lfs-scripts.tar.bz2 to know what each one does.
Also, before installing each package it would be prudent to check out
the build file to know what it does.
Hope this helps, let me know if you run into any problems.
Tushar Teredesai
tushartATabbnmDOTcom
Extension: 5267
Unsubscribe: send email to [email]listar@linuxfromscratch.org[/email]
and put 'unsubscribe blfs-support' in the subject header of the message
LFS全套中文文档:http://lfs.linuxsir.org(主力)&br /&
LFS 英文站点镜像:http://lfs.&br /&
二笔输入法 for Linux: http://ebf.
注册时间 00:25:00
最后登录 04:14:26
用户头衔:资深版主
状态:我不在线
现在我的系统已经转变成pkg-user的啦,呵呵。
改了不少脚本。不知道有没有人要。
LFS全套中文文档:http://lfs.linuxsir.org(主力)&br /&
LFS 英文站点镜像:http://lfs.&br /&
二笔输入法 for Linux: http://ebf.
注册时间 18:59:07
最后登录 08:44:56
用户头衔:注册会员
状态:我不在线
标题:感兴趣
我也觉得这是个很好的做法。
不知道楼主用了这个办法一年多之后,有没有新的看法?
注册时间 22:19:36
最后登录 12:16:54
用户头衔:注册会员
状态:我不在线
呵,我的计算机里的东西都把安装时的源代码目录存在着,装了什么东西也都做了记录,什么时候不要了就make uninstall,也没觉得麻烦。
版主是不是lfs cvs的管理员,我想加入blfs文档的翻译团队。
======================&br /&
Msn: &br /&
地点:北京&br /&
努力!努力!就一定有结果。&br /&
======================
注册时间 18:59:07
最后登录 08:44:56
用户头衔:注册会员
状态:我不在线
硬盘大的话,存着所有的源代码目录倒也可以。
注册时间 22:19:36
最后登录 12:16:54
用户头衔:注册会员
状态:我不在线
不大的时候可以删掉,把Makefile保存一下,想泄载时直接make uninstall也行。
======================&br /&
Msn: &br /&
地点:北京&br /&
努力!努力!就一定有结果。&br /&
======================
注册时间 18:59:07
最后登录 08:44:56
用户头衔:注册会员
状态:我不在线
这倒也是个好解决方案。我要试一下。 谢谢。
注册时间 00:25:00
最后登录 04:14:26
用户头衔:资深版主
状态:我不在线
pkgusr比较麻烦,尤其是一些老的软件包:(
LFS全套中文文档:http://lfs.linuxsir.org(主力)&br /&
LFS 英文站点镜像:http://lfs.&br /&
二笔输入法 for Linux: http://ebf.
Processed in : 0.070000 second(s) (C)2014LinuxSir -}

我要回帖

更多关于 酷派大神f2内置软件 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信