Boot path should always try to set hardware clock, but not err out
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- linux, shell
調査の方向性
03-console-setup.sh と hwclock --systz の呼び出しから始めます。HARDWARECLOCK が未設定の場合、および hwclock がサポートされていない操作を報告した場合の動作を確認します。完了条件は、想定されるその失敗に対して emergency_shell に移行せず、デフォルトでカーネルのタイムゾーン設定が試行されることです。
索引モデルが issue の本文から書いたものです。
説明
From #musl:
16:53 <arnd> khem, ericonr: they sort-of have a point that the situation is broken: the kernel's behavior is absurdly broken but kept for backwards compatibility with a hack that dates back to the early 1990s. Whichever program calls settimeofday the first time after boot decides whether the kernel uses normal UTC behavior or MS-DOS compatible RTC-is-localtime.
16:54 <arnd> If /sbin/init doesn't do this but something else calls settimeofday() with a non-zero TZ offset later, it all goes wrong
16:55 <arnd> So if settimeofday() is either not available (on rv32) or disabled and returns -ENOSYS, the init task should just continue
16:57 <ericonr> arnd: I assume the kernel is hardcoded to use UTC on such on such archs?
16:58 <arnd> yes, the logic to do the timewarp is still there, but there are no other callers
16:59 <ericonr> I guess you still need to call it where available, otherwise some other application can force a sudden time warp >.<
16:59 <arnd> I don't think there are any distros that actually try to use the timewarp code, though setting the kernel timezone is still done sometimes
17:00 <arnd> any sane /sbin/init implementation does the same as the busybox variant
From 03-console-setup.sh:
if [ -n "$HARDWARECLOCK" ]; then
msg "Setting up RTC to '${HARDWARECLOCK}'..."
TZ=$TIMEZONE hwclock --systz \
${HARDWARECLOCK:+--$(echo $HARDWARECLOCK |tr A-Z a-z) --noadjfile} || emergency_shell
fi
This means that
- we only try to set the kernel timezone when
HARDWARECLOCKis set, which means a badly behaved application can force a time warp by callingsettimeofday(0, some_tz)as root. - our
initof choice, runit, never callssettimeofday(), which means for safety reasons we should always try to set the kernel timezone, and defaulting toUTCis entirely reasonable. - On some archs (and maybe at some point even some kernels?), this command can error out, so
|| emergency_shellis also wrong there.
- 主要言語
- C
- スター
- 245
- フォーク
- 67
- 平均マージ
- 2日
- マージ済み PR(30日)
- 2
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
void-linux/void-runit のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
void-linux/void-runit#135 · コメント 10 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
void-linux/void-runit#127 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
void-linux/void-runit#125 · コメント 4 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
void-linux/void-runit#120 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
void-linux/void-runit#119 · コメント 7 件 ·
void-linux/void-runit の issue をすべて見る
似ている issue
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 60/100
-
Nmap
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
flang:fir-hlfir
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
llvm/llvm-project#225935 ·