ECS LIZA Z 内蔵 eMMC を使う
はじめに
Fedora25ぐらいの新しいディストリビューションであればインストーラの時点で認識してフォーマット、マウントなどできていると思いますが、コマンドでフォーマットするまでの流れをメモしておきます。
デバイス名を確認する
/dev の下に生成はされていますがどれかはわからないので、 dmesg からデバイス名を探します。
[root@localhost ~]# dmesg | grep mmc [ 3.128699] mmc0: SDHCI controller on PCI [0000:00:1c.0] using ADMA 64-bit [ 3.294539] mmc0: new HS400 MMC card at address 0001 [ 3.299862] mmcblk0: mmc0:0001 DF4032 29.1 GiB [ 3.299969] mmcblk0boot0: mmc0:0001 DF4032 partition 1 4.00 MiB [ 3.300155] mmcblk0boot1: mmc0:0001 DF4032 partition 2 4.00 MiB [ 3.300327] mmcblk0rpmb: mmc0:0001 DF4032 partition 3 4.00 MiB
eMMCサイズが32GBなので、 mmcblk0 が該当します。 mmcblk0boot0, mmcblk0boot1, mmcblk0rpmb はeMMCの内蔵デバイスのようなので無視します。 (正確なうらとりはできていないです。)
[root@localhost ~]# ls -l /dev/mmcblk0 brw-rw----. 1 root disk 179, 0 Apr 7 14:58 /dev/mmcblk0
fdisk コマンドでも確認する
[root@localhost ~]# fdisk -lu Disk /dev/mmcblk0: 29.1 GiB, 31268536320 bytes, 61071360 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes
初期化し利用する
デバイス名が確認できたら、 fdisk -> mkfs.xfs -> マウントポイントの作成 -> マウント で普通に利用できます。
手順では、 xfsにフォーマットしています。
[root@localhost ~]# fdisk /dev/mmcblk0 Welcome to fdisk (util-linux 2.28.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table. Created a new DOS disklabel with disk identifier 0x03c81196. Command (m for help): p Disk /dev/mmcblk0: 29.1 GiB, 31268536320 bytes, 61071360 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x03c81196 Command (m for help): n Partition type p primary (0 primary, 0 extended, 4 free) e extended (container for logical partitions) Select (default p): p Partition number (1-4, default 1): 1 First sector (2048-61071359, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-61071359, default 61071359): Created a new partition 1 of type 'Linux' and of size 29.1 GiB. Command (m for help): p Disk /dev/mmcblk0: 29.1 GiB, 31268536320 bytes, 61071360 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x03c81196 Device Boot Start End Sectors Size Id Type /dev/mmcblk0p1 2048 61071359 61069312 29.1G 83 Linux [root@localhost ~]# ls -l /dev/mmcblk0p1 brw-rw----. 1 root disk 179, 1 Apr 7 14:58 /dev/mmcblk0p1 [root@localhost ~]# mkfs.xfs -f /dev/mmcblk0p1 meta-data=/dev/mmcblk0p1 isize=512 agcount=4, agsize=1908416 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=1, sparse=0 data = bsize=4096 blocks=7633664, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=1 log =internal log bsize=4096 blocks=3727, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 [root@localhost ~]# mkdir /emmc [root@localhost ~]# vi /etc/fstab (省略) /dev/mmcblk0p1 /emmc xfs defaults 1 2 [root@localhost ~]# mount /emmc [root@localhost ~]# df | grep /emmc /dev/mmcblk0p1 30519748 32960 30486788 1% /emmc
以上
ECS LIZA Z にFedora25をインストールする
はじめに
ECS LIZA ZにFedora25をインストールする際は、BIOSの設定変更が必要になります。 その際の設定を参照用にメモしておきます。
BIOS設定を変更する
- BIOS Menu => Boot section を選択する。
- Boot section内の"Operation System Select"を"Linux"へ変更する。
- Boot section内の"Fast Boot"を"Disabled"へ変更する。
蛇足
CentOS 7 16.11 は、設定変更しないでもブートできますが。 チップセットとCPUが対応しておらず、インストーラの起動に20分以上かかります。 (20分ぐらい待っていましたが起動しなかったので諦めているのでももっとかかります。)
おそらくEFI bootを使うようにBIOSすればOKです。
以上
macOSでBootableな起動ディスクを作る
macOSでBootableな起動ディスクを作ります
よく忘れてしまうのでメモ
USBメモリのフォーマット ディスクユーティリティで、”FAT"形式でフォーマットしておきます。
起動させたいLinuxディストリビューションのisoイメージを用意します。
hdiutilコマンドでisoイメージを変換します。
$ hdiutil convert -format UDRW -o CentOS7-x86_64.img CentOS-7-x86_64-Minimal-1611.iso Master Boot Record(MBR: 0)を読み込み中… CentOS 7 x86_64 (Apple_ISO: 1)を読み込み中… (Type EF: 2)を読み込み中… . CentOS 7 x86_64 (Apple_ISO: 3)を読み込み中… ....................................................................................................................... 経過時間: 7.275s 速度: 93.5Mバイト/秒 節約率: 0.0% created: /Users/aohta/Downloads/iso/CentOS7-x86_64.img.dmg
$ diskutil list (...) /dev/disk2 (external, physical): #: TYPE NAME SIZE IDENTIFIER 0: FDisk_partition_scheme *8.0 GB disk2 1: DOS_FAT_32 COS 8.0 GB disk2s1
- 変換したイメージを書き込むためにアンマウントしておきます。
$ diskutil umountDisk /dev/disk2 Unmount of all volumes on disk2 was successful
- USBメモリに変換したイメージを書き込みます。
$ sudo dd if=CentOS7-x86_64.img.dmg of=/dev/disk2 bs=2m
以上
RE: Jenkins と Python の連携
pytest の連携
まず、テスト結果のレポートからです。
Jenkins 側へ追加のプラグインのインストールは不要です。
pytest は、実行時にオプションを渡すことで XUnit 形式のレポートを出力できます。
インストール
$ easy_install -ZU pytest
XUnit 形式の XML でテスト結果を出力する
$ py.test --junitxml=pytest.xml test_sample1.py
pytest の使い方は割愛しますが、コマンドから --junitxml オプションを付与することで
XUnit形式のレポートを出力させることができます。
レポート結果の集約には、ビルド後の処理に、JUnitテスト結果の集計 へチェックをいれ、
出力ファイルとなる pytest.xml を入力します。
coverage 連携
カバレッジの出力には、 Python ライブラリの python-coverage 、
pytest プラグインの pytest-cov 、
Jenkins プラグインの Cobertura Plugin が必要です。
Cobertura Plugin のインストールは、 Jenkins の管理コンソールからインストールします。
$ easy_install -ZU coverage $ easy_install -ZU pytest-cov
$ py.test --cov-report xml --cov sample1 test_sample1.py
テスト結果のレポートと同じように、コマンドへオプションを渡すことで
カバレッジ結果を XML で出力します。
ビルド後の処理に、Cobertura カバレッジ・レポートの集計を実行し、出力ファイルを読み込ませます。
github pages に Sphinx で生成したドキュメントを公開する。
Github Pages にSphinxで生成したドキュメントを公開するほうほうです。
Github Pages では各リポジトリごとにプロジェクトページを作成することができます。
各プロジェクトごとにページを作成することでマニュアルなどの公開が便利にできます。
Sphinx で生成したドキュメントをそのまま公開すると、スタイルシートなど静的ファイルへのリンクが切れてしまいます。
静的ファイルは、ルートからのパスを想定しているためです。
html 生成時にリンクを修正してくれるプラグインが公開されています。
sphinxtogithub を利用すると、 Github Pages 用のリンクに修正してくれます。
利用方法
1. sphinxtogithub をインストールする。
$ easy_install -ZU sphinxtogithub
2. conf.py で、プラグインを有効にする。
extensions = ['sphinxtogithub']
3. make html でプロジェクトを生成しなおす。
以上の手順だけで簡単に Github Pages 対応ができます。