差分
このページの2つのバージョン間の差分を表示します。
次のリビジョン | 前のリビジョン | ||
gadget:raspberry_pi_1b:install_freebsd_11_to_raspi_1b [2017-05-08 11:50] Decomo 作成 |
gadget:raspberry_pi_1b:install_freebsd_11_to_raspi_1b [2017-05-10 17:03] (現在) Decomo |
||
---|---|---|---|
行 7: | 行 7: | ||
* SDHCカード 16GB | * SDHCカード 16GB | ||
- | ===== 手順 ===== | + | ===== 起動用SDカードの作成 |
- | + | ||
- | ==== 起動用SDカードの作成 ==== | + | |
2017-05-05現在、Raspberry Pi 2まではFreeBSD Foundationが公式にディスクイメージを配布しているので、有り難く使わせてもらう。 | 2017-05-05現在、Raspberry Pi 2まではFreeBSD Foundationが公式にディスクイメージを配布しているので、有り難く使わせてもらう。 | ||
行 22: | 行 20: | ||
正常に書き込めてれば、MSDOSBOOT(FAT32)とrootfs(UFS)の2パーティションが出来上がる。 | 正常に書き込めてれば、MSDOSBOOT(FAT32)とrootfs(UFS)の2パーティションが出来上がる。 | ||
- | ==== 起動 ==== | + | ===== 起動 |
+ | ===== 設定 ===== | ||
+ | デフォルトでDHCPクライアントとsshdが有効になっている。SSHでのrootログインは許可されていないが、通常のFreeBSDと違って一般ユーザーfreebsd(パスワード: | ||
+ | |||
+ | 参考までにデフォルトの/ | ||
+ | |||
+ | <file conf / | ||
+ | hostname=" | ||
+ | ifconfig_DEFAULT=" | ||
+ | sshd_enable=" | ||
+ | sendmail_enable=" | ||
+ | sendmail_submit_enable=" | ||
+ | sendmail_outbound_enable=" | ||
+ | sendmail_msp_queue_enable=" | ||
+ | growfs_enable=" | ||
+ | </ | ||
+ | |||
+ | ==== ユーザーとパスワード ==== | ||
+ | |||
+ | rootのデフォルトパスワードが" | ||
+ | <code bash> | ||
+ | # passwd | ||
+ | Changing local password for root | ||
+ | New Password: | ||
+ | Retype New Password: | ||
+ | </ | ||
+ | |||
+ | 更に、一般ユーザーfreebsdのパスワードも忘れずに変更すること。今回はユーザー自体を削除した。 | ||
+ | |||
+ | <code bash> | ||
+ | # rmuser freebsd | ||
+ | Matching password entry: | ||
+ | |||
+ | freebsd: | ||
+ | |||
+ | Is this the entry you wish to remove? y | ||
+ | Remove user's home directory (/ | ||
+ | Removing user (freebsd): mailspool home passwd. | ||
+ | </ | ||
+ | |||
+ | で、代わりにオレオレ一般ユーザーを追加する。 | ||
+ | |||
+ | < | ||
+ | # adduser | ||
+ | Username: Decomo | ||
+ | Full name: | ||
+ | Uid (Leave empty for default): | ||
+ | Login group [Decomo]: | ||
+ | Login group is Decomo. Invite Decomo into other groups? []: wheel | ||
+ | Login class [default]: | ||
+ | Shell (sh csh tcsh nologin) [sh]: | ||
+ | Home directory [/ | ||
+ | Home directory permissions (Leave empty for default): | ||
+ | Use password-based authentication? | ||
+ | Use an empty password? (yes/no) [no]: | ||
+ | Use a random password? (yes/no) [no]: | ||
+ | Enter password: | ||
+ | Enter password again: | ||
+ | Lock out the account after creation? [no]: | ||
+ | Username | ||
+ | Password | ||
+ | Full Name : | ||
+ | Uid : 1001 | ||
+ | Class : | ||
+ | Groups | ||
+ | Home : / | ||
+ | Home Mode : | ||
+ | Shell : /bin/sh | ||
+ | Locked | ||
+ | OK? (yes/no): yes | ||
+ | adduser: INFO: Successfully added (Decomo) to the user database. | ||
+ | Add another user? (yes/no): no | ||
+ | Goodbye! | ||
+ | </ | ||
+ | |||
+ | ==== IPアドレス設定 ==== | ||
+ | |||
+ | IPアドレスは固定で使いたいので、/ | ||
+ | |||
+ | < | ||
+ | ifconfig_DEFAULT=" | ||
+ | ↓ | ||
+ | ifconfig_ue0=" | ||
+ | defaultrouter=" | ||
+ | </ | ||
+ | |||
+ | DHCPが上手く動いてれば/ | ||
+ | <file conf / | ||
+ | nameserver 172.16.0.1 | ||
+ | </ | ||
+ | |||
+ | ==== 時刻の設定 ==== | ||
+ | |||
+ | 標準のRaspberry PiはRTCを持っておらず電源を切ると時刻が狂ってしまうため、NTPはほぼ必須。 | ||
+ | |||
+ | / | ||
+ | |||
+ | <file conf / | ||
+ | server ntp.nict.jp iburst | ||
+ | server ntp.jst.mfeed.ad.jp | ||
+ | </ | ||
+ | |||
+ | / | ||
+ | |||
+ | < | ||
+ | # ntpdを自動起動 | ||
+ | ntpd_enable=" | ||
+ | # システム起動時にntpで時刻を同期する | ||
+ | ntpd_sync_on_start=" | ||
+ | </ | ||
+ | |||
+ | タイムゾーンを日本にする。 | ||
+ | < | ||
+ | # tzsetup | ||
+ | Select local or UTC (Greenwich Mean Time) clock) → Yes | ||
+ | Time Zone Selector → Asia | ||
+ | Countries in Asia → Japan | ||
+ | Confirmation → Yes | ||
+ | </ | ||
+ | |||
+ | 動作確認 | ||
+ | <code bash> | ||
+ | root@rpi-b:/ | ||
+ | Tue Oct 4 00:18:59 JST 2016 | ||
+ | root@rpi-b:/ | ||
+ | 9 May 03:57:06 ntpdate[13204]: | ||
+ | root@rpi-b:/ | ||
+ | Tue May 9 03:57:11 JST 2017 | ||
+ | root@rpi-b:/ | ||
+ | Starting ntpd. | ||
+ | root@rpi-b:/ | ||
+ | | ||
+ | ============================================================================== | ||
+ | | ||
+ | +ntp2.jst.mfeed. 133.243.236.17 | ||
+ | | ||
+ | *sv01.azsx.net | ||
+ | +mmm21.wni.co.jp 172.16.20.210 | ||
+ | </ | ||
+ | |||
+ | ==== pkg ==== | ||
+ | |||
+ | pkgを入れる。 | ||
+ | |||
+ | <code bash> | ||
+ | # pkg | ||
+ | The package management tool is not yet installed on your system. | ||
+ | Do you want to fetch and install it now? [y/N]: y | ||
+ | Bootstrapping pkg from pkg+http:// | ||
+ | Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done | ||
+ | pkg-static: Warning: Major OS version upgrade detected. | ||
+ | Installing pkg-1.10.1... | ||
+ | Extracting pkg-1.10.1: 100% | ||
+ | pkg: not enough arguments | ||
+ | Usage: pkg [-v] [-d] [-l] [-N] [-j <jail name or id>|-c <chroot path>|-r < | ||
+ | |||
+ | For more information on available commands and options see 'pkg help'. | ||
+ | </ |