| 1 | /* |
| 2 | * Copyright 2004 Sun Microsystems, Inc. All rights reserved. |
| 3 | * Use is subject to license terms. |
| 4 | */ |
| 5 | #pragma ident "@(#)README.modify_diskimage 1.1 05/03/14 SMI" |
| 6 | # |
| 7 | # Modifying the Solaris disk image: |
| 8 | # |
| 9 | |
| 10 | There are 2 ways to modify a disk image for use within the simulation |
| 11 | environment: |
| 12 | |
| 13 | 1) lofi mount the disk image |
| 14 | The Solaris disk image may be mounted on your development host by |
| 15 | using the Solaris lofi facility. Use lofiadm to enable access to |
| 16 | the simulated disk as a block device and then the Solaris mount |
| 17 | command may be used to mount it. |
| 18 | NOTE: you will need root access to modify a disk image. |
| 19 | |
| 20 | Example: |
| 21 | |
| 22 | To add files to the Solaris disk that you are booting from: |
| 23 | As root on a machine, do the following: |
| 24 | |
| 25 | # lofiadm -a /export/my_disk_image |
| 26 | |
| 27 | Take note of the value returned from lofiadm. For this |
| 28 | example we assume it's /dev/lofi/1 |
| 29 | |
| 30 | If needed, you can fsck your boot disk image as follows |
| 31 | # fsck -y /dev/rlofi/1 |
| 32 | |
| 33 | You can then mount this disk image: |
| 34 | # mount /dev/lofi/1 /mnt |
| 35 | # cd /mnt |
| 36 | |
| 37 | You can then add/remove files to/from your disk image. |
| 38 | Once you are done you can umount the disk image and boot |
| 39 | the simulator. |
| 40 | |
| 41 | # cd / |
| 42 | # umount /mnt |
| 43 | # lofiadm -d /dev/lofi/1 |
| 44 | |
| 45 | 2) Boot under legion with disk in "shared" mode |
| 46 | The default legion config file uses the disk image in "rom" mode |
| 47 | (changes made to the disk image by the simulated system are not |
| 48 | committed to the underlying disk image). Once the simulator exits |
| 49 | the changes are lost. The benefit of this mode is that bugs in |
| 50 | the simulated system will not corrupt your disk image. |
| 51 | (eg. load s0 rom "disk1";) |
| 52 | |
| 53 | You can use the "shared" keyword in the config file to allow |
| 54 | changes made within legion to the disk to be reflected on the |
| 55 | disk image itself. (eg. load s0 shared "disk1"; ) |
| 56 | Be careful when using this mode as you can corrupt your disk |
| 57 | image if you leave it in an inconsistent state. If running in |
| 58 | this mode, halt the running Solaris within legion before killing |
| 59 | the simulation. |
| 60 | |
| 61 | Example: |
| 62 | |
| 63 | device "memory" 0x1f40000000 +800M { |
| 64 | virtual_disk; |
| 65 | load s0 shared "disk1"; |
| 66 | load s3 shared "disk.export"; |
| 67 | } |
| 68 | |
| 69 | |