Skip to content

Commit

Permalink
Documentation: teaching: labs: Add git pull warning before the exerci…
Browse files Browse the repository at this point in the history
…ses in every lab

Signed-off-by: Valentin Ghita valx92@gmail.com
  • Loading branch information
valighita committed Feb 26, 2020
1 parent e5d6adb commit 9e95e74
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 75 deletions.
6 changes: 2 additions & 4 deletions Documentation/teaching/labs/block_device_drivers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -866,10 +866,8 @@ Further reading
Exercises
=========

.. important::

.. include:: exercises-summary.hrst
.. |LAB_NAME| replace:: block_device_drivers
.. include:: exercises-summary.hrst
.. |LAB_NAME| replace:: block_device_drivers

0. Intro
--------
Expand Down
3 changes: 3 additions & 0 deletions Documentation/teaching/labs/deferred_work.rst
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,9 @@ Further reading
Exercises
=========

.. include:: exercises-summary.hrst
.. |LAB_NAME| replace:: deferred_work

0. Intro
--------

Expand Down
6 changes: 2 additions & 4 deletions Documentation/teaching/labs/device_drivers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -754,10 +754,8 @@ While another thread will change the flag value and wake up the waiting threads:
Exercises
=========

.. important::

.. include:: exercises-summary.hrst
.. |LAB_NAME| replace:: device_drivers
.. include:: exercises-summary.hrst
.. |LAB_NAME| replace:: device_drivers

0. Intro
--------
Expand Down
10 changes: 2 additions & 8 deletions Documentation/teaching/labs/device_model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -877,14 +877,8 @@ udevand dispose entries sysfs.
Exercises
=========

.. important::

.. include:: exercises-summary.hrst

.. |LAB_NAME| replace:: device_model

Generate the skeleton for this lab (task name should be empty).

.. include:: exercises-summary.hrst
.. |LAB_NAME| replace:: device_model

0. Intro
---------
Expand Down
64 changes: 38 additions & 26 deletions Documentation/teaching/labs/exercises-summary.hrst
Original file line number Diff line number Diff line change
@@ -1,44 +1,56 @@
.. important::

To solve exercises, you need to perform these steps:
To solve exercises, you need to perform these steps:

* prepare skeletons from templates
* build modules
* copy modules to the VM
* start the VM and test the module in the VM.
* prepare skeletons from templates
* build modules
* copy modules to the VM
* start the VM and test the module in the VM.

The current lab name is |LAB_NAME|. See the exercises for the task name.
The current lab name is |LAB_NAME|. See the exercises for the task name.

The skeleton code is generated from full source examples located in
:file:`tools/labs/templates`. To solve the tasks, start by generating
the skeleton code for a complete lab:
The skeleton code is generated from full source examples located in
:file:`tools/labs/templates`. To solve the tasks, start by generating
the skeleton code for a complete lab:

.. code-block:: shell
.. code-block:: shell

tools/labs $ make clean
tools/labs $ LABS=<lab name> make skels
tools/labs $ make clean
tools/labs $ LABS=<lab name> make skels

You can also generate the skeleton for a single task, using
You can also generate the skeleton for a single task, using

.. code-block:: shell
.. code-block:: shell

tools/labs $ LABS=<lab name>/<task name> make skels
tools/labs $ LABS=<lab name>/<task name> make skels

Once the skeleton drivers are generated, build the source:
Once the skeleton drivers are generated, build the source:

.. code-block:: shell
.. code-block:: shell

tools/labs $ make build
tools/labs $ make build

Then, copy the modules and start the VM:
Then, copy the modules and start the VM:

.. code-block:: shell
.. code-block:: shell

tools/labs $ make copy
tools/labs $ make boot
tools/labs $ make copy
tools/labs $ make boot

The modules are placed in /home/root/skels/|LAB_NAME|/<task_name>.
The modules are placed in /home/root/skels/|LAB_NAME|/<task_name>.

