요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
진단 개선
init.rst:38-48`kernel_execve()` 결과 기록과 오류 메시지 개선을 위한 후속 작업을 제안합니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
Explaining the "No working init found." boot hang message
=========================================================
:Authors: Andreas Mohr <andi at lisas period de>
Cristian Souza <cristianmsbr at gmail period com>
This document provides some high-level reasons for failure
(listed roughly in order of execution) to load the init binary.
1) **Unable to mount root FS**: Set "debug" kernel parameter (in bootloader
config file or CONFIG_CMDLINE) to get more detailed kernel messages.
2) **init binary doesn't exist on rootfs**: Make sure you have the correct
root FS type (and ``root=`` kernel parameter points to the correct
partition), required drivers such as storage hardware (such as SCSI or
USB!) and filesystem (ext3, jffs2, etc.) are builtin (alternatively as
modules, to be pre-loaded by an initrd).
3) **Broken console device**: Possibly a conflict in ``console= setup``
--> initial console unavailable. E.g. some serial consoles are unreliable
due to serial IRQ issues (e.g. missing interrupt-based configuration).
Try using a different ``console= device`` or e.g. ``netconsole=``.
4) **Binary exists but dependencies not available**: E.g. required library
dependencies of the init binary such as ``/lib/ld-linux.so.2`` missing or
broken. Use ``readelf -d <INIT>|grep NEEDED`` to find out which libraries
are required.
5) **Binary cannot be loaded**: Make sure the binary's architecture matches
your hardware. E.g. i386 vs. x86_64 mismatch, or trying to load x86 on ARM
hardware. In case you tried loading a non-binary file here (shell script?),
you should make sure that the script specifies an interpreter in its
shebang header line (``#!/...``) that is fully working (including its
library dependencies). And before tackling scripts, better first test a
simple non-script binary such as ``/bin/sh`` and confirm its successful
execution. To find out more, add code ``to init/main.c`` to display
kernel_execve()s return values.
Please extend this explanation whenever you find new failure causes
(after all loading the init binary is a CRITICAL and hard transition step
which needs to be made as painless as possible), then submit a patch to LKML.
Further TODOs:
- Implement the various ``run_init_process()`` invocations via a struct array
which can then store the ``kernel_execve()`` result value and on failure
log it all by iterating over **all** results (very important usability fix).
- Try to make the implementation itself more helpful in general, e.g. by
providing additional error messages at affected places.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
No working init found 메시지 개요
1-8`No working init found.` 부팅 정지 메시지 설명
저자는 Andreas Mohr `<andi at lisas period de>`와 Cristian Souza `<cristianmsbr at gmail period com>`입니다.
이 문서는 init 바이너리를 불러오지 못하는 상위 수준의 원인을 대략적인 실행 순서에 따라 설명합니다.
init 로드 실패 원인 1~5
9-371. 루트 파일시스템을 마운트할 수 없음
더 자세한 커널 메시지를 얻으려면 부트로더 설정 파일이나 `CONFIG_CMDLINE`에 `debug` 커널 매개변수를 설정하십시오.
2. 루트 파일시스템에 init 바이너리가 없음
루트 파일시스템 유형이 올바른지, `root=` 커널 매개변수가 올바른 파티션을 가리키는지 확인하십시오. SCSI나 USB 같은 스토리지 하드웨어 드라이버와 ext3, jffs2 같은 파일시스템 드라이버가 커널에 내장되어 있어야 합니다. 또는 모듈로 제공하고 initrd가 미리 불러오게 할 수 있습니다.
3. 콘솔 장치가 손상됨
`console=` 설정 충돌로 초기 콘솔을 사용할 수 없을 수 있습니다. 인터럽트 기반 설정 누락 같은 직렬 IRQ 문제 때문에 일부 직렬 콘솔이 불안정할 수 있습니다. 다른 `console=` 장치나 `netconsole=`을 사용해 보십시오.
4. 바이너리는 있지만 의존성을 사용할 수 없음
init 바이너리에 필요한 `/lib/ld-linux.so.2` 같은 라이브러리가 없거나 손상되었을 수 있습니다. 필요한 라이브러리는 다음 명령으로 확인하십시오.
readelf -d <INIT>|grep NEEDED
5. 바이너리를 불러올 수 없음
바이너리 아키텍처가 하드웨어와 일치하는지 확인하십시오. 예를 들어 i386과 x86_64가 맞지 않거나 ARM 하드웨어에서 x86 바이너리를 불러오려 할 수 있습니다.
셸 스크립트 같은 비바이너리 파일을 불러오려 했다면 shebang 헤더 `#!/...`가 완전히 동작하는 인터프리터를 지정하는지 확인하십시오. 인터프리터의 라이브러리 의존성도 모두 필요합니다.
스크립트를 조사하기 전에 `/bin/sh` 같은 단순한 비스크립트 바이너리를 먼저 실행해 성공 여부를 확인하는 편이 좋습니다. 더 자세히 조사하려면 `init/main.c`에 코드를 추가해 `kernel_execve()` 반환값을 표시하십시오.
문서 개선과 추가 작업
38-48새 실패 원인을 찾으면 이 설명을 확장하고 LKML에 패치를 제출하십시오. init 바이너리를 불러오는 과정은 매우 중요하고 어려운 전환 단계이므로 가능한 한 고통 없이 진단할 수 있어야 합니다.
추가 TODO는 다음과 같습니다.
- 여러 `run_init_process()` 호출을 구조체 배열로 구현하여 `kernel_execve()` 결과값을 저장하고, 실패 시 모든 결과를 순회하며 기록합니다. 사용성에 매우 중요한 개선입니다.
- 영향받는 지점에 추가 오류 메시지를 제공하는 등 구현 자체가 전반적으로 더 유용한 진단 정보를 내도록 개선합니다.
실패 원인
init.rst:1-37실행 순서에 따라 init 로드 실패의 다섯 가지 주요 원인을 설명합니다.