From patchwork Fri Dec 10 11:43:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Haines X-Patchwork-Id: 12669459 X-Patchwork-Delegate: paul@paul-moore.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F3F7C433EF for ; Fri, 10 Dec 2021 11:43:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240761AbhLJLr2 (ORCPT ); Fri, 10 Dec 2021 06:47:28 -0500 Received: from mailomta10-re.btinternet.com ([213.120.69.103]:48573 "EHLO re-prd-fep-045.btinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S240667AbhLJLr2 (ORCPT ); Fri, 10 Dec 2021 06:47:28 -0500 Received: from re-prd-rgout-004.btmx-prd.synchronoss.net ([10.2.54.7]) by re-prd-fep-045.btinternet.com with ESMTP id <20211210114351.YZFW16557.re-prd-fep-045.btinternet.com@re-prd-rgout-004.btmx-prd.synchronoss.net>; Fri, 10 Dec 2021 11:43:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=btinternet.com; s=btmx201904; t=1639136631; bh=DAPPg9Hv/hY4PRZWz5p/c/RPPtI3drgYpl6Ei8E/EK8=; h=From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References:MIME-Version; b=jtGcoT8MRgFZ90VXE/+v4STYHM8VZKfCGcUV9rPNfbV2+9JAqqbaJ0kcmdXDEa0joRru9wk/jwVl7bTr+imxRpaFPs0P9xmn+OpnHtKLTEQWuakd9f1GajOdxxvvqD7wEae7VbgbQfdwBrM6SDlpKRZCUmRap4VtNcx0BxW54PdkvSRTi/grSP+SPHrLy7MXdU7uiOKRjxzlvx/HtyqKX5wvC1yyFRj4IjuFdTmql0aN0zjaB3UAuDq+zu8YyZWT6iXz8rzsy6pcTqNb+hKh7CelB8xQMAZ4TbKPdkNE0mTTvOAtjxRxtyL824zDsKpaJtv9ZXtAd98L0YZvWCkt5g== Authentication-Results: btinternet.com; none X-SNCR-Rigid: 613A901C0CC4A23B X-Originating-IP: [81.141.144.155] X-OWM-Source-IP: 81.141.144.155 (GB) X-OWM-Env-Sender: richard_c_haines@btinternet.com X-VadeSecure-score: verdict=clean score=0/300, class=clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvuddrkedvgdefvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemuceutffkvffkuffjvffgnffgvefqofdpqfgfvfenuceurghilhhouhhtmecufedtudenucenucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomheptfhitghhrghrugcujfgrihhnvghsuceorhhitghhrghruggptggphhgrihhnvghssegsthhinhhtvghrnhgvthdrtghomheqnecuggftrfgrthhtvghrnhepudeukefgueevudeitdelueeggeefheefffekhefgveegkeeiudeltdduvefgteetnecuffhomhgrihhnpehgihhthhhusgdrtghomhdpphhoshhtghhrvghsqhhlrdhorhhgnecukfhppeekuddrudeguddrudeggedrudehheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopehlohgtrghlhhhoshhtrdhlohgtrghlughomhgrihhnpdhinhgvthepkedurddugedurddugeegrdduheehpdhmrghilhhfrhhomheprhhitghhrghruggptggphhgrihhnvghssegsthhinhhtvghrnhgvthdrtghomhdprhgtphhtthhopehprghulhesphgruhhlqdhmohhorhgvrdgtohhmpdhrtghpthhtoheprhhitghhrghruggptggphhgrihhnvghssegsthhinhhtvghrnhgvthdrtghomhdprhgtphhtthhopehsvghlihhnuhigsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean X-SNCR-hdrdom: btinternet.com Received: from localhost.localdomain (81.141.144.155) by re-prd-rgout-004.btmx-prd.synchronoss.net (5.8.716.04) (authenticated as richard_c_haines@btinternet.com) id 613A901C0CC4A23B; Fri, 10 Dec 2021 11:43:51 +0000 From: Richard Haines To: selinux@vger.kernel.org Cc: paul@paul-moore.com, Richard Haines Subject: [PATCH 1/4] selinux-notebook: Make file links consistent Date: Fri, 10 Dec 2021 11:43:37 +0000 Message-Id: <20211210114340.13977-2-richard_c_haines@btinternet.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211210114340.13977-1-richard_c_haines@btinternet.com> References: <20211210114340.13977-1-richard_c_haines@btinternet.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org Before building EPUB book the file links to the notebook-examples directory area needs to be consistent. This will allow sed to fix the path during the build (as pandoc insists on defaulting to file:///EPUB/text). Signed-off-by: Richard Haines --- src/bounds_rules.md | 2 +- src/cil_overview.md | 2 +- src/embedded_systems.md | 12 ++++++------ src/network_support.md | 4 ++-- src/postgresql.md | 6 +++--- src/toc.md | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/bounds_rules.md b/src/bounds_rules.md index 650f817..b3afb6c 100644 --- a/src/bounds_rules.md +++ b/src/bounds_rules.md @@ -11,7 +11,7 @@ policy. However only the *typebounds* rule is currently implemented by The CIL language does support *userbounds* and *rolebounds* but these are resolved at policy compile time, not via the kernel at run-time (i.e. they are NOT enforced by the SELinux kernel services). The -[**CIL Reference Guide**](notebook-examples/selinux-policy/cil/CIL_Reference_Guide.pdf) +[**CIL Reference Guide**](./notebook-examples/selinux-policy/cil/CIL_Reference_Guide.pdf) gives details. ## *typebounds* diff --git a/src/cil_overview.md b/src/cil_overview.md index ddb70f6..f39e156 100644 --- a/src/cil_overview.md +++ b/src/cil_overview.md @@ -6,7 +6,7 @@ have been documented within the CIL compiler source, available at: A PDF version is included in this documentation: -[**CIL Reference Guide**](notebook-examples/selinux-policy/cil/CIL_Reference_Guide.pdf) +[**CIL Reference Guide**](./notebook-examples/selinux-policy/cil/CIL_Reference_Guide.pdf) The CIL compiler source can be found at: within the *secilc* and diff --git a/src/embedded_systems.md b/src/embedded_systems.md index f2c5112..75821fe 100644 --- a/src/embedded_systems.md +++ b/src/embedded_systems.md @@ -342,7 +342,7 @@ cd refpolicy For the initial configuration, either replace the current *build.conf* file with the sample -[***build.conf***](notebook-examples/embedded-policy/reference-policy/build.conf) +[***build.conf***](./notebook-examples/embedded-policy/reference-policy/build.conf) or edit the current *build.conf* file to the requirements (e.g. MONOLITHIC = y) Install the source policy in the build directory: @@ -367,7 +367,7 @@ make conf ``` Replace the current *policy/modules.conf* with the sample -[***modules.conf***](notebook-examples/embedded-policy/reference-policy/modules.conf) +[***modules.conf***](./notebook-examples/embedded-policy/reference-policy/modules.conf) and run: ``` @@ -482,7 +482,7 @@ git checkout android-4.1.1_r1 ``` - Copy the text below into a - [*Makefile*](notebook-examples/embedded-policy/android-policy/android-4/Makefile) + [*Makefile*](./notebook-examples/embedded-policy/android-policy/android-4/Makefile) installed in the *sepolicy* directory. ``` @@ -517,9 +517,9 @@ Over time the Android policy locked down more and more processes and then became more complex as policy version control was required when upgrading. The **Brillo** release was their first IoT release and can be built using the instructions in the -[*brillo/Makefile*](notebook-examples/embedded-policy/android-policy/brillo/Makefile) +[*brillo/Makefile*](./notebook-examples/embedded-policy/android-policy/brillo/Makefile) To build a policy containing a device, follow the instructions in the -[*brillo-device/Makefile*](notebook-examples/embedded-policy/android-policy/brillo-device/Makefile) +[*brillo-device/Makefile*](./notebook-examples/embedded-policy/android-policy/brillo-device/Makefile) as a device policy must be obtained from the Android repository. Later Android split policy into private and public segments, they also used @@ -527,7 +527,7 @@ CIL for some policy components as described in the [**Android - The SELinux Policy**](seandroid.md#the-selinux-policy) section. The **Android 10** release policy is an example where this split policy is used. This can be built using the instructions in the -[*android-10/Makefile*](notebook-examples/embedded-policy/android-policy/android-10/Makefile). +[*android-10/Makefile*](./notebook-examples/embedded-policy/android-policy/android-10/Makefile). [^fn_em_1]: An example of this integration is setting a new process context as shown in the Zygote code: diff --git a/src/network_support.md b/src/network_support.md index 21759bf..bec725e 100644 --- a/src/network_support.md +++ b/src/network_support.md @@ -349,7 +349,7 @@ netlabelctl calipso add pass doi:16 **Figure 16:** - *MLS Systems on different networks communicating via a gateway* There are CIPSO/CALIPSO examples in the -[***notebook-examples/network/netlabel***](notebook-examples/network/README.md) +[***notebook-examples/network/netlabel***](./notebook-examples/network/README.md) section. The CALIPSO example ***netlabelctl**(8)* commands for loopback are: ``` @@ -518,7 +518,7 @@ firewall-cmd --add-service ipsec ``` There are two simple examples in the -[***notebook-examples/network/ipsec***](notebook-examples/network/README.md) +[***notebook-examples/network/ipsec***](./notebook-examples/network/README.md) section. These use ***setkey**(8)* and commands directly and therefore do not require the IKE daemons. diff --git a/src/postgresql.md b/src/postgresql.md index 595a594..81a6d01 100644 --- a/src/postgresql.md +++ b/src/postgresql.md @@ -38,7 +38,7 @@ sequences. **Table 1: Database Security Context Information** shows a simple database with one table and two columns, each with their object class and associated security context (the [**Internal Tables**](#internal-tables) section shows these entries from the *testdb* database in the -[**Notebook sepgsql Example**](notebook-examples/sepgsql/testdb-example.sql). +[**Notebook sepgsql Example**](./notebook-examples/sepgsql/testdb-example.sql). The database object classes and permissions are described in [**Appendix A - Object Classes and Permissions**](object_classes_permissions.md#database-object-classes). @@ -88,7 +88,7 @@ The [**https://www.postgresql.org/docs/11/sepgsql.html**](https://www.postgresql page contains all the information required to install the *sepgsql* extension. There are also instructions in the -[**Notebook sepgsql Example - README**](notebook-examples/sepgsql/README.md) +[**Notebook sepgsql Example - README**](./notebook-examples/sepgsql/README.md) that describes building the example database used in the sections below. ## *SECURITY LABEL* SQL Command @@ -207,7 +207,7 @@ is shown in the table below and has been taken from These are entries taken from a '*SELECT * FROM pg_seclabel;*' command that refers to the example *testdb* database built using the -[**Notebook - testdb-example.sql**](notebook-examples/sepgsql/testdb-example.sql): +[**Notebook - testdb-example.sql**](./notebook-examples/sepgsql/testdb-example.sql): ``` objoid | classoid | objsubid | provider | label diff --git a/src/toc.md b/src/toc.md index f5778bd..a51732b 100644 --- a/src/toc.md +++ b/src/toc.md @@ -32,7 +32,7 @@ - [Policy Configuration Files](policy_config_files.md#policy-configuration-files) - [SELinux Policy Languages](policy_languages.md#the-selinux-policy-languages) - [CIL Policy Language](cil_overview.md#cil-overview) - - [CIL Reference Guide](notebook-examples/selinux-policy/cil/CIL_Reference_Guide.pdf) + - [CIL Reference Guide](./notebook-examples/selinux-policy/cil/CIL_Reference_Guide.pdf) - [Kernel Policy Language](kernel_policy_language.md#kernel-policy-language) - [Policy Configuration Statements](policy_config_statements.md#policy-configuration-statements) - [Default Rules](default_rules.md#default-object-rules) From patchwork Fri Dec 10 11:43:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Haines X-Patchwork-Id: 12669463 X-Patchwork-Delegate: paul@paul-moore.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7742C433F5 for ; Fri, 10 Dec 2021 11:43:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240723AbhLJLr3 (ORCPT ); Fri, 10 Dec 2021 06:47:29 -0500 Received: from mailomta27-re.btinternet.com ([213.120.69.120]:12480 "EHLO re-prd-fep-047.btinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S240744AbhLJLr2 (ORCPT ); Fri, 10 Dec 2021 06:47:28 -0500 Received: from re-prd-rgout-004.btmx-prd.synchronoss.net ([10.2.54.7]) by re-prd-fep-047.btinternet.com with ESMTP id <20211210114352.HCSF24878.re-prd-fep-047.btinternet.com@re-prd-rgout-004.btmx-prd.synchronoss.net>; Fri, 10 Dec 2021 11:43:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=btinternet.com; s=btmx201904; t=1639136632; bh=TkD5JLfcM2u1FJFTo1/9V1+0C1cUzcWOdn7v1pKygtQ=; h=From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References:MIME-Version; b=NsQlmqMi9qw+IRjJVa6uUz0eQ1kt6Mf+fa62peadPXwGkI8i7pdpdbVsnLW3s4IHO8pI+Wrx03BvHN5HEI9x7eZUMg8ZDFH/P53FExCtgHDAvcHjNOkmJPp//9rQAqkW0sq3gJ7xr1Zs7/QLEIVbTBKGE1X6SdmOx9mB0qo770Ox6cRjdR0stpuui9EnZex0h1OT+GiUFKzO5jJJDd96zArsNb7vb70CQ8UmUk/4n+7kE19ubxkhA28y9G/61UG2HrZjq6kq8pBt3F0Rrq0pHyZqVO3aGc74WJi5WgIA/+KUNQEzt6PHGn1impx6y8xWqi91zY6fP815lJzNA2iXow== Authentication-Results: btinternet.com; none X-SNCR-Rigid: 613A901C0CC4A27A X-Originating-IP: [81.141.144.155] X-OWM-Source-IP: 81.141.144.155 (GB) X-OWM-Env-Sender: richard_c_haines@btinternet.com X-VadeSecure-score: verdict=clean score=0/300, class=clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvuddrkedvgdefvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemuceutffkvffkuffjvffgnffgvefqofdpqfgfvfenuceurghilhhouhhtmecufedtudenucenucfjughrpefhvffufffkofgjfhgggfestdhqredtredttdenucfhrhhomheptfhitghhrghrugcujfgrihhnvghsuceorhhitghhrghruggptggphhgrihhnvghssegsthhinhhtvghrnhgvthdrtghomheqnecuggftrfgrthhtvghrnhepgfffuddvveffgfegveelledtieeludejueduhefftedtvefhtdehhfeuiefhgeetnecuffhomhgrihhnpehinhhkshgtrghpvgdrohhrghdpphhurhhlrdhorhhgpdhrvghsohhurhgtvgdrohhrghdpfiefrdhorhhgpdhsohhurhgtvghfohhrghgvrdhnvghtnecukfhppeekuddrudeguddrudeggedrudehheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopehlohgtrghlhhhoshhtrdhlohgtrghlughomhgrihhnpdhinhgvthepkedurddugedurddugeegrdduheehpdhmrghilhhfrhhomheprhhitghhrghruggptggphhgrihhnvghssegsthhinhhtvghrnhgvthdrtghomhdprhgtphhtthhopehprghulhesphgruhhlqdhmohhorhgvrdgtohhmpdhrtghpthhtoheprhhitghhrghruggptggphhgrihhnvghssegsthhinhhtvghrnhgvthdrtghomhdprhgtphhtthhopehsvghlihhnuhigsehvghgvrhdrkhgvrhhnvghl rdhorhhg X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean X-SNCR-hdrdom: btinternet.com Received: from localhost.localdomain (81.141.144.155) by re-prd-rgout-004.btmx-prd.synchronoss.net (5.8.716.04) (authenticated as richard_c_haines@btinternet.com) id 613A901C0CC4A27A; Fri, 10 Dec 2021 11:43:52 +0000 From: Richard Haines To: selinux@vger.kernel.org Cc: paul@paul-moore.com, Richard Haines Subject: [PATCH 2/4] src/images: Remove current penguin Date: Fri, 10 Dec 2021 11:43:38 +0000 Message-Id: <20211210114340.13977-3-richard_c_haines@btinternet.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211210114340.13977-1-richard_c_haines@btinternet.com> References: <20211210114340.13977-1-richard_c_haines@btinternet.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org Remove pengiun image before replacement Signed-off-by: Richard Haines --- src/images/selinux-penguin.svg | 398 --------------------------------- 1 file changed, 398 deletions(-) delete mode 100644 src/images/selinux-penguin.svg diff --git a/src/images/selinux-penguin.svg b/src/images/selinux-penguin.svg deleted file mode 100644 index ca7f1c9..0000000 --- a/src/images/selinux-penguin.svg +++ /dev/null @@ -1,398 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From patchwork Fri Dec 10 11:43:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Haines X-Patchwork-Id: 12669465 X-Patchwork-Delegate: paul@paul-moore.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02FEBC433EF for ; Fri, 10 Dec 2021 11:43:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240768AbhLJLrb (ORCPT ); Fri, 10 Dec 2021 06:47:31 -0500 Received: from mailomta26-re.btinternet.com ([213.120.69.119]:33466 "EHLO re-prd-fep-046.btinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S240744AbhLJLra (ORCPT ); Fri, 10 Dec 2021 06:47:30 -0500 Received: from re-prd-rgout-004.btmx-prd.synchronoss.net ([10.2.54.7]) by re-prd-fep-046.btinternet.com with ESMTP id <20211210114354.KBLG24326.re-prd-fep-046.btinternet.com@re-prd-rgout-004.btmx-prd.synchronoss.net>; Fri, 10 Dec 2021 11:43:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=btinternet.com; s=btmx201904; t=1639136634; bh=UBTAVqWtgVhxKtVVyZg0DKzx16fLVN67bgj+xfwcGQg=; h=From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References:MIME-Version; b=X3zGyR0GbbKm3LCuuw86d6VVsjhL77hlZoNNOG/3rXs1fzkAio0f9KuvAtSoGAzBhHrBeHl4PKte649PuNjwp0EKc6UWN+tFMlDtg+XRlfDx6FJy7wOcfG4h+jijS1KE5pkrKjhdO2iWmgZaVzYryBZfCXBRS7E7fC9bB8tcMVoZ3RCicluKD5AHw4Kg8vTTcquYS2DeEy2IWnSBeXQI+iuWTzdieZLDJO2njnyD50hak9UFM3oVnclI8ejeT1LacnNTXV9k5kWdAeLaF1U/CIqa1Zzuw8SaHfwohra8pFDweW5JCEwis5iVVNWmmPVxgTPdQ/qkiEAs5JZKjBNuog== Authentication-Results: btinternet.com; none X-SNCR-Rigid: 613A901C0CC4A2C9 X-Originating-IP: [81.141.144.155] X-OWM-Source-IP: 81.141.144.155 (GB) X-OWM-Env-Sender: richard_c_haines@btinternet.com X-VadeSecure-score: verdict=clean score=0/300, class=clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvuddrkedvgdefvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemuceutffkvffkuffjvffgnffgvefqofdpqfgfvfenuceurghilhhouhhtmecufedtudenucenucfjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeftihgthhgrrhguucfjrghinhgvshcuoehrihgthhgrrhgupggtpghhrghinhgvshessghtihhnthgvrhhnvghtrdgtohhmqeenucggtffrrghtthgvrhhnpeduffefveduffeuhfekgfeuleffgfelheelieffgeegvedvgfeuveevveeigeetveenucffohhmrghinhepuhhpuggrthgvqdhmihhmvgdquggrthgrsggrshgvrdhlohgtrghlpdhgnhhurdhorhhgpdguvghvihgrnhhtrghrthdrtghomhenucfkphepkedurddugedurddugeegrdduheehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehhvghloheplhhotggrlhhhohhsthdrlhhotggrlhguohhmrghinhdpihhnvghtpeekuddrudeguddrudeggedrudehhedpmhgrihhlfhhrohhmpehrihgthhgrrhgupggtpghhrghinhgvshessghtihhnthgvrhhnvghtrdgtohhmpdhrtghpthhtohepphgruhhlsehprghulhdqmhhoohhrvgdrtghomhdprhgtphhtthhopehrihgthhgrrhgupggtpghhrghinhgvshessghtihhnthgvrhhnvghtrdgtohhmpdhrtghpthhtohepshgvlhhinhhugiesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean X-SNCR-hdrdom: btinternet.com Received: from localhost.localdomain (81.141.144.155) by re-prd-rgout-004.btmx-prd.synchronoss.net (5.8.716.04) (authenticated as richard_c_haines@btinternet.com) id 613A901C0CC4A2C9; Fri, 10 Dec 2021 11:43:54 +0000 From: Richard Haines To: selinux@vger.kernel.org Cc: paul@paul-moore.com, Richard Haines Subject: [PATCH 4/4] selinux-notebook: Add epub build Date: Fri, 10 Dec 2021 11:43:40 +0000 Message-Id: <20211210114340.13977-5-richard_c_haines@btinternet.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211210114340.13977-1-richard_c_haines@btinternet.com> References: <20211210114340.13977-1-richard_c_haines@btinternet.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org Build an epub document. Signed-off-by: Richard Haines --- BUILD.md | 17 +++++++++++----- CONTRIBUTING.md | 10 +++++----- Makefile | 48 ++++++++++++++++++++++++++++++++++++++------- README.md | 9 +++++---- src/cover.md | 16 +++++++++++++++ src/cover_epub.md | 2 ++ src/styles_epub.css | 44 +++++++++++++++++++++++++++++++++++++++++ src/title.md | 16 --------------- 8 files changed, 125 insertions(+), 37 deletions(-) create mode 100644 src/cover.md create mode 100644 src/cover_epub.md create mode 100644 src/styles_epub.css diff --git a/BUILD.md b/BUILD.md index 34045cf..6ca9077 100644 --- a/BUILD.md +++ b/BUILD.md @@ -29,9 +29,9 @@ Extract from the README: > > % update-mime-database ~/.local/share/mime -# Build HTML or PDF Versions +# Build HTML, PDF or EPUB Versions -The SELinux Notebook can be rendered in both HTML and PDF using the included +The SELinux Notebook can be rendered in HTML, PDF and EPUB using the included Makefile. In order to build these versions of the notebook, "pandoc" and "weasyprint" must be installed on your system; consult your distribution documentation for information on installing these packages. @@ -41,9 +41,16 @@ following command: % make pdf -... and the following will generate the HTML notebook: +... the following will generate the HTML notebook: % make html -The PDF and HTML notebooks will be generated in newly created "pdf" and "html" -directories. +... and the following will generate the EPUB notebook: + + % make epub + +The PDF, HTML and EPUB notebooks will be generated in newly created "pdf", +"html" and "epub" directories. + +The Notebook examples are not embedded into any of the document formats, +however they will have links to them via their build directory. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 43f1934..db137b0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,11 +10,11 @@ project. ## Make Sure Your Changes Render Correctly -The SELinux Notebook can be viewed in three different formats: Markdown, HTML, -and PDF. Your changes need to render correctly in all three formats. The -HTML and PDF formatted notebooks can be created using the included Makefile -and Markdown can be viewed directly via the GitHub source browser or any -number of Markdown viewers. +The SELinux Notebook can be viewed in four different formats: Markdown, HTML, +PDF and EPUB. Your changes need to render correctly in all four formats. +The HTML, PDF and EPUB formatted notebooks can be created using the included +Makefile and Markdown can be viewed directly via the GitHub source browser +or any number of Markdown viewers. ## Explain Your Work diff --git a/Makefile b/Makefile index f41bb16..1903982 100644 --- a/Makefile +++ b/Makefile @@ -2,20 +2,23 @@ # The SELinux Notebook # +SED = sed +PANDOC = pandoc CWD ?= $(shell pwd) SCRIPTS = $(CWD)/scripts SRCDIR = $(CWD)/src HTMLDIR ?= $(CWD)/html PDFDIR ?= $(CWD)/pdf +EPUBDIR ?= $(CWD)/epub IMAGES = $(SRCDIR)/images EXAMPLES = $(SRCDIR)/notebook-examples +EXAMPLES_EPUB = $(shell echo $(EXAMPLES) | $(SED) 's;/;\\/;g') METADATA = $(SRCDIR)/metadata.yaml HTML_OUT = SELinux_Notebook.html PDF_OUT = SELinux_Notebook.pdf +EPUB_OUT = SELinux_Notebook.epub -SED = sed -PANDOC = pandoc PANDOC_OPTS = --from markdown+pipe_tables PANDOC_OPTS += -V mainfont='DejaVu Serif' -V monofont='DejaVu Sans Mono' @@ -27,8 +30,8 @@ help: @echo "targets:" @grep "^#@ " Makefile | cut -c4- -#@ all build both the PDF and HTML versions -all: html pdf +#@ all build the PDF, HTML and EPUB versions +all: html pdf epub #@ navlinks update the navigation links in the markdown sources .PHONY: navlinks @@ -46,11 +49,13 @@ navlinks: echo "" >> $$i; \ done -#@ pdf build both the PDF version +#@ pdf build PDF version .PHONY: pdf pdf: $(DEP_FILE_LIST) $(METADATA) mkdir -p $(PDFDIR) cat $(METADATA) > $(PDFDIR)/.full_document.md + cat $(SRCDIR)/cover.md | $(SCRIPTS)/macros_section.sh \ + >> $(PDFDIR)/.full_document.md for i in $(DEP_FILE_LIST); do \ cat $$i | $(SCRIPTS)/macros_section.sh \ >> $(PDFDIR)/.full_document.md; \ @@ -70,11 +75,13 @@ pdf: $(DEP_FILE_LIST) $(METADATA) --css=$(SRCDIR)/styles_pdf.css --self-contained \ $(PDFDIR)/.full_document.md -o $(PDFDIR)/$(PDF_OUT)) -#@ html build both the HTML version +#@ html build HTML version .PHONY: html html: $(DEP_FILE_LIST) $(METADATA) mkdir -p $(HTMLDIR) cat $(METADATA) > $(HTMLDIR)/.full_document.md + cat $(SRCDIR)/cover.md | $(SCRIPTS)/macros_section.sh \ + >> $(HTMLDIR)/.full_document.md for i in $(DEP_FILE_LIST); do \ cat $$i | $(SCRIPTS)/macros_section.sh \ >> $(HTMLDIR)/.full_document.md; \ @@ -92,7 +99,34 @@ html: $(DEP_FILE_LIST) $(METADATA) --css=$(SRCDIR)/styles_html.css --self-contained \ $(HTMLDIR)/.full_document.md -o $(HTMLDIR)/$(HTML_OUT)) +#@ epub build EPUB version +.PHONY: epub +epub: $(DEP_FILE_LIST) $(METADATA) + mkdir -p $(EPUBDIR) + cat $(METADATA) > $(EPUBDIR)/.full_document.md + cat $(SRCDIR)/cover_epub.md | $(SCRIPTS)/macros_section.sh \ + >> $(EPUBDIR)/.full_document.md + for i in $(DEP_FILE_LIST); do \ + cat $$i | $(SCRIPTS)/macros_section.sh \ + >> $(EPUBDIR)/.full_document.md; \ + echo '' \ + >> $(EPUBDIR)/.full_document.md; \ + done + $(SCRIPTS)/macros_doc.sh $(EPUBDIR)/.full_document.md + $(SED) -i 's/](.*\.md#/](#/' $(EPUBDIR)/.full_document.md + # remove the section file name from all HTML links + $(SED) -i 's/href=.*\.md#/href="#/' $(EPUBDIR)/.full_document.md + # fixup path for examples, otherwise defaults to file:///EPUB/text + $(SED) -i 's/](.\/notebook-examples/](file:\/\/$(EXAMPLES_EPUB)/g' \ + $(EPUBDIR)/.full_document.md + [ -e $(EPUBDIR)/images ] || ln -s $(IMAGES) $(EPUBDIR) + [ -e $(EPUBDIR)/notebook-examples ] || ln -s $(EXAMPLES) $(EPUBDIR) + (cd $(EPUBDIR); $(PANDOC) $(PANDOC_OPTS) \ + --epub-cover-image=$(SRCDIR)/images/selinux-penguin_400.png \ + --css=$(SRCDIR)/styles_epub.css --self-contained \ + $(EPUBDIR)/.full_document.md -o $(EPUBDIR)/$(EPUB_OUT)) + #@ clean clean any build artifacts .PHONY: clean clean: - rm -rf $(HTMLDIR) $(PDFDIR) + rm -rf $(HTMLDIR) $(PDFDIR) $(EPUBDIR) diff --git a/README.md b/README.md index 9558101..f2e1c94 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # The SELinux Notebook -![](./src/images/selinux-penguin.svg) +![](./src/images/selinux-penguin_400.png) ## Introduction @@ -69,7 +69,8 @@ See: **** Logo designed by [*Máirín Duffy*](http://pookstar.deviantart.com/) -## Building HTML/PDF Versions +## Building HTML/PDF/EPUB Versions -The [**BUILD.md**](BUILD.md) file has more information on building HTML and PDF -versions of the notebook as well as alternate ways to view the source markdown. +The [**BUILD.md**](BUILD.md) file has more information on building HTML, PDF +and EPUB versions of the notebook as well as alternate ways to view the +source markdown. diff --git a/src/cover.md b/src/cover.md new file mode 100644 index 0000000..d3be82c --- /dev/null +++ b/src/cover.md @@ -0,0 +1,16 @@ + + + +# The SELinux Notebook + + + +![](./images/selinux-penguin_400.png) + + +**** + + + + + diff --git a/src/cover_epub.md b/src/cover_epub.md new file mode 100644 index 0000000..3f90deb --- /dev/null +++ b/src/cover_epub.md @@ -0,0 +1,2 @@ +**** + diff --git a/src/styles_epub.css b/src/styles_epub.css new file mode 100644 index 0000000..a1bb26f --- /dev/null +++ b/src/styles_epub.css @@ -0,0 +1,44 @@ + +.title { + /* pandoc generates the h1 title with the "title" class */ + display: none; +} + +html { + font-size: 100%; +} + +a { + color: blue; +} + +table { + /* limit to 95% page width */ + min-width: 50%; + max-width: 95%; + /* combine table borders when they are adjacent */ + border-collapse: collapse; +} +table th { + padding: 0.5em; + border: 1px solid black; + background-color: #d3d3d3; +} +table tr, td { + padding: 0.5em; + border: 1px solid black; +} + +img { + /* center and limit to 95% page width */ + display: block; + margin-left: auto; + margin-right: auto; + max-width: 95%; +} + +pre { + width: 95%; + padding: 1em; + background-color: #f5f5f5; +} diff --git a/src/title.md b/src/title.md index 03c5795..7f21617 100644 --- a/src/title.md +++ b/src/title.md @@ -1,19 +1,3 @@ - - - -# The SELinux Notebook - - - -![](./images/selinux-penguin.svg) - - -**** - - - - - ## Copyright Information