Alternatively, we can copy files via :command:`scp`, in order to avoid restarting the VM.
For additional details about connecting to the VM via the network, please check :ref:`vm_interaction_link`.
Alternatively, we can copy files via :command:`scp`, in order to avoid restarting the VM.
For additional details about connecting to the VM via the network, please check :ref:`vm_interaction_link`.

Review the `Exercises`_ section for more detailed information.
Review the `Exercises`_ section for more detailed information.

.. warning::

Before starting the exercises or generating the skeletons, please run **git pull** inside the Linux repo,
to make sure you have the latest version of the exercises.

If you have local changes, the pull command will fail. Check for local changes using ``git status``.
If you want to keep them, run ``git stash`` before ``pull`` and ``git stash pop`` after.
To discard the changes, run ``git reset --hard master``.

If you already generated the skeleton before ``git pull`` you will need to generate it again.
7 changes: 2 additions & 5 deletions Documentation/teaching/labs/filesystems_part1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -442,11 +442,8 @@ Further reading
Exercises
=========

.. important::

.. include:: exercises-summary.hrst

.. |LAB_NAME| replace:: filesystems
.. include:: exercises-summary.hrst
.. |LAB_NAME| replace:: filesystems


myfs
Expand Down
7 changes: 2 additions & 5 deletions Documentation/teaching/labs/filesystems_part2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -602,11 +602,8 @@ Further reading
Exercises
=========

.. important::

.. include:: exercises-summary.hrst

.. |LAB_NAME| replace:: filesystems
.. include:: exercises-summary.hrst
.. |LAB_NAME| replace:: filesystems

.. important::

Expand Down
9 changes: 2 additions & 7 deletions Documentation/teaching/labs/interrupts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -674,13 +674,8 @@ Linux device drivers
Exercises
=========

.. important::

.. include:: exercises-summary.hrst

.. |LAB_NAME| replace:: interrupts

Generate the skeleton for this lab (task name should be empty).
.. include:: exercises-summary.hrst
.. |LAB_NAME| replace:: interrupts

0. Intro
--------
Expand Down
2 changes: 1 addition & 1 deletion Documentation/teaching/labs/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ A few links related to the Linux kernel are shown bellow:
The links are not comprehensive. Using `The Internet <http://www.google.com>`__ and
`kernel source code <http://lxr.free-electrons.com/>`__ is essential.
Exercices
Exercises
=========
Remarks
Expand Down
6 changes: 2 additions & 4 deletions Documentation/teaching/labs/kernel_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -600,10 +600,8 @@ performed.
Exercises
=========

.. important::

.. include:: exercises-summary.hrst
.. |LAB_NAME| replace:: kernel_api
.. include:: exercises-summary.hrst
.. |LAB_NAME| replace:: kernel_api

0. Intro
--------
Expand Down
8 changes: 2 additions & 6 deletions Documentation/teaching/labs/kernel_modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -855,12 +855,8 @@ Exercises
.. _exercises_summary:
.. important::
.. include:: exercises-summary.hrst
.. |LAB_NAME| replace:: kernel_modules
.. include:: exercises-summary.hrst
.. |LAB_NAME| replace:: kernel_modules
0. Intro
--------
Expand Down
3 changes: 3 additions & 0 deletions Documentation/teaching/labs/memory_mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ Further reading
Exercises
=========

.. include:: exercises-summary.hrst
.. |LAB_NAME| replace:: memory_mapping

1. Mapping contiguous physical memory to userspace
--------------------------------------------------

Expand Down
7 changes: 2 additions & 5 deletions Documentation/teaching/labs/networking.rst
Original file line number Diff line number Diff line change
Expand Up @@ -977,11 +977,8 @@ Further reading
Exercises
=========

.. important::

.. include:: exercises-summary.hrst

.. |LAB_NAME| replace:: networking
.. include:: exercises-summary.hrst
.. |LAB_NAME| replace:: networking

.. important::

Expand Down

0 comments on commit 9e95e74

Please sign in to comment.