尝试在 ubuntu 14.04 上使用“lfs”用户执行源命令并得到:
root@linux:~/lfs# su lfs - -c "source ~/.bash_profile"
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
背景信息:我正在关注 LFS 的书,用它制作一个脚本,所以在我用 sudo 执行的脚本中,当它到达这部分时,在创建 lfs 用户和他的 .bashrc 和 .bashprofile 之后,我猜它正在加载它。
echo "info: create 'lfs' group and user..."
groupadd -f lfs
id -u lfs &>/dev/null || useradd -s /bin/bash -g lfs -m -k /dev/null lfs
passwd -d -q lfs
echo "info: make 'lfs' own the 'tools' and 'sources' directories..." …
Run Code Online (Sandbox Code Playgroud) 我编写了一个示例脚本来拆分字符串,但它没有按预期工作
#!/bin/bash
IN="One-XX-X-17.0.0"
IFS='-' read -r -a ADDR <<< "$IN"
for i in "${ADDR[@]}"; do
echo "Element:$i"
done
#split 17.0.0 into NUM
IFS='.' read -a array <<<${ADDR[3]};
for element in "${array[@]}"
do
echo "Num:$element"
done
Run Code Online (Sandbox Code Playgroud)
输出
One
XX
X
17.0.0
17 0 0
Run Code Online (Sandbox Code Playgroud)
但我预计输出是:
One
XX
X
17.0.0
17
0
0
Run Code Online (Sandbox Code Playgroud) 我安装了 Linux Mint 14 作为我唯一的操作系统。我有一个包含 /swap、/ 和 /home 的扩展分区,我的驱动器上还有一些未分配的空间。
我猜 Mint 决定把这一切都放在一个扩展分区上,而不是三个主分区上。
所以我想使用我的一些未分配空间从头开始构建 Linux。 我的第一个问题是,我是否需要为每个发行版都有一个交换分区,或者 LFS 可以使用我已经拥有的交换分区吗?如果是这样,交换分区必须是主分区,还是无关紧要?
主分区和逻辑分区之间有什么实际区别吗?
关于定义的问题: 扩展分区是否只是包含逻辑分区的主分区?
最后,自从删除了 Windows 7(sda 1-3),我的 Linux 分区仍然编号为 5-7。如果我创建一个新分区,它会被称为 sda1 吗?
我参加了 LFS 7.6。我想知道是否可以将其制作成可以引导到不同系统的可引导磁盘映像?
执行时出现以下错误 make tooldir=/usr
../../binutils-2.22/libiberty/regex.c:130:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
../../binutils-2.22/libiberty/regex.c:130:7: warning: conflicting types for built-in function 'malloc' [enabled by default]
../../binutils-2.22/libiberty/regex.c:131:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
../../binutils-2.22/libiberty/regex.c:131:7: warning: conflicting types for built-in function 'realloc' [enabled by default]
In file included from /usr/include/bits/string2.h:1296:0,
from /usr/include/string.h:633,
from ../../binutils-2.22/libiberty/regex.c:149:
/usr/include/stdlib.h:470:14: error: conflicting types for 'malloc'
../../binutils-2.22/libiberty/regex.c:130:7: note: previous declaration of 'malloc' was here
In file included from ../../binutils-2.22/libiberty/regex.c:638:0:
../../binutils-2.22/libiberty/regex.c: In function 'byte_regex_compile':
../../binutils-2.22/libiberty/regex.c:2439:7: warning: implicit declaration of function 'free' …
Run Code Online (Sandbox Code Playgroud) 在完成 Linux From Scratch 之后,我有一种怪异的感觉,在实践中,这不是新发行版的构建方式。
如何搜索其他发行版使用的工具?Debian 真的是从头开始构建的吗?谷歌搜索“Linux 发行版构建工具”并不是很有成效。
以下是我在 LFS 或 Google 上都找不到的一些问题:
LFS 很酷,但它没有回答我的许多实际问题。我在哪里可以找到更多信息?特别是,我可以在 google 搜索中使用哪些关键字来查找有关可用于构建 linux 发行版的工具的信息?有没有像 LFS 这样的书更侧重于分支现有发行版而不是学习构建过程?
聚苯乙烯
我遇到过 SUSE Studio 等,但这些工具要求您锁定在该特定发行版中,并且只能提供程序允许的最大灵活性。在 SUSE Studio 之前,人们是如何从 SUSE linux 分支的?
我正在尝试在我的主机 Linux Mint 机器上构建一个 Linux From Scratch 系统。然而,当我运行version-check.sh文件,它返回我的系统缺失libgmp.la
,libmpfr.la
以及libmpc.la
,即使我有libgmp10
,lipmpc3
和libmpfr4
。这是版本检查的输出:
bash, version 4.2.45(1)-release
/bin/sh -> /bin/dash
Binutils: (GNU Binutils for Ubuntu) 2.23.52.20130913
bison (GNU Bison) 2.7.12-4996
/usr/bin/yacc -> /usr/bin/bison.yacc
bzip2, Version 1.0.6, 6-Sept-2010.
Coreutils: 8.20
diff (GNU diffutils) 3.2
find (GNU findutils) 4.4.2
GNU Awk 4.0.1
/usr/bin/awk -> /usr/bin/gawk
gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
g++ (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
(Ubuntu EGLIBC 2.17-93ubuntu4) 2.17
grep (GNU grep) 2.14
gzip 1.6
Linux version 3.11.0-12-generic …
Run Code Online (Sandbox Code Playgroud) 是否有可能从头开始开发一个基于Nix(包管理器,而不是 nixos 发行版)的 Linux 系统?进一步来说:
AFAIK Nix 提供了 glibc、gcc、linux 内核等基础设施包。这是否意味着不需要像 LFS 那样手动构建这些包?
Nixos 本身使用 systemd,但我知道not-os,它基于 runit。nixpkg 软件包对 systemd 的依赖程度如何?
Nixos 似乎仅支持 grub 作为引导加载程序。可以将 EFI-stub 引导与 dracut 或手工卷起的 initcpio 一起与 Nix 一起使用吗?
如果您好奇,这就是原因:
我喜欢 gentoo 的 USE 标志,但是有点厌倦了 gentoo 频繁的依赖地狱和世界重新编译(特别是在 python 版本控制方面,尽管这本质上不是 gentoo 的错,哈哈)。因此,我正在寻找一个包管理器,它对基于源的包和二进制包都有很好的支持,并且具有更简单的依赖关系处理。我在 Arch (Artix) 和 Void 之间徘徊,但在这两种情况下都必须手动管理源包。最后我发现尼克斯非常适合。
纯粹出于乐趣和美观的原因,我想尝试一个非 systemd 发行版。
我更喜欢 EFI 存根。
我使用 ZFS 作为根文件系统,它需要特殊的 initcpio。
我尝试使用Linux From Scratch (LFS) 网站创建 Linux 发行版。一切顺利,直到第5.7步。Glibc-2.19,但是当我尝试时:
$LFS_TGT-gcc dummy.c
Run Code Online (Sandbox Code Playgroud)
我得到:
/tools/lib/gcc/i686-lfs-linux-gnu/4.8.2/../../../../i686-lfs-linux-gnu/bin/ld: cannot find crt1.o: No such file or directory
/tools/lib/gcc/i686-lfs-linux-gnu/4.8.2/../../../../i686-lfs-linux-gnu/bin/ld: cannot find crti.o: No such file or directory
Run Code Online (Sandbox Code Playgroud)
所以我用谷歌搜索了一段时间,我意识到 Debian 改变了一些目录,我搜索了这些文件,我在以下位置找到了它们:
/usr/libx32/
Run Code Online (Sandbox Code Playgroud)
我从这些搜索中意识到,尝试在 32 位结构中编译 64 位时会发生这种情况,我应该在以下位置创建主题的虚拟链接:
/tools/lib/gcc/i686-lfs-linux-gnu/4.8.2/
Run Code Online (Sandbox Code Playgroud)
但是当我这样做时,我得到了:
/tools/lib/gcc/i686-lfs-linux-gnu/4.8.2/crt1.o: file not recognized: File format not recognized
Run Code Online (Sandbox Code Playgroud)
在这一步我真的不知道下一步该怎么做。我该如何解决?
我正在尝试将apt-get
包管理器添加到 LFS (LINUX FROM SCRATCH) 系统。我找到了一个解决方案,解释了如何为 LFS '编译 apt-get 和 dpkg '。但它很旧而且无法使用。我搜索了apt-get
源代码并在debian.org上找到了它。它是 Debian 版本apt
。我已经下载了apt-0.8.10.3.deb
软件包并将其内容解压到LFS的根目录中。当我的 LFS 系统启动并输入 时apt-get
,会显示此错误:
E: Unable to determine a suitable packaging system type.
Run Code Online (Sandbox Code Playgroud)
apt-get
到 LFS 并使其正常工作?