libcや他の多くのツールにアップグレードした後、独自のカーネルビルドとオペレーティングシステムを起動しようとしています。私は3.2.0カーネルのinitramfsといくつかのユーティリティ(busyboxなど)を使って起動します。しかし、udev 172とsystemd 43の更新によってsystemd
構造が大幅に変更されたようです。以前はbootを使用していましたが、init=/bin/systemd
今はそうです/usr/lib/systemd/systemd
。ただし、init
このエラーとカーネルパニックが発生するため、値を変更するだけでは機能しません。
# exec /bin/busybox switch_root /mnt/rootfs /usr/lib/systemd/systemd ro rootwait
BusyBox v1.20.2 (2014-05-28 13:23:51 IST) multi-call binary.
Usage: switch_root [-c /dev/console] NEW_ROOT NEW_INIT [ARGS]
Unmounting /proc
Executing switch_root and spawning init
switch_root: can't execute '/usr/lib/systemd/systemd': Too many levels of symbolic links
[49290.074730] Kernel panic - not syncing: Attempted to kill init!
[49290.093029] Backtrace:
[49290.100574] Function entered at [<c0017160>] from [<c0410744>]
[49290.118584] r6:4024473c r5:cf01bc00 r4:c0cdbb08 r3:60000013
[49290.136081] Function entered at [<c041072c>] from [<c04109c0>]
[49290.154074] Function entered at [<c0410950>] from [<c003e240>]
[49290.172069] r3:c0cac4a4 r2:0000001c r1:00000001 r0:c0457748
[49290.189560] r7:000000f8
[49290.197366] Function entered at [<c003dbdc>] from [<c003e348>]
[49290.215360] r7:000000f8
[49290.223152] Function entered at [<c003e2f4>] from [<c003e3b8>]
[49290.241147] r4:00000001 r3:00000001
[49290.252176] Function entered at [<c003e3a0>] from [<c0013a80>]
busyboxのswitch_rootまたは起動/usr/lib/systemd/systemd
プロセスでシンボリックリンクエラーが発生したかどうかを知っている人はいますか?
私はswitch_rootが何かを解釈するのに問題があると仮定していますが、systemdを正しく設定していない可能性があります。
私はこれをデバッグする方法を知りません。
ls -ld
出力は次のようになります(以下に混乱した説明があるので申し訳ありません)。
# ls -ld /mnt/rootfs/usr/lib/systemd/
drwxrwxr-x 7 0 0 4096 Jan 8 01:21 /mnt/rootfs/usr/lib/systemd/
#
# ls -ld /mnt/rootfs/usr/lib/systemd/systemd
-rwxr-xr-x 1 0 0 674468 Apr 12 2016 /mnt/rootfs/usr/lib/systemd/systemd
strace
出力は次のとおりです。
# exec strace -f /bin/busybox switch_root /mnt/rootfs /usr/lib/systemd/systemd r
o rootwait
execve("/bin/busybox", ["/bin/busybox", "switch_root", "/mnt/rootfs", "/usr/lib/systemd/systemd", "ro", "rootwait"], [/* 6 vars */]) = 0
brk(0) = 0x1a45000
uname({sys="Linux", node="(none)", ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x400ac000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/tls/v7l/neon/vfp/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/v7l/neon/vfp", 0xbe9d3540) = -1 ENOENT (No such file or directory)
open("/lib/tls/v7l/neon/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/v7l/neon", 0xbe9d3540) = -1 ENOENT (No such file or directory)
open("/lib/tls/v7l/vfp/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/v7l/vfp", 0xbe9d3540) = -1 ENOENT (No such file or directory)
open("/lib/tls/v7l/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/v7l", 0xbe9d3540) = -1 ENOENT (No such file or directory)
open("/lib/tls/neon/vfp/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/neon/vfp", 0xbe9d3540) = -1 ENOENT (No such file or directory)
open("/lib/tls/neon/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/neon", 0xbe9d3540) = -1 ENOENT (No such file or directory)
open("/lib/tls/vfp/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/vfp", 0xbe9d3540) = -1 ENOENT (No such file or directory)
open("/lib/tls/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/lib/tls", 0xbe9d3540) = -1 ENOENT (No such file or directory)
open("/lib/v7l/neon/vfp/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/lib/v7l/neon/vfp", 0xbe9d3540) = -1 ENOENT (No such file or directory)
open("/lib/v7l/neon/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/lib/v7l/neon", 0xbe9d3540) = -1 ENOENT (No such file or directory)
open("/lib/v7l/vfp/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/lib/v7l/vfp", 0xbe9d3540) = -1 ENOENT (No such file or directory)
open("/lib/v7l/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/lib/v7l", 0xbe9d3540) = -1 ENOENT (No such file or directory)
open("/lib/neon/vfp/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/lib/neon/vfp", 0xbe9d3540) = -1 ENOENT (No such file or directory)
open("/lib/neon/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/lib/neon", 0xbe9d3540) = -1 ENOENT (No such file or directory)
open("/lib/vfp/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/lib/vfp", 0xbe9d3540) = -1 ENOENT (No such file or directory)
open("/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\250g\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1242860, ...}) = 0
mmap2(NULL, 1312160, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x400d3000
mprotect(0x401fe000, 65536, PROT_NONE) = 0
mmap2(0x4020e000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x12b) = 0x4020e000
mmap2(0x40211000, 9632, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40211000
close(3) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40214000
set_tls(0x402144c0, 0x40214ba8, 0x4004b000, 0x402144c0, 0x4004b000) = 0
mprotect(0x4020e000, 8192, PROT_READ) = 0
mprotect(0x4004a000, 4096, PROT_READ) = 0
getuid32() = 0
chdir("/mnt/rootfs") = 0
stat64("/", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
stat64(".", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
getpid() = 771
mmap2(NULL, 45056, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x402ba000
mmap2(NULL, 401408, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40307000
brk(0) = 0x1a45000
brk(0x1a67000) = 0x1a67000
munmap(0x40307000, 401408) = 0
munmap(0x402ba000, 45056) = 0
write(2, "BusyBox v1.20.2 (2016-04-12 15:5"..., 41BusyBox v1.20.2 (2016-04-12 15:51:37 IST)) = 41
write(2, " multi-call binary.\n", 20 multi-call binary.
) = 20
write(2, "\nUsage: ", 8
Usage: ) = 8
write(2, "switch_root", 11switch_root) = 11
write(2, " ", 1 ) = 1
write(2, "[-c /dev/console] NEW_ROOT NEW_I"..., 42[-c /dev/console] NEW_ROOT NEW_INIT [ARGS]) = 42
write(2, "\n\n", 2
) = 2
exit_group(1) = ?
+++ exited with 1 +++
Unmounting /proc
Executing switch_root and spawning init
switch_root: can't execute '/usr/lib/systemd/systemd': Too many levels of symbolic links
[ 52.064978] Kernel panic - not syncing: Attempted to kill init!
[ 52.083278] Backtrace:
[ 52.090828] Function entered at [<c0017160>] from [<c0410764>]
[ 52.108828] r6:40259730 r5:cf01bc00 r4:c09c1b08 r3:600b0013
[ 52.126328] Function entered at [<c041074c>] from [<c04109e0>]
[ 52.144324] Function entered at [<c0410970>] from [<c003e240>]
[ 52.162319] r3:c09924a4 r2:00000020 r1:00000001 r0:c0457750
[ 52.179817] r7:000000f8
[ 52.187621] Function entered at [<c003dbdc>] from [<c003e348>]
[ 52.205616] r7:000000f8
[ 52.213410] Function entered at [<c003e2f4>] from [<c003e3b8>]
[ 52.231416] r4:000a0138 r3:ffffffff
[ 52.242451] Function entered at [<c003e3a0>] from [<c0013a80>]
残念ながら、その中に有用な情報が見つかりませんでした。ビジボックスコードを見ると、タスクを実行し、以前のインストールchroot
ディレクトリをクリーンアップしてから、私のコマンドをexecv
使用してinit
タスクを実行します。