VirtualBox

Changeset 64523 in vbox for trunk/src/VBox/ValidationKit


Ignore:
Timestamp:
Nov 2, 2016 8:07:37 PM (8 years ago)
Author:
vboxsync
Message:

TestBoxImaging: Updates & service script.

Location:
trunk/src/VBox/ValidationKit/docs
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/docs/TestBoxImaging.html

    r64498 r64523  
    386386<dd><ul class="first last simple">
    387387<li>backup</li>
    388 <li>redo-backup</li>
     388<li>backup-again</li>
    389389<li>restore</li>
     390<li>refresh-info</li>
     391<li>rescue</li>
    390392</ul>
    391393</dd>
     
    393395<p>Possible modifier that indicates a subset of disk on testboxes with other OSes
    394396installed.  Support for partition level backup/restore is not explored here.</p>
     397<div class="section" id="how-to-use">
     398<h2>How to use</h2>
     399<p>To perform one of the above maintenance actions on a testbox copy the</p>
     400</div>
    395401</div>
    396402<div class="section" id="storage-server">
     
    400406<blockquote>
    401407<ol class="arabic simple">
    402 <li>/exports/testbox-tftp    - TFTP config area.  Read-write.</li>
    403 <li>/exports/testbox-backup  - Images and logs.  Read-write.</li>
    404 <li>/exports/testbox-nfsroot - Custom debian.  Read-only, no root squash.</li>
     408<li>/export/testbox-tftp    - TFTP config area.  Read-write.</li>
     409<li>/export/testbox-backup  - Images and logs.  Read-write.</li>
     410<li>/export/testbox-nfsroot - Custom debian.  Read-only, no root squash.</li>
    405411</ol>
    406412</blockquote>
    407413</div>
    408 <div class="section" id="tftp-exports-testbox-tftp">
    409 <h1>TFTP (/exports/testbox-tftp)</h1>
     414<div class="section" id="tftp-export-testbox-tftp">
     415<h1>TFTP (/export/testbox-tftp)</h1>
    410416<p>The testbox-tftp share needs to be writable, root squashing is okay.</p>
    411417<p>We need files from both PXELINUX and SYSLINUX to make this work now.  On a
     
    419425Perform the following copy operations:</p>
    420426<pre class="literal-block">
    421 cp /usr/lib/PXELINUX/pxelinux.0 testbox-tftp/
    422 cp /usr/lib/syslinux/modules/*/ldlinux.* testbox-tftp/
    423 cp /usr/lib/syslinux/modules/bios  testbox-tftp/
    424 cp /usr/lib/syslinux/modules/efi32 testbox-tftp/
    425 cp /usr/lib/syslinux/modules/efi64 testbox-tftp/
     427cp /usr/lib/PXELINUX/pxelinux.0 /mnt/testbox-tftp/
     428cp /usr/lib/syslinux/modules/*/ldlinux.* /mnt/testbox-tftp/
     429cp -R /usr/lib/syslinux/modules/bios  /mnt/testbox-tftp/
     430cp -R /usr/lib/syslinux/modules/efi32 /mnt/testbox-tftp/
     431cp -R /usr/lib/syslinux/modules/efi64 /mnt/testbox-tftp/
    426432</pre>
    427433<p>For simplicitly, all the testboxes boot using good old fashioned BIOS, no EFI.
     
    445451</pre>
    446452<p>This will make the default behavior to boot the local disk system.</p>
    447 </div>
    448 <div class="section" id="images-and-logs-exports-testbox-backup">
    449 <h1>Images and logs (/exports/testbox-backup)</h1>
     453<p>Create <tt class="docutils literal"><span class="pre">pxelinux.cfg/do-backup</span></tt>, <tt class="docutils literal"><span class="pre">pxelinux.cfg/do-backup-again</span></tt>,
     454<tt class="docutils literal"><span class="pre">pxelinux.cfg/do-restore</span></tt>, <tt class="docutils literal"><span class="pre">pxelinux.cfg/do-refresh-info</span></tt>, and
     455<tt class="docutils literal"><span class="pre">pxelinux.cfg/do-rescue</span></tt> configuration files on the form:</p>
     456<pre class="literal-block">
     457PATH bios
     458DEFAULT maintenance
     459LABEL maintenance
     460  MENU LABEL Maintenance (NFS)
     461  KERNEL maintenance-boot/vmlinuz-3.16.0-4-amd64
     462  APPEND initrd=maintenance-boot/initrd.img-3.16.0-4-amd64 testbox-action-backup ro ip=dhcp aufs=tmpfs boot=nfs root=/dev/nfs nfsroot=10.42.1.1:/export/testbox-nfsroot,ro nfsvers=3 nfsrootdebug
     463LABEL local-boot
     464LOCALBOOT
     465</pre>
     466<p>When you want to preform an action on a testbox, copy the <tt class="docutils literal"><span class="pre">do-&lt;action&gt;</span></tt> to
     467<tt class="docutils literal"><span class="pre">pxeclient.cfg/&lt;HEX-ip-addr&gt;</span></tt> and trigger a boot of the testbox.  The machine
     468config will be removed automatically once the action has been successfully
     469completed.</p>
     470</div>
     471<div class="section" id="images-and-logs-export-testbox-backup">
     472<h1>Images and logs (/export/testbox-backup)</h1>
    450473<p>The testbox-backup share needs to be writable, root squashing is okay.</p>
     474<p>In the root there must be a file <tt class="docutils literal"><span class="pre">testbox-backup</span></tt> so we can easily tell
     475whether we've actually mounted the share or are just staring at an empty mount
     476point directory.</p>
     477<p>The <tt class="docutils literal"><span class="pre">testbox-maintenance.sh</span></tt> script maintains a global log in the root
     478directory that's called <tt class="docutils literal">maintenance.log</tt>.  Errors will be logged there as
     479well as a ping and the action.</p>
    451480<p>We use a directory layout based on dotted decimal IP addresses here, so for a
    452 server with the IP 10.40.41.42 all its file will be under <tt class="docutils literal">10.40.41.42/</tt>.</p>
    453 <p>Files found under <tt class="docutils literal">10.40.41.42/</tt>:</p>
     481server with the IP 10.40.41.42 all its file will be under <tt class="docutils literal">10.40.41.42/</tt>:</p>
    454482<dl class="docutils">
    455483<dt><tt class="docutils literal">&lt;hostname&gt;</tt></dt>
     
    473501</dl>
    474502</div>
    475 <div class="section" id="debian-nfs-root-exports-testbox-nfsroot">
    476 <h1>Debian NFS root (/exports/testbox-nfsroot)</h1>
     503<div class="section" id="debian-nfs-root-export-testbox-nfsroot">
     504<h1>Debian NFS root (/export/testbox-nfsroot)</h1>
    477505<p>The testbox-nfsroot share should be read-only and must <strong>not</strong> have root
    478506squashing enabled.</p>
     
    484512<blockquote>
    485513<ul>
    486 <li><p class="first"><tt class="docutils literal"><span class="pre">apt-get</span> install pxelinux syslinux <span class="pre">initramfs-tools</span> gddrescue joe</tt> and
    487 optionally <tt class="docutils literal"><span class="pre">apt-get</span> install smbclient <span class="pre">cifs-utils</span></tt>.</p>
     514<li><p class="first"><tt class="docutils literal"><span class="pre">apt-get</span> install pxelinux syslinux <span class="pre">initramfs-tools</span> zip gddrescue joe</tt>
     515and optionally <tt class="docutils literal"><span class="pre">apt-get</span> install smbclient <span class="pre">cifs-utils</span></tt>.</p>
    488516</li>
    489517<li><p class="first"><tt class="docutils literal">/etc/default/grub</tt> was modified to set <tt class="docutils literal">GRUB_CMDLINE_LINUX_DEFAULT</tt> to
     
    493521</li>
    494522<li><p class="first">Create the directory <tt class="docutils literal">/etc/systemd/system/getty&#64;tty1.service.d</tt> and create
    495 the file noclear.conf in it with the following content:</p>
     523the file <tt class="docutils literal">noclear.conf</tt> in it with the following content:</p>
    496524<pre class="literal-block">
    497525[Service]
     
    501529messages, which includes messages from the testbox-maintenance service.</p>
    502530</li>
    503 <li><p class="first">Copy the <tt class="docutils literal"><span class="pre">testbox-maintenance.sh</span></tt> file found in the same directory as this
    504 document to <tt class="docutils literal">/root/scripts/</tt> (need to create the dir) and make it
    505 executable.</p>
    506 </li>
    507 <li><p class="first">Create the systemd service file for the maintenance service as
    508 <tt class="docutils literal"><span class="pre">/etc/systemd/system/textbox-maintenance.service</span></tt> with the content:</p>
    509 <pre class="literal-block">
    510 [Unit]
    511 Description=Testbox Maintenance
    512 After=network.target
    513 Before=getty&#64;tty1.service
    514 
    515 [Service]
    516 Type=oneshot
    517 RemainAfterExit=True
    518 ExecStart=/root/scripts/testbox-maintenance.sh
    519 ExecStartPre=/bin/echo -e \033%G
    520 ExecReload=/bin/kill -HUP $MAINPID
    521 WorkingDirectory=/tmp
    522 Environment=TERM=xterm
    523 StandardOutput=journal+console
    524 
    525 [Install]
    526 WantedBy=multi-user.target
    527 </pre>
    528 </li>
    529531<li><p class="first">Mount the testbox-nfsroot under <tt class="docutils literal">/mnt/</tt> with write privileges.  (The write
    530532privileges are temporary - don't forget to remove them later on.):</p>
    531533<pre class="literal-block">
    532 mount -t nfs myserver.com:/exports/testbox-nfsroot
    533 </pre>
     534mount -t nfs myserver.com:/export/testbox-nfsroot
     535</pre>
     536<p>Note! Adding <tt class="docutils literal"><span class="pre">-o</span> nfsvers=3</tt> may help with some NTFv4 servers.</p>
    534537</li>
    535538<li><p class="first">Copy the debian root and dev file system onto nfsroot.  If you have ssh
     
    544547<blockquote>
    545548<ul>
    546 <li><p class="first">Enable our service: <tt class="docutils literal">systemctl enable <span class="pre">testbox-maintenance.service</span></tt></p>
     549<li><p class="first"><tt class="docutils literal">mount <span class="pre">-o</span> proc proc /proc</tt></p>
     550</li>
     551<li><p class="first"><tt class="docutils literal">mount <span class="pre">-o</span> sysfs sysfs /sys</tt></p>
     552</li>
     553<li><p class="first"><tt class="docutils literal">mkdir <span class="pre">/mnt/testbox-tftp</span> <span class="pre">/mnt/testbox-backup</span></tt></p>
     554</li>
     555<li><p class="first">Recreate <tt class="docutils literal">/etc/fstab</tt> with:</p>
     556<pre class="literal-block">
     557proc                             /proc               proc  defaults   0 0
     558/dev/nfs                         /                   nfs   defaults   1 1
     55910.42.1.1:/export/testbox-tftp   /mnt/testbox-tftp   nfs   nfsvers=3  2 2
     56010.42.1.1:/export/testbox-backup /mnt/testbox-backup nfs   nfsvers=3  3 3
     561</pre>
     562</li>
     563<li><p class="first">Do <tt class="docutils literal">mount <span class="pre">/mnt/testbox-tftp</span> &amp;&amp; mount <span class="pre">/mnt/testbox-backup</span></tt> to mount the
     564two shares.  This may be a good time to execute the instructions in the
     565sections above relating to these two shares.</p>
    547566</li>
    548567<li><p class="first">Edit <tt class="docutils literal"><span class="pre">/etc/initramfs-tools/initramfs.conf</span></tt> and change the <tt class="docutils literal">MODULES</tt>
     
    556575an executable file with the following content:</p>
    557576<pre class="literal-block">
     577#!/bin/sh
    558578# Don't run during update-initramfs:
    559579case &quot;$1&quot; in
     
    576596</li>
    577597<li><p class="first">Update the init ramdisk: <tt class="docutils literal"><span class="pre">update-initramfs</span> <span class="pre">-u</span> <span class="pre">-k</span> all</tt></p>
    578 </li>
    579 <li><p class="first">Either copy the initrd.img and corresponding kernel to the
    580 <tt class="docutils literal"><span class="pre">testbox-tftp/maintenance-boot/</span></tt> directory, or create
    581 <tt class="docutils literal"><span class="pre">testbox-tftp/maintenance-boot</span></tt> as a symbolic link to
    582 <tt class="docutils literal"><span class="pre">testbox-nfsroot/boot/</span></tt>.</p>
    583 </li>
    584 <li><p class="first">Recreate <tt class="docutils literal">/etc/fstab</tt> with:</p>
    585 <pre class="literal-block">
    586 proc          /proc    proc    defaults        0 0
    587 /dev/nfs      /        nfs     defaults        1 1
    588 # Mount tftp and backup too.
    589 </pre>
    590 </li>
    591 <li><p class="first">xxx</p>
     598<dl class="docutils">
     599<dt>Note! It may be necessary to do <tt class="docutils literal">mount <span class="pre">-t</span> tmpfs tmpfs /var/tmp</tt> to help</dt>
     600<dd><p class="first last">this operation succeed.</p>
     601</dd>
     602</dl>
     603</li>
     604<li><p class="first">Copy <tt class="docutils literal">/boot</tt> to <tt class="docutils literal"><span class="pre">/mnt/testbox-tftp/maintenance-boot/</span></tt>.</p>
     605</li>
     606<li><p class="first">Copy the <tt class="docutils literal"><span class="pre">testbox-maintenance.sh</span></tt> file found in the same directory as this
     607document to <tt class="docutils literal">/root/scripts/</tt> (need to create the dir) and make it
     608executable.</p>
     609</li>
     610<li><p class="first">Create the systemd service file for the maintenance service as
     611<tt class="docutils literal"><span class="pre">/etc/systemd/system/testbox-maintenance.service</span></tt> with the content:</p>
     612<pre class="literal-block">
     613[Unit]
     614Description=Testbox Maintenance
     615After=network.target
     616Before=getty&#64;tty1.service
     617
     618[Service]
     619Type=oneshot
     620RemainAfterExit=True
     621ExecStart=/root/scripts/testbox-maintenance.sh
     622ExecStartPre=/bin/echo -e \033%G
     623ExecReload=/bin/kill -HUP $MAINPID
     624WorkingDirectory=/tmp
     625Environment=TERM=xterm
     626StandardOutput=journal+console
     627
     628[Install]
     629WantedBy=multi-user.target
     630</pre>
     631</li>
     632<li><p class="first">Enable our service: <tt class="docutils literal">systemctl enable <span class="pre">/etc/systemd/system/testbox-maintenance.service</span></tt></p>
     633</li>
     634<li><p class="first">xxxx ... more ???</p>
     635</li>
     636<li><p class="first">Before leaving the chroot, do <tt class="docutils literal">mount /proc /sys <span class="pre">/mnt/testbox-*</span></tt>.</p>
    592637</li>
    593638</ul>
    594639</blockquote>
    595640</li>
    596 <li><dl class="first docutils">
    597 <dt>Testing the setup from a VM is kind of useful:</dt>
    598 <dd><ul class="first last">
     641<li><p class="first">Testing the setup from a VM is kind of useful (if the nfs server can be
     642convinced to accept root nfs mounts from non-privileged clinet ports):</p>
     643<blockquote>
     644<ul>
    599645<li><p class="first">Create a VM using the 64-bit debian profile.  Let's call it &quot;pxe-vm&quot;.</p>
    600646</li>
     
    617663  KERNEL maintenance-boot/vmlinuz-3.16.0-4-amd64
    618664  APPEND initrd=maintenance-boot/initrd.img-3.16.0-4-amd64 ro ip=dhcp aufs=tmpfs \
    619          boot=nfs root=/dev/nfs nfsroot=10.42.1.1:/exports/testbox-nfsroot
     665         boot=nfs root=/dev/nfs nfsroot=10.42.1.1:/export/testbox-nfsroot
    620666LABEL local-boot
    621667LOCALBOOT
     
    623669</li>
    624670</ul>
    625 </dd>
    626 </dl>
     671</blockquote>
    627672</li>
    628673</ul>
  • trunk/src/VBox/ValidationKit/docs/TestBoxImaging.txt

    r64498 r64523  
    4444Maintenance actions are:
    4545 - backup
    46  - redo-backup
     46 - backup-again
    4747 - restore
     48 - refresh-info
     49 - rescue
    4850
    4951Possible modifier that indicates a subset of disk on testboxes with other OSes
     
    5153
    5254
     55How to use
     56----------
     57
     58To perform one of the above maintenance actions on a testbox copy the
     59
     60
    5361Storage Server
    5462==============
     
    5765avoids extra work getting CIFS sharing right too (NFS is already a pain).
    5866
    59  1. /exports/testbox-tftp    - TFTP config area.  Read-write.
    60  2. /exports/testbox-backup  - Images and logs.  Read-write.
    61  3. /exports/testbox-nfsroot - Custom debian.  Read-only, no root squash.
    62 
    63 
    64 TFTP (/exports/testbox-tftp)
     67 1. /export/testbox-tftp    - TFTP config area.  Read-write.
     68 2. /export/testbox-backup  - Images and logs.  Read-write.
     69 3. /export/testbox-nfsroot - Custom debian.  Read-only, no root squash.
     70
     71
     72TFTP (/export/testbox-tftp)
    6573============================
    6674
     
    7886Perform the following copy operations::
    7987
    80   cp /usr/lib/PXELINUX/pxelinux.0 testbox-tftp/
    81   cp /usr/lib/syslinux/modules/*/ldlinux.* testbox-tftp/
    82   cp /usr/lib/syslinux/modules/bios  testbox-tftp/
    83   cp /usr/lib/syslinux/modules/efi32 testbox-tftp/
    84   cp /usr/lib/syslinux/modules/efi64 testbox-tftp/
     88  cp /usr/lib/PXELINUX/pxelinux.0 /mnt/testbox-tftp/
     89  cp /usr/lib/syslinux/modules/*/ldlinux.* /mnt/testbox-tftp/
     90  cp -R /usr/lib/syslinux/modules/bios  /mnt/testbox-tftp/
     91  cp -R /usr/lib/syslinux/modules/efi32 /mnt/testbox-tftp/
     92  cp -R /usr/lib/syslinux/modules/efi64 /mnt/testbox-tftp/
    8593
    8694
     
    109117This will make the default behavior to boot the local disk system.
    110118
    111 
    112 
    113 Images and logs (/exports/testbox-backup)
     119Create ``pxelinux.cfg/do-backup``, ``pxelinux.cfg/do-backup-again``,
     120``pxelinux.cfg/do-restore``, ``pxelinux.cfg/do-refresh-info``, and
     121``pxelinux.cfg/do-rescue`` configuration files on the form::
     122
     123  PATH bios
     124  DEFAULT maintenance
     125  LABEL maintenance
     126    MENU LABEL Maintenance (NFS)
     127    KERNEL maintenance-boot/vmlinuz-3.16.0-4-amd64
     128    APPEND initrd=maintenance-boot/initrd.img-3.16.0-4-amd64 testbox-action-backup ro ip=dhcp aufs=tmpfs boot=nfs root=/dev/nfs nfsroot=10.42.1.1:/export/testbox-nfsroot,ro nfsvers=3 nfsrootdebug
     129  LABEL local-boot
     130  LOCALBOOT
     131
     132When you want to preform an action on a testbox, copy the ``do-<action>`` to
     133``pxeclient.cfg/<HEX-ip-addr>`` and trigger a boot of the testbox.  The machine
     134config will be removed automatically once the action has been successfully
     135completed.
     136
     137
     138
     139Images and logs (/export/testbox-backup)
    114140=========================================
    115141
    116142The testbox-backup share needs to be writable, root squashing is okay.
    117143
     144In the root there must be a file ``testbox-backup`` so we can easily tell
     145whether we've actually mounted the share or are just staring at an empty mount
     146point directory.
     147
     148The ``testbox-maintenance.sh`` script maintains a global log in the root
     149directory that's called ``maintenance.log``.  Errors will be logged there as
     150well as a ping and the action.
     151
    118152We use a directory layout based on dotted decimal IP addresses here, so for a
    119 server with the IP 10.40.41.42 all its file will be under ``10.40.41.42/``.
    120 
    121 
    122 Files found under ``10.40.41.42/``:
     153server with the IP 10.40.41.42 all its file will be under ``10.40.41.42/``:
    123154
    124155``<hostname>``
     
    149180
    150181
    151 Debian NFS root (/exports/testbox-nfsroot)
     182Debian NFS root (/export/testbox-nfsroot)
    152183==========================================
    153184
     
    162193done in a VM.  After installation the following modifications was done:
    163194
    164  - ``apt-get install pxelinux syslinux initramfs-tools gddrescue joe`` and
    165    optionally ``apt-get install smbclient cifs-utils``.
     195 - ``apt-get install pxelinux syslinux initramfs-tools zip gddrescue joe``
     196   and optionally ``apt-get install smbclient cifs-utils``.
    166197
    167198
     
    172203
    173204 - Create the directory ``/etc/systemd/system/[email protected]`` and create
    174    the file noclear.conf in it with the following content::
     205   the file ``noclear.conf`` in it with the following content::
    175206
    176207     [Service]
     
    180211   messages, which includes messages from the testbox-maintenance service.
    181212
    182  - Copy the ``testbox-maintenance.sh`` file found in the same directory as this
    183    document to ``/root/scripts/`` (need to create the dir) and make it
    184    executable.
    185 
    186  - Create the systemd service file for the maintenance service as
    187    ``/etc/systemd/system/textbox-maintenance.service`` with the content::
    188 
    189      [Unit]
    190      Description=Testbox Maintenance
    191      After=network.target
    192      [email protected]
    193 
    194      [Service]
    195      Type=oneshot
    196      RemainAfterExit=True
    197      ExecStart=/root/scripts/testbox-maintenance.sh
    198      ExecStartPre=/bin/echo -e \033%G
    199      ExecReload=/bin/kill -HUP $MAINPID
    200      WorkingDirectory=/tmp
    201      Environment=TERM=xterm
    202      StandardOutput=journal+console
    203 
    204      [Install]
    205      WantedBy=multi-user.target
    206 
    207213 - Mount the testbox-nfsroot under ``/mnt/`` with write privileges.  (The write
    208214   privileges are temporary - don't forget to remove them later on.)::
    209215
    210      mount -t nfs myserver.com:/exports/testbox-nfsroot
     216     mount -t nfs myserver.com:/export/testbox-nfsroot
     217
     218   Note! Adding ``-o nfsvers=3`` may help with some NTFv4 servers.
    211219
    212220 - Copy the debian root and dev file system onto nfsroot.  If you have ssh
     
    220228 - chroot into the nfsroot: ``chroot /mnt/``
    221229
    222      - Enable our service: ``systemctl enable testbox-maintenance.service``
     230     - ``mount -o proc proc /proc``
     231
     232     - ``mount -o sysfs sysfs /sys``
     233
     234     - ``mkdir /mnt/testbox-tftp /mnt/testbox-backup``
     235
     236     - Recreate ``/etc/fstab`` with::
     237
     238         proc                             /proc               proc  defaults   0 0
     239         /dev/nfs                         /                   nfs   defaults   1 1
     240         10.42.1.1:/export/testbox-tftp   /mnt/testbox-tftp   nfs   nfsvers=3  2 2
     241         10.42.1.1:/export/testbox-backup /mnt/testbox-backup nfs   nfsvers=3  3 3
     242
     243     - Do ``mount /mnt/testbox-tftp && mount /mnt/testbox-backup`` to mount the
     244       two shares.  This may be a good time to execute the instructions in the
     245       sections above relating to these two shares.
    223246
    224247     - Edit ``/etc/initramfs-tools/initramfs.conf`` and change the ``MODULES``
     
    232255       an executable file with the following content::
    233256
     257         #!/bin/sh
    234258         # Don't run during update-initramfs:
    235259         case "$1" in
     
    252276     - Update the init ramdisk: ``update-initramfs -u -k all``
    253277
    254      - Either copy the initrd.img and corresponding kernel to the
    255        ``testbox-tftp/maintenance-boot/`` directory, or create
    256        ``testbox-tftp/maintenance-boot`` as a symbolic link to
    257        ``testbox-nfsroot/boot/``.
    258 
    259      - Recreate ``/etc/fstab`` with::
    260 
    261          proc          /proc    proc    defaults        0 0
    262          /dev/nfs      /        nfs     defaults        1 1
    263          # Mount tftp and backup too.
    264 
    265      - xxx
    266 
    267 
    268  - Testing the setup from a VM is kind of useful:
     278       Note! It may be necessary to do ``mount -t tmpfs tmpfs /var/tmp`` to help
     279             this operation succeed.
     280
     281     - Copy ``/boot`` to ``/mnt/testbox-tftp/maintenance-boot/``.
     282
     283     - Copy the ``testbox-maintenance.sh`` file found in the same directory as this
     284       document to ``/root/scripts/`` (need to create the dir) and make it
     285       executable.
     286
     287     - Create the systemd service file for the maintenance service as
     288       ``/etc/systemd/system/testbox-maintenance.service`` with the content::
     289
     290         [Unit]
     291         Description=Testbox Maintenance
     292         After=network.target
     293         [email protected]
     294
     295         [Service]
     296         Type=oneshot
     297         RemainAfterExit=True
     298         ExecStart=/root/scripts/testbox-maintenance.sh
     299         ExecStartPre=/bin/echo -e \033%G
     300         ExecReload=/bin/kill -HUP $MAINPID
     301         WorkingDirectory=/tmp
     302         Environment=TERM=xterm
     303         StandardOutput=journal+console
     304
     305         [Install]
     306         WantedBy=multi-user.target
     307
     308     - Enable our service: ``systemctl enable /etc/systemd/system/testbox-maintenance.service``
     309
     310     - xxxx ... more ???
     311
     312     - Before leaving the chroot, do ``mount /proc /sys /mnt/testbox-*``.
     313
     314
     315 - Testing the setup from a VM is kind of useful (if the nfs server can be
     316   convinced to accept root nfs mounts from non-privileged clinet ports):
     317
    269318     - Create a VM using the 64-bit debian profile.  Let's call it "pxe-vm".
    270319     - Mount the TFTP share somewhere, like M: or /mnt/testbox-tftp.
     
    284333           KERNEL maintenance-boot/vmlinuz-3.16.0-4-amd64
    285334           APPEND initrd=maintenance-boot/initrd.img-3.16.0-4-amd64 ro ip=dhcp aufs=tmpfs \
    286                   boot=nfs root=/dev/nfs nfsroot=10.42.1.1:/exports/testbox-nfsroot
     335                  boot=nfs root=/dev/nfs nfsroot=10.42.1.1:/export/testbox-nfsroot
    287336         LABEL local-boot
    288337         LOCALBOOT
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette