-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
150 lines (85 loc) · 3.95 KB
/
README
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
############################################################################################
#
# JPK package distribution tool
#
############################################################################################
1. Intro
--------
Educational attempt on building a linux package distribution system, for LFS based OS
2. JPK File structure
---------------------
JPK file structure is tar file compressed with xz and organized as follows:
File.Version.jpk
- pkg.tar (uncompressed tar file, containing the files to be distributed)
- jpk
- jpk.info (file with information related to the package)
- index.tgz (output of 'tar tvf pkt.tar' compressed with gzip)
2.1. jpk.info
-------------
- Pre-Script: and Post-Script:
Pre and Post scripts can be configured to be executed with the Pre-Script: and Post-Script: entries
If this entries are set, the script files must exist and be executable, otherwise the installation will fail.
The execution path is always relative to the scripts directory
- Checksum:
If present, checksum will be checked before installation
3. jpk tool
-----------
Insall a package
# jpk install package.jpk (installs a jpk package)
TODO: Remove a package
# jpk remove package.jpk (TODO: removes a jpk package)
4. Packaging helper tools
-------------------------
Source the file containing the jpk helper functions with
# source /pkg/bin/jpk_functions.sh
Setup a build environment (should be called as root)
# jpk_setup_pkg PKG_NAME PKG_VERSION [SRC_TAR_FILE]
Setup the environment variables to needed for jpk_* functions
If SRC_TAR_FILE is provided, the basic needed directory structure is created
/pkg/src/PKG_NAME/PKG_VERSION
/pkg/dst/PKG_NAME/PKG_VERSION/root
/pkg/dst/PKG_NAME/PKG_VERSION/scripts/*
and the SRC_TAR_FILE is extracted into dst/.../root
SRC_TAR_FILE can be passed as - if untaring the source is not needed
Print current package informations
# jpk_print_pkg_info
Variable JPK_BUILD_USER can be set to indicate the user that will build the source
If the variable is not set, the current user will be used
This function returns the effective owner that will be used to extract the tar files
# jpk_get_build_user
Change to package source directory
# jpk_cd_pkg_src_dir
Change to destination directory
# jpk_cd_pkg_dst_dir
After building the package this function can be used to install the produced code into fakeroot
( http://www.linuxfromscratch.org/hints/downloads/files/fakeroot.txt )
# jpk_install_pkg
If the package does not support DESTDIR variable in make install, some other approach must be used
Here the jpk_snapshot_disk can be useful to take a snapshot of the filesystem before calling jpk_install_pkg and after,
and check if some file was modified outside the /pkg tree
Strip unneded symbols from elf files
# jpk_strip_pkg
Create the final package and place it in /pkg/repo
# jpk_pack_pkg
Unset all the env vars set with jpk_setup_pkg
# jpk_unset_pkg
5. jpk_snapshot_disk tool
-------------------------
This tool provides a way to take a snapshot of the filesystem structure,
useful to check if files have been changed after performing an operation
To take a filesystem snapshot use:
# jpk_snapshot_disk db /tmp/filesnap1
START_ROOT variable may be set before the command to specify where to start the lookup,
otherwise use / (root)
To compare two snapshots use
# jpk_snapshot_disk cmp /tmp/filesnap1 tmp/filesnap2
The last parameter can be committed, and a temporary snapshot will be taken
6. find_elf_dependencies tool
-----------------------------
This tool can be used to check shared lib dependencies of all ELF files inside a directory
# find_elf_dependencies DIR
7. TODO
-------
- Implement more jpk commands (such as remove)
- implement mechanism to check for dependencies
- Download files from http://