Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

docs: virt: convert UML documentation to ReST

Despite being an old document, it contains lots of information
that could still be useful.

The document has a nice style with makes easy to convert to
ReST. So, let's convert it to ReST.

This patch does:

- Use proper markups for titles;
- Mark and proper indent literal blocks;
- don't use an 'o' character for lists;
- other minor changes required for the doc to be parsed.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

authored by

Mauro Carvalho Chehab and committed by
Paolo Bonzini
7d94ab16 7bd460fc

+782 -910
+1
Documentation/virt/index.rst
··· 8 8 :maxdepth: 2 9 9 10 10 kvm/index 11 + uml/user_mode_linux 11 12 paravirt_ops 12 13 13 14 .. only:: html and subproject
+781 -910
Documentation/virt/uml/UserModeLinux-HOWTO.txt Documentation/virt/uml/user_mode_linux.rst
··· 1 - User Mode Linux HOWTO 2 - User Mode Linux Core Team 3 - Mon Nov 18 14:16:16 EST 2002 1 + .. SPDX-License-Identifier: GPL-2.0 4 2 5 - This document describes the use and abuse of Jeff Dike's User Mode 6 - Linux: a port of the Linux kernel as a normal Intel Linux process. 7 - ______________________________________________________________________ 3 + ===================== 4 + User Mode Linux HOWTO 5 + ===================== 8 6 9 - Table of Contents 7 + :Author: User Mode Linux Core Team 8 + :Last-updated: Mon Nov 18 14:16:16 EST 2002 9 + 10 + This document describes the use and abuse of Jeff Dike's User Mode 11 + Linux: a port of the Linux kernel as a normal Intel Linux process. 12 + 13 + 14 + .. Table of Contents 10 15 11 16 1. Introduction 12 17 ··· 137 132 15.5 Other contributions 138 133 139 134 140 - ______________________________________________________________________ 141 - 142 - 1. Introduction 135 + 1. Introduction 136 + ================ 143 137 144 138 Welcome to User Mode Linux. It's going to be fun. 145 139 146 140 147 141 148 - 1.1. How is User Mode Linux Different? 142 + 1.1. How is User Mode Linux Different? 143 + --------------------------------------- 149 144 150 145 Normally, the Linux Kernel talks straight to your hardware (video 151 146 card, keyboard, hard drives, etc), and any programs which run ask the 152 - kernel to operate the hardware, like so: 147 + kernel to operate the hardware, like so:: 153 148 154 149 155 150 ··· 165 160 166 161 167 162 The User Mode Linux Kernel is different; instead of talking to the 168 - hardware, it talks to a `real' Linux kernel (called the `host kernel' 163 + hardware, it talks to a `real` Linux kernel (called the `host kernel` 169 164 from now on), like any other program. Programs can then run inside 170 165 User-Mode Linux as if they were running under a normal kernel, like 171 - so: 166 + so:: 172 167 173 168 174 169 ··· 186 181 187 182 188 183 189 - 1.2. Why Would I Want User Mode Linux? 184 + 1.2. Why Would I Want User Mode Linux? 185 + --------------------------------------- 190 186 191 187 192 188 1. If User Mode Linux crashes, your host kernel is still fine. ··· 210 204 211 205 212 206 207 + .. _Compiling_the_kernel_and_modules: 208 + 209 + 2. Compiling the kernel and modules 210 + ==================================== 213 211 214 212 215 - 2. Compiling the kernel and modules 216 213 217 214 218 - 219 - 220 - 2.1. Compiling the kernel 215 + 2.1. Compiling the kernel 216 + -------------------------- 221 217 222 218 223 219 Compiling the user mode kernel is just like compiling any other ··· 228 220 229 221 230 222 1. Download the latest UML patch from 231 - 232 223 the download page <http://user-mode-linux.sourceforge.net/ 233 224 234 225 In this example, the file is uml-patch-2.4.0-prerelease.bz2. ··· 237 230 such as: 238 231 239 232 ftp://ftp.ca.kernel.org/pub/kernel/v2.4/linux-2.4.0-prerelease.tar.bz2 240 - <ftp://ftp.ca.kernel.org/pub/kernel/v2.4/linux-2.4.0-prerelease.tar.bz2> 241 - . 242 233 243 234 244 - 3. Make a directory and unpack the kernel into it. 245 - 246 - 235 + 3. Make a directory and unpack the kernel into it:: 247 236 248 237 host% 249 238 mkdir ~/uml 250 239 251 - 252 - 253 - 254 - 255 - 256 240 host% 257 241 cd ~/uml 258 - 259 - 260 - 261 - 262 - 263 242 264 243 host% 265 244 tar -xzvf linux-2.4.0-prerelease.tar.bz2 266 245 267 246 268 247 269 - 270 - 271 - 272 - 4. Apply the patch using 273 - 274 - 248 + 4. Apply the patch using:: 275 249 276 250 host% 277 251 cd ~/uml/linux 278 - 279 - 280 252 281 253 host% 282 254 bzcat uml-patch-2.4.0-prerelease.bz2 | patch -p1 283 255 284 256 285 257 286 - 287 - 288 - 289 - 5. Run your favorite config; `make xconfig ARCH=um' is the most 290 - convenient. `make config ARCH=um' and 'make menuconfig ARCH=um' 258 + 5. Run your favorite config; ``make xconfig ARCH=um`` is the most 259 + convenient. ``make config ARCH=um`` and ``make menuconfig ARCH=um`` 291 260 will work as well. The defaults will give you a useful kernel. If 292 261 you want to change something, go ahead, it probably won't hurt 293 262 anything. ··· 271 288 272 289 Note: If the host is configured with a 2G/2G address space split 273 290 rather than the usual 3G/1G split, then the packaged UML binaries 274 - will not run. They will immediately segfault. See ``UML on 2G/2G 275 - hosts'' for the scoop on running UML on your system. 291 + will not run. They will immediately segfault. See 292 + :ref:`UML_on_2G/2G_hosts` for the scoop on running UML on your system. 276 293 277 294 278 295 279 - 6. Finish with `make linux ARCH=um': the result is a file called 280 - `linux' in the top directory of your source tree. 296 + 6. Finish with ``make linux ARCH=um``: the result is a file called 297 + ``linux`` in the top directory of your source tree. 281 298 282 299 Make sure that you don't build this kernel in /usr/src/linux. On some 283 300 distributions, /usr/include/asm is a link into this pool. The user- ··· 293 310 corresponding directory in the appropriate kernel pool. 294 311 295 312 If you don't have the latest kernel pool, you can get the 296 - corresponding user-mode sources with 313 + corresponding user-mode sources with:: 297 314 298 315 299 316 host% cvs co -r v_2_3_x linux ··· 305 322 bug fixes and enhancements that have gone into subsequent releases. 306 323 307 324 308 - 2.2. Compiling and installing kernel modules 325 + 2.2. Compiling and installing kernel modules 326 + --------------------------------------------- 309 327 310 328 UML modules are built in the same way as the native kernel (with the 311 - exception of the 'ARCH=um' that you always need for UML): 329 + exception of the 'ARCH=um' that you always need for UML):: 312 330 313 331 314 332 host% make modules ARCH=um ··· 321 337 the user-mode pool. Modules from the native kernel won't work. 322 338 323 339 You can install them by using ftp or something to copy them into the 324 - virtual machine and dropping them into /lib/modules/`uname -r`. 340 + virtual machine and dropping them into ``/lib/modules/$(uname -r)``. 325 341 326 342 You can also get the kernel build process to install them as follows: 327 343 328 344 1. with the kernel not booted, mount the root filesystem in the top 329 - level of the kernel pool: 345 + level of the kernel pool:: 330 346 331 347 332 348 host% mount root_fs mnt -o loop ··· 336 352 337 353 338 354 339 - 2. run 355 + 2. run:: 340 356 341 357 342 358 host% ··· 347 363 348 364 349 365 350 - 3. unmount the filesystem 366 + 3. unmount the filesystem:: 351 367 352 368 353 369 host% umount mnt ··· 370 386 371 387 372 388 373 - 2.3. Compiling and installing uml_utilities 389 + 2.3. Compiling and installing uml_utilities 390 + -------------------------------------------- 374 391 375 392 Many features of the UML kernel require a user-space helper program, 376 393 so a uml_utilities package is distributed separately from the kernel 377 394 patch which provides these helpers. Included within this is: 378 395 379 - o port-helper - Used by consoles which connect to xterms or ports 396 + - port-helper - Used by consoles which connect to xterms or ports 380 397 381 - o tunctl - Configuration tool to create and delete tap devices 398 + - tunctl - Configuration tool to create and delete tap devices 382 399 383 - o uml_net - Setuid binary for automatic tap device configuration 400 + - uml_net - Setuid binary for automatic tap device configuration 384 401 385 - o uml_switch - User-space virtual switch required for daemon 402 + - uml_switch - User-space virtual switch required for daemon 386 403 transport 387 404 388 - The uml_utilities tree is compiled with: 405 + The uml_utilities tree is compiled with:: 389 406 390 407 391 408 host# ··· 408 423 409 424 410 425 411 - 3. Running UML and logging in 426 + 3. Running UML and logging in 427 + ============================== 412 428 413 429 414 430 415 - 3.1. Running UML 431 + 3.1. Running UML 432 + ----------------- 416 433 417 434 It runs on 2.2.15 or later, and all 2.4 kernels. 418 435 419 436 420 437 Booting UML is straightforward. Simply run 'linux': it will try to 421 - mount the file `root_fs' in the current directory. You do not need to 422 - run it as root. If your root filesystem is not named `root_fs', then 423 - you need to put a `ubd0=root_fs_whatever' switch on the linux command 438 + mount the file ``root_fs`` in the current directory. You do not need to 439 + run it as root. If your root filesystem is not named ``root_fs``, then 440 + you need to put a ``ubd0=root_fs_whatever`` switch on the linux command 424 441 line. 425 442 426 443 ··· 434 447 The kernel will boot up and present you with a login prompt. 435 448 436 449 437 - Note: If the host is configured with a 2G/2G address space split 450 + Note: 451 + If the host is configured with a 2G/2G address space split 438 452 rather than the usual 3G/1G split, then the packaged UML binaries will 439 - not run. They will immediately segfault. See ``UML on 2G/2G hosts'' 453 + not run. They will immediately segfault. See :ref:`UML_on_2G/2G_hosts` 440 454 for the scoop on running UML on your system. 441 455 442 456 443 457 444 - 3.2. Logging in 458 + 3.2. Logging in 459 + ---------------- 445 460 446 461 447 462 ··· 457 468 458 469 There are a couple of other ways to log in: 459 470 460 - o On a virtual console 471 + - On a virtual console 461 472 462 473 463 474 464 475 Each virtual console that is configured (i.e. the device exists in 465 476 /dev and /etc/inittab runs a getty on it) will come up in its own 466 - xterm. If you get tired of the xterms, read ``Setting up serial 467 - lines and consoles'' to see how to attach the consoles to 468 - something else, like host ptys. 477 + xterm. If you get tired of the xterms, read 478 + :ref:`setting_up_serial_lines_and_consoles` to see how to attach 479 + the consoles to something else, like host ptys. 469 480 470 481 471 482 472 - o Over the serial line 483 + - Over the serial line 473 484 474 485 475 - In the boot output, find a line that looks like: 486 + In the boot output, find a line that looks like:: 476 487 477 488 478 489 ··· 482 493 483 494 484 495 Attach your favorite terminal program to the corresponding tty. I.e. 485 - for minicom, the command would be 496 + for minicom, the command would be:: 486 497 487 498 488 499 host% minicom -o -p /dev/ttyp1 ··· 492 503 493 504 494 505 495 - o Over the net 506 + - Over the net 496 507 497 508 498 509 If the network is running, then you can telnet to the virtual 499 - machine and log in to it. See ``Setting up the network'' to learn 510 + machine and log in to it. See :ref:`Setting_up_the_network` to learn 500 511 about setting up a virtual network. 501 512 502 513 When you're done using it, run halt, and the kernel will bring itself 503 514 down and the process will exit. 504 515 505 516 506 - 3.3. Examples 517 + 3.3. Examples 518 + -------------- 507 519 508 520 Here are some examples of UML in action: 509 521 510 - o A login session <http://user-mode-linux.sourceforge.net/login.html> 522 + - A login session <http://user-mode-linux.sourceforge.net/login.html> 511 523 512 - o A virtual network <http://user-mode-linux.sourceforge.net/net.html> 513 - 514 - 524 + - A virtual network <http://user-mode-linux.sourceforge.net/net.html> 515 525 516 526 517 527 518 528 519 529 520 - 4. UML on 2G/2G hosts 530 + 531 + .. _UML_on_2G/2G_hosts: 532 + 533 + 4. UML on 2G/2G hosts 534 + ====================== 521 535 522 536 523 537 524 538 525 - 4.1. Introduction 539 + 4.1. Introduction 540 + ------------------ 526 541 527 542 528 543 Most Linux machines are configured so that the kernel occupies the ··· 539 546 540 547 541 548 542 - 4.2. The problem 549 + 4.2. The problem 550 + ----------------- 543 551 544 552 545 553 The prebuilt UML binaries on this site will not run on 2G/2G hosts ··· 552 558 553 559 554 560 555 - 4.3. The solution 561 + 4.3. The solution 562 + ------------------ 556 563 557 564 558 565 The fix for this is to rebuild UML from source after enabling 559 566 CONFIG_HOST_2G_2G (under 'General Setup'). This will cause UML to 560 567 load itself in the top .5G of that smaller process address space, 561 - where it will run fine. See ``Compiling the kernel and modules'' if 568 + where it will run fine. See :ref:`Compiling_the_kernel_and_modules` if 562 569 you need help building UML from source. 563 570 564 571 ··· 568 573 569 574 570 575 576 + .. _setting_up_serial_lines_and_consoles: 571 577 572 578 573 - 574 - 5. Setting up serial lines and consoles 579 + 5. Setting up serial lines and consoles 580 + ======================================== 575 581 576 582 577 583 It is possible to attach UML serial lines and consoles to many types ··· 580 584 581 585 582 586 You can attach them to host ptys, ttys, file descriptors, and ports. 583 - This allows you to do things like 587 + This allows you to do things like: 584 588 585 - o have a UML console appear on an unused host console, 589 + - have a UML console appear on an unused host console, 586 590 587 - o hook two virtual machines together by having one attach to a pty 591 + - hook two virtual machines together by having one attach to a pty 588 592 and having the other attach to the corresponding tty 589 593 590 - o make a virtual machine accessible from the net by attaching a 594 + - make a virtual machine accessible from the net by attaching a 591 595 console to a port on the host. 592 596 593 597 594 - The general format of the command line option is device=channel. 598 + The general format of the command line option is ``device=channel``. 595 599 596 600 597 601 598 - 5.1. Specifying the device 602 + 5.1. Specifying the device 603 + --------------------------- 599 604 600 605 Devices are specified with "con" or "ssl" (console or serial line, 601 606 respectively), optionally with a device number if you are talking ··· 610 613 611 614 A specific device name will override a less general "con=" or "ssl=". 612 615 So, for example, you can assign a pty to each of the serial lines 613 - except for the first two like this: 616 + except for the first two like this:: 614 617 615 618 616 619 ssl=pty ssl0=tty:/dev/tty0 ssl1=tty:/dev/tty1 ··· 623 626 624 627 625 628 626 - 5.2. Specifying the channel 629 + 5.2. Specifying the channel 630 + ---------------------------- 627 631 628 632 There are a number of different types of channels to attach a UML 629 633 device to, each with a different way of specifying exactly what to 630 634 attach to. 631 635 632 - o pseudo-terminals - device=pty pts terminals - device=pts 636 + - pseudo-terminals - device=pty pts terminals - device=pts 633 637 634 638 635 639 This will cause UML to allocate a free host pseudo-terminal for the ··· 638 640 log. You access it by attaching a terminal program to the 639 641 corresponding tty: 640 642 641 - o screen /dev/pts/n 643 + - screen /dev/pts/n 642 644 643 - o screen /dev/ttyxx 645 + - screen /dev/ttyxx 644 646 645 - o minicom -o -p /dev/ttyxx - minicom seems not able to handle pts 647 + - minicom -o -p /dev/ttyxx - minicom seems not able to handle pts 646 648 devices 647 649 648 - o kermit - start it up, 'open' the device, then 'connect' 650 + - kermit - start it up, 'open' the device, then 'connect' 649 651 650 652 651 653 652 654 653 655 654 - o terminals - device=tty:tty device file 656 + - terminals - device=tty:tty device file 655 657 656 658 657 - This will make UML attach the device to the specified tty (i.e 659 + This will make UML attach the device to the specified tty (i.e:: 658 660 659 661 660 662 con1=tty:/dev/tty3 ··· 670 672 671 673 672 674 673 - o xterms - device=xterm 675 + - xterms - device=xterm 674 676 675 677 676 678 UML will run an xterm and the device will be attached to it. ··· 679 681 680 682 681 683 682 - o Port - device=port:port number 684 + - Port - device=port:port number 683 685 684 686 685 687 This will attach the UML devices to the specified host port. 686 688 Attaching console 1 to the host's port 9000 would be done like 687 - this: 689 + this:: 688 690 689 691 690 692 con1=port:9000 ··· 692 694 693 695 694 696 695 - Attaching all the serial lines to that port would be done similarly: 697 + Attaching all the serial lines to that port would be done similarly:: 696 698 697 699 698 700 ssl=port:9000 ··· 700 702 701 703 702 704 703 - You access these devices by telnetting to that port. Each active tel- 704 - net session gets a different device. If there are more telnets to a 705 + You access these devices by telnetting to that port. Each active 706 + telnet session gets a different device. If there are more telnets to a 705 707 port than UML devices attached to it, then the extra telnet sessions 706 708 will block until an existing telnet detaches, or until another device 707 709 becomes active (i.e. by being activated in /etc/inittab). ··· 723 725 724 726 725 727 726 - o already-existing file descriptors - device=file descriptor 728 + - already-existing file descriptors - device=file descriptor 727 729 728 730 729 731 If you set up a file descriptor on the UML command line, you can 730 732 attach a UML device to it. This is most commonly used to put the 731 733 main console back on stdin and stdout after assigning all the other 732 - consoles to something else: 734 + consoles to something else:: 733 735 734 736 735 737 con0=fd:0,fd:1 con=pts ··· 741 743 742 744 743 745 744 - o Nothing - device=null 746 + - Nothing - device=null 745 747 746 748 747 749 This allows the device to be opened, in contrast to 'none', but ··· 752 754 753 755 754 756 755 - o None - device=none 757 + - None - device=none 756 758 757 759 758 760 This causes the device to disappear. ··· 760 762 761 763 762 764 You can also specify different input and output channels for a device 763 - by putting a comma between them: 765 + by putting a comma between them:: 764 766 765 767 766 768 ssl3=tty:/dev/tty2,xterm ··· 783 785 784 786 785 787 786 - 5.3. Examples 788 + 5.3. Examples 789 + -------------- 787 790 788 791 There are a number of interesting things you can do with this 789 792 capability. 790 793 791 794 792 795 First, this is how you get rid of those bleeding console xterms by 793 - attaching them to host ptys: 796 + attaching them to host ptys:: 794 797 795 798 796 799 con=pty con0=fd:0,fd:1 ··· 801 802 802 803 This will make a UML console take over an unused host virtual console, 803 804 so that when you switch to it, you will see the UML login prompt 804 - rather than the host login prompt: 805 + rather than the host login prompt:: 805 806 806 807 807 808 con1=tty:/dev/tty6 ··· 812 813 You can attach two virtual machines together with what amounts to a 813 814 serial line as follows: 814 815 815 - Run one UML with a serial line attached to a pty - 816 + Run one UML with a serial line attached to a pty:: 816 817 817 818 818 819 ssl1=pty ··· 824 825 that it got /dev/ptyp1). 825 826 826 827 Boot the other UML with a serial line attached to the corresponding 827 - tty - 828 + tty:: 828 829 829 830 830 831 ssl1=tty:/dev/ttyp1 ··· 837 838 prompt of the other virtual machine. 838 839 839 840 840 - 6. Setting up the network 841 + .. _setting_up_the_network: 842 + 843 + 6. Setting up the network 844 + ========================== 841 845 842 846 843 847 ··· 860 858 There are currently five transport types available for a UML virtual 861 859 machine to exchange packets with other hosts: 862 860 863 - o ethertap 861 + - ethertap 864 862 865 - o TUN/TAP 863 + - TUN/TAP 866 864 867 - o Multicast 865 + - Multicast 868 866 869 - o a switch daemon 867 + - a switch daemon 870 868 871 - o slip 869 + - slip 872 870 873 - o slirp 871 + - slirp 874 872 875 - o pcap 873 + - pcap 876 874 877 875 The TUN/TAP, ethertap, slip, and slirp transports allow a UML 878 876 instance to exchange packets with the host. They may be directed ··· 895 893 With so many host transports, which one should you use? Here's when 896 894 you should use each one: 897 895 898 - o ethertap - if you want access to the host networking and it is 896 + - ethertap - if you want access to the host networking and it is 899 897 running 2.2 900 898 901 - o TUN/TAP - if you want access to the host networking and it is 899 + - TUN/TAP - if you want access to the host networking and it is 902 900 running 2.4. Also, the TUN/TAP transport is able to use a 903 901 preconfigured device, allowing it to avoid using the setuid uml_net 904 902 helper, which is a security advantage. 905 903 906 - o Multicast - if you want a purely virtual network and you don't want 904 + - Multicast - if you want a purely virtual network and you don't want 907 905 to set up anything but the UML 908 906 909 - o a switch daemon - if you want a purely virtual network and you 907 + - a switch daemon - if you want a purely virtual network and you 910 908 don't mind running the daemon in order to get somewhat better 911 909 performance 912 910 913 - o slip - there is no particular reason to run the slip backend unless 911 + - slip - there is no particular reason to run the slip backend unless 914 912 ethertap and TUN/TAP are just not available for some reason 915 913 916 - o slirp - if you don't have root access on the host to setup 914 + - slirp - if you don't have root access on the host to setup 917 915 networking, or if you don't want to allocate an IP to your UML 918 916 919 - o pcap - not much use for actual network connectivity, but great for 917 + - pcap - not much use for actual network connectivity, but great for 920 918 monitoring traffic on the host 921 919 922 920 Ethertap is available on 2.4 and works fine. TUN/TAP is preferred ··· 928 926 exploit the helper's root privileges. 929 927 930 928 931 - 6.1. General setup 929 + 6.1. General setup 930 + ------------------- 932 931 933 932 First, you must have the virtual network enabled in your UML. If are 934 933 running a prebuilt kernel from this site, everything is already ··· 941 938 The next step is to provide a network device to the virtual machine. 942 939 This is done by describing it on the kernel command line. 943 940 944 - The general format is 941 + The general format is:: 945 942 946 943 947 944 eth <n> = <transport> , <transport args> ··· 950 947 951 948 952 949 For example, a virtual ethernet device may be attached to a host 953 - ethertap device as follows: 950 + ethertap device as follows:: 954 951 955 952 956 953 eth0=ethertap,tap0,fe:fd:0:0:0:1,192.168.0.254 ··· 981 978 982 979 983 980 You can also add devices to a UML and remove them at runtime. See the 984 - ``The Management Console'' page for details. 981 + :ref:`The_Management_Console` page for details. 985 982 986 983 987 984 The sections below describe this in more detail. ··· 998 995 999 996 1000 997 1001 - 6.2. Userspace daemons 998 + 6.2. Userspace daemons 999 + ----------------------- 1002 1000 1003 1001 You will likely need the setuid helper, or the switch daemon, or both. 1004 1002 They are both installed with the RPM and deb, so if you've installed ··· 1015 1011 1016 1012 1017 1013 1018 - 6.3. Specifying ethernet addresses 1014 + 6.3. Specifying ethernet addresses 1015 + ----------------------------------- 1019 1016 1020 1017 Below, you will see that the TUN/TAP, ethertap, and daemon interfaces 1021 1018 allow you to specify hardware addresses for the virtual ethernet ··· 1028 1023 sufficient to guarantee a unique hardware address for the device. A 1029 1024 couple of exceptions are: 1030 1025 1031 - o Another set of virtual ethernet devices are on the same network and 1026 + - Another set of virtual ethernet devices are on the same network and 1032 1027 they are assigned hardware addresses using a different scheme which 1033 1028 may conflict with the UML IP address-based scheme 1034 1029 1035 - o You aren't going to use the device for IP networking, so you don't 1030 + - You aren't going to use the device for IP networking, so you don't 1036 1031 assign the device an IP address 1037 1032 1038 1033 If you let the driver provide the hardware address, you should make 1039 1034 sure that the device IP address is known before the interface is 1040 - brought up. So, inside UML, this will guarantee that: 1035 + brought up. So, inside UML, this will guarantee that:: 1041 1036 1042 1037 1043 1038 1044 - UML# 1045 - ifconfig eth0 192.168.0.250 up 1039 + UML# 1040 + ifconfig eth0 192.168.0.250 up 1046 1041 1047 1042 1048 1043 ··· 1054 1049 1055 1050 1056 1051 1057 - 6.4. UML interface setup 1052 + 6.4. UML interface setup 1053 + ------------------------- 1058 1054 1059 1055 Once the network devices have been described on the command line, you 1060 1056 should boot UML and log in. 1061 1057 1062 1058 1063 - The first thing to do is bring the interface up: 1059 + The first thing to do is bring the interface up:: 1064 1060 1065 1061 1066 1062 UML# ifconfig ethn ip-address up ··· 1073 1067 1074 1068 1075 1069 To reach the rest of the world, you should set a default route to the 1076 - host: 1070 + host:: 1077 1071 1078 1072 1079 1073 UML# route add default gw host ip ··· 1081 1075 1082 1076 1083 1077 1084 - Again, with host ip of 192.168.0.4: 1078 + Again, with host ip of 192.168.0.4:: 1085 1079 1086 1080 1087 1081 UML# route add default gw 192.168.0.4 ··· 1103 1097 Note: If you can't communicate with other hosts on your physical 1104 1098 ethernet, it's probably because of a network route that's 1105 1099 automatically set up. If you run 'route -n' and see a route that 1106 - looks like this: 1100 + looks like this:: 1107 1101 1108 1102 1109 1103 1110 1104 1111 - Destination Gateway Genmask Flags Metric Ref Use Iface 1112 - 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 1105 + Destination Gateway Genmask Flags Metric Ref Use Iface 1106 + 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 1113 1107 1114 1108 1115 1109 1116 1110 1117 1111 with a mask that's not 255.255.255.255, then replace it with a route 1118 - to your host: 1112 + to your host:: 1119 1113 1120 1114 1121 1115 UML# 1122 1116 route del -net 192.168.0.0 dev eth0 netmask 255.255.255.0 1123 - 1124 - 1125 - 1126 - 1127 1117 1128 1118 1129 1119 UML# ··· 1133 1131 1134 1132 1135 1133 1136 - 6.5. Multicast 1134 + 6.5. Multicast 1135 + --------------- 1137 1136 1138 1137 The simplest way to set up a virtual network between multiple UMLs is 1139 1138 to use the mcast transport. This was written by Harald Welte and is ··· 1145 1142 messages when you bring the device up inside UML. 1146 1143 1147 1144 1148 - To use it, run two UMLs with 1145 + To use it, run two UMLs with:: 1149 1146 1150 1147 1151 1148 eth0=mcast ··· 1154 1151 1155 1152 1156 1153 on their command lines. Log in, configure the ethernet device in each 1157 - machine with different IP addresses: 1154 + machine with different IP addresses:: 1158 1155 1159 1156 1160 1157 UML1# ifconfig eth0 192.168.0.254 1161 - 1162 - 1163 - 1164 - 1165 1158 1166 1159 1167 1160 UML2# ifconfig eth0 192.168.0.253 ··· 1167 1168 1168 1169 and they should be able to talk to each other. 1169 1170 1170 - The full set of command line options for this transport are 1171 + The full set of command line options for this transport are:: 1171 1172 1172 1173 1173 1174 ··· 1185 1186 This is useful when your network does not support multicast, and 1186 1187 all network connections are simple point to point links. 1187 1188 1188 - The full set of command line options for this transport are 1189 + The full set of command line options for this transport are:: 1189 1190 1190 1191 1191 1192 ethn=ucast,ethernet address,remote address,listen port,remote port ··· 1193 1194 1194 1195 1195 1196 1196 - 6.6. TUN/TAP with the uml_net helper 1197 + 6.6. TUN/TAP with the uml_net helper 1198 + ------------------------------------- 1197 1199 1198 1200 TUN/TAP is the preferred mechanism on 2.4 to exchange packets with the 1199 1201 host. The TUN/TAP backend has been in UML since 2.4.9-3um. ··· 1216 1216 kernel or as the tun.o module. 1217 1217 1218 1218 The format of the command line switch to attach a device to a TUN/TAP 1219 - device is 1219 + device is:: 1220 1220 1221 1221 1222 1222 eth <n> =tuntap,,, <IP address> ··· 1226 1226 1227 1227 For example, this argument will attach the UML's eth0 to the next 1228 1228 available tap device and assign an ethernet address to it based on its 1229 - IP address 1229 + IP address:: 1230 1230 1231 1231 1232 1232 eth0=tuntap,,,192.168.0.254 ··· 1247 1247 There are a couple potential problems with running the TUN/TAP 1248 1248 transport on a 2.4 host kernel 1249 1249 1250 - o TUN/TAP seems not to work on 2.4.3 and earlier. Upgrade the host 1250 + - TUN/TAP seems not to work on 2.4.3 and earlier. Upgrade the host 1251 1251 kernel or use the ethertap transport. 1252 1252 1253 - o With an upgraded kernel, TUN/TAP may fail with 1253 + - With an upgraded kernel, TUN/TAP may fail with:: 1254 1254 1255 1255 1256 1256 File descriptor in bad state ··· 1264 1264 kernel. 1265 1265 1266 1266 These were pointed out by Tim Robinson <timro at trkr dot net> in 1267 - <http://www.geocrawler.com/> name="this uml- 1268 - user post"> . 1267 + <http://www.geocrawler.com/> name="this uml-user post"> . 1269 1268 1270 1269 1271 1270 1272 - 6.7. TUN/TAP with a preconfigured tap device 1271 + 6.7. TUN/TAP with a preconfigured tap device 1272 + --------------------------------------------- 1273 1273 1274 1274 If you prefer not to have UML use uml_net (which is somewhat 1275 1275 insecure), with UML 2.4.17-11, you can set up a TUN/TAP device ··· 1277 1277 there is no need for root assistance. Setting up the device is done 1278 1278 as follows: 1279 1279 1280 - o Create the device with tunctl (available from the UML utilities 1281 - tarball) 1280 + - Create the device with tunctl (available from the UML utilities 1281 + tarball):: 1282 1282 1283 1283 1284 1284 ··· 1291 1291 where uid is the user id or username that UML will be run as. This 1292 1292 will tell you what device was created. 1293 1293 1294 - o Configure the device IP (change IP addresses and device name to 1295 - suit) 1294 + - Configure the device IP (change IP addresses and device name to 1295 + suit):: 1296 1296 1297 1297 1298 1298 ··· 1303 1303 1304 1304 1305 1305 1306 - o Set up routing and arping if desired - this is my recipe, there are 1307 - other ways of doing the same thing 1306 + - Set up routing and arping if desired - this is my recipe, there are 1307 + other ways of doing the same thing:: 1308 1308 1309 1309 1310 1310 host# ··· 1313 1313 host# 1314 1314 route add -host 192.168.0.253 dev tap0 1315 1315 1316 - 1317 - 1318 - 1319 - 1320 - 1321 1316 host# 1322 1317 bash -c 'echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp' 1323 - 1324 - 1325 - 1326 - 1327 - 1328 1318 1329 1319 host# 1330 1320 arp -Ds 192.168.0.253 eth0 pub ··· 1328 1338 utility which reads the information from a config file and sets up 1329 1339 devices at boot time. 1330 1340 1331 - o Rather than using up two IPs and ARPing for one of them, you can 1341 + - Rather than using up two IPs and ARPing for one of them, you can 1332 1342 also provide direct access to your LAN by the UML by using a 1333 - bridge. 1343 + bridge:: 1334 1344 1335 1345 1336 1346 host# 1337 1347 brctl addbr br0 1338 1348 1339 1349 1340 - 1341 - 1342 - 1343 - 1344 1350 host# 1345 1351 ifconfig eth0 0.0.0.0 promisc up 1346 - 1347 - 1348 - 1349 - 1350 1352 1351 1353 1352 1354 host# 1353 1355 ifconfig tap0 0.0.0.0 promisc up 1354 1356 1355 1357 1356 - 1357 - 1358 - 1359 - 1360 1358 host# 1361 1359 ifconfig br0 192.168.0.1 netmask 255.255.255.0 up 1362 1360 1363 1361 1364 - 1365 - 1366 - 1367 - 1368 - 1369 - host# 1370 - brctl stp br0 off 1371 - 1372 - 1373 - 1374 - 1362 + host# 1363 + brctl stp br0 off 1375 1364 1376 1365 1377 1366 host# 1378 1367 brctl setfd br0 1 1379 1368 1380 1369 1381 - 1382 - 1383 - 1384 - 1385 1370 host# 1386 1371 brctl sethello br0 1 1387 1372 1388 1373 1389 - 1390 - 1391 - 1392 - 1393 1374 host# 1394 1375 brctl addif br0 eth0 1395 - 1396 - 1397 - 1398 - 1399 1376 1400 1377 1401 1378 host# ··· 1374 1417 Note that 'br0' should be setup using ifconfig with the existing IP 1375 1418 address of eth0, as eth0 no longer has its own IP. 1376 1419 1377 - o 1420 + - 1378 1421 1379 1422 1380 1423 Also, the /dev/net/tun device must be writable by the user running 1381 1424 UML in order for the UML to use the device that's been configured 1382 - for it. The simplest thing to do is 1425 + for it. The simplest thing to do is:: 1383 1426 1384 1427 1385 1428 host# chmod 666 /dev/net/tun ··· 1395 1438 devices and chgrp /dev/net/tun to that group with mode 664 or 660. 1396 1439 1397 1440 1398 - o Once the device is set up, run UML with 'eth0=tuntap,device name' 1441 + - Once the device is set up, run UML with 'eth0=tuntap,device name' 1399 1442 (i.e. 'eth0=tuntap,tap0') on the command line (or do it with the 1400 1443 mconsole config command). 1401 1444 1402 - o Bring the eth device up in UML and you're in business. 1445 + - Bring the eth device up in UML and you're in business. 1403 1446 1404 1447 If you don't want that tap device any more, you can make it non- 1405 - persistent with 1448 + persistent with:: 1406 1449 1407 1450 1408 1451 host# tunctl -d tap device ··· 1412 1455 1413 1456 Finally, tunctl has a -b (for brief mode) switch which causes it to 1414 1457 output only the name of the tap device it created. This makes it 1415 - suitable for capture by a script: 1458 + suitable for capture by a script:: 1416 1459 1417 1460 1418 1461 host# TAP=`tunctl -u 1000 -b` ··· 1422 1465 1423 1466 1424 1467 1425 - 6.8. Ethertap 1468 + 6.8. Ethertap 1469 + -------------- 1426 1470 1427 1471 Ethertap is the general mechanism on 2.2 for userspace processes to 1428 1472 exchange packets with the kernel. ··· 1431 1473 1432 1474 1433 1475 To use this transport, you need to describe the virtual network device 1434 - on the UML command line. The general format for this is 1476 + on the UML command line. The general format for this is:: 1435 1477 1436 1478 1437 1479 eth <n> =ethertap, <device> , <ethernet address> , <tap IP address> ··· 1439 1481 1440 1482 1441 1483 1442 - So, the previous example 1484 + So, the previous example:: 1443 1485 1444 1486 1445 1487 eth0=ethertap,tap0,fe:fd:0:0:0:1,192.168.0.254 ··· 1479 1521 1480 1522 If you want to set things up yourself, you need to make sure that the 1481 1523 appropriate /dev entry exists. If it doesn't, become root and create 1482 - it as follows: 1524 + it as follows:: 1483 1525 1484 1526 1485 1527 mknod /dev/tap <minor> c 36 <minor> + 16 ··· 1487 1529 1488 1530 1489 1531 1490 - For example, this is how to create /dev/tap0: 1532 + For example, this is how to create /dev/tap0:: 1491 1533 1492 1534 1493 1535 mknod /dev/tap0 c 36 0 + 16 ··· 1497 1539 1498 1540 You also need to make sure that the host kernel has ethertap support. 1499 1541 If ethertap is enabled as a module, you apparently need to insmod 1500 - ethertap once for each ethertap device you want to enable. So, 1542 + ethertap once for each ethertap device you want to enable. So,:: 1501 1543 1502 1544 1503 1545 host# ··· 1507 1549 1508 1550 1509 1551 will give you the tap0 interface. To get the tap1 interface, you need 1510 - to run 1552 + to run:: 1511 1553 1512 1554 1513 1555 host# ··· 1519 1561 1520 1562 1521 1563 1522 - 6.9. The switch daemon 1564 + 6.9. The switch daemon 1565 + ----------------------- 1523 1566 1524 1567 Note: This is the daemon formerly known as uml_router, but which was 1525 1568 renamed so the network weenies of the world would stop growling at me. ··· 1536 1577 sockets. 1537 1578 1538 1579 1539 - If you want it to listen on a different pair of sockets, use 1580 + If you want it to listen on a different pair of sockets, use:: 1540 1581 1541 1582 1542 1583 -unix control socket data socket ··· 1545 1586 1546 1587 1547 1588 1548 - If you want it to act as a hub rather than a switch, use 1589 + If you want it to act as a hub rather than a switch, use:: 1549 1590 1550 1591 1551 1592 -hub ··· 1555 1596 1556 1597 1557 1598 If you want the switch to be connected to host networking (allowing 1558 - the umls to get access to the outside world through the host), use 1599 + the umls to get access to the outside world through the host), use:: 1559 1600 1560 1601 1561 1602 -tap tap0 ··· 1569 1610 device than tap0, specify that instead of tap0. 1570 1611 1571 1612 1572 - uml_switch can be backgrounded as follows 1613 + uml_switch can be backgrounded as follows:: 1573 1614 1574 1615 1575 1616 host% ··· 1582 1623 stdin for EOF. When it sees that, it exits. 1583 1624 1584 1625 1585 - The general format of the kernel command line switch is 1626 + The general format of the kernel command line switch is:: 1586 1627 1587 1628 1588 1629 ··· 1598 1639 how to communicate with the daemon. You should only specify them if 1599 1640 you told the daemon to use different sockets than the default. So, if 1600 1641 you ran the daemon with no arguments, running the UML on the same 1601 - machine with 1642 + machine with:: 1643 + 1602 1644 eth0=daemon 1603 1645 1604 1646 ··· 1609 1649 1610 1650 1611 1651 1612 - 6.10. Slip 1652 + 6.10. Slip 1653 + ----------- 1613 1654 1614 1655 Slip is another, less general, mechanism for a process to communicate 1615 1656 with the host networking. In contrast to the ethertap interface, ··· 1619 1658 IP. 1620 1659 1621 1660 1622 - The general format of the command line switch is 1661 + The general format of the command line switch is:: 1623 1662 1624 1663 1625 1664 ··· 1642 1681 1643 1682 1644 1683 1645 - 6.11. Slirp 1684 + 6.11. Slirp 1685 + ------------ 1646 1686 1647 1687 slirp uses an external program, usually /usr/bin/slirp, to provide IP 1648 1688 only networking connectivity through the host. This is similar to IP ··· 1653 1691 root access or setuid binaries on the host. 1654 1692 1655 1693 1656 - The general format of the command line switch for slirp is: 1694 + The general format of the command line switch for slirp is:: 1657 1695 1658 1696 1659 1697 ··· 1678 1716 The eth0 interface on UML should be set up with the IP 10.2.0.15, 1679 1717 although you can use anything as long as it is not used by a network 1680 1718 you will be connecting to. The default route on UML should be set to 1681 - use 1719 + use:: 1682 1720 1683 1721 1684 1722 UML# ··· 1699 1737 1700 1738 1701 1739 1702 - 6.12. pcap 1740 + 6.12. pcap 1741 + ----------- 1703 1742 1704 1743 The pcap transport is attached to a UML ethernet device on the command 1705 - line or with uml_mconsole with the following syntax: 1744 + line or with uml_mconsole with the following syntax:: 1706 1745 1707 1746 1708 1747 ··· 1725 1762 expression optimizer is used. 1726 1763 1727 1764 1728 - Example: 1765 + Example:: 1729 1766 1730 1767 1731 1768 ··· 1740 1777 1741 1778 1742 1779 1743 - 6.13. Setting up the host yourself 1780 + 6.13. Setting up the host yourself 1781 + ----------------------------------- 1744 1782 1745 1783 If you don't specify an address for the host side of the ethertap or 1746 1784 slip device, UML won't do any setup on the host. So this is what is ··· 1749 1785 192.168.0.251 and a UML-side IP of 192.168.0.250 - adjust to suit your 1750 1786 own network): 1751 1787 1752 - o The device needs to be configured with its IP address. Tap devices 1788 + - The device needs to be configured with its IP address. Tap devices 1753 1789 are also configured with an mtu of 1484. Slip devices are 1754 1790 configured with a point-to-point address pointing at the UML ip 1755 - address. 1791 + address:: 1756 1792 1757 1793 1758 1794 host# ifconfig tap0 arp mtu 1484 192.168.0.251 up 1759 - 1760 - 1761 - 1762 - 1763 1795 1764 1796 1765 1797 host# ··· 1765 1805 1766 1806 1767 1807 1768 - o If a tap device is being set up, a route is set to the UML IP. 1808 + - If a tap device is being set up, a route is set to the UML IP:: 1769 1809 1770 1810 1771 1811 UML# route add -host 192.168.0.250 gw 192.168.0.251 ··· 1774 1814 1775 1815 1776 1816 1777 - o To allow other hosts on your network to see the virtual machine, 1778 - proxy arp is set up for it. 1817 + - To allow other hosts on your network to see the virtual machine, 1818 + proxy arp is set up for it:: 1779 1819 1780 1820 1781 1821 host# arp -Ds 192.168.0.250 eth0 pub ··· 1784 1824 1785 1825 1786 1826 1787 - o Finally, the host is set up to route packets. 1827 + - Finally, the host is set up to route packets:: 1788 1828 1789 1829 1790 1830 host# echo 1 > /proc/sys/net/ipv4/ip_forward ··· 1798 1838 1799 1839 1800 1840 1801 - 7. Sharing Filesystems between Virtual Machines 1841 + 7. Sharing Filesystems between Virtual Machines 1842 + ================================================ 1802 1843 1803 1844 1804 1845 1805 1846 1806 - 7.1. A warning 1847 + 7.1. A warning 1848 + --------------- 1807 1849 1808 1850 Don't attempt to share filesystems simply by booting two UMLs from the 1809 1851 same file. That's the same thing as booting two physical machines ··· 1813 1851 1814 1852 1815 1853 1816 - 7.2. Using layered block devices 1854 + 7.2. Using layered block devices 1855 + --------------------------------- 1817 1856 1818 1857 The way to share a filesystem between two virtual machines is to use 1819 1858 the copy-on-write (COW) layering capability of the ubd block driver. ··· 1835 1872 1836 1873 1837 1874 To add a copy-on-write layer to an existing block device file, simply 1838 - add the name of the COW file to the appropriate ubd switch: 1875 + add the name of the COW file to the appropriate ubd switch:: 1839 1876 1840 1877 1841 1878 ubd0=root_fs_cow,root_fs_debian_22 ··· 1846 1883 where 'root_fs_cow' is the private COW file and 'root_fs_debian_22' is 1847 1884 the existing shared filesystem. The COW file need not exist. If it 1848 1885 doesn't, the driver will create and initialize it. Once the COW file 1849 - has been initialized, it can be used on its own on the command line: 1886 + has been initialized, it can be used on its own on the command line:: 1850 1887 1851 1888 1852 1889 ubd0=root_fs_cow ··· 1859 1896 1860 1897 1861 1898 1862 - 7.3. Note! 1899 + 7.3. Note! 1900 + ----------- 1863 1901 1864 1902 When checking the size of the COW file in order to see the gobs of 1865 1903 space that you're saving, make sure you use 'ls -ls' to see the actual 1866 1904 disk consumption rather than the length of the file. The COW file is 1867 1905 sparse, so the length will be very different from the disk usage. 1868 1906 Here is a 'ls -l' of a COW file and backing file from one boot and 1869 - shutdown: 1907 + shutdown:: 1908 + 1870 1909 host% ls -l cow.debian debian2.2 1871 1910 -rw-r--r-- 1 jdike jdike 492504064 Aug 6 21:16 cow.debian 1872 1911 -rwxrw-rw- 1 jdike jdike 537919488 Aug 6 20:42 debian2.2 ··· 1876 1911 1877 1912 1878 1913 1879 - Doesn't look like much saved space, does it? Well, here's 'ls -ls': 1914 + Doesn't look like much saved space, does it? Well, here's 'ls -ls':: 1880 1915 1881 1916 1882 1917 host% ls -ls cow.debian debian2.2 ··· 1891 1926 1892 1927 1893 1928 1894 - 7.4. Another warning 1929 + 7.4. Another warning 1930 + --------------------- 1895 1931 1896 1932 Once a filesystem is being used as a readonly backing file for a COW 1897 1933 file, do not boot directly from it or modify it in any way. Doing so ··· 1918 1952 1919 1953 1920 1954 1921 - 7.5. uml_moo : Merging a COW file with its backing file 1955 + 7.5. uml_moo : Merging a COW file with its backing file 1956 + -------------------------------------------------------- 1922 1957 1923 1958 Depending on how you use UML and COW devices, it may be advisable to 1924 1959 merge the changes in the COW file into the backing file every once in ··· 1928 1961 1929 1962 1930 1963 1931 - The utility that does this is uml_moo. Its usage is 1964 + The utility that does this is uml_moo. Its usage is:: 1932 1965 1933 1966 1934 1967 host% uml_moo COW file new backing file ··· 1968 2001 1969 2002 1970 2003 1971 - 8. Creating filesystems 2004 + 8. Creating filesystems 2005 + ======================== 1972 2006 1973 2007 1974 2008 You may want to create and mount new UML filesystems, either because ··· 1983 2015 should be easy to translate to the filesystem of your choice. 1984 2016 1985 2017 1986 - 8.1. Create the filesystem file 2018 + 8.1. Create the filesystem file 2019 + ================================ 1987 2020 1988 2021 dd is your friend. All you need to do is tell dd to create an empty 1989 2022 file of the appropriate size. I usually make it sparse to save time 1990 2023 and to avoid allocating disk space until it's actually used. For 1991 2024 example, the following command will create a sparse 100 meg file full 1992 - of zeroes. 2025 + of zeroes:: 1993 2026 1994 2027 1995 2028 host% ··· 2003 2034 2004 2035 8.2. Assign the file to a UML device 2005 2036 2006 - Add an argument like the following to the UML command line: 2037 + Add an argument like the following to the UML command line:: 2007 2038 2008 - ubd4=new_filesystem 2039 + ubd4=new_filesystem 2009 2040 2010 2041 2011 2042 ··· 2022 2053 etc), then get them into UML by way of the net or hostfs. 2023 2054 2024 2055 2025 - Make the new filesystem on the device assigned to the new file: 2056 + Make the new filesystem on the device assigned to the new file:: 2026 2057 2027 2058 2028 2059 host# mkreiserfs /dev/ubd/4 ··· 2046 2077 2047 2078 2048 2079 2049 - Now, mount it: 2080 + Now, mount it:: 2050 2081 2051 2082 2052 2083 UML# ··· 2065 2096 2066 2097 2067 2098 2068 - 9. Host file access 2099 + 9. Host file access 2100 + ==================== 2069 2101 2070 2102 2071 2103 If you want to access files on the host machine from inside UML, you ··· 2082 2112 files contained in it just as you would on the host. 2083 2113 2084 2114 2085 - 9.1. Using hostfs 2115 + 9.1. Using hostfs 2116 + ------------------ 2086 2117 2087 2118 To begin with, make sure that hostfs is available inside the virtual 2088 - machine with 2119 + machine with:: 2089 2120 2090 2121 2091 2122 UML# cat /proc/filesystems ··· 2098 2127 module and available inside the virtual machine, and insmod it. 2099 2128 2100 2129 2101 - Now all you need to do is run mount: 2130 + Now all you need to do is run mount:: 2102 2131 2103 2132 2104 2133 UML# mount none /mnt/host -t hostfs ··· 2110 2139 2111 2140 2112 2141 If you don't want to mount the host root directory, then you can 2113 - specify a subdirectory to mount with the -o switch to mount: 2142 + specify a subdirectory to mount with the -o switch to mount:: 2114 2143 2115 2144 2116 2145 UML# mount none /mnt/home -t hostfs -o /home ··· 2122 2151 2123 2152 2124 2153 2125 - 9.2. hostfs as the root filesystem 2154 + 9.2. hostfs as the root filesystem 2155 + ----------------------------------- 2126 2156 2127 2157 It's possible to boot from a directory hierarchy on the host using 2128 2158 hostfs rather than using the standard filesystem in a file. 2129 2159 2130 2160 To start, you need that hierarchy. The easiest way is to loop mount 2131 - an existing root_fs file: 2161 + an existing root_fs file:: 2132 2162 2133 2163 2134 2164 host# mount root_fs uml_root_dir -o loop ··· 2138 2166 2139 2167 2140 2168 You need to change the filesystem type of / in etc/fstab to be 2141 - 'hostfs', so that line looks like this: 2169 + 'hostfs', so that line looks like this:: 2142 2170 2143 - /dev/ubd/0 / hostfs defaults 1 1 2171 + /dev/ubd/0 / hostfs defaults 1 1 2144 2172 2145 2173 2146 2174 2147 2175 2148 2176 Then you need to chown to yourself all the files in that directory 2149 - that are owned by root. This worked for me: 2177 + that are owned by root. This worked for me:: 2150 2178 2151 2179 2152 2180 host# find . -uid 0 -exec chown jdike {} \; ··· 2155 2183 2156 2184 2157 2185 Next, make sure that your UML kernel has hostfs compiled in, not as a 2158 - module. Then run UML with the boot device pointing at that directory: 2186 + module. Then run UML with the boot device pointing at that directory:: 2159 2187 2160 2188 2161 2189 ubd0=/path/to/uml/root/directory ··· 2166 2194 UML should then boot as it does normally. 2167 2195 2168 2196 2169 - 9.3. Building hostfs 2197 + 9.3. Building hostfs 2198 + --------------------- 2170 2199 2171 2200 If you need to build hostfs because it's not in your kernel, you have 2172 2201 two choices: 2173 2202 2174 2203 2175 2204 2176 - o Compiling hostfs into the kernel: 2205 + - Compiling hostfs into the kernel: 2177 2206 2178 2207 2179 2208 Reconfigure the kernel and set the 'Host filesystem' option under 2180 2209 2181 2210 2182 - o Compiling hostfs as a module: 2211 + - Compiling hostfs as a module: 2183 2212 2184 2213 2185 2214 Reconfigure the kernel and set the 'Host filesystem' option under 2186 2215 be in arch/um/fs/hostfs/hostfs.o. Install that in 2187 - /lib/modules/`uname -r`/fs in the virtual machine, boot it up, and 2216 + ``/lib/modules/$(uname -r)/fs`` in the virtual machine, boot it up, and:: 2188 2217 2189 2218 2190 2219 UML# insmod hostfs 2191 2220 2192 2221 2222 + .. _The_Management_Console: 2193 2223 2194 - 2195 - 2196 - 2197 - 2198 - 2199 - 2200 - 2201 - 2202 - 2203 - 10. The Management Console 2224 + 10. The Management Console 2225 + =========================== 2204 2226 2205 2227 2206 2228 ··· 2206 2240 2207 2241 There are a number of things you can do with the mconsole interface: 2208 2242 2209 - o get the kernel version 2243 + - get the kernel version 2210 2244 2211 - o add and remove devices 2245 + - add and remove devices 2212 2246 2213 - o halt or reboot the machine 2247 + - halt or reboot the machine 2214 2248 2215 - o Send SysRq commands 2249 + - Send SysRq commands 2216 2250 2217 - o Pause and resume the UML 2251 + - Pause and resume the UML 2218 2252 2219 2253 2220 2254 You need the mconsole client (uml_mconsole) which is present in CVS ··· 2223 2257 2224 2258 2225 2259 You also need CONFIG_MCONSOLE (under 'General Setup') enabled in UML. 2226 - When you boot UML, you'll see a line like: 2260 + When you boot UML, you'll see a line like:: 2227 2261 2228 2262 2229 2263 mconsole initialized on /home/jdike/.uml/umlNJ32yL/mconsole ··· 2231 2265 2232 2266 2233 2267 2234 - If you specify a unique machine id one the UML command line, i.e. 2268 + If you specify a unique machine id one the UML command line, i.e.:: 2235 2269 2236 2270 2237 2271 umid=debian ··· 2239 2273 2240 2274 2241 2275 2242 - you'll see this 2276 + you'll see this:: 2243 2277 2244 2278 2245 2279 mconsole initialized on /home/jdike/.uml/debian/mconsole ··· 2248 2282 2249 2283 2250 2284 That file is the socket that uml_mconsole will use to communicate with 2251 - UML. Run it with either the umid or the full path as its argument: 2285 + UML. Run it with either the umid or the full path as its argument:: 2252 2286 2253 2287 2254 2288 host% uml_mconsole debian ··· 2256 2290 2257 2291 2258 2292 2259 - or 2293 + or:: 2260 2294 2261 2295 2262 2296 host% uml_mconsole /home/jdike/.uml/debian/mconsole ··· 2266 2300 2267 2301 You'll get a prompt, at which you can run one of these commands: 2268 2302 2269 - o version 2303 + - version 2270 2304 2271 - o halt 2305 + - halt 2272 2306 2273 - o reboot 2307 + - reboot 2274 2308 2275 - o config 2309 + - config 2276 2310 2277 - o remove 2311 + - remove 2278 2312 2279 - o sysrq 2313 + - sysrq 2280 2314 2281 - o help 2315 + - help 2282 2316 2283 - o cad 2317 + - cad 2284 2318 2285 - o stop 2319 + - stop 2286 2320 2287 - o go 2321 + - go 2288 2322 2289 2323 2290 - 10.1. version 2324 + 10.1. version 2325 + -------------- 2291 2326 2292 - This takes no arguments. It prints the UML version. 2327 + This takes no arguments. It prints the UML version:: 2293 2328 2294 2329 2295 2330 (mconsole) version ··· 2309 2342 2310 2343 2311 2344 2312 - 10.2. halt and reboot 2345 + 10.2. halt and reboot 2346 + ---------------------- 2313 2347 2314 2348 These take no arguments. They shut the machine down immediately, with 2315 2349 no syncing of disks and no clean shutdown of userspace. So, they are 2316 - pretty close to crashing the machine. 2350 + pretty close to crashing the machine:: 2317 2351 2318 2352 2319 2353 (mconsole) halt ··· 2325 2357 2326 2358 2327 2359 2328 - 10.3. config 2360 + 10.3. config 2361 + ------------- 2329 2362 2330 2363 "config" adds a new device to the virtual machine. Currently the ubd 2331 2364 and network drivers support this. It takes one argument, which is the 2332 - device to add, with the same syntax as the kernel command line. 2365 + device to add, with the same syntax as the kernel command line:: 2333 2366 2334 2367 2335 2368 2336 2369 2337 - (mconsole) 2338 - config ubd3=/home/jdike/incoming/roots/root_fs_debian22 2370 + (mconsole) 2371 + config ubd3=/home/jdike/incoming/roots/root_fs_debian22 2339 2372 2340 - OK 2341 - (mconsole) config eth1=mcast 2342 - OK 2343 - 2344 - 2373 + OK 2374 + (mconsole) config eth1=mcast 2375 + OK 2345 2376 2346 2377 2347 2378 2348 2379 2349 - 10.4. remove 2380 + 2381 + 2382 + 10.4. remove 2383 + ------------- 2350 2384 2351 2385 "remove" deletes a device from the system. Its argument is just the 2352 2386 name of the device to be removed. The device must be idle in whatever 2353 2387 sense the driver considers necessary. In the case of the ubd driver, 2354 2388 the removed block device must not be mounted, swapped on, or otherwise 2355 - open, and in the case of the network driver, the device must be down. 2389 + open, and in the case of the network driver, the device must be down:: 2356 2390 2357 2391 2358 2392 (mconsole) remove ubd3 ··· 2367 2397 2368 2398 2369 2399 2370 - 10.5. sysrq 2400 + 10.5. sysrq 2401 + ------------ 2371 2402 2372 2403 This takes one argument, which is a single letter. It calls the 2373 2404 generic kernel's SysRq driver, which does whatever is called for by ··· 2378 2407 2379 2408 2380 2409 2381 - 10.6. help 2410 + 10.6. help 2411 + ----------- 2382 2412 2383 2413 "help" returns a string listing the valid commands and what each one 2384 2414 does. 2385 2415 2386 2416 2387 2417 2388 - 10.7. cad 2418 + 10.7. cad 2419 + ---------- 2389 2420 2390 2421 This invokes the Ctl-Alt-Del action on init. What exactly this ends 2391 2422 up doing is up to /etc/inittab. Normally, it reboots the machine. 2392 2423 With UML, this is usually not desired, so if a halt would be better, 2393 - then find the section of inittab that looks like this 2424 + then find the section of inittab that looks like this:: 2394 2425 2395 2426 2396 2427 # What to do when CTRL-ALT-DEL is pressed. ··· 2405 2432 2406 2433 2407 2434 2408 - 10.8. stop 2435 + 10.8. stop 2436 + ----------- 2409 2437 2410 2438 This puts the UML in a loop reading mconsole requests until a 'go' 2411 2439 mconsole command is received. This is very useful for making backups ··· 2422 2448 2423 2449 2424 2450 2425 - 10.9. go 2451 + 10.9. go 2452 + --------- 2426 2453 2427 2454 This resumes a UML after being paused by a 'stop' command. Note that 2428 2455 when the UML has resumed, TCP connections may have timed out and if ··· 2435 2460 2436 2461 2437 2462 2463 + .. _Kernel_debugging: 2438 2464 2439 - 2440 - 11. Kernel debugging 2465 + 11. Kernel debugging 2466 + ===================== 2441 2467 2442 2468 2443 2469 Note: The interface that makes debugging, as described here, possible ··· 2453 2477 2454 2478 2455 2479 In order to debug the kernel, you need build it from source. See 2456 - ``Compiling the kernel and modules'' for information on doing that. 2480 + :ref:`Compiling_the_kernel_and_modules` for information on doing that. 2457 2481 Make sure that you enable CONFIG_DEBUGSYM and CONFIG_PT_PROXY during 2458 - the config. These will compile the kernel with -g, and enable the 2482 + the config. These will compile the kernel with ``-g``, and enable the 2459 2483 ptrace proxy so that gdb works with UML, respectively. 2460 2484 2461 2485 2462 2486 2463 2487 2464 - 11.1. Starting the kernel under gdb 2488 + 11.1. Starting the kernel under gdb 2489 + ------------------------------------ 2465 2490 2466 2491 You can have the kernel running under the control of gdb from the 2467 2492 beginning by putting 'debug' on the command line. You will get an ··· 2475 2498 There is a transcript of a debugging session here <debug- 2476 2499 session.html> , with breakpoints being set in the scheduler and in an 2477 2500 interrupt handler. 2478 - 11.2. Examining sleeping processes 2501 + 2502 + 2503 + 11.2. Examining sleeping processes 2504 + ----------------------------------- 2505 + 2479 2506 2480 2507 Not every bug is evident in the currently running process. Sometimes, 2481 2508 processes hang in the kernel when they shouldn't because they've ··· 2497 2516 2498 2517 Now what you do is this: 2499 2518 2500 - o detach from the current thread 2519 + - detach from the current thread:: 2501 2520 2502 2521 2503 2522 (UML gdb) det ··· 2506 2525 2507 2526 2508 2527 2509 - o attach to the thread you are interested in 2528 + - attach to the thread you are interested in:: 2510 2529 2511 2530 2512 2531 (UML gdb) att <host pid> ··· 2515 2534 2516 2535 2517 2536 2518 - o look at its stack and anything else of interest 2537 + - look at its stack and anything else of interest:: 2519 2538 2520 2539 2521 2540 (UML gdb) bt ··· 2526 2545 Note that you can't do anything at this point that requires that a 2527 2546 process execute, e.g. calling a function 2528 2547 2529 - o when you're done looking at that process, reattach to the current 2530 - thread and continue it 2548 + - when you're done looking at that process, reattach to the current 2549 + thread and continue it:: 2531 2550 2532 2551 2533 2552 (UML gdb) 2534 2553 att 1 2535 - 2536 - 2537 - 2538 - 2539 2554 2540 2555 2541 2556 (UML gdb) ··· 2546 2569 2547 2570 2548 2571 2549 - 11.3. Running ddd on UML 2572 + 11.3. Running ddd on UML 2573 + ------------------------- 2550 2574 2551 2575 ddd works on UML, but requires a special kludge. The process goes 2552 2576 like this: 2553 2577 2554 - o Start ddd 2578 + - Start ddd:: 2555 2579 2556 2580 2557 2581 host% ddd linux ··· 2561 2583 2562 2584 2563 2585 2564 - o With ps, get the pid of the gdb that ddd started. You can ask the 2586 + - With ps, get the pid of the gdb that ddd started. You can ask the 2565 2587 gdb to tell you, but for some reason that confuses things and 2566 2588 causes a hang. 2567 2589 2568 - o run UML with 'debug=parent gdb-pid=<pid>' added to the command line 2590 + - run UML with 'debug=parent gdb-pid=<pid>' added to the command line 2569 2591 - it will just sit there after you hit return 2570 2592 2571 - o type 'att 1' to the ddd gdb and you will see something like 2593 + - type 'att 1' to the ddd gdb and you will see something like:: 2572 2594 2573 2595 2574 2596 0xa013dc51 in __kill () ··· 2580 2602 2581 2603 2582 2604 2583 - o At this point, type 'c', UML will boot up, and you can use ddd just 2605 + - At this point, type 'c', UML will boot up, and you can use ddd just 2584 2606 as you do on any other process. 2585 2607 2586 2608 2587 2609 2588 - 11.4. Debugging modules 2610 + 11.4. Debugging modules 2611 + ------------------------ 2612 + 2589 2613 2590 2614 gdb has support for debugging code which is dynamically loaded into 2591 2615 the process. This support is what is needed to debug kernel modules ··· 2609 2629 2610 2630 2611 2631 First, you must tell it where your modules are. There is a list in 2612 - the script that looks like this: 2632 + the script that looks like this:: 2633 + 2613 2634 set MODULE_PATHS { 2614 2635 "fat" "/usr/src/uml/linux-2.4.18/fs/fat/fat.o" 2615 2636 "isofs" "/usr/src/uml/linux-2.4.18/fs/isofs/isofs.o" ··· 2622 2641 2623 2642 You change that to list the names and paths of the modules that you 2624 2643 are going to debug. Then you run it from the toplevel directory of 2625 - your UML pool and it basically tells you what to do: 2626 - 2627 - 2644 + your UML pool and it basically tells you what to do:: 2628 2645 2629 2646 2630 2647 ******** GDB pid is 21903 ******** ··· 2645 2666 2646 2667 2647 2668 After you run UML and it sits there doing nothing, you hit return at 2648 - the 'att 1' and continue it: 2669 + the 'att 1' and continue it:: 2649 2670 2650 2671 2651 2672 Attaching to program: /home/jdike/linux/2.4/um/./linux, process 1 ··· 2657 2678 2658 2679 2659 2680 At this point, you debug normally. When you insmod something, the 2660 - expect magic will kick in and you'll see something like: 2681 + expect magic will kick in and you'll see something like:: 2661 2682 2662 2683 2684 + *** Module hostfs loaded *** 2685 + Breakpoint 1, sys_init_module (name_user=0x805abb0 "hostfs", 2686 + mod_user=0x8070e00) at module.c:349 2687 + 349 char *name, *n_name, *name_tmp = NULL; 2688 + (UML gdb) finish 2689 + Run till exit from #0 sys_init_module (name_user=0x805abb0 "hostfs", 2690 + mod_user=0x8070e00) at module.c:349 2691 + 0xa00e2e23 in execute_syscall (r=0xa8140284) at syscall_kern.c:411 2692 + 411 else res = EXECUTE_SYSCALL(syscall, regs); 2693 + Value returned is $1 = 0 2694 + (UML gdb) 2695 + p/x (int)module_list + module_list->size_of_struct 2663 2696 2697 + $2 = 0xa9021054 2698 + (UML gdb) symbol-file ./linux 2699 + Load new symbol table from "./linux"? (y or n) y 2700 + Reading symbols from ./linux... 2701 + done. 2702 + (UML gdb) 2703 + add-symbol-file /home/jdike/linux/2.4/um/arch/um/fs/hostfs/hostfs.o 0xa9021054 2664 2704 2705 + add symbol table from file "/home/jdike/linux/2.4/um/arch/um/fs/hostfs/hostfs.o" at 2706 + .text_addr = 0xa9021054 2707 + (y or n) y 2665 2708 2666 - 2667 - 2668 - 2669 - 2670 - 2671 - 2672 - 2673 - 2674 - 2675 - 2676 - 2677 - 2678 - *** Module hostfs loaded *** 2679 - Breakpoint 1, sys_init_module (name_user=0x805abb0 "hostfs", 2680 - mod_user=0x8070e00) at module.c:349 2681 - 349 char *name, *n_name, *name_tmp = NULL; 2682 - (UML gdb) finish 2683 - Run till exit from #0 sys_init_module (name_user=0x805abb0 "hostfs", 2684 - mod_user=0x8070e00) at module.c:349 2685 - 0xa00e2e23 in execute_syscall (r=0xa8140284) at syscall_kern.c:411 2686 - 411 else res = EXECUTE_SYSCALL(syscall, regs); 2687 - Value returned is $1 = 0 2688 - (UML gdb) 2689 - p/x (int)module_list + module_list->size_of_struct 2690 - 2691 - $2 = 0xa9021054 2692 - (UML gdb) symbol-file ./linux 2693 - Load new symbol table from "./linux"? (y or n) y 2694 - Reading symbols from ./linux... 2695 - done. 2696 - (UML gdb) 2697 - add-symbol-file /home/jdike/linux/2.4/um/arch/um/fs/hostfs/hostfs.o 0xa9021054 2698 - 2699 - add symbol table from file "/home/jdike/linux/2.4/um/arch/um/fs/hostfs/hostfs.o" at 2700 - .text_addr = 0xa9021054 2701 - (y or n) y 2702 - 2703 - Reading symbols from /home/jdike/linux/2.4/um/arch/um/fs/hostfs/hostfs.o... 2704 - done. 2705 - (UML gdb) p *module_list 2706 - $1 = {size_of_struct = 84, next = 0xa0178720, name = 0xa9022de0 "hostfs", 2707 - size = 9016, uc = {usecount = {counter = 0}, pad = 0}, flags = 1, 2708 - nsyms = 57, ndeps = 0, syms = 0xa9023170, deps = 0x0, refs = 0x0, 2709 - init = 0xa90221f0 <init_hostfs>, cleanup = 0xa902222c <exit_hostfs>, 2710 - ex_table_start = 0x0, ex_table_end = 0x0, persist_start = 0x0, 2711 - persist_end = 0x0, can_unload = 0, runsize = 0, kallsyms_start = 0x0, 2712 - kallsyms_end = 0x0, 2713 - archdata_start = 0x1b855 <Address 0x1b855 out of bounds>, 2714 - archdata_end = 0xe5890000 <Address 0xe5890000 out of bounds>, 2715 - kernel_data = 0xf689c35d <Address 0xf689c35d out of bounds>} 2716 - >> Finished loading symbols for hostfs ... 2709 + Reading symbols from /home/jdike/linux/2.4/um/arch/um/fs/hostfs/hostfs.o... 2710 + done. 2711 + (UML gdb) p *module_list 2712 + $1 = {size_of_struct = 84, next = 0xa0178720, name = 0xa9022de0 "hostfs", 2713 + size = 9016, uc = {usecount = {counter = 0}, pad = 0}, flags = 1, 2714 + nsyms = 57, ndeps = 0, syms = 0xa9023170, deps = 0x0, refs = 0x0, 2715 + init = 0xa90221f0 <init_hostfs>, cleanup = 0xa902222c <exit_hostfs>, 2716 + ex_table_start = 0x0, ex_table_end = 0x0, persist_start = 0x0, 2717 + persist_end = 0x0, can_unload = 0, runsize = 0, kallsyms_start = 0x0, 2718 + kallsyms_end = 0x0, 2719 + archdata_start = 0x1b855 <Address 0x1b855 out of bounds>, 2720 + archdata_end = 0xe5890000 <Address 0xe5890000 out of bounds>, 2721 + kernel_data = 0xf689c35d <Address 0xf689c35d out of bounds>} 2722 + >> Finished loading symbols for hostfs ... 2717 2723 2718 2724 2719 2725 ··· 2708 2744 2709 2745 2710 2746 Boot the kernel under the debugger and load the module with insmod or 2711 - modprobe. With gdb, do: 2747 + modprobe. With gdb, do:: 2712 2748 2713 2749 2714 2750 (UML gdb) p module_list ··· 2722 2758 the name fields until find the module you want to debug. Take the 2723 2759 address of that structure, and add module.size_of_struct (which in 2724 2760 2.4.10 kernels is 96 (0x60)) to it. Gdb can make this hard addition 2725 - for you :-): 2761 + for you :-):: 2726 2762 2727 2763 2728 2764 2729 - (UML gdb) 2730 - printf "%#x\n", (int)module_list module_list->size_of_struct 2765 + (UML gdb) 2766 + printf "%#x\n", (int)module_list module_list->size_of_struct 2731 2767 2732 2768 2733 2769 ··· 2735 2771 The offset from the module start occasionally changes (before 2.4.0, 2736 2772 it was module.size_of_struct + 4), so it's a good idea to check the 2737 2773 init and cleanup addresses once in a while, as describe below. Now 2738 - do: 2774 + do:: 2739 2775 2740 2776 2741 2777 (UML gdb) ··· 2750 2786 If there's any doubt that you got the offset right, like breakpoints 2751 2787 appear not to work, or they're appearing in the wrong place, you can 2752 2788 check it by looking at the module structure. The init and cleanup 2753 - fields should look like: 2789 + fields should look like:: 2754 2790 2755 2791 2756 2792 init = 0x588066b0 <init_hostfs>, cleanup = 0x588066c0 <exit_hostfs> ··· 2765 2801 2766 2802 When you want to load in a new version of the module, you need to get 2767 2803 gdb to forget about the old one. The only way I've found to do that 2768 - is to tell gdb to forget about all symbols that it knows about: 2804 + is to tell gdb to forget about all symbols that it knows about:: 2769 2805 2770 2806 2771 2807 (UML gdb) symbol-file ··· 2773 2809 2774 2810 2775 2811 2776 - Then reload the symbols from the kernel binary: 2812 + Then reload the symbols from the kernel binary:: 2777 2813 2778 2814 2779 2815 (UML gdb) symbol-file /path/to/kernel ··· 2787 2823 2788 2824 2789 2825 2790 - 11.5. Attaching gdb to the kernel 2826 + 11.5. Attaching gdb to the kernel 2827 + ---------------------------------- 2791 2828 2792 2829 If you don't have the kernel running under gdb, you can attach gdb to 2793 2830 it later by sending the tracing thread a SIGUSR1. The first line of 2794 - the console output identifies its pid: 2831 + the console output identifies its pid:: 2832 + 2795 2833 tracing thread pid = 20093 2796 2834 2797 2835 2798 2836 2799 2837 2800 - When you send it the signal: 2838 + When you send it the signal:: 2801 2839 2802 2840 2803 2841 host% kill -USR1 20093 ··· 2811 2845 2812 2846 2813 2847 If you have the mconsole compiled into UML, then the mconsole client 2814 - can be used to start gdb: 2848 + can be used to start gdb:: 2815 2849 2816 2850 2817 2851 (mconsole) (mconsole) config gdb=xterm ··· 2823 2857 2824 2858 2825 2859 2826 - 11.6. Using alternate debuggers 2860 + 11.6. Using alternate debuggers 2861 + -------------------------------- 2827 2862 2828 2863 UML has support for attaching to an already running debugger rather 2829 2864 than starting gdb itself. This is present in CVS as of 17 Apr 2001. ··· 2853 2886 An example of an alternate debugger is strace. You can strace the 2854 2887 actual kernel as follows: 2855 2888 2856 - o Run the following in a shell 2889 + - Run the following in a shell:: 2857 2890 2858 2891 2859 2892 host% ··· 2861 2894 2862 2895 2863 2896 2864 - o Run UML with 'debug' and 'gdb-pid=<pid>' with the pid printed out 2897 + - Run UML with 'debug' and 'gdb-pid=<pid>' with the pid printed out 2865 2898 by the previous command 2866 2899 2867 - o Hit return in the shell, and UML will start running, and strace 2900 + - Hit return in the shell, and UML will start running, and strace 2868 2901 output will start accumulating in the output file. 2869 2902 2870 - Note that this is different from running 2903 + Note that this is different from running:: 2871 2904 2872 2905 2873 2906 host% strace ./linux ··· 2884 2917 2885 2918 2886 2919 2887 - 12. Kernel debugging examples 2920 + 12. Kernel debugging examples 2921 + ============================== 2888 2922 2889 - 12.1. The case of the hung fsck 2923 + 12.1. The case of the hung fsck 2924 + -------------------------------- 2890 2925 2891 2926 When booting up the kernel, fsck failed, and dropped me into a shell 2892 - to fix things up. I ran fsck -y, which hung: 2927 + to fix things up. I ran fsck -y, which hung:: 2893 2928 2894 2929 2930 + Setting hostname uml [ OK ] 2931 + Checking root filesystem 2932 + /dev/fhd0 was not cleanly unmounted, check forced. 2933 + Error reading block 86894 (Attempt to read block from filesystem resulted in short read) while reading indirect blocks of inode 19780. 2895 2934 2935 + /dev/fhd0: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. 2936 + (i.e., without -a or -p options) 2937 + [ FAILED ] 2896 2938 2939 + *** An error occurred during the file system check. 2940 + *** Dropping you to a shell; the system will reboot 2941 + *** when you leave the shell. 2942 + Give root password for maintenance 2943 + (or type Control-D for normal startup): 2897 2944 2945 + [root@uml /root]# fsck -y /dev/fhd0 2946 + fsck -y /dev/fhd0 2947 + Parallelizing fsck version 1.14 (9-Jan-1999) 2948 + e2fsck 1.14, 9-Jan-1999 for EXT2 FS 0.5b, 95/08/09 2949 + /dev/fhd0 contains a file system with errors, check forced. 2950 + Pass 1: Checking inodes, blocks, and sizes 2951 + Error reading block 86894 (Attempt to read block from filesystem resulted in short read) while reading indirect blocks of inode 19780. Ignore error? yes 2898 2952 2953 + Inode 19780, i_blocks is 1548, should be 540. Fix? yes 2899 2954 2955 + Pass 2: Checking directory structure 2956 + Error reading block 49405 (Attempt to read block from filesystem resulted in short read). Ignore error? yes 2900 2957 2958 + Directory inode 11858, block 0, offset 0: directory corrupted 2959 + Salvage? yes 2901 2960 2961 + Missing '.' in directory inode 11858. 2962 + Fix? yes 2902 2963 2903 - 2904 - 2905 - 2906 - 2907 - 2908 - 2909 - 2910 - 2911 - 2912 - 2913 - 2914 - 2915 - 2916 - 2917 - 2918 - 2919 - 2920 - 2921 - 2922 - 2923 - 2924 - 2925 - 2926 - 2927 - 2928 - 2929 - 2930 - Setting hostname uml [ OK ] 2931 - Checking root filesystem 2932 - /dev/fhd0 was not cleanly unmounted, check forced. 2933 - Error reading block 86894 (Attempt to read block from filesystem resulted in short read) while reading indirect blocks of inode 19780. 2934 - 2935 - /dev/fhd0: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. 2936 - (i.e., without -a or -p options) 2937 - [ FAILED ] 2938 - 2939 - *** An error occurred during the file system check. 2940 - *** Dropping you to a shell; the system will reboot 2941 - *** when you leave the shell. 2942 - Give root password for maintenance 2943 - (or type Control-D for normal startup): 2944 - 2945 - [root@uml /root]# fsck -y /dev/fhd0 2946 - fsck -y /dev/fhd0 2947 - Parallelizing fsck version 1.14 (9-Jan-1999) 2948 - e2fsck 1.14, 9-Jan-1999 for EXT2 FS 0.5b, 95/08/09 2949 - /dev/fhd0 contains a file system with errors, check forced. 2950 - Pass 1: Checking inodes, blocks, and sizes 2951 - Error reading block 86894 (Attempt to read block from filesystem resulted in short read) while reading indirect blocks of inode 19780. Ignore error? yes 2952 - 2953 - Inode 19780, i_blocks is 1548, should be 540. Fix? yes 2954 - 2955 - Pass 2: Checking directory structure 2956 - Error reading block 49405 (Attempt to read block from filesystem resulted in short read). Ignore error? yes 2957 - 2958 - Directory inode 11858, block 0, offset 0: directory corrupted 2959 - Salvage? yes 2960 - 2961 - Missing '.' in directory inode 11858. 2962 - Fix? yes 2963 - 2964 - Missing '..' in directory inode 11858. 2965 - Fix? yes 2966 - 2967 - 2968 - 2964 + Missing '..' in directory inode 11858. 2965 + Fix? yes 2969 2966 2970 2967 2971 2968 The standard drill in this sort of situation is to fire up gdb on the 2972 2969 signal thread, which, in this case, was pid 1935. In another window, 2973 - I run gdb and attach pid 1935. 2974 - 2975 - 2970 + I run gdb and attach pid 1935:: 2976 2971 2977 2972 2978 2973 ~/linux/2.3.26/um 1016: gdb linux ··· 2951 3022 0x100756d9 in __wait4 () 2952 3023 2953 3024 2954 - 2955 - 2956 - 2957 - 2958 - Let's see what's currently running: 3025 + Let's see what's currently running:: 2959 3026 2960 3027 2961 3028 ··· 2966 3041 reason and never woke up. 2967 3042 2968 3043 2969 - Let's guess that the last process in the process list is fsck: 3044 + Let's guess that the last process in the process list is fsck:: 2970 3045 2971 3046 2972 3047 ··· 2977 3052 2978 3053 2979 3054 2980 - It is, so let's see what it thinks it's up to: 3055 + It is, so let's see what it thinks it's up to:: 2981 3056 2982 3057 2983 3058 ··· 2993 3068 2994 3069 2995 3070 2996 - 2997 - 2998 3071 The interesting things here are the fact that its .thread.syscall.id 2999 3072 is __NR_write (see the big switch in arch/um/kernel/syscall_kern.c or 3000 3073 the defines in include/asm-um/arch/unistd.h), and that it never ··· 3004 3081 The fact that it never returned from write means that its stack should 3005 3082 be fairly interesting. Its pid is 1980 (.thread.extern_pid). That 3006 3083 process is being ptraced by the signal thread, so it must be detached 3007 - before gdb can attach it: 3084 + before gdb can attach it:: 3008 3085 3009 3086 3010 3087 3088 + (gdb) call detach(1980) 3011 3089 3012 - 3013 - 3014 - 3015 - 3016 - 3017 - 3018 - (gdb) call detach(1980) 3019 - 3020 - Program received signal SIGSEGV, Segmentation fault. 3021 - <function called from gdb> 3022 - The program being debugged stopped while in a function called from GDB. 3023 - When the function (detach) is done executing, GDB will silently 3024 - stop (instead of continuing to evaluate the expression containing 3025 - the function call). 3026 - (gdb) call detach(1980) 3027 - $15 = 0 3028 - 3029 - 3030 - 3090 + Program received signal SIGSEGV, Segmentation fault. 3091 + <function called from gdb> 3092 + The program being debugged stopped while in a function called from GDB. 3093 + When the function (detach) is done executing, GDB will silently 3094 + stop (instead of continuing to evaluate the expression containing 3095 + the function call). 3096 + (gdb) call detach(1980) 3097 + $15 = 0 3031 3098 3032 3099 3033 3100 The first detach segfaults for some reason, and the second one ··· 3025 3112 3026 3113 3027 3114 Now I detach from the signal thread, attach to the fsck thread, and 3028 - look at its stack: 3115 + look at its stack:: 3029 3116 3030 3117 3031 3118 (gdb) det ··· 3065 3152 3066 3153 3067 3154 3068 - The interesting things here are : 3155 + The interesting things here are: 3069 3156 3070 - o There are two segfaults on this stack (frames 9 and 14) 3157 + - There are two segfaults on this stack (frames 9 and 14) 3071 3158 3072 - o The first faulting address (frame 11) is 0x50000800 3159 + - The first faulting address (frame 11) is 0x50000800:: 3073 3160 3074 - (gdb) p (void *)1342179328 3075 - $16 = (void *) 0x50000800 3161 + (gdb) p (void *)1342179328 3162 + $16 = (void *) 0x50000800 3076 3163 3077 3164 3078 3165 ··· 3088 3175 3089 3176 However, the more immediate problem is that second segfault and I'm 3090 3177 going to concentrate on that. First, I want to see where the fault 3091 - happened, so I have to go look at the sigcontent struct in frame 8: 3178 + happened, so I have to go look at the sigcontent struct in frame 8:: 3092 3179 3093 3180 3094 3181 ··· 3124 3211 3125 3212 3126 3213 3127 - That's not very useful, so I'll try a more manual method: 3214 + That's not very useful, so I'll try a more manual method:: 3128 3215 3129 3216 3130 3217 (gdb) p *((struct sigcontext *) (&sig + 1)) ··· 3137 3224 3138 3225 3139 3226 3140 - The ip is in handle_mm_fault: 3227 + The ip is in handle_mm_fault:: 3141 3228 3142 3229 3143 3230 (gdb) p (void *)268480945 ··· 3149 3236 3150 3237 3151 3238 3152 - Specifically, it's in pte_alloc: 3239 + Specifically, it's in pte_alloc:: 3153 3240 3154 3241 3155 3242 (gdb) i line *$20 ··· 3162 3249 3163 3250 3164 3251 To find where in handle_mm_fault this is, I'll jump forward in the 3165 - code until I see an address in that procedure: 3252 + code until I see an address in that procedure:: 3166 3253 3167 3254 3168 3255 ··· 3199 3286 3200 3287 3201 3288 Something is apparently wrong with the page tables or vma_structs, so 3202 - lets go back to frame 11 and have a look at them: 3289 + lets go back to frame 11 and have a look at them:: 3203 3290 3204 3291 3205 3292 3206 - #11 0x1006c0aa in segv (address=1342179328, is_write=2) at trap_kern.c:50 3207 - 50 handle_mm_fault(current, vma, address, is_write); 3208 - (gdb) call pgd_offset_proc(vma->vm_mm, address) 3209 - $22 = (pgd_t *) 0x80a548c 3293 + #11 0x1006c0aa in segv (address=1342179328, is_write=2) at trap_kern.c:50 3294 + 50 handle_mm_fault(current, vma, address, is_write); 3295 + (gdb) call pgd_offset_proc(vma->vm_mm, address) 3296 + $22 = (pgd_t *) 0x80a548c 3210 3297 3211 3298 3212 3299 3213 3300 3214 3301 3215 3302 That's pretty bogus. Page tables aren't supposed to be in process 3216 - text or data areas. Let's see what's in the vma: 3303 + text or data areas. Let's see what's in the vma:: 3217 3304 3218 3305 3219 3306 (gdb) p *vma ··· 3238 3325 3239 3326 3240 3327 3241 - 3242 - 3243 3328 This also pretty bogus. With all of the 0x80xxxxx and 0xaffffxxx 3244 3329 addresses, this is looking like a stack was plonked down on top of 3245 - these structures. Maybe it's a stack overflow from the next page: 3246 - 3330 + these structures. Maybe it's a stack overflow from the next page:: 3247 3331 3248 3332 3249 3333 (gdb) p vma ··· 3248 3338 3249 3339 3250 3340 3251 - 3252 - 3253 3341 That's towards the lower quarter of the page, so that would have to 3254 - have been pretty heavy stack overflow: 3342 + have been pretty heavy stack overflow:: 3255 3343 3256 3344 3257 - 3258 - 3259 - 3260 - 3261 - 3262 - 3263 - 3264 - 3265 - 3266 - 3267 - 3268 - 3269 - (gdb) x/100x $25 3270 - 0x507d2434: 0x507d2434 0x00000000 0x08048000 0x080a4f8c 3271 - 0x507d2444: 0x00000000 0x080a79e0 0x080a8c94 0x080d1000 3272 - 0x507d2454: 0xaffffdb0 0xaffffe63 0xaffffe7a 0xaffffe7a 3273 - 0x507d2464: 0xafffffec 0x00000062 0x0000008a 0x00000000 3274 - 0x507d2474: 0x00000000 0x00000000 0x00000000 0x00000000 3275 - 0x507d2484: 0x00000000 0x00000000 0x00000000 0x00000000 3276 - 0x507d2494: 0x00000000 0x00000000 0x507d2fe0 0x00000000 3277 - 0x507d24a4: 0x00000000 0x00000000 0x00000000 0x00000000 3278 - 0x507d24b4: 0x00000000 0x00000000 0x00000000 0x00000000 3279 - 0x507d24c4: 0x00000000 0x00000000 0x00000000 0x00000000 3280 - 0x507d24d4: 0x00000000 0x00000000 0x00000000 0x00000000 3281 - 0x507d24e4: 0x00000000 0x00000000 0x00000000 0x00000000 3282 - 0x507d24f4: 0x00000000 0x00000000 0x00000000 0x00000000 3283 - 0x507d2504: 0x00000000 0x00000000 0x00000000 0x00000000 3284 - 0x507d2514: 0x00000000 0x00000000 0x00000000 0x00000000 3285 - 0x507d2524: 0x00000000 0x00000000 0x00000000 0x00000000 3286 - 0x507d2534: 0x00000000 0x00000000 0x507d25dc 0x00000000 3287 - 0x507d2544: 0x00000000 0x00000000 0x00000000 0x00000000 3288 - 0x507d2554: 0x00000000 0x00000000 0x00000000 0x00000000 3289 - 0x507d2564: 0x00000000 0x00000000 0x00000000 0x00000000 3290 - 0x507d2574: 0x00000000 0x00000000 0x00000000 0x00000000 3291 - 0x507d2584: 0x00000000 0x00000000 0x00000000 0x00000000 3292 - 0x507d2594: 0x00000000 0x00000000 0x00000000 0x00000000 3293 - 0x507d25a4: 0x00000000 0x00000000 0x00000000 0x00000000 3294 - 0x507d25b4: 0x00000000 0x00000000 0x00000000 0x00000000 3295 - 3296 - 3345 + (gdb) x/100x $25 3346 + 0x507d2434: 0x507d2434 0x00000000 0x08048000 0x080a4f8c 3347 + 0x507d2444: 0x00000000 0x080a79e0 0x080a8c94 0x080d1000 3348 + 0x507d2454: 0xaffffdb0 0xaffffe63 0xaffffe7a 0xaffffe7a 3349 + 0x507d2464: 0xafffffec 0x00000062 0x0000008a 0x00000000 3350 + 0x507d2474: 0x00000000 0x00000000 0x00000000 0x00000000 3351 + 0x507d2484: 0x00000000 0x00000000 0x00000000 0x00000000 3352 + 0x507d2494: 0x00000000 0x00000000 0x507d2fe0 0x00000000 3353 + 0x507d24a4: 0x00000000 0x00000000 0x00000000 0x00000000 3354 + 0x507d24b4: 0x00000000 0x00000000 0x00000000 0x00000000 3355 + 0x507d24c4: 0x00000000 0x00000000 0x00000000 0x00000000 3356 + 0x507d24d4: 0x00000000 0x00000000 0x00000000 0x00000000 3357 + 0x507d24e4: 0x00000000 0x00000000 0x00000000 0x00000000 3358 + 0x507d24f4: 0x00000000 0x00000000 0x00000000 0x00000000 3359 + 0x507d2504: 0x00000000 0x00000000 0x00000000 0x00000000 3360 + 0x507d2514: 0x00000000 0x00000000 0x00000000 0x00000000 3361 + 0x507d2524: 0x00000000 0x00000000 0x00000000 0x00000000 3362 + 0x507d2534: 0x00000000 0x00000000 0x507d25dc 0x00000000 3363 + 0x507d2544: 0x00000000 0x00000000 0x00000000 0x00000000 3364 + 0x507d2554: 0x00000000 0x00000000 0x00000000 0x00000000 3365 + 0x507d2564: 0x00000000 0x00000000 0x00000000 0x00000000 3366 + 0x507d2574: 0x00000000 0x00000000 0x00000000 0x00000000 3367 + 0x507d2584: 0x00000000 0x00000000 0x00000000 0x00000000 3368 + 0x507d2594: 0x00000000 0x00000000 0x00000000 0x00000000 3369 + 0x507d25a4: 0x00000000 0x00000000 0x00000000 0x00000000 3370 + 0x507d25b4: 0x00000000 0x00000000 0x00000000 0x00000000 3297 3371 3298 3372 3299 3373 ··· 3293 3399 on will be somewhat clearer. 3294 3400 3295 3401 3296 - 12.2. Episode 2: The case of the hung fsck 3402 + 12.2. Episode 2: The case of the hung fsck 3403 + ------------------------------------------- 3297 3404 3298 3405 After setting a trap in the SEGV handler for accesses to the signal 3299 3406 thread's stack, I reran the kernel. 3300 3407 3301 3408 3302 - fsck hung again, this time by hitting the trap: 3409 + fsck hung again, this time by hitting the trap:: 3303 3410 3304 3411 3305 3412 3413 + Setting hostname uml [ OK ] 3414 + Checking root filesystem 3415 + /dev/fhd0 contains a file system with errors, check forced. 3416 + Error reading block 86894 (Attempt to read block from filesystem resulted in short read) while reading indirect blocks of inode 19780. 3306 3417 3418 + /dev/fhd0: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. 3419 + (i.e., without -a or -p options) 3420 + [ FAILED ] 3307 3421 3422 + *** An error occurred during the file system check. 3423 + *** Dropping you to a shell; the system will reboot 3424 + *** when you leave the shell. 3425 + Give root password for maintenance 3426 + (or type Control-D for normal startup): 3308 3427 3428 + [root@uml /root]# fsck -y /dev/fhd0 3429 + fsck -y /dev/fhd0 3430 + Parallelizing fsck version 1.14 (9-Jan-1999) 3431 + e2fsck 1.14, 9-Jan-1999 for EXT2 FS 0.5b, 95/08/09 3432 + /dev/fhd0 contains a file system with errors, check forced. 3433 + Pass 1: Checking inodes, blocks, and sizes 3434 + Error reading block 86894 (Attempt to read block from filesystem resulted in short read) while reading indirect blocks of inode 19780. Ignore error? yes 3309 3435 3436 + Pass 2: Checking directory structure 3437 + Error reading block 49405 (Attempt to read block from filesystem resulted in short read). Ignore error? yes 3310 3438 3439 + Directory inode 11858, block 0, offset 0: directory corrupted 3440 + Salvage? yes 3311 3441 3442 + Missing '.' in directory inode 11858. 3443 + Fix? yes 3312 3444 3445 + Missing '..' in directory inode 11858. 3446 + Fix? yes 3313 3447 3314 - 3315 - 3316 - 3317 - 3318 - 3319 - Setting hostname uml [ OK ] 3320 - Checking root filesystem 3321 - /dev/fhd0 contains a file system with errors, check forced. 3322 - Error reading block 86894 (Attempt to read block from filesystem resulted in short read) while reading indirect blocks of inode 19780. 3323 - 3324 - /dev/fhd0: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. 3325 - (i.e., without -a or -p options) 3326 - [ FAILED ] 3327 - 3328 - *** An error occurred during the file system check. 3329 - *** Dropping you to a shell; the system will reboot 3330 - *** when you leave the shell. 3331 - Give root password for maintenance 3332 - (or type Control-D for normal startup): 3333 - 3334 - [root@uml /root]# fsck -y /dev/fhd0 3335 - fsck -y /dev/fhd0 3336 - Parallelizing fsck version 1.14 (9-Jan-1999) 3337 - e2fsck 1.14, 9-Jan-1999 for EXT2 FS 0.5b, 95/08/09 3338 - /dev/fhd0 contains a file system with errors, check forced. 3339 - Pass 1: Checking inodes, blocks, and sizes 3340 - Error reading block 86894 (Attempt to read block from filesystem resulted in short read) while reading indirect blocks of inode 19780. Ignore error? yes 3341 - 3342 - Pass 2: Checking directory structure 3343 - Error reading block 49405 (Attempt to read block from filesystem resulted in short read). Ignore error? yes 3344 - 3345 - Directory inode 11858, block 0, offset 0: directory corrupted 3346 - Salvage? yes 3347 - 3348 - Missing '.' in directory inode 11858. 3349 - Fix? yes 3350 - 3351 - Missing '..' in directory inode 11858. 3352 - Fix? yes 3353 - 3354 - Untested (4127) [100fe44c]: trap_kern.c line 31 3448 + Untested (4127) [100fe44c]: trap_kern.c line 31 3355 3449 3356 3450 3357 3451 ··· 3347 3465 3348 3466 I need to get the signal thread to detach from pid 4127 so that I can 3349 3467 attach to it with gdb. This is done by sending it a SIGUSR1, which is 3350 - caught by the signal thread, which detaches the process: 3468 + caught by the signal thread, which detaches the process:: 3351 3469 3352 3470 3353 3471 kill -USR1 4127 ··· 3356 3474 3357 3475 3358 3476 3359 - Now I can run gdb on it: 3477 + Now I can run gdb on it:: 3360 3478 3361 3479 3362 - 3363 - 3364 - 3365 - 3366 - 3367 - 3368 - 3369 - 3370 - 3371 - 3372 - 3373 - ~/linux/2.3.26/um 1034: gdb linux 3374 - GNU gdb 4.17.0.11 with Linux support 3375 - Copyright 1998 Free Software Foundation, Inc. 3376 - GDB is free software, covered by the GNU General Public License, and you are 3377 - welcome to change it and/or distribute copies of it under certain conditions. 3378 - Type "show copying" to see the conditions. 3379 - There is absolutely no warranty for GDB. Type "show warranty" for details. 3380 - This GDB was configured as "i386-redhat-linux"... 3381 - (gdb) att 4127 3382 - Attaching to program `/home/dike/linux/2.3.26/um/linux', Pid 4127 3383 - 0x10075891 in __libc_nanosleep () 3480 + ~/linux/2.3.26/um 1034: gdb linux 3481 + GNU gdb 4.17.0.11 with Linux support 3482 + Copyright 1998 Free Software Foundation, Inc. 3483 + GDB is free software, covered by the GNU General Public License, and you are 3484 + welcome to change it and/or distribute copies of it under certain conditions. 3485 + Type "show copying" to see the conditions. 3486 + There is absolutely no warranty for GDB. Type "show warranty" for details. 3487 + This GDB was configured as "i386-redhat-linux"... 3488 + (gdb) att 4127 3489 + Attaching to program `/home/dike/linux/2.3.26/um/linux', Pid 4127 3490 + 0x10075891 in __libc_nanosleep () 3384 3491 3385 3492 3386 3493 ··· 3377 3506 3378 3507 The backtrace shows that it was in a write and that the fault address 3379 3508 (address in frame 3) is 0x50000800, which is right in the middle of 3380 - the signal thread's stack page: 3509 + the signal thread's stack page:: 3381 3510 3382 3511 3383 3512 (gdb) bt ··· 3411 3540 3412 3541 3413 3542 3414 - 3415 - 3416 3543 Going up the stack to the segv_handler frame and looking at where in 3417 3544 the code the access happened shows that it happened near line 110 of 3418 - block_dev.c: 3545 + block_dev.c:: 3419 3546 3420 3547 3421 3548 3422 - 3423 - 3424 - 3425 - 3426 - 3427 - 3428 - (gdb) up 3429 - #1 0x1007584d in __sleep (seconds=1000000) 3430 - at ../sysdeps/unix/sysv/linux/sleep.c:78 3431 - ../sysdeps/unix/sysv/linux/sleep.c:78: No such file or directory. 3432 - (gdb) 3433 - #2 0x1006ce9a in stop () at user_util.c:191 3434 - 191 while(1) sleep(1000000); 3435 - (gdb) 3436 - #3 0x1006bf88 in segv (address=1342179328, is_write=2) at trap_kern.c:31 3437 - 31 KERN_UNTESTED(); 3438 - (gdb) 3439 - #4 0x1006c628 in segv_handler (sc=0x5006eaf8) at trap_user.c:174 3440 - 174 segv(sc->cr2, sc->err & 2); 3441 - (gdb) p *sc 3442 - $1 = {gs = 0, __gsh = 0, fs = 0, __fsh = 0, es = 43, __esh = 0, ds = 43, 3443 - __dsh = 0, edi = 1342179328, esi = 134973440, ebp = 1342631484, 3444 - esp = 1342630864, ebx = 256, edx = 0, ecx = 256, eax = 1024, trapno = 14, 3445 - err = 6, eip = 268550834, cs = 35, __csh = 0, eflags = 66070, 3446 - esp_at_signal = 1342630864, ss = 43, __ssh = 0, fpstate = 0x0, oldmask = 0, 3447 - cr2 = 1342179328} 3448 - (gdb) p (void *)268550834 3449 - $2 = (void *) 0x1001c2b2 3450 - (gdb) i sym $2 3451 - block_write + 1090 in section .text 3452 - (gdb) i line *$2 3453 - Line 209 of "/home/dike/linux/2.3.26/um/include/asm/arch/string.h" 3454 - starts at address 0x1001c2a1 <block_write+1073> 3455 - and ends at 0x1001c2bf <block_write+1103>. 3456 - (gdb) i line *0x1001c2c0 3457 - Line 110 of "block_dev.c" starts at address 0x1001c2bf <block_write+1103> 3458 - and ends at 0x1001c2e3 <block_write+1139>. 3459 - 3460 - 3549 + (gdb) up 3550 + #1 0x1007584d in __sleep (seconds=1000000) 3551 + at ../sysdeps/unix/sysv/linux/sleep.c:78 3552 + ../sysdeps/unix/sysv/linux/sleep.c:78: No such file or directory. 3553 + (gdb) 3554 + #2 0x1006ce9a in stop () at user_util.c:191 3555 + 191 while(1) sleep(1000000); 3556 + (gdb) 3557 + #3 0x1006bf88 in segv (address=1342179328, is_write=2) at trap_kern.c:31 3558 + 31 KERN_UNTESTED(); 3559 + (gdb) 3560 + #4 0x1006c628 in segv_handler (sc=0x5006eaf8) at trap_user.c:174 3561 + 174 segv(sc->cr2, sc->err & 2); 3562 + (gdb) p *sc 3563 + $1 = {gs = 0, __gsh = 0, fs = 0, __fsh = 0, es = 43, __esh = 0, ds = 43, 3564 + __dsh = 0, edi = 1342179328, esi = 134973440, ebp = 1342631484, 3565 + esp = 1342630864, ebx = 256, edx = 0, ecx = 256, eax = 1024, trapno = 14, 3566 + err = 6, eip = 268550834, cs = 35, __csh = 0, eflags = 66070, 3567 + esp_at_signal = 1342630864, ss = 43, __ssh = 0, fpstate = 0x0, oldmask = 0, 3568 + cr2 = 1342179328} 3569 + (gdb) p (void *)268550834 3570 + $2 = (void *) 0x1001c2b2 3571 + (gdb) i sym $2 3572 + block_write + 1090 in section .text 3573 + (gdb) i line *$2 3574 + Line 209 of "/home/dike/linux/2.3.26/um/include/asm/arch/string.h" 3575 + starts at address 0x1001c2a1 <block_write+1073> 3576 + and ends at 0x1001c2bf <block_write+1103>. 3577 + (gdb) i line *0x1001c2c0 3578 + Line 110 of "block_dev.c" starts at address 0x1001c2bf <block_write+1103> 3579 + and ends at 0x1001c2e3 <block_write+1139>. 3461 3580 3462 3581 3463 3582 3464 3583 Looking at the source shows that the fault happened during a call to 3465 - copy_from_user to copy the data into the kernel: 3584 + copy_from_user to copy the data into the kernel:: 3466 3585 3467 3586 3468 3587 107 count -= chars; ··· 3462 3601 3463 3602 3464 3603 3465 - 3466 - 3467 3604 p is the pointer which must contain 0x50000800, since buf contains 3468 - 0x80b8800 (frame 8 above). It is defined as: 3605 + 0x80b8800 (frame 8 above). It is defined as:: 3469 3606 3470 3607 3471 3608 p = offset + bh->b_data; ··· 3474 3615 3475 3616 I need to figure out what bh is, and it just so happens that bh is 3476 3617 passed as an argument to mark_buffer_uptodate and mark_buffer_dirty a 3477 - few lines later, so I do a little disassembly: 3618 + few lines later, so I do a little disassembly:: 3478 3619 3479 3620 3480 - 3481 - 3482 - (gdb) disas 0x1001c2bf 0x1001c2e0 3483 - Dump of assembler code from 0x1001c2bf to 0x1001c2d0: 3484 - 0x1001c2bf <block_write+1103>: addl %eax,0xc(%ebp) 3485 - 0x1001c2c2 <block_write+1106>: movl 0xfffffdd4(%ebp),%edx 3486 - 0x1001c2c8 <block_write+1112>: btsl $0x0,0x18(%edx) 3487 - 0x1001c2cd <block_write+1117>: btsl $0x1,0x18(%edx) 3488 - 0x1001c2d2 <block_write+1122>: sbbl %ecx,%ecx 3489 - 0x1001c2d4 <block_write+1124>: testl %ecx,%ecx 3490 - 0x1001c2d6 <block_write+1126>: jne 0x1001c2e3 <block_write+1139> 3491 - 0x1001c2d8 <block_write+1128>: pushl $0x0 3492 - 0x1001c2da <block_write+1130>: pushl %edx 3493 - 0x1001c2db <block_write+1131>: call 0x1001819c <__mark_buffer_dirty> 3494 - End of assembler dump. 3621 + (gdb) disas 0x1001c2bf 0x1001c2e0 3622 + Dump of assembler code from 0x1001c2bf to 0x1001c2d0: 3623 + 0x1001c2bf <block_write+1103>: addl %eax,0xc(%ebp) 3624 + 0x1001c2c2 <block_write+1106>: movl 0xfffffdd4(%ebp),%edx 3625 + 0x1001c2c8 <block_write+1112>: btsl $0x0,0x18(%edx) 3626 + 0x1001c2cd <block_write+1117>: btsl $0x1,0x18(%edx) 3627 + 0x1001c2d2 <block_write+1122>: sbbl %ecx,%ecx 3628 + 0x1001c2d4 <block_write+1124>: testl %ecx,%ecx 3629 + 0x1001c2d6 <block_write+1126>: jne 0x1001c2e3 <block_write+1139> 3630 + 0x1001c2d8 <block_write+1128>: pushl $0x0 3631 + 0x1001c2da <block_write+1130>: pushl %edx 3632 + 0x1001c2db <block_write+1131>: call 0x1001819c <__mark_buffer_dirty> 3633 + End of assembler dump. 3495 3634 3496 3635 3497 3636 ··· 3497 3640 3498 3641 At that point, bh is in %edx (address 0x1001c2da), which is calculated 3499 3642 at 0x1001c2c2 as %ebp + 0xfffffdd4, so I figure exactly what that is, 3500 - taking %ebp from the sigcontext_struct above: 3643 + taking %ebp from the sigcontext_struct above:: 3501 3644 3502 3645 3503 3646 (gdb) p (void *)1342631484 ··· 3514 3657 3515 3658 3516 3659 Now, I look at the structure to see what's in it, and particularly, 3517 - what its b_data field contains: 3660 + what its b_data field contains:: 3518 3661 3519 3662 3520 3663 (gdb) p *((struct buffer_head *)0x50100200) ··· 3539 3682 3540 3683 The b_page field is a pointer to the page_struct representing the 3541 3684 0x50000000 page. Looking at it shows the kernel's idea of the state 3542 - of that page: 3685 + of that page:: 3543 3686 3544 3687 3545 3688 3546 - (gdb) p *$13.b_page 3547 - $17 = {list = {next = 0x50004a5c, prev = 0x100c5174}, mapping = 0x0, 3548 - index = 0, next_hash = 0x0, count = {counter = 1}, flags = 132, lru = { 3549 - next = 0x50008460, prev = 0x50019350}, wait = { 3550 - lock = <optimized out or zero length>, task_list = {next = 0x50004024, 3551 - prev = 0x50004024}, __magic = 1342193708, __creator = 0}, 3552 - pprev_hash = 0x0, buffers = 0x501002c0, virtual = 1342177280, 3553 - zone = 0x100c5160} 3689 + (gdb) p *$13.b_page 3690 + $17 = {list = {next = 0x50004a5c, prev = 0x100c5174}, mapping = 0x0, 3691 + index = 0, next_hash = 0x0, count = {counter = 1}, flags = 132, lru = { 3692 + next = 0x50008460, prev = 0x50019350}, wait = { 3693 + lock = <optimized out or zero length>, task_list = {next = 0x50004024, 3694 + prev = 0x50004024}, __magic = 1342193708, __creator = 0}, 3695 + pprev_hash = 0x0, buffers = 0x501002c0, virtual = 1342177280, 3696 + zone = 0x100c5160} 3554 3697 3555 3698 3556 3699 ··· 3559 3702 Some sanity-checking: the virtual field shows the "virtual" address of 3560 3703 this page, which in this kernel is the same as its "physical" address, 3561 3704 and the page_struct itself should be mem_map[0], since it represents 3562 - the first page of memory: 3705 + the first page of memory:: 3563 3706 3564 3707 3565 3708 ··· 3576 3719 3577 3720 3578 3721 Now to check out the page_struct itself. In particular, the flags 3579 - field shows whether the page is considered free or not: 3722 + field shows whether the page is considered free or not:: 3580 3723 3581 3724 3582 3725 (gdb) p (void *)132 ··· 3596 3739 3597 3740 3598 3741 In my setup_arch procedure, I have the following code which looks just 3599 - fine: 3742 + fine:: 3600 3743 3601 3744 3602 3745 ··· 3619 3762 3620 3763 3621 3764 Stepping into init_bootmem, and looking at bootmem_map before looking 3622 - at what it contains shows the following: 3765 + at what it contains shows the following:: 3623 3766 3624 3767 3625 3768 ··· 3645 3788 3646 3789 3647 3790 3648 - 13. What to do when UML doesn't work 3791 + 13. What to do when UML doesn't work 3792 + ===================================== 3649 3793 3650 3794 3651 3795 3652 3796 3653 - 13.1. Strange compilation errors when you build from source 3797 + 13.1. Strange compilation errors when you build from source 3798 + ------------------------------------------------------------ 3654 3799 3655 3800 As of test11, it is necessary to have "ARCH=um" in the environment or 3656 3801 on the make command line for all steps in building UML, including 3657 3802 clean, distclean, or mrproper, config, menuconfig, or xconfig, dep, 3658 3803 and linux. If you forget for any of them, the i386 build seems to 3659 - contaminate the UML build. If this happens, start from scratch with 3804 + contaminate the UML build. If this happens, start from scratch with:: 3660 3805 3661 3806 3662 3807 host% ··· 3670 3811 and repeat the build process with ARCH=um on all the steps. 3671 3812 3672 3813 3673 - See ``Compiling the kernel and modules'' for more details. 3814 + See :ref:`Compiling_the_kernel_and_modules` for more details. 3674 3815 3675 3816 3676 3817 Another cause of strange compilation errors is building UML in ··· 3683 3824 3684 3825 3685 3826 3686 - 13.3. A variety of panics and hangs with /tmp on a reiserfs filesys- 3687 - tem 3827 + 13.3. A variety of panics and hangs with /tmp on a reiserfs filesystem 3828 + ----------------------------------------------------------------------- 3688 3829 3689 3830 I saw this on reiserfs 3.5.21 and it seems to be fixed in 3.5.27. 3690 - Panics preceded by 3831 + Panics preceded by:: 3691 3832 3692 3833 3693 3834 Detaching pid nnnn ··· 3713 3854 3714 3855 3715 3856 3716 - 13.5. UML doesn't work when /tmp is an NFS filesystem 3857 + 13.5. UML doesn't work when /tmp is an NFS filesystem 3858 + ------------------------------------------------------ 3717 3859 3718 3860 This seems to be a similar situation with the ReiserFS problem above. 3719 3861 Some versions of NFS seems not to handle mmap correctly, which UML 3720 3862 depends on. The workaround is have /tmp be a non-NFS directory. 3721 3863 3722 3864 3723 - 13.6. UML hangs on boot when compiled with gprof support 3865 + 13.6. UML hangs on boot when compiled with gprof support 3866 + --------------------------------------------------------- 3724 3867 3725 3868 If you build UML with gprof support and, early in the boot, it does 3726 - this 3869 + this:: 3727 3870 3728 3871 3729 3872 kernel BUG at page_alloc.c:100! ··· 3739 3878 3740 3879 3741 3880 3742 - 13.7. syslogd dies with a SIGTERM on startup 3881 + 13.7. syslogd dies with a SIGTERM on startup 3882 + --------------------------------------------- 3743 3883 3744 3884 The exact boot error depends on the distribution that you're booting, 3745 - but Debian produces this: 3885 + but Debian produces this:: 3746 3886 3747 3887 3748 3888 /etc/rc2.d/S10sysklogd: line 49: 93 Terminated ··· 3759 3897 3760 3898 3761 3899 3762 - 13.8. TUN/TAP networking doesn't work on a 2.4 host 3900 + 13.8. TUN/TAP networking doesn't work on a 2.4 host 3901 + ---------------------------------------------------- 3763 3902 3764 3903 There are a couple of problems which were 3765 3904 <http://www.geocrawler.com/lists/3/SourceForge/597/0/> name="pointed 3766 3905 out"> by Tim Robinson <timro at trkr dot net> 3767 3906 3768 - o It doesn't work on hosts running 2.4.7 (or thereabouts) or earlier. 3907 + - It doesn't work on hosts running 2.4.7 (or thereabouts) or earlier. 3769 3908 The fix is to upgrade to something more recent and then read the 3770 3909 next item. 3771 3910 3772 - o If you see 3911 + - If you see:: 3773 3912 3774 3913 3775 3914 File descriptor in bad state ··· 3784 3921 3785 3922 3786 3923 3787 - 13.9. You can network to the host but not to other machines on the 3788 - net 3924 + 13.9. You can network to the host but not to other machines on the net 3925 + ======================================================================= 3789 3926 3790 3927 If you can connect to the host, and the host can connect to UML, but 3791 3928 you cannot connect to any other machines, then you may need to enable ··· 3793 3930 using private IP addresses (192.168.x.x or 10.x.x.x) for host/UML 3794 3931 networking, rather than the public address space that your host is 3795 3932 connected to. UML does not enable IP Masquerading, so you will need 3796 - to create a static rule to enable it: 3933 + to create a static rule to enable it:: 3797 3934 3798 3935 3799 3936 host% ··· 3811 3948 3812 3949 3813 3950 If you can reach the local net, but not the outside Internet, then 3814 - that is usually a routing problem. The UML needs a default route: 3951 + that is usually a routing problem. The UML needs a default route:: 3815 3952 3816 3953 3817 3954 UML# ··· 3835 3972 3836 3973 3837 3974 3838 - 13.10. I have no root and I want to scream 3975 + 13.10. I have no root and I want to scream 3976 + =========================================== 3839 3977 3840 3978 Thanks to Birgit Wahlich for telling me about this strange one. It 3841 3979 turns out that there's a limit of six environment variables on the ··· 3851 3987 3852 3988 3853 3989 3854 - 13.11. UML build conflict between ptrace.h and ucontext.h 3990 + 13.11. UML build conflict between ptrace.h and ucontext.h 3991 + ========================================================== 3855 3992 3856 3993 On some older systems, /usr/include/asm/ptrace.h and 3857 3994 /usr/include/sys/ucontext.h define the same names. So, when they're 3858 3995 included together, the defines from one completely mess up the parsing 3859 - of the other, producing errors like: 3996 + of the other, producing errors like:: 3997 + 3860 3998 /usr/include/sys/ucontext.h:47: parse error before 3861 - `10' 3999 + `10` 3862 4000 3863 4001 3864 4002 ··· 3873 4007 3874 4008 3875 4009 3876 - 13.12. The UML BogoMips is exactly half the host's BogoMips 4010 + 13.12. The UML BogoMips is exactly half the host's BogoMips 4011 + ------------------------------------------------------------ 3877 4012 3878 4013 On i386 kernels, there are two ways of running the loop that is used 3879 4014 to calculate the BogoMips rating, using the TSC if it's there or using ··· 3886 4019 3887 4020 3888 4021 3889 - 13.13. When you run UML, it immediately segfaults 4022 + 13.13. When you run UML, it immediately segfaults 4023 + -------------------------------------------------- 3890 4024 3891 4025 If the host is configured with the 2G/2G address space split, that's 3892 - why. See ``UML on 2G/2G hosts'' for the details on getting UML to 4026 + why. See ref:`UML_on_2G/2G_hosts` for the details on getting UML to 3893 4027 run on your host. 3894 4028 3895 4029 3896 4030 3897 - 13.14. xterms appear, then immediately disappear 4031 + 13.14. xterms appear, then immediately disappear 4032 + ------------------------------------------------- 3898 4033 3899 4034 If you're running an up to date kernel with an old release of 3900 4035 uml_utilities, the port-helper program will not work properly, so ··· 3908 4039 3909 4040 3910 4041 3911 - 13.15. Any other panic, hang, or strange behavior 4042 + 13.15. Any other panic, hang, or strange behavior 4043 + -------------------------------------------------- 3912 4044 3913 4045 If you're seeing truly strange behavior, such as hangs or panics that 3914 4046 happen in random places, or you try running the debugger to see what's ··· 3927 4057 it and that a fix is imminent. 3928 4058 3929 4059 3930 - If you want to be super-helpful, read ``Diagnosing Problems'' and 4060 + If you want to be super-helpful, read :ref:`Diagnosing_Problems` and 3931 4061 follow the instructions contained therein. 3932 - 14. Diagnosing Problems 4062 + 4063 + .. _Diagnosing_Problems: 4064 + 4065 + 14. Diagnosing Problems 4066 + ======================== 3933 4067 3934 4068 3935 4069 If you get UML to crash, hang, or otherwise misbehave, you should ··· 3948 4074 3949 4075 For any diagnosis, you're going to need to build a debugging kernel. 3950 4076 The binaries from this site aren't debuggable. If you haven't done 3951 - this before, read about ``Compiling the kernel and modules'' and 3952 - ``Kernel debugging'' UML first. 4077 + this before, read about :ref:`Compiling_the_kernel_and_modules` and 4078 + :ref:`Kernel_debugging` UML first. 3953 4079 3954 4080 3955 - 14.1. Case 1 : Normal kernel panics 4081 + 14.1. Case 1 : Normal kernel panics 4082 + ------------------------------------ 3956 4083 3957 4084 The most common case is for a normal thread to panic. To debug this, 3958 4085 you will need to run it under the debugger (add 'debug' to the command 3959 4086 line). An xterm will start up with gdb running inside it. Continue 3960 - it when it stops in start_kernel and make it crash. Now ^C gdb and 4087 + it when it stops in start_kernel and make it crash. Now ``^C gdb`` and 3961 4088 3962 4089 3963 4090 If the panic was a "Kernel mode fault", then there will be a segv 3964 4091 frame on the stack and I'm going to want some more information. The 3965 - stack might look something like this: 4092 + stack might look something like this:: 3966 4093 3967 4094 3968 4095 (UML gdb) backtrace ··· 3982 4107 3983 4108 3984 4109 I'm going to want to see the symbol and line information for the value 3985 - of ip in the segv frame. In this case, you would do the following: 4110 + of ip in the segv frame. In this case, you would do the following:: 3986 4111 3987 4112 3988 4113 (UML gdb) i sym 268849158 ··· 3990 4115 3991 4116 3992 4117 3993 - and 4118 + and:: 3994 4119 3995 4120 3996 4121 (UML gdb) i line *268849158 ··· 4003 4128 to get that information from the faulting ip. 4004 4129 4005 4130 4006 - 14.2. Case 2 : Tracing thread panics 4131 + 14.2. Case 2 : Tracing thread panics 4132 + ------------------------------------- 4007 4133 4008 4134 The less common and more painful case is when the tracing thread 4009 4135 panics. In this case, the kernel debugger will be useless because it ··· 4012 4136 do is get a backtrace from the tracing thread. This is done by 4013 4137 figuring out what its pid is, firing up gdb, and attaching it to that 4014 4138 pid. You can figure out the tracing thread pid by looking at the 4015 - first line of the console output, which will look like this: 4139 + first line of the console output, which will look like this:: 4016 4140 4017 4141 4018 4142 tracing thread pid = 15851 ··· 4021 4145 4022 4146 4023 4147 or by running ps on the host and finding the line that looks like 4024 - this: 4148 + this:: 4025 4149 4026 4150 4027 4151 jdike 15851 4.5 0.4 132568 1104 pts/0 S 21:34 0:05 ./linux [(tracing thread)] ··· 4040 4164 14.3. Case 3 : Tracing thread panics caused by other threads 4041 4165 4042 4166 However, there are cases where the misbehavior of another thread 4043 - caused the problem. The most common panic of this type is: 4167 + caused the problem. The most common panic of this type is:: 4044 4168 4045 4169 4046 4170 wait_for_stop failed to wait for <pid> to stop with <signal number> ··· 4053 4177 debugger is defunct and without some fancy footwork, another gdb can't 4054 4178 attach to it. So, this is how the fancy footwork goes: 4055 4179 4056 - In a shell: 4180 + In a shell:: 4057 4181 4058 4182 4059 4183 host% kill -STOP pid ··· 4061 4185 4062 4186 4063 4187 4064 - Run gdb on the tracing thread as described in case 2 and do: 4188 + Run gdb on the tracing thread as described in case 2 and do:: 4065 4189 4066 4190 4067 4191 (host gdb) call detach(pid) ··· 4069 4193 4070 4194 If you get a segfault, do it again. It always works the second time. 4071 4195 4072 - Detach from the tracing thread and attach to that other thread: 4196 + Detach from the tracing thread and attach to that other thread:: 4073 4197 4074 4198 4075 4199 (host gdb) detach ··· 4085 4209 4086 4210 4087 4211 If gdb hangs when attaching to that process, go back to a shell and 4088 - do: 4212 + do:: 4089 4213 4090 4214 4091 4215 host% ··· 4094 4218 4095 4219 4096 4220 4097 - And then get the backtrace: 4221 + And then get the backtrace:: 4098 4222 4099 4223 4100 4224 (host gdb) backtrace ··· 4103 4227 4104 4228 4105 4229 4106 - 14.4. Case 4 : Hangs 4230 + 14.4. Case 4 : Hangs 4231 + --------------------- 4107 4232 4108 4233 Hangs seem to be fairly rare, but they sometimes happen. When a hang 4109 4234 happens, we need a backtrace from the offending process. Run the 4110 4235 kernel debugger as described in case 1 and get a backtrace. If the 4111 4236 current process is not the idle thread, then send in the backtrace. 4112 - You can tell that it's the idle thread if the stack looks like this: 4237 + You can tell that it's the idle thread if the stack looks like this:: 4113 4238 4114 4239 4115 4240 #0 0x100b1401 in __libc_nanosleep () ··· 4134 4257 4135 4258 4136 4259 4137 - 15. Thanks 4260 + 15. Thanks 4261 + =========== 4138 4262 4139 4263 4140 4264 A number of people have helped this project in various ways, and this ··· 4152 4274 bookkeeping lapses and I forget about contributions. 4153 4275 4154 4276 4155 - 15.1. Code and Documentation 4277 + 15.1. Code and Documentation 4278 + ----------------------------- 4156 4279 4157 4280 Rusty Russell <rusty at linuxcare.com.au> - 4158 4281 4159 - o wrote the HOWTO <http://user-mode- 4282 + - wrote the HOWTO <http://user-mode- 4160 4283 linux.sourceforge.net/UserModeLinux-HOWTO.html> 4161 4284 4162 - o prodded me into making this project official and putting it on 4285 + - prodded me into making this project official and putting it on 4163 4286 SourceForge 4164 4287 4165 - o came up with the way cool UML logo <http://user-mode- 4288 + - came up with the way cool UML logo <http://user-mode- 4166 4289 linux.sourceforge.net/uml-small.png> 4167 4290 4168 - o redid the config process 4291 + - redid the config process 4169 4292 4170 4293 4171 4294 Peter Moulder <reiter at netspace.net.au> - Fixed my config and build ··· 4175 4296 4176 4297 Bill Stearns <wstearns at pobox.com> - 4177 4298 4178 - o HOWTO updates 4299 + - HOWTO updates 4179 4300 4180 - o lots of bug reports 4301 + - lots of bug reports 4181 4302 4182 - o lots of testing 4303 + - lots of testing 4183 4304 4184 - o dedicated a box (uml.ists.dartmouth.edu) to support UML development 4305 + - dedicated a box (uml.ists.dartmouth.edu) to support UML development 4185 4306 4186 - o wrote the mkrootfs script, which allows bootable filesystems of 4307 + - wrote the mkrootfs script, which allows bootable filesystems of 4187 4308 RPM-based distributions to be cranked out 4188 4309 4189 - o cranked out a large number of filesystems with said script 4310 + - cranked out a large number of filesystems with said script 4190 4311 4191 4312 4192 4313 Jim Leu <jleu at mindspring.com> - Wrote the virtual ethernet driver ··· 4254 4375 4255 4376 David Coulson <http://davidcoulson.net> - 4256 4377 4257 - o Set up the usermodelinux.org <http://usermodelinux.org> site, 4378 + - Set up the usermodelinux.org <http://usermodelinux.org> site, 4258 4379 which is a great way of keeping the UML user community on top of 4259 4380 UML goings-on. 4260 4381 4261 - o Site documentation and updates 4382 + - Site documentation and updates 4262 4383 4263 - o Nifty little UML management daemon UMLd 4384 + - Nifty little UML management daemon UMLd 4264 4385 <http://uml.openconsultancy.com/umld/> 4265 4386 4266 - o Lots of testing and bug reports 4387 + - Lots of testing and bug reports 4267 4388 4268 4389 4269 4390 4270 4391 4271 - 15.2. Flushing out bugs 4392 + 15.2. Flushing out bugs 4393 + ------------------------ 4272 4394 4273 4395 4274 4396 4275 - o Yuri Pudgorodsky 4397 + - Yuri Pudgorodsky 4276 4398 4277 - o Gerald Britton 4399 + - Gerald Britton 4278 4400 4279 - o Ian Wehrman 4401 + - Ian Wehrman 4280 4402 4281 - o Gord Lamb 4403 + - Gord Lamb 4282 4404 4283 - o Eugene Koontz 4405 + - Eugene Koontz 4284 4406 4285 - o John H. Hartman 4407 + - John H. Hartman 4286 4408 4287 - o Anders Karlsson 4409 + - Anders Karlsson 4288 4410 4289 - o Daniel Phillips 4411 + - Daniel Phillips 4290 4412 4291 - o John Fremlin 4413 + - John Fremlin 4292 4414 4293 - o Rainer Burgstaller 4415 + - Rainer Burgstaller 4294 4416 4295 - o James Stevenson 4417 + - James Stevenson 4296 4418 4297 - o Matt Clay 4419 + - Matt Clay 4298 4420 4299 - o Cliff Jefferies 4421 + - Cliff Jefferies 4300 4422 4301 - o Geoff Hoff 4423 + - Geoff Hoff 4302 4424 4303 - o Lennert Buytenhek 4425 + - Lennert Buytenhek 4304 4426 4305 - o Al Viro 4427 + - Al Viro 4306 4428 4307 - o Frank Klingenhoefer 4429 + - Frank Klingenhoefer 4308 4430 4309 - o Livio Baldini Soares 4431 + - Livio Baldini Soares 4310 4432 4311 - o Jon Burgess 4433 + - Jon Burgess 4312 4434 4313 - o Petru Paler 4435 + - Petru Paler 4314 4436 4315 - o Paul 4437 + - Paul 4316 4438 4317 - o Chris Reahard 4439 + - Chris Reahard 4318 4440 4319 - o Sverker Nilsson 4441 + - Sverker Nilsson 4320 4442 4321 - o Gong Su 4443 + - Gong Su 4322 4444 4323 - o johan verrept 4445 + - johan verrept 4324 4446 4325 - o Bjorn Eriksson 4447 + - Bjorn Eriksson 4326 4448 4327 - o Lorenzo Allegrucci 4449 + - Lorenzo Allegrucci 4328 4450 4329 - o Muli Ben-Yehuda 4451 + - Muli Ben-Yehuda 4330 4452 4331 - o David Mansfield 4453 + - David Mansfield 4332 4454 4333 - o Howard Goff 4455 + - Howard Goff 4334 4456 4335 - o Mike Anderson 4457 + - Mike Anderson 4336 4458 4337 - o John Byrne 4459 + - John Byrne 4338 4460 4339 - o Sapan J. Batia 4461 + - Sapan J. Batia 4340 4462 4341 - o Iris Huang 4463 + - Iris Huang 4342 4464 4343 - o Jan Hudec 4465 + - Jan Hudec 4344 4466 4345 - o Voluspa 4467 + - Voluspa 4346 4468 4347 4469 4348 4470 4349 4471 4350 - 15.3. Buglets and clean-ups 4472 + 15.3. Buglets and clean-ups 4473 + ---------------------------- 4351 4474 4352 4475 4353 4476 4354 - o Dave Zarzycki 4477 + - Dave Zarzycki 4355 4478 4356 - o Adam Lazur 4479 + - Adam Lazur 4357 4480 4358 - o Boria Feigin 4481 + - Boria Feigin 4359 4482 4360 - o Brian J. Murrell 4483 + - Brian J. Murrell 4361 4484 4362 - o JS 4485 + - JS 4363 4486 4364 - o Roman Zippel 4487 + - Roman Zippel 4365 4488 4366 - o Wil Cooley 4489 + - Wil Cooley 4367 4490 4368 - o Ayelet Shemesh 4491 + - Ayelet Shemesh 4369 4492 4370 - o Will Dyson 4493 + - Will Dyson 4371 4494 4372 - o Sverker Nilsson 4495 + - Sverker Nilsson 4373 4496 4374 - o dvorak 4497 + - dvorak 4375 4498 4376 - o v.naga srinivas 4499 + - v.naga srinivas 4377 4500 4378 - o Shlomi Fish 4501 + - Shlomi Fish 4379 4502 4380 - o Roger Binns 4503 + - Roger Binns 4381 4504 4382 - o johan verrept 4505 + - johan verrept 4383 4506 4384 - o MrChuoi 4507 + - MrChuoi 4385 4508 4386 - o Peter Cleve 4509 + - Peter Cleve 4387 4510 4388 - o Vincent Guffens 4511 + - Vincent Guffens 4389 4512 4390 - o Nathan Scott 4513 + - Nathan Scott 4391 4514 4392 - o Patrick Caulfield 4515 + - Patrick Caulfield 4393 4516 4394 - o jbearce 4517 + - jbearce 4395 4518 4396 - o Catalin Marinas 4519 + - Catalin Marinas 4397 4520 4398 - o Shane Spencer 4521 + - Shane Spencer 4399 4522 4400 - o Zou Min 4523 + - Zou Min 4401 4524 4402 4525 4403 - o Ryan Boder 4526 + - Ryan Boder 4404 4527 4405 - o Lorenzo Colitti 4528 + - Lorenzo Colitti 4406 4529 4407 - o Gwendal Grignou 4530 + - Gwendal Grignou 4408 4531 4409 - o Andre' Breiler 4532 + - Andre' Breiler 4410 4533 4411 - o Tsutomu Yasuda 4534 + - Tsutomu Yasuda 4412 4535 4413 4536 4414 4537 4415 - 15.4. Case Studies 4538 + 15.4. Case Studies 4539 + ------------------- 4416 4540 4417 4541 4418 - o Jon Wright 4542 + - Jon Wright 4419 4543 4420 - o William McEwan 4544 + - William McEwan 4421 4545 4422 - o Michael Richardson 4546 + - Michael Richardson 4423 4547 4424 4548 4425 4549 4426 - 15.5. Other contributions 4550 + 15.5. Other contributions 4551 + -------------------------- 4427 4552 4428 4553 4429 4554 Bill Carr <Bill.Carr at compaq.com> made the Red Hat mkrootfs script ··· 4458 4575 server jailed inside UML. It's available from the download 4459 4576 <http://user-mode-linux.sourceforge.net/dl-sf.html> page in the Jail 4460 4577 Filesystems section. 4461 - 4462 - 4463 - 4464 - 4465 - 4466 - 4467 - 4468 - 4469 - 4470 - 4471 - 4472 -