switch_root com systemd: “Muitos níveis de links simbólicos”

1

Eu estou tentando inicializar uma construção de kernel e sistema operacional proprietários após uma atualização para a libc e várias outras ferramentas. Eu estou inicializando usando um initramfs no kernel 3.2.0 com alguns utilitários, como o busybox. No entanto, devido às atualizações do udev 172 e do systemd 43, há mudanças significativas em como o systemd parece estar estruturado. Eu costumava inicializar usando init=/bin/systemd , agora que parece ser /usr/lib/systemd/systemd , no entanto, apenas alterar o valor de init não funciona, já que recebo esse erro e o kernel panic:

# 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>]

Alguém tem alguma idéia se o erro de links simbólicos está vindo do switch_root do busybox ou do processo /usr/lib/systemd/systemd inicial?

Estou assumindo que o switch_root tem problemas para interpretar algo, mas é provável que não tenha configurado corretamente.

Eu só estou chegando vazio com idéias sobre como depurar isso.

Aqui está a saída ls -ld (desculpe pelos comentários confusos abaixo):

# 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

Aqui está a strace output:

# 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, "7ELF
# 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>]
# 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
# 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, "7ELF%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%(%pre%%pre%%pre%%pre%0g%pre%04%pre%%pre%%pre%"..., 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>]
%pre%%pre%%pre%%pre%%pre%%pre%(%pre%%pre%%pre%%pre%0g%pre%04%pre%%pre%%pre%"..., 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>]

Infelizmente, não consigo encontrar nenhuma informação útil nisso. Observando o código do busybox, ele faz um chroot , limpa o antigo diretório montado e executa um comando execv with my init .

    
por Gatica 12.04.2016 / 15:17

0 respostas