forked from ubinux/smart2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
293 lines (240 loc) · 15.5 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
1. Overview
Smart2 is a package manager that based on smart. Smart2 supports all the
funtions of smart. In addition, smart2 has some new features.
--------------
New Features
--------------
- A new interface named "tgui" can show you a GUI on your character terminal.
- Support for custom target rootfs on host development machine.
Note
More information about smart, refer to doc/ or http://labix.org/smart/howto.
2. How to get smart2
Smart2 now is managed on Github. You can get smart2 from there.
https://github.com/ubinux/smart2.git
3. Installation
3.1 Dependencies
1) The dependencies are same as smart
Smart2 is based on smart, so please make sure the prerequisites for smart have been installed.
Refre to http://labix.org/smart/howto to obtain details.
2) Dependencies for smart2 new features.
- python-newt: the snack module depended by "tgui" graphic interface.
Note
In some cases (e.g. Cross-Platform), maybe you can not use the above command
which belongs to host directly. You should build a special one for your target-platform,
and make sure it's available in your toolchain for Cross-Platform.
E.g, for Yocto user, you should install the toolchain firstly
3.2 Installation
cd into smart2 directory and execute the following commands as root:
-------------------------------------------------------------------
# python setup.py build
# python setup.py install
-------------------------------------------------------------------
Or you can use the supplied Makefile:
-------------------------------------------------------------------
# make
# make install
-------------------------------------------------------------------
Note
After installation, you have to change the interpreter from "#!/usr/bin/python" to
"#!/usr/bin/env python" in your smart2 command.
-----------------------------------------------------------------
$ whereis smart
smart: /opt/bin/smart
$ cat /opt/bin/smart
#!/usr/bin/env python
......
-----------------------------------------------------------------
3.3 Global Settings
1) In Cross-Platform case, make sure the required commands can be invoked preferentially.
For example, you can do it by the following command for Yocto-User
-----------------------------------------------------------------------
$ source TOOLCHAIN/environment-setup-i586-poky-linux
-----------------------------------------------------------------------
2) Make sure the following environment variable point to correct path.
-----------------------------------------------------------------------
$ export RPM_USRLIBRPM=/usr/lib/rpm
$ export RPM_ETCRPM=/etc/rpm
$ export RPM_LOCALEDIR=/usr/share/locale
-----------------------------------------------------------------------
Note
In Cross-Platform case, maybe you should customize these variable.
E.g. for Yocto user, you should set them as following.
-------------------------------------------------------------------
$ export RPM_USRLIBRPM=${OECORE_NATIVE_SYSROOT}/usr/lib/rpm
$ export RPM_ETCRPM=${SDKTARGETSYSROOT}/etc/rpm
$ export RPM_LOCALEDIR=${OECORE_NATIVE_SYSROOT}/usr/share/locale
-------------------------------------------------------------------
4. How to manage packages
4.1 Prepare
You should construct the environment before doing install/remove/search operations.
Smart2 provides a script named environment-smart.sh to do it automatically.
It can help you to complete the following jobs:
- Build pseudo environment.
- Configure DB settings for packages sources (e.g. rpm, deb).
- Configure smart2 settings for packages sources (e.g. rpm, deb).
- Add channels for each packages source.
You can configure your smart2 environment as the following:
-------------------------------------------------------------------
$ . environment-smart.sh ROOTFS_DIR PACKAGES_DIR
-------------------------------------------------------------------
There must be two parameters for environment-smart.sh:
1) ROOTFS_DIR: The rootfs directory where you want to install packages.
Note
* ROOTFS_DIR must be absolute path.
* If it doesn't exist, it will be created.
2) PACKAGES_DIR: The packages sources directory. There can be multiple packages sources
in this directory.
For example:
If you build x86 by Yocto, there will be three packages sources for x86.
And there is a repodata in each packages sources:
-------------------------------------------------------------------
# tree /home/test/x86_rpm/ | grep -v "\.rpm"
/home/test/x86_rpm/
|-- all
| |-- repodata
| | |-- filelists.xml.gz
| | |-- other.xml.gz
| | |-- primary.xml.gz
| | |-- repomd.xml
|-- i586
| |-- repodata
| | |-- filelists.xml.gz
| | |-- other.xml.gz
| | |-- primary.xml.gz
| | |-- repomd.xml
|-- qemux86
| |-- repodata
| | |-- filelists.xml.gz
| | |-- other.xml.gz
| | |-- primary.xml.gz
| | |-- repomd.xml
-------------------------------------------------------------------
You can configure your smart2 environment for x86 by the following:
-------------------------------------------------------------------
$ . environment-smart.sh /home/test/x86_rootfs /home/test/x86_rpm
-------------------------------------------------------------------
Note
Smart2 manage packages by repodata, make sure there is repodata in every sources
directory under PACKAGES_DIR.
If the rpm package is added, deleted or updated, the repodata needs to be updated to
reflect the newest infomation.
-------------------------------------------------------------------
$ rm -rf repodata
$ createrepo ./
-------------------------------------------------------------------
4.2 Create rootfs for Target-Platform
Smart2 supports a new interface named "tgui" which can
help you to customize your rootfs under character terminal in your development machine.
You will enter the tgui insterface with the option "--interface=tgui".
For example:
-------------------------------------------------------------------
$ smart --rootfs-dir=$ROOTFS_DIR --interface=tgui
-------------------------------------------------------------------
Note
--rootfs-dir: rootfs directory that specified by environment-smart.sh.
After execute the above command, you can enter the interface of tgui:
1) Select install type
Smart2 supports three kinds of install type:
- install all
By default, all pacakges will be selected.
- Busybox base
By default, only busybox packages will be selected.
- customize
By default, no packages will be selected.
2) Smart2 can help you filter GPLv3.
If you select "install all" or "customize" in above, smart2 will ask you whether
you want to install packages which license is GPLv3.
- No : GPLv3 packages will not be selected and not display in the next step.
- Yes : GPLv3 packages can be selected as same as the other packages.
3) customize packages
------------------------------- Select package -----------------------------------
| |
| [ ] acl |
| [ ] acpid |
| [ ] adwaita-icon-theme |
| [ ] adwaita-icon-theme-cursors |
| [ ] adwaita-icon-theme-hires |
| [ ] adwaita-icon-theme-symbolic |
| [ ] alsa-conf |
| [ ] alsa-conf-base |
| [ ] alsa-lib |
| [ ] alsa-plugins |
| [ ] alsa-plugins-pulseaudio-conf |
| [ ] alsa-server |
| [I] alsa-state |
| [ ] alsa-states |
| [ ] alsa-utils |
| [ ] alsa-utils-aconnect |
| [ ] alsa-utils-alsactl |
| [ ] alsa-utils-alsaloop |
| [ ] alsa-utils-alsamixer |
| [I] alsa-utils-alsaucm |
| [*] alsa-utils-amixer |
| ------------------------------------------------------------------------------ |
| All Packages [2503] Installed Packages [2] Selected Packages [1] |
| ------------------------------------------------------------------------------ |
| SPACE/ENTER:select/unselect R:seaRch N:Next B:Back I:Info X:eXit |
----------------------------------------------------------------------------------
Note
- [] Means the package has not been selected and installed. If you want to install it, you can
select it by pressing enter.
- [*] Means the package has been selcted and will be installed. If you don't want to install it,
you can cancel by pressing enter.
- [I] Means the package has been installed in your rootfs. You can't select/unselect it in tgui.
If you want to uninstall it.Please use the following command after exiting tgui.
$ smart --rootfs-dir=/home/test/x86-rootfs remove pkgname
- Next: If you press "N" or "n" in the interface, it will go to the next step.
4) customize packages type
You can select the package type that you want to install into rootfs.
---------------------------- customize special type packages ----------------------------
| |
| locale [ ] |
| dev [ ] |
| doc [ ] |
| dbg [ ] |
| staticdev [ ] |
| ptest [ ] |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| -------------------------------------------------------------------------------------- |
| SPACE/ENTER:select/unselect N:Next B:Back I:Info X:eXit |
------------------------------------------------------------------------------------------
Note
You can get details about the package type by pressing "I" or "i".
5) Confirm selection
After you confirming your customization, the installation will begin.
6) Confirm installation
To make sure the files in rootfs have correct uid and gid, notice that:
* When rootfs is finished, please compress it into a tarball in the
current terminal to keep the pseudo environment.
* When unpack rootfs, please use sudo command with "--numeric-owner" option.
For example:
-------------------------------------------------------------------
$ . environment-smart.sh /home/test/x86_rootfs /home/test/x86_rpm
$ smart --rootfs-dir=/home/test/x86_rootfs --interface=tgui
$ cd /home/test/
$ tar cvf - x86-rootfs | (cd $DEST_DIR ;sudo tar xvf - --numeric-owner)
-------------------------------------------------------------------
4.3 Smart2 Commands
Besides "tgui", you also can manage packages by command line with the option
"--rootfs-dir".
For example:
-------------------------------------------------------------------
$ smart --rootfs-dir=/home/test/x86-rootfs install pkgname
$ smart --rootfs-dir=/home/test/x86-rootfs remove pkgname
$ smart --rootfs-dir=/home/test/x86-rootfs query '*kgnam*'
-------------------------------------------------------------------
More commands please reference to doc/ or http://labix.org/smart/howto.