| 121 | |
| 122 | = 09/15 = |
| 123 | * 方針 |
| 124 | * ゲスト上でビルドすると遅いので、ホスト上でビルドしたソースツリーをVMwareのHGFSを使ってゲスト上にマウントし、そこからsudo make installする |
| 125 | |
| 126 | == build kernel on Guest == |
| 127 | * 比較対象として、同時並行でゲスト上でビルド&インストールも行ってみた |
| 128 | |
| 129 | * mitty@ubuntu-lucid:~$ sudo aptitude update |
| 130 | * mitty@ubuntu-lucid:~$ sudo aptitude install build-essential kernel-package libncurses-dev |
| 131 | {{{ |
| 132 | Note: selecting "libncurses5-dev" instead of the |
| 133 | virtual package "libncurses-dev" |
| 134 | The following NEW packages will be installed: |
| 135 | binutils{a} build-essential cvs{a} dpkg-dev{a} fakeroot{a} g++{a} |
| 136 | g++-4.4{a} gcc{a} gcc-4.4{a} gettext{a} intltool-debian{a} kernel-package |
| 137 | libc-dev-bin{a} libc6-dev{a} libcroco3{a} libfile-copy-recursive-perl{a} |
| 138 | libgomp1{a} liblzma1{a} libmail-sendmail-perl{a} libncurses5-dev |
| 139 | libstdc++6-4.4-dev{a} libsys-hostname-long-perl{a} linux-libc-dev{a} |
| 140 | manpages-dev{a} patch{a} po-debconf{a} update-inetd{a} xz-utils{a} |
| 141 | 0 packages upgraded, 28 newly installed, 0 to remove and 0 not upgraded. |
| 142 | Need to get 25.7MB of archives. After unpacking 88.4MB will be used. |
| 143 | }}} |
| 144 | |
| 145 | * mitty@ubuntu-lucid:~$ wget https://github.com/mirrors/linux/tarball/v2.6.35 -O mirrors-linux-v2.6.35-0-g9fe6206.tar.gz |
| 146 | * mitty@ubuntu-lucid:~/kernel$ tar xzfv mirrors-linux-v2.6.35-0-g9fe6206.tar.gz |
| 147 | |
| 148 | * mitty@ubuntu-lucid:~/kernel/mirrors-linux-d786bf1$ make defconfig |
| 149 | * mitty@ubuntu-lucid:~/kernel/mirrors-linux-d786bf1$ make menuconfig |
| 150 | * 設定内容については後述 |
| 151 | * mitty@ubuntu-lucid:~/kernel/mirrors-linux-d786bf1$ make |
| 152 | * mitty@ubuntu-lucid:~/kernel/mirrors-linux-d786bf1$ make modules |
| 153 | * mitty@ubuntu-lucid:~/kernel/mirrors-linux-d786bf1$ sudo make install |
| 154 | * mitty@ubuntu-lucid:~/kernel/mirrors-linux-d786bf1$ sudo make modules_install |
| 155 | * mitty@ubuntu-lucid:~/kernel/mirrors-linux-d786bf1$ sudo mkinitramfs -o /boot/initrd.img-2.6.35 2.6.35 |
| 156 | |
| 157 | * mitty@ubuntu-lucid:~/kernel/mirrors-linux-d786bf1$ sudo update-grub |
| 158 | |
| 159 | |
| 160 | * mitty@ubuntu-lucid:~$ sudo reboot |
| 161 | * mitty@ubuntu-lucid:~$ uname -a |
| 162 | {{{ |
| 163 | Linux ubuntu-lucid 2.6.35 #3 SMP Fri Sep 16 15:01:05 JST 2011 i686 GNU/Linux |
| 164 | }}} |
| 165 | * ビルド成功 |
| 166 | * ただ、ホスト側にはソースツリーが無いので、このままではリモートデバッグ出来ない |
| 167 | |
| 168 | == build kernel on Host == |
| 169 | === install packages to Guest === |
| 170 | * s0711489@ubuntu-lucid:~$ sudo aptitude update |
| 171 | * s0711489@ubuntu-lucid:~$ sudo aptitude install build-essential kernel-package libncurses-dev |
| 172 | {{{ |
| 173 | Note: selecting "libncurses5-dev" instead of the |
| 174 | virtual package "libncurses-dev" |
| 175 | The following NEW packages will be installed: |
| 176 | binutils{a} build-essential cvs{a} dpkg-dev{a} fakeroot{a} g++{a} |
| 177 | g++-4.4{a} gcc{a} gcc-4.4{a} gettext{a} intltool-debian{a} kernel-package |
| 178 | libc-dev-bin{a} libc6-dev{a} libcroco3{a} libfile-copy-recursive-perl{a} |
| 179 | libgomp1{a} liblzma1{a} libmail-sendmail-perl{a} libncurses5-dev |
| 180 | libstdc++6-4.4-dev{a} libsys-hostname-long-perl{a} linux-libc-dev{a} |
| 181 | manpages-dev{a} patch{a} po-debconf{a} update-inetd{a} xz-utils{a} |
| 182 | 0 packages upgraded, 28 newly installed, 0 to remove and 0 not upgraded. |
| 183 | Need to get 25.7MB of archives. After unpacking 88.4MB will be used. |
| 184 | }}} |
| 185 | |
| 186 | === install VMware Tools === |
| 187 | * s0711489@ubuntu-lucid:~$ sudo mount /dev/cdrom /media/ |
| 188 | * s0711489@ubuntu-lucid:~$ tar xzf /media/VMwareTools-8.4.6-385536.tar.gz |
| 189 | * s0711489@ubuntu-lucid:~/vmware-tools-distrib$ sudo ./vmware-install.pl --default |
| 190 | |
| 191 | === download kernel source and build === |
| 192 | * windell57:linux-v2.6.35 s0711489$ wget https://github.com/mirrors/linux/tarball/v2.6.35 -O mirrors-linux-v2.6.35-0-g9fe6206.tar.gz --no-check-certificate |
| 193 | * windell57:linux-v2.6.35 s0711489$ tar xzfv mirrors-linux-v2.6.35-0-g9fe6206.tar.gz |
| 194 | |
| 195 | * windell57:mirrors-linux-d786bf1 s0711489$ make defconfig |
| 196 | * windell57:mirrors-linux-d786bf1 s0711489$ make menuconfig |
| 197 | {{{ |
| 198 | │ │ [*] Networking support ---> │ │ |
| 199 | │ │ Networking options ---> │ │ |
| 200 | │ │ < > The IPv6 protocol ---> │ │ |
| 201 | │ │ [ ] Amateur Radio support ---> │ │ |
| 202 | │ │ -*- Wireless ---> │ │ |
| 203 | │ │ < > cfg80211 - wireless configuration API │ │ |
| 204 | │ │ < > RF switch subsystem support ---> │ │ |
| 205 | │ │ Device Drivers ---> │ │ |
| 206 | │ │ Generic Driver Options ---> │ │ |
| 207 | │ │ [*] Maintain a devtmpfs filesystem to mount at /dev │ │ |
| 208 | │ │ [*] Automount devtmpfs at /dev, after the kernel mounted the rootfs │ │ |
| 209 | │ │ SCSI device support ---> │ │ |
| 210 | │ │ [*] SCSI low-level drivers ---> │ │ |
| 211 | │ │ <*> BusLogic SCSI support │ │ |
| 212 | │ │ [*] Network device support ---> │ │ |
| 213 | │ │ [*] Ethernet (10 or 100Mbit) ---> │ │ |
| 214 | │ │ <*> AMD PCnet32 PCI support │ │ |
| 215 | │ │ File systems ---> │ │ |
| 216 | │ │ <*> The Extended 4 (ext4) filesystem │ │ |
| 217 | │ │ [ ] Network File Systems ---> │ │ |
| 218 | │ │ Kernel hacking ---> │ │ |
| 219 | │ │ [*] Compile the kernel with debug info │ │ |
| 220 | │ │ [ ] Virtualization ---> │ │ |
| 221 | }}} |
| 222 | * windell57:mirrors-linux-d786bf1 s0711489$ make -j2 |
| 223 | * windell57:mirrors-linux-d786bf1 s0711489$ make modules |
| 224 | |
| 225 | === make install on Guest === |
| 226 | * s0711489@ubuntu-lucid:~$ cd /mnt/hgfs/linux-v2.6.35/mirrors-linux-d786bf1/ |
| 227 | * s0711489@ubuntu-lucid:/mnt/hgfs/linux-v2.6.35/mirrors-linux-d786bf1$ sudo make install |
| 228 | {{{ |
| 229 | sh /mnt/hgfs/linux-v2.6.35/mirrors-linux-d786bf1/arch/x86/boot/install.sh 2.6.35 arch/x86/boot/bzImage \ |
| 230 | System.map "/boot" |
| 231 | }}} |
| 232 | * s0711489@ubuntu-lucid:/mnt/hgfs/linux-v2.6.35/mirrors-linux-d786bf1$ sudo make modules_install |
| 233 | {{{ |
| 234 | INSTALL arch/x86/kernel/test_nx.ko |
| 235 | INSTALL drivers/scsi/scsi_wait_scan.ko |
| 236 | INSTALL fs/ext4/ext4.ko |
| 237 | INSTALL fs/jbd2/jbd2.ko |
| 238 | INSTALL lib/crc16.ko |
| 239 | INSTALL net/netfilter/xt_mark.ko |
| 240 | DEPMOD 2.6.35 |
| 241 | }}} |
| 242 | * s0711489@ubuntu-lucid:/mnt/hgfs/linux-v2.6.35/mirrors-linux-d786bf1$ sudo mkinitramfs -o /boot/initrd.img-2.6.35 2.6.35 |
| 243 | * s0711489@ubuntu-lucid:/mnt/hgfs/linux-v2.6.35/mirrors-linux-d786bf1$ sudo update-grub |
| 244 | {{{ |
| 245 | Generating grub.cfg ... |
| 246 | Found linux image: /boot/vmlinuz-2.6.35 |
| 247 | Found initrd image: /boot/initrd.img-2.6.35 |
| 248 | Found linux image: /boot/vmlinuz-2.6.35.old |
| 249 | Found initrd image: /boot/initrd.img-2.6.35 |
| 250 | Found linux image: /boot/vmlinuz-2.6.32-33-generic |
| 251 | Found initrd image: /boot/initrd.img-2.6.32-33-generic |
| 252 | Found memtest86+ image: /boot/memtest86+.bin |
| 253 | done |
| 254 | }}} |
| 255 | |
| 256 | === reboot === |
| 257 | * s0711489@ubuntu-lucid:/mnt/hgfs/linux-v2.6.35/mirrors-linux-d786bf1$ uname -a |
| 258 | {{{ |
| 259 | Linux ubuntu-lucid 2.6.32-33-generic #72-Ubuntu SMP Fri Jul 29 21:08:37 UTC 2011 i686 GNU/Linux |
| 260 | }}} |
| 261 | * s0711489@ubuntu-lucid:/mnt/hgfs/linux-v2.6.35/mirrors-linux-d786bf1$ sudo reboot |
| 262 | |
| 263 | * 起動しない[[br]][[Image(WS001485.png,33%)]] |
| 264 | * 注: 後日同じ(と思われる)手順で繰り返したところ、再現せず問題なく起動した |
| 265 | |
| 266 | === retry with 2.6.32 === |
| 267 | * windell57:linux-v2.6.32 s0711489$ wget https://github.com/mirrors/linux/tarball/v2.6.32 -O mirrors-linux-v2.6.32-0-g22763c5.tar.gz --no-check-certificate |
| 268 | |
| 269 | * windell57:mirrors-linux-459b3d5 s0711489$ make defconfig |
| 270 | * windell57:mirrors-linux-459b3d5 s0711489$ make menuconfig |
| 271 | |
| 272 | * s0711489@ubuntu-lucid:/mnt/hgfs/linux-v2.6.32/mirrors-linux-459b3d5$ sudo make install |
| 273 | {{{ |
| 274 | sh /mnt/hgfs/linux-v2.6.32/mirrors-linux-459b3d5/arch/x86/boot/install.sh 2.6.32 arch/x86/boot/bzImage \ |
| 275 | System.map "/boot" |
| 276 | }}} |
| 277 | * s0711489@ubuntu-lucid:/mnt/hgfs/linux-v2.6.32/mirrors-linux-459b3d5$ sudo make modules_install |
| 278 | {{{ |
| 279 | INSTALL arch/x86/kernel/test_nx.ko |
| 280 | INSTALL drivers/scsi/scsi_wait_scan.ko |
| 281 | DEPMOD 2.6.32 |
| 282 | }}} |
| 283 | * s0711489@ubuntu-lucid:/mnt/hgfs/linux-v2.6.32/mirrors-linux-459b3d5$ sudo mkinitramfs -o /boot/initrd.img-2.6.32 2.6.32 |
| 284 | * s0711489@ubuntu-lucid:/mnt/hgfs/linux-v2.6.32/mirrors-linux-459b3d5$ sudo update-grub |
| 285 | {{{ |
| 286 | Generating grub.cfg ... |
| 287 | Found linux image: /boot/vmlinuz-2.6.35 |
| 288 | Found initrd image: /boot/initrd.img-2.6.35 |
| 289 | Found linux image: /boot/vmlinuz-2.6.35.old |
| 290 | Found initrd image: /boot/initrd.img-2.6.35 |
| 291 | Found linux image: /boot/vmlinuz-2.6.32-33-generic |
| 292 | Found initrd image: /boot/initrd.img-2.6.32-33-generic |
| 293 | Found linux image: /boot/vmlinuz-2.6.32 |
| 294 | Found initrd image: /boot/initrd.img-2.6.32 |
| 295 | Found memtest86+ image: /boot/memtest86+.bin |
| 296 | done |
| 297 | }}} |
| 298 | |
| 299 | * s0711489@ubuntu-lucid:~$ uname -a |
| 300 | {{{ |
| 301 | Linux ubuntu-lucid 2.6.32-33-generic #72-Ubuntu SMP Fri Jul 29 21:08:37 UTC 2011 i686 GNU/Linux |
| 302 | }}} |
| 303 | * s0711489@ubuntu-lucid:/mnt/hgfs/linux-v2.6.32/mirrors-linux-459b3d5$ sudo reboot |
| 304 | * s0711489@ubuntu-lucid:~$ uname -a |
| 305 | {{{ |
| 306 | Linux ubuntu-lucid 2.6.32 #1 SMP Fri Sep 16 15:49:51 JST 2011 i686 GNU/Linux |
| 307 | }}} |
| 308 | * 今度は起動成功 |
| 309 | |
| 310 | == 結論 == |
| 311 | * 2.6.35で何故失敗したかは不明(再現しなかった) |
| 312 | * makeにかかる時間が長すぎるので、violaを使ってビルドする方法を探る |