2015年4月29日水曜日

32bit EFIブートファイルを作成する

WindowsタブレットPC等で採用されているCPU(Intel Atom: xx Trail)は基本的に32bitアーキテクチャであり、最近は例外なくファームウェアとしてUEFIが採用されていることから、この類のものにLinuxをインストールしたい場合は、別途32bit版(U)EFIファイルを用意する必要がある。

環境
  • Ubuntu Server 14.04.2 LTS x64

作業ディレクトリを作成
$ mkdir ~/tmpwork
$ cd ~/tmpwork

必要なパッケージをインストール
$ sudo apt-get update -y
$ sudo apt-get install -y git build-essential
$ sudo apt-get install -y bison libopts25 libselinux1-dev autogen m4 autoconf help2man libopts25-dev flex libfont-freetype-perl automake autotools-dev libfreetype6-dev texinfo

GRUB 2のソースを落としてきてmake
$ git clone git://git.savannah.gnu.org/grub.git
$ cd grub
$ ./autogen.sh
$ ./configure --with-platform=efi --target=i386 --program-prefix=''
$ make

EFIファイルを作成
$ cd grub-core
$ sudo ../grub-mkimage -d . -o bootia32.efi -O i386-efi -p /boot/grub ntfs hfs appleldr boot cat efi_gop efi_uga elf fat hfsplus iso9660 linux keylayouts memdisk minicmd part_apple ext2 extcmd xfs xnu part_bsd part_gpt search search_fs_file chain btrfs loadbios loadenv lvm minix minix2 reiserfs memrw mmap msdospart scsi loopback normal configfile gzio all_video efi_gop efi_uga gfxterm gettext echo boot chain eval

作成したEFIファイルを作業ディレクトリ直下にコピーしておく
$ cp bootia32.efi ~/tmpwork


[参考URL]
Instructions to install Ubuntu 14.10 on ASUS EeeBook X205TA
UEFIBooting - Community Help Wiki

2015年4月26日日曜日

Ubuntu ServerインストーラをUSBメモリに書き込む

環境
  • Ubuntu Server 14.04.2 LTS x64

isoイメージファイルをダウンロード
$ wget http://releases.ubuntu.com/14.04/ubuntu-14.04.2-server-amd64.iso
$ md5 ubuntu-14.04.2-server-amd64.iso 
MD5 (ubuntu-14.04.2-server-amd64.iso) = 83aabd8dcf1e8f469f3c72fff2375195

isoファイルからimgファイルに変換
$ hdiutil convert -format UDRW -o ubuntu-14.04.2-server-amd64.img ubuntu-14.04.2-server-amd64.iso
$ mv ubuntu-14.04.2-server-amd64.img.dmg ubuntu-14.04.2-server-amd64.img

USBメモリを接続してディスク番号を確認
$ diskutil list
$ df -h

USBメモリをアンマウントした上で、rawデバイス指定でimgファイルを書き込む
(下記はディスク番号が「2」の場合)
$ sudo diskutil unmountDisk /dev/disk2
$ sudo dd bs=1m if=ubuntu-14.04.2-server-amd64.img of=/dev/rdisk2
$ sudo diskutil eject /dev/disk2


[参考URL]
How to create a bootable USB stick on OS X | Ubuntu