これは日々の作業を通して学んだことや毎日の生活で気づいたことをを記録しておく備忘録である。
HTML ファイル生成日時: 2025/07/30 08:17:51.269 (台灣標準時)
https://www.netbsd.org/docs/guide/en/chap-updating.html の記述に従って NetBSD-10.0 から 10.1 にバージョンを上げてみるでござる。
まず、新しい userland を構築するでござる。
% su -m - # cd /usr/src # ./build.sh -j 6 -O ../obj -T ../tools -U distribution ..... ===> Summary of results: build.sh command: ./build.sh -j 6 -O ../obj -T ../tools -U distribution build.sh started: Mon Jul 14 09:40:17 CST 2025 NetBSD version: 10.1_STABLE MACHINE: amd64 MACHINE_ARCH: x86_64 Build platform: NetBSD 10.0_STABLE amd64 HOST_SH: /bin/sh MAKECONF file: /etc/mk.conf TOOLDIR path: /usr/src/../tools DESTDIR path: /usr/src/../obj/destdir.amd64 RELEASEDIR path: /usr/src/../obj/releasedir Updated makewrapper: /usr/src/../tools/bin/nbmake-amd64 Successful make distribution build.sh ended: Mon Jul 14 11:19:44 CST 2025 ===> .
次に、新しいカーネルを作るでござる。
# cd /usr/src/sys/arch/amd64/conf # cp -pi GENERIC MITAKA_GEN_20250714 # vi MITAKA_GEN_20250714 # cd /usr/src # ./build.sh -j 6 -O ../obj -T ../tools -U kernel=/usr/src/sys/arch/amd64/conf/MITAKA_GEN_20250714 ..... ===> Summary of results: build.sh command: ./build.sh -j 6 -O ../obj -T ../tools -U kernel=/usr/src/sys/arch/amd64/conf/MITAKA_GEN_20250714 build.sh started: Mon Jul 14 11:24:50 CST 2025 NetBSD version: 10.1_STABLE MACHINE: amd64 MACHINE_ARCH: x86_64 Build platform: NetBSD 10.0_STABLE amd64 HOST_SH: /bin/sh MAKECONF file: /etc/mk.conf TOOLDIR path: /usr/src/../tools DESTDIR path: /usr/src/../obj/destdir.amd64 RELEASEDIR path: /usr/src/../obj/releasedir Updated makewrapper: /usr/src/../tools/bin/nbmake-amd64 Building kernel without building new tools Building kernel: /usr/src/sys/arch/amd64/conf/MITAKA_GEN_20250714 Build directory: /usr/src/../obj/sys/arch/amd64/compile/MITAKA_GEN_20250714 Kernels built from /usr/src/sys/arch/amd64/conf/MITAKA_GEN_20250714: /usr/src/../obj/sys/arch/amd64/compile/MITAKA_GEN_20250714/netbsd build.sh ended: Mon Jul 14 11:34:26 CST 2025 ===> .
カーネルモジュールを作るでござる。
# ./build.sh -j 6 -O ../obj -T ../tools -U modules ..... ===> Summary of results: build.sh command: ./build.sh -j 6 -O ../obj -T ../tools -U modules build.sh started: Mon Jul 14 11:38:15 CST 2025 NetBSD version: 10.1_STABLE MACHINE: amd64 MACHINE_ARCH: x86_64 Build platform: NetBSD 10.0_STABLE amd64 HOST_SH: /bin/sh MAKECONF file: /etc/mk.conf TOOLDIR path: /usr/src/../tools DESTDIR path: /usr/src/../obj/destdir.amd64 RELEASEDIR path: /usr/src/../obj/releasedir Updated makewrapper: /usr/src/../tools/bin/nbmake-amd64 Building modules without building new tools Building kernel modules for NetBSD/amd64 10.1_STABLE Successful build of kernel modules for NetBSD/amd64 10.1_STABLE build.sh ended: Mon Jul 14 11:44:54 CST 2025 ===> .
新しく作ったカーネルモジュールをインストールするでござる。
# ./build.sh -O ../obj -T ../tools -U installmodules=/ ..... ===> Summary of results: build.sh command: ./build.sh -O ../obj -T ../tools -U installmodules=/ build.sh started: Mon Jul 14 13:52:46 CST 2025 NetBSD version: 10.1_STABLE MACHINE: amd64 MACHINE_ARCH: x86_64 Build platform: NetBSD 10.0_STABLE amd64 HOST_SH: /bin/sh MAKECONF file: /etc/mk.conf TOOLDIR path: /usr/src/../tools DESTDIR path: /usr/src/../obj/destdir.amd64 RELEASEDIR path: /usr/src/../obj/releasedir Updated makewrapper: /usr/src/../tools/bin/nbmake-amd64 Successful installmodules to / build.sh ended: Mon Jul 14 13:53:02 CST 2025 ===> .
新しく作ったカーネルをインストールするでござる。
# file /usr/obj/sys/arch/amd64/compile/MITAKA_GEN_20250714/netbsd /usr/obj/sys/arch/amd64/compile/MITAKA_GEN_20250714/netbsd: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, for NetBSD 10.1, not stripped # cp -pi /netbsd /netbsd.old # cp -pi /usr/obj/sys/arch/amd64/compile/MITAKA_GEN_20250714/netbsd /netbsd overwrite /netbsd? y # ls -l /netbsd* -rwxr-xr-x 1 root wheel 29529616 Jul 14 11:34 /netbsd -rwxr-xr-x 1 root wheel 29513648 Jul 30 2024 /netbsd.old
新しいカーネルで起動するでござる。
# shutdown -r now
新しいカーネルで起動できたかどうか確認してみるでござる。
# uname -srmp NetBSD 10.1_STABLE amd64 x86_64
ユーザーランドをインストールするでござる。
# cd /usr/src # ./build.sh -O ../obj -T ../tools -U install=/ ..... ===> Summary of results: build.sh command: ./build.sh -O ../obj -T ../tools -U install=/ build.sh started: Mon Jul 14 14:06:17 CST 2025 NetBSD version: 10.1_STABLE MACHINE: amd64 MACHINE_ARCH: x86_64 Build platform: NetBSD 10.1_STABLE amd64 HOST_SH: /bin/sh MAKECONF file: /etc/mk.conf TOOLDIR path: /usr/src/../tools DESTDIR path: /usr/src/../obj/destdir.amd64 RELEASEDIR path: /usr/src/../obj/releasedir Updated makewrapper: /usr/src/../tools/bin/nbmake-amd64 Successful installworld to / build.sh ended: Mon Jul 14 14:07:02 CST 2025 ===> .
設定ファイルを更新するでござる。
# /usr/sbin/postinstall -s /usr/src check ..... postinstall checks passed: atf autofsconfig blocklist bluetooth catpages ddbonpanic dhcpcd dhcpcdrundir envsys fontconfig gid gpio hosts iscsi makedev manconf motd named opensslcertsconf pam periodic pf ptyfsoldnodes pwd_mkdb rc ssh tcpdumpchroot uid varrwho varshm wscons x11 xkb postinstall checks failed: defaults mtree opensslcertsrehash obsolete To fix, run: sh /usr/sbin/postinstall -s /usr/src -d / fix defaults mtree opensslcertsrehash obsolete Note that this may overwrite local changes. # /usr/sbin/postinstall -s /usr/src -d / fix defaults mtree opensslcertsrehash obsolete ..... postinstall fixes passed: defaults mtree obsolete postinstall fixes failed: opensslcertsrehash # /usr/sbin/etcupdate -s /usr/src ..... x11 check: xkb check: obsolete check: postinstall checks passed: atf autofsconfig blocklist bluetooth catpages ddbonpanic defaults dhcpcd dhcpcdrundir envsys fontconfig gid gpio hosts iscsi makedev manconf motd mtree named opensslcertsconf pam periodic pf ptyfsoldnodes pwd_mkdb rc ssh tcpdumpchroot uid varrwho varshm wscons x11 xkb obsolete postinstall checks failed: opensslcertsrehash To fix, run: sh /usr/sbin/postinstall -s /usr/src -d / fix opensslcertsrehash Note that this may overwrite local changes. *** All done
これでよいようでござる。