ラベル Mac の投稿を表示しています。 すべての投稿を表示
ラベル Mac の投稿を表示しています。 すべての投稿を表示

2012年6月29日金曜日

Mac の CLI から ISO イメージを作成する

Mac の CLI(Terminal.app)から ISO イメージを作成する方法です。思いっきり、[コマンド] マックでCDからISOイメージの作り方を参考にさせて頂きました。
$ drutil status
 Vendor   Product           Rev 
 TEAC     DV-W28S-W         L.0A

           Type: DVD-R                Name: /dev/disk2
       Sessions: 1                  Tracks: 1 
   Overwritable:   00:00:00         blocks:        0 /   0.00MB /   0.00MiB
     Space Free:   00:00:00         blocks:        0 /   0.00MB /   0.00MiB
     Space Used:   22:05:32         blocks:    99407 / 203.59MB / 194.15MiB
    Writability: 
      Book Type: DVD-R (v5)
       Media ID: SONY16D1

$ diskutil unmountDisk disk2
Unmount of all volumes on disk2 was successful

$ dd if=/dev/disk2 of=file.iso
397628+0 records in
397628+0 records out
203585536 bytes transferred in 49.532596 secs (4110133 bytes/sec)

$ diskutil mountDisk disk2
Volume(s) mounted successfully

2012年4月21日土曜日

Lion 上で Qemu 0.14.1 を動かす



Mac OS X 10.7.3(Lion)上に Qemu 0.14.1 をインストールした際の自分メモです。こちらを参考にさせて頂きました。

gcc のインストール

まず、非 LLVM な gcc をインストールします。opensource.apple.com から gcc のソースコードをダウンロードし、コンパイル&インストールします。
$ cd /private/tmp
$ curl -kLO http://opensource.apple.com/tarballs/gcc/gcc-5664.tar.gz
$ tar zxvf gcc-5664.tar.gz
$ cd gcc-5664
$ mkdir -p build/obj build/dst build/sym
$ sudo gnumake install RC_OS=macos RC_ARCHS='i386 x86_64' TARGETS='i386 x86_64' SRCROOT=`pwd` OBJROOT=`pwd`/build/obj DSTROOT=`pwd`/build/dst SYMROOT=`pwd`/build/sym
$ sudo ditto build/dst /
gcc がインストールされたことを確認します。
$ gcc-4.2 --version
i686-apple-darwin11-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

gnutls のインストール

gnutls が無いと qemu のコンパイル時にエラーが発生する為、先に gnutls をインストールしておきます。今回は homebrew でインストールしました。
$ brew install gnutls

qemu のインストール

最後に qemu をインストールします。patch を当ててから、qemu 本体をコンパイルします。
$ curl -kLO http://download.savannah.gnu.org/releases/qemu/qemu-0.14.1.tar.gz
$ curl -o qemu-0.14.1-gns3_patches.tgz http://forum.gns3.net/download/file.php?id=859
$ 
$ tar xjf qemu-0.14.1.tar.gz
$ tar xjf qemu-0.14.1-gns3_patches.tgz
$ 
$ mv qemu-0.14.1_* qemu-0.14.1
$ cd qemu-0.14.1
$ 
$ patch -p1 -i qemu-0.14.1_hw_e1000_c.patch
$ patch -p1 -i qemu-0.14.1_block_raw-win32_c.patch
$ patch -p1 -i qemu-0.14.1_Makefile_objs.patch
$ patch -p1 -i qemu-0.14.1_net_c.patch
$ patch -p1 -i qemu-0.14.1_net_h.patch
$ patch -p1 -i qemu-0.14.1_net_udp_c.patch
$ patch -p1 -i qemu-0.14.1_net_udp_h.patch
$ 
$ cp /opt/local/include/gnutls .
$ cp -r /usr/local/Cellar/gnutls .
$ 
$ ./configure --prefix=/usr/local --disable-sdl --enable-cocoa --disable-docs --target-list="i386-softmmu x86_64-softmmu" --cc=/usr/bin/gcc-4.2 --host-cc=/usr/bin/gcc-4.2
$ make
$ sudo make install