-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dev%2FBuild_Documentation%2FUpgrading_Derivative_Deb_Packages_from_Source_Code.mw
134 lines (95 loc) · 5.55 KB
/
Dev%2FBuild_Documentation%2FUpgrading_Derivative_Deb_Packages_from_Source_Code.mw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
{{Header}}
{{#seo:
|description=HowTo: Upgrade {{project_name_long}} Deb Packages from Source Code
}}
{{forkme}}
{{Title|title=
Upgrading {{project_name_short}} Deb Packages from Source Code
}}
== Introduction ==
This assumes you are updating {{project_name_short}} debian packages while you are using {{project_name_short}}.
== Prerequisites ==
Might be a good idea to create a backup and/or clone before trying to update.
If you haven't done already, disable {{project_name_short}} APT repository. <ref>
[[Project-APT-Repository#Disable_{{project_name_short}}_APT_Repository]]
</ref>
{{CodeSelect|code=
sudo repository-dist --disable
}}
Upgrade from Debian packages.
{{CodeSelect|code=
sudo apt update && sudo apt --yes full-upgrade
}}
== Get the Source Code ==
=== Get the Signing Key ===
{{Get_Signing_Key}}
=== Get the Source Code ===
{{Build_Documentation_Get_Source}}
=== Change Directory ===
Get into the <code>{{project_name_short}}</code> source code folder because later on package build commands using <code>./derivative-maker</code> are expected to be run from the root of the source folder.
{{CodeSelect|code=
cd derivative-maker
}}
=== OpenPGP Verify the Source Code ===
{{OpenPGP Verify the Source Code}}
=== Choose Version ===
{{
Build Documentation Choose Version
|version={{VersionNew}}-stable
|extra=--recurse-submodules
}}
=== Check Git ===
{{Build Documentation Check Git
|version={{{version}}}
}}
== Build Dependencies ==
Get all build dependencies.
{{CodeSelect|code=
sudo -E ./build-steps.d/1100_prepare-build-machine --internalrun --build --target root
}}
Why <code>--target root</code>? This is correct, if you want to know why, see footnote. <ref>Setting the <code>--target</code> parameter to <code>root</code> will result in installing fewer build dependencies. For example VirtualBox will not be installed. These are only required to build full images, but since we just want to create updated {{project_name_short}} Debian Packages, this is unnecessary. Not much harm done when forgetting to use <code>--target root</code>, because the user is free to remove any build dependencies later.</ref>
== Create the Packages ==
If you're not debugging, create the packages with:
{{CodeSelect|code=
sudo -E ./build-steps.d/1200_create-debian-packages --build --internalrun --target root
}}
If debugging, use the following command. Developers only! <ref>Packages are possibly not matching the quality for redistributable testes or stable builds. This is because the package will potentially built from git master, which has no proper debian/changelog release version, and no signed git tag. There may be another package of that version in the repository that is different. Distinguishing these packages is hard and would cause confusion. Therefore this is considered unclean and only developers may do this for debugging purposes.</ref> Potentially insecure unless the untagged / uncommited changes are by you or by a trusted developer with a git gpg signature that you verified.
{{CodeSelect|code=
sudo -E ./build-steps.d/1200_create-debian-packages --build --allow-untagged true --allow-uncommitted true --internalrun --target root
}}
== Upgrade {{project_name_short}} Debian Packages ==
Upgrade {{project_name_short}} Debian Packages without contacting a {{project_name_short}} APT Repository, using your own locally created apt package repository.
For {{project_name_gateway_long}}.
{{CodeSelect|code=
sudo ./packages/kicksecure/developer-meta-files/debug-steps/locally-upgrade-derivative-debian-packages --build --target root --flavor whonix-gateway
}}
<ref>Why use <code>--target root</code>"? Technical explanation: <code>--target root</code> in context of {{project_name_short}} source code means "do it on the system currently running, i.e. do it directly on the root folder "/[...]", don't do it inside "vm_image/[...]".</ref>
For {{project_name_workstation_long}}.
{{CodeSelect|code=
sudo ./packages/kicksecure/developer-meta-files/debug-steps/locally-upgrade-derivative-debian-packages --build --target root --flavor whonix-workstation
}}
There will be a lot debug output. <ref>Unless you log in as root and run <code>export WHONIX_DEB_DEBUG=0</code>.</ref>
If everything went well, you will see <ref>Or saying {{project_name_gateway_short}} respectively</ref> <ref>It won't, if you have <code>export WHONIX_DEB_DEBUG=0</code> set.</ref>
<blockquote>
<nowiki>########################################################################</nowiki></br>
<nowiki>##</nowiki> INFO: Successfully configured (postinst script) {{project_name_workstation_short}}. <nowiki>#</nowiki></br>
<nowiki>########################################################################</nowiki>
</blockquote>
The last few highlighted messages will be similar to:
<blockquote>
+ true 'INFO: Skipping script, because --target root: /home/user/whonix_dot/{{project_name_short}}/help-steps/unmount-img'<br />
+ true 'INFO: End of: ./debug-steps/locally-upgrade-derivative-debian-packages | exit_code: 0 | error(s) detected: 0 | benchmark: 00:01:40'
</blockquote>
In case any error is caught, the script will loudly complain by echoing in a red colored error message:
<blockquote>
ERROR in ./debug-steps/locally-upgrade-derivative-debian-packages! Aborted.
</blockquote>
Lets hope it works well. Please get in [[Support|Contact]] should there be any issues. Leave feedback if you are using this, if it worked for you, which issues you may have had, so these instructions can be updated.
== Cleanup ==
{{Build_Documentation_Cleanup}}
= See Also =
* [[Dev/Build Documentation]]
= Footnotes =
{{reflist|close=1}}
{{Footer}}
[[Category:Development]]