| 1 |
AUTHOR: Zhou Peng(Chowroc) <chowroc dot z at gmail dot com> |
|---|
| 2 |
|
|---|
| 3 |
DATE: 2006-12-05 |
|---|
| 4 |
|
|---|
| 5 |
LICENSE: GNU Free Documentation License Version 1.2 |
|---|
| 6 |
|
|---|
| 7 |
SYNOPSIS: crablfs -- User Based Package Management System |
|---|
| 8 |
|
|---|
| 9 |
DESCRIPTION: |
|---|
| 10 |
Every package and its files belong to a system normal user, and |
|---|
| 11 |
a batch script to rebuild or migrate your personalized LFS/BLFS |
|---|
| 12 |
system by install all your packages all at once. |
|---|
| 13 |
|
|---|
| 14 |
ATTACHMENTS: |
|---|
| 15 |
http://cheeseshop.python.org/pypi?:action=display&name=crablfs |
|---|
| 16 |
https://sourceforge.net/project/showfiles.php?group_id=180695 |
|---|
| 17 |
|
|---|
| 18 |
PREREQUISITES: |
|---|
| 19 |
python-2.4 |
|---|
| 20 |
pexpect-2.1(optional) |
|---|
| 21 |
|
|---|
| 22 |
HINT: |
|---|
| 23 |
|
|---|
| 24 |
(1) Introduction: |
|---|
| 25 |
crablfs: User Based Package Management System which is written in |
|---|
| 26 |
python. Every package and its files belong to a system normal user, |
|---|
| 27 |
and a batch script to rebuild or migrate your personalized LFS/BLFS |
|---|
| 28 |
system by install all your packages automatically all at once. The |
|---|
| 29 |
goal of "crablfs" is to exert more control on packages that compiled |
|---|
| 30 |
from source, and reduce the costs of system migration and backup. |
|---|
| 31 |
|
|---|
| 32 |
The basic theory is: every package in the system has a corresponding |
|---|
| 33 |
user it belongs to, the installation actions(copy, mkdir, etc) will |
|---|
| 34 |
run by this user, thus all the files a package generated have the |
|---|
| 35 |
mode of this user. At the same time, all those users belongs to a |
|---|
| 36 |
'install' group, and the key directories in the system such as |
|---|
| 37 |
/usr/local, /usr/local/bin, etc have g+s,o+t mode, and owned to the |
|---|
| 38 |
'install' group, to make different packages create their own files |
|---|
| 39 |
and directories in those directories. |
|---|
| 40 |
|
|---|
| 41 |
There are many benefits to use this method. which can be looked up |
|---|
| 42 |
from the "LFS hints": |
|---|
| 43 |
|
|---|
| 44 |
More Control and Package Management using Package Users (v1.2) |
|---|
| 45 |
http://www.linuxfromscratch.org/hints/downloads/files/more_control_and_pkg_man.txt |
|---|
| 46 |
|
|---|
| 47 |
Based on this theory, the package manager "userpack" is a command |
|---|
| 48 |
line interface like rpm and paco, for finishing some necessary |
|---|
| 49 |
operations. It can install, remove, query a package, or list all |
|---|
| 50 |
packages of current system, or find the package owner of a specified |
|---|
| 51 |
file. the package name($pkgname-$version) will add to the list file |
|---|
| 52 |
(/usr/src/packages.list for default). |
|---|
| 53 |
|
|---|
| 54 |
Every package user has its own HOME dir, which is default to |
|---|
| 55 |
/usr/src/$pkgname. It will stores compressed source archives, all |
|---|
| 56 |
patches and supplementary files for installation, and installation |
|---|
| 57 |
profiles which contains the information of the package, such as |
|---|
| 58 |
user/group, source archive, patches, create time and those commands |
|---|
| 59 |
to build this package. |
|---|
| 60 |
|
|---|
| 61 |
By default, "userpack" use interactive mode, which will start a |
|---|
| 62 |
shell like command line, in which you type "cmd $command" to execute |
|---|
| 63 |
the corresponding command, and those commands will been recorded to |
|---|
| 64 |
"installation profile"(described before). This profile can be used |
|---|
| 65 |
to execute installation commands automatically in noninteractive |
|---|
| 66 |
mode. |
|---|
| 67 |
|
|---|
| 68 |
The script "crablfs" is a batch script write in python, it is another |
|---|
| 69 |
ALFS instance in other words, which make use of the automated ability |
|---|
| 70 |
of "userpack". It can use the list file(/usr/src/packages.list) |
|---|
| 71 |
mentioned before, to operate the compressed source archives and |
|---|
| 72 |
installation profiles you appointed automatically. And you can also |
|---|
| 73 |
specified a directory that has the same structure as $homepre |
|---|
| 74 |
(/usr/src) to build a ALFS system automatically. This means that you |
|---|
| 75 |
can migrate from an old system to new ones more easily -- and rebuild |
|---|
| 76 |
your personalized system more quickly. |
|---|
| 77 |
|
|---|
| 78 |
The essential differences among Linux distributions is the |
|---|
| 79 |
differences of the package management ways. As a distribution, LFS |
|---|
| 80 |
actually does not has a mature package manager itself, this of course |
|---|
| 81 |
roots to the flexibility of LFS, but for daily use, a mature package |
|---|
| 82 |
management system is necessary. It is recommended to use User Based |
|---|
| 83 |
Management in the BLFS document, but the LFS hints only give the basic |
|---|
| 84 |
principles which is very creative, but the shell scripts is not |
|---|
| 85 |
enough to form a self-consistency system. So I write one regardless of |
|---|
| 86 |
unveil my superficialness, a hope that my crude remarks may draw forth |
|---|
| 87 |
by abler people. |
|---|
| 88 |
|
|---|
| 89 |
Of course crablfs is not only used for LFS, it aims to those packages |
|---|
| 90 |
that build from source code, so it can used on other distributions, too. |
|---|
| 91 |
|
|---|
| 92 |
It's now available from: |
|---|
| 93 |
https://sourceforge.net/project/showfiles.php?group_id=180695 |
|---|
| 94 |
http://cheeseshop.python.org/pypi?:action=display&name=crablfs |
|---|
| 95 |
|
|---|
| 96 |
(2) install crablfs |
|---|
| 97 |
To make sure that crablfs also under the control of package |
|---|
| 98 |
management, to install by the following way to build the tools chain: |
|---|
| 99 |
# export PYTHONPATH=/opt/lib/python2.4/site-packages |
|---|
| 100 |
// sys.path will not be influenced by PYTHONPATH |
|---|
| 101 |
|
|---|
| 102 |
*** Now the pexpect package is optional *** |
|---|
| 103 |
# tar xfz pexpect-2.1.tar.gz |
|---|
| 104 |
# cd pexpect-2.1 |
|---|
| 105 |
# python setup.py install --prefix=/opt |
|---|
| 106 |
# cd .. |
|---|
| 107 |
|
|---|
| 108 |
# tar xfz crablfs-0.1.tar.gz |
|---|
| 109 |
# cd crablfs-0.1 |
|---|
| 110 |
# vi userpack.dirs |
|---|
| 111 |
*** define all key directories *** |
|---|
| 112 |
*** these dirs will belong to 'install' group.and have g+s,o+t mode *** |
|---|
| 113 |
/usr/local/ |
|---|
| 114 |
/usr/local/bin/ |
|---|
| 115 |
/usr/local/doc/ |
|---|
| 116 |
/usr/local/etc/ |
|---|
| 117 |
/usr/local/include/ |
|---|
| 118 |
/usr/local/info/ |
|---|
| 119 |
/usr/local/lib/ |
|---|
| 120 |
/usr/local/libexec/ |
|---|
| 121 |
/usr/local/man/ |
|---|
| 122 |
/usr/local/man/man1/ |
|---|
| 123 |
/usr/local/man/man2/ |
|---|
| 124 |
/usr/local/man/man3/ |
|---|
| 125 |
/usr/local/man/man4/ |
|---|
| 126 |
/usr/local/man/man5/ |
|---|
| 127 |
/usr/local/man/man6/ |
|---|
| 128 |
/usr/local/man/man7/ |
|---|
| 129 |
/usr/local/man/man8/ |
|---|
| 130 |
/usr/local/sbin/ |
|---|
| 131 |
/usr/local/share/ |
|---|
| 132 |
/usr/local/share/doc/ |
|---|
| 133 |
/usr/local/share/info/ |
|---|
| 134 |
/usr/local/share/locale/ |
|---|
| 135 |
/usr/local/share/man/ |
|---|
| 136 |
/usr/local/share/man/man1/ |
|---|
| 137 |
/usr/local/share/man/man2/ |
|---|
| 138 |
/usr/local/share/man/man3/ |
|---|
| 139 |
/usr/local/share/man/man4/ |
|---|
| 140 |
/usr/local/share/man/man5/ |
|---|
| 141 |
/usr/local/share/man/man6/ |
|---|
| 142 |
/usr/local/share/man/man7/ |
|---|
| 143 |
/usr/local/share/man/man8/ |
|---|
| 144 |
/usr/local/share/misc/ |
|---|
| 145 |
/usr/local/share/terminfo/ |
|---|
| 146 |
/usr/local/share/zoneinfo/ |
|---|
| 147 |
/usr/lib/python2.4/site-packages/ |
|---|
| 148 |
/usr/lib64/python2.4/site-packages/ |
|---|
| 149 |
// Adjust it for you own needs |
|---|
| 150 |
# python setup.py install --prefix=/opt |
|---|
| 151 |
# cd .. |
|---|
| 152 |
|
|---|
| 153 |
# /opt/bin/userpack init |
|---|
| 154 |
# /opt/bin/userpack install -f /tmp/crablfs-0.1.tar.gz crablfs-0.1 |
|---|
| 155 |
crablfs> cmd tar xfz crablfs-0.1.tar.gz |
|---|
| 156 |
crablfs> cmd cd crablfs-0.1 |
|---|
| 157 |
crablfs> cmd python setup.py install --install-scripts=/usr/local/bin |
|---|
| 158 |
crablfs> cmd cd .. |
|---|
| 159 |
crablfs> cmd rm -rf crablfs-0.1 |
|---|
| 160 |
crablfs> commit |
|---|
| 161 |
|
|---|
| 162 |
*** Now the pexpect package is optional *** |
|---|
| 163 |
# userpack install -f /tmp/pexpect-2.1.tar.gz pexpect-2.1 |
|---|
| 164 |
crablfs> cmd tar xfz pexpect-2.1.tar.gz |
|---|
| 165 |
crablfs> cmd cd pexpect-2.1 |
|---|
| 166 |
crablfs> cmd python setup.py install |
|---|
| 167 |
crablfs> cmd cd .. |
|---|
| 168 |
crablfs> cmd rm -rf pexpect-2.1 |
|---|
| 169 |
crablfs> commit |
|---|
| 170 |
|
|---|
| 171 |
# unset PYTHONPATH |
|---|
| 172 |
|
|---|
| 173 |
(3) package management: |
|---|
| 174 |
Manager is 'userpack'. |
|---|
| 175 |
|
|---|
| 176 |
a. install a package: |
|---|
| 177 |
# userpack install $pkgname-$version |
|---|
| 178 |
for example: |
|---|
| 179 |
# userpack install rxvt-2.7.10 |
|---|
| 180 |
you can classify: |
|---|
| 181 |
# userpack install meida.mplayer-1.0pre8 |
|---|
| 182 |
because the system support '.' for user name. |
|---|
| 183 |
|
|---|
| 184 |
The short way is: |
|---|
| 185 |
# upm i $pkgname-$version |
|---|
| 186 |
|
|---|
| 187 |
****** |
|---|
| 188 |
NOTICE: |
|---|
| 189 |
* It is not true for LFS system,the shadow package that LFS use |
|---|
| 190 |
only support [-a-z0-9_] chars, so I wrote a shadow module to access |
|---|
| 191 |
/etc/passwd, /etc/group, /etc/shadow, /etc/gshadow directly. |
|---|
| 192 |
|
|---|
| 193 |
*. So far the classification function have not been tested strictly. |
|---|
| 194 |
****** |
|---|
| 195 |
|
|---|
| 196 |
Under the conditions above, the default action will taken, that is: |
|---|
| 197 |
the compressed source archive and patches are considered to have |
|---|
| 198 |
been in the dir of HOME(/usr/src/$pkgname), other will you should |
|---|
| 199 |
specify it with argument: |
|---|
| 200 |
# userpack install -f /mnt/file/packages/rxvt-2.7.10.tar.gz rxvt-2.7.10 |
|---|
| 201 |
to make those archive and patches to be copied to HOME. |
|---|
| 202 |
|
|---|
| 203 |
This command will start an interactive command line, it is simple and |
|---|
| 204 |
only several command. In fact it is like a shell, you can type any |
|---|
| 205 |
'shell' command to install the package, only need add 'cmd' before the |
|---|
| 206 |
command to make the 'userpack' records the commands. These commands |
|---|
| 207 |
will be stored into HOME/.config(installation profile). |
|---|
| 208 |
crablfs> cmd tar xfz rxvt-2.7.10.tar.gz |
|---|
| 209 |
crablfs> cmd cd rxvt-2.7.10 |
|---|
| 210 |
crablfs> cmd ./configure |
|---|
| 211 |
crablfs> cmd make |
|---|
| 212 |
crablfs> cmd make install |
|---|
| 213 |
crablfs> cmd cd .. |
|---|
| 214 |
crablfs> cmd rm -rf rxvt-2.7.10 |
|---|
| 215 |
crablfs> commit |
|---|
| 216 |
|
|---|
| 217 |
You should known that the current user is the package user, not root; |
|---|
| 218 |
and current working directory is the user's HOME, so there may be |
|---|
| 219 |
ownership problem(What is the purpose of User Based Package |
|---|
| 220 |
Management System). |
|---|
| 221 |
|
|---|
| 222 |
When you type commands, you can use 'list' to see what you have typed: |
|---|
| 223 |
crablfs> list |
|---|
| 224 |
0, tar xfz rxvt-2.7.10.tar.gz |
|---|
| 225 |
1, cd rxvt-2.7.10 |
|---|
| 226 |
2, ./configure |
|---|
| 227 |
3, make |
|---|
| 228 |
4, make install |
|---|
| 229 |
|
|---|
| 230 |
Use 'rollback' to clean up these, and 'del N' to delete specified |
|---|
| 231 |
command. |
|---|
| 232 |
|
|---|
| 233 |
If you want to execute a command but not want it to be recorded into |
|---|
| 234 |
the 'list', just 'do': |
|---|
| 235 |
crablfs> do ls |
|---|
| 236 |
|
|---|
| 237 |
You must 'commit/cmt' at last, thus all the commands will be recorded |
|---|
| 238 |
to the .config, the $pkgname-$version couple will been add to list |
|---|
| 239 |
file(/usr/src/packages.list for default), to indicate that the package |
|---|
| 240 |
has been installed. If there is a command error makes the installation |
|---|
| 241 |
failed, and the fault can't been clean up by yourself, just type |
|---|
| 242 |
'quit' and the installation terminated, but the archive and patches |
|---|
| 243 |
will still be copied to HOME. |
|---|
| 244 |
|
|---|
| 245 |
If there is any other supplementary files: |
|---|
| 246 |
# userpack install -f /mnt/file/packages/MPlayer-1.0per8.tar.bz2 \ |
|---|
| 247 |
-p /mnt/file/packages/all-20060611.tar.bz2 \ |
|---|
| 248 |
-p /mnt/file/packages/Blue-1.6.tar.bz2 mplayer-1.0pre8 |
|---|
| 249 |
// all is mplayer's codecs.Blue is GUI Skin. |
|---|
| 250 |
|
|---|
| 251 |
If you have the installation profile before, you can use -a|--auto |
|---|
| 252 |
to install automatically: |
|---|
| 253 |
# userpack install -a rxvt-2.7.10 |
|---|
| 254 |
This means the HOME/.config exists, otherwise use -c|--profile: |
|---|
| 255 |
# userpack install -ac /mnt/packages/confiles/rxvt-2.7.10 rxvt-2.7.10 |
|---|
| 256 |
|
|---|
| 257 |
If you have burned /usr/src to DCD-R's sources dir, you can also |
|---|
| 258 |
execute the automatically installation below: |
|---|
| 259 |
# userpack install -as /mnt/dvdrom/sources rxvt-2.7.10 |
|---|
| 260 |
|
|---|
| 261 |
Moreover, the sources could also on the net such as ftp or ssh: |
|---|
| 262 |
ssh://localhost/sources/mlterm-2.9.3.tar.gz |
|---|
| 263 |
scp://localhost/sources/mlterm-2.9.3.tar.gz |
|---|
| 264 |
the 2 above is same, |
|---|
| 265 |
ftp://localhost/pub/sources/mlterm-2.9.3.tar.gz |
|---|
| 266 |
for example: |
|---|
| 267 |
# userpack install \ |
|---|
| 268 |
-f ftp://192.168.0.1/pub/sources/mlterm-2.9.3.tar.gz mlterm-2.9.3 |
|---|
| 269 |
|
|---|
| 270 |
****** |
|---|
| 271 |
If the package name(mlterm-2.9.3) is not given, it can be parsed |
|---|
| 272 |
from the archive name(mlterm-2.9.3.tar.gz) automatically by 'userpack'. |
|---|
| 273 |
****** |
|---|
| 274 |
|
|---|
| 275 |
If a archive has problem and makes installation failed, the archive |
|---|
| 276 |
still has been copied to HOME, and the next time 'userpack' will check |
|---|
| 277 |
whether the archive exists in HOME, if true, copy will not occur. To |
|---|
| 278 |
change this, use -C|--copy-force: |
|---|
| 279 |
# userpack install -Caf libesmtp-1.0.3r1.tar.bz2 |
|---|
| 280 |
|
|---|
| 281 |
About the user/group ID, 'userpack' can define its own range, |
|---|
| 282 |
default from 1000 to 20000, U can define in |
|---|
| 283 |
/usr/lib/python2.4/site-packages/crablfs/shadow.py: |
|---|
| 284 |
UID_MIN 1000 |
|---|
| 285 |
UID_MAX 20000 |
|---|
| 286 |
GID_MIN 1000 |
|---|
| 287 |
GID_MAX 20000 |
|---|
| 288 |
ADM_MIN 950 |
|---|
| 289 |
ADM_MAX 1000 |
|---|
| 290 |
|
|---|
| 291 |
This mean the normal user ids range is (1000, 19999), admin group ids |
|---|
| 292 |
is (950, 999). So 'install' group will be 950 by default. |
|---|
| 293 |
|
|---|
| 294 |
Besides the 'install', other admin groups will be used as 'application |
|---|
| 295 |
groups'. For example, 'glib2', 'atk', 'gtk', 'gtk2' all belongs to |
|---|
| 296 |
'GTK' group for some limited directories sharing, such as |
|---|
| 297 |
/usr/share/gtk-doc/ |
|---|
| 298 |
/usr/share/gtk-doc/html |
|---|
| 299 |
thus no modification of userpack.dirs is necessary. |
|---|
| 300 |
|
|---|
| 301 |
Correspondingly, add a '-G' option to support multiple groups, for |
|---|
| 302 |
example, 'xfce4' belogs to 'xfce4', 'install' and 'GTK' group. |
|---|
| 303 |
(default is 'xfce4' and 'install'). |
|---|
| 304 |
|
|---|
| 305 |
Now I can do this to support 'applications group' and 'multiple groups': |
|---|
| 306 |
# upm i -G GTK glib2-2.6.4 |
|---|
| 307 |
crablfs> ... |
|---|
| 308 |
...... |
|---|
| 309 |
crablfs> chgrp GTK /usr/share/gtk-doc/{,html} |
|---|
| 310 |
crablfs> chmod g+w,o+t /usr/share/gtk-doc/{,html} |
|---|
| 311 |
...... |
|---|
| 312 |
|
|---|
| 313 |
# upm i -G GTK atk-1.9.1 |
|---|
| 314 |
...... |
|---|
| 315 |
|
|---|
| 316 |
These all can be read from the installation profiles and be executed |
|---|
| 317 |
automatically. |
|---|
| 318 |
|
|---|
| 319 |
b. remove: |
|---|
| 320 |
# userpack remove rxvt-2.7.10 |
|---|
| 321 |
or |
|---|
| 322 |
# upm r rxvt-2.7.10 |
|---|
| 323 |
|
|---|
| 324 |
c. list all packages under the control: |
|---|
| 325 |
# userpack packs |
|---|
| 326 |
or |
|---|
| 327 |
# upm a |
|---|
| 328 |
rxvt-2.7.10 |
|---|
| 329 |
mplayer-1.0pre8 |
|---|
| 330 |
crablfs-0.1 |
|---|
| 331 |
pexpect-2.1 |
|---|
| 332 |
mlterm-2.9.3 |
|---|
| 333 |
|
|---|
| 334 |
d. query a file's package owner: |
|---|
| 335 |
# userpack owner /usr/local/bin/mlterm |
|---|
| 336 |
or |
|---|
| 337 |
# upm o /usr/local/bin/mlterm |
|---|
| 338 |
mlterm-2.9.3 |
|---|
| 339 |
|
|---|
| 340 |
e. list all files a package contains: |
|---|
| 341 |
# userpack files pexpect-2.1 |
|---|
| 342 |
or |
|---|
| 343 |
# upm l pexpect-2.1 |
|---|
| 344 |
/usr/lib/python2.4/site-packages/fdpexpect.py |
|---|
| 345 |
/usr/lib/python2.4/site-packages/pxssh.py |
|---|
| 346 |
/usr/lib/python2.4/site-packages/pexpect.py |
|---|
| 347 |
/usr/lib/python2.4/site-packages/pxssh.pyc |
|---|
| 348 |
/usr/lib/python2.4/site-packages/pexpect.pyc |
|---|
| 349 |
/usr/lib/python2.4/site-packages/fdpexpect.pyc |
|---|
| 350 |
|
|---|
| 351 |
This will read $HOME/.files to print all files the package have. This |
|---|
| 352 |
file is generated by the Package Manager 'userpack' as soon as the |
|---|
| 353 |
installation is finished, but you can force 'userpack' to regenerate |
|---|
| 354 |
it by run: |
|---|
| 355 |
# upm L pexpect-2.1 |
|---|
| 356 |
This command will also print all the files of the package. |
|---|
| 357 |
|
|---|
| 358 |
(4) About the pkgname & version rule: |
|---|
| 359 |
This is the argument to |
|---|
| 360 |
'userpack', the form is '$pkgname-$version', the python re pattern |
|---|
| 361 |
is: |
|---|
| 362 |
'^(?P<pkgname>(\w+-{0,1})+)(-(?P<version>(\d[\w]*[-\.])*\d[\w]*))' |
|---|
| 363 |
|
|---|
| 364 |
That is '$pkgname' part is 'part1[-part2][-part3][...]', every part |
|---|
| 365 |
could contains '[-a-zA-Z0-9_]', no rules for start char, but it is |
|---|
| 366 |
recommended to use alphabet; when meet '-[0-9][a-zA-Z0-9_]\.' |
|---|
| 367 |
pattern('-' follows a string start with digit, and follows a '.'), |
|---|
| 368 |
this will be considered as start part of $version, $version can also |
|---|
| 369 |
contains other '-', and when meet a string not start with digit, |
|---|
| 370 |
$version ends. chars follows are ignored. |
|---|
| 371 |
|
|---|
| 372 |
(5) ALFS |
|---|
| 373 |
It is mentioned before that all commands will be recorded to |
|---|
| 374 |
HOME/.config, and 'userpack' can also use this commands to run |
|---|
| 375 |
automatically, so there could be a batch script to use packages.list |
|---|
| 376 |
to install those packages all at once. Based on this, we can get an |
|---|
| 377 |
instance of ALFS. |
|---|
| 378 |
|
|---|
| 379 |
The target of the instance is extended to tranditional nALFS and |
|---|
| 380 |
jhalfs, for more personalized environment, for example: The first |
|---|
| 381 |
time, I build LFS/BLFS step by step, and the packages installed, |
|---|
| 382 |
related with their own's information & operations are recorded to |
|---|
| 383 |
the profiles, the next time, I can use those profiles to build the |
|---|
| 384 |
software envrionment I need with a 'turn key' way, exactly as those |
|---|
| 385 |
before. This means I can migrate many times, and others can also use |
|---|
| 386 |
my profiles to build their own personalized system. The end target |
|---|
| 387 |
also contains a platform independent operation. |
|---|
| 388 |
|
|---|
| 389 |
This batch script is 'crablfs'. |
|---|
| 390 |
|
|---|
| 391 |
****** |
|---|
| 392 |
So far, it is only tested under the condition that the LFS base |
|---|
| 393 |
system has been built, to use 'crablfs' to build a bunch of BLFS |
|---|
| 394 |
packages, so it is the future to make the LFS base system under the |
|---|
| 395 |
control of package management system. |
|---|
| 396 |
****** |
|---|
| 397 |
|
|---|
| 398 |
At first, adjust the tool chain: |
|---|
| 399 |
# cd /blfs-sources |
|---|
| 400 |
# tar xfj python-2.4.1.tar.bz2 |
|---|
| 401 |
# cd python-2.4.1 |
|---|
| 402 |
# patch -Np1 -i ../python-2.4.1-gdbm-1.patch |
|---|
| 403 |
# ./configure --prefix=/opt --enable-shared |
|---|
| 404 |
# make && make install |
|---|
| 405 |
# cd .. |
|---|
| 406 |
# rm -rf python-2.4.1 |
|---|
| 407 |
// U'd better delete it, otherwise may be problems |
|---|
| 408 |
|
|---|
| 409 |
# export PYTHONPATH=/opt/lib/python2.4/site-packages |
|---|
| 410 |
|
|---|
| 411 |
*** Now pexpect is optional *** |
|---|
| 412 |
# tar xfz pexpect-2.1.tar.gz |
|---|
| 413 |
# cd pexpect-2.1 |
|---|
| 414 |
# /opt/bin/python setup.py install --prefix=/opt |
|---|
| 415 |
# cd .. |
|---|
| 416 |
# rm -rf pexpect-2.1 |
|---|
| 417 |
|
|---|
| 418 |
# tar xfz crablfs-0.1.tar.gz |
|---|
| 419 |
# cd crablfs-0.1 |
|---|
| 420 |
# cp userpack.dirs.blfs userpack.dirs |
|---|
| 421 |
// Adjust for you own need and system |
|---|
| 422 |
// Whenever U meet pemission problem, just adjust /etc/userpack.dirs |
|---|
| 423 |
// and run 'userpack init' |
|---|
| 424 |
# /opt/bin/python setup.py install --prefix=/opt |
|---|
| 425 |
|
|---|
| 426 |
# /opt/bin/userpack init |
|---|
| 427 |
# /opt/bin/userpack install -f python-2.4.1.tar.bz2 -p |
|---|
| 428 |
# python-2.4.1-gdbm-1.patch python-2.4.1 |
|---|
| 429 |
crablfs> cmd tar xfj python-2.4.1.tar.bz2 |
|---|
| 430 |
crablfs> cmd cd python-2.4.1 |
|---|
| 431 |
crablfs> cmd ./configure --prefix=/usr --enable-shared |
|---|
| 432 |
crablfs> cmd make |
|---|
| 433 |
crablfs> cmd make install |
|---|
| 434 |
crablfs> cmd cd .. |
|---|
| 435 |
crablfs> cmd rm -rf python-2.4.1 |
|---|
| 436 |
crablfs> commit |
|---|
| 437 |
|
|---|
| 438 |
# /opt/bin/userpack install -f crablfs-0.1.tar.gz crablfs-0.1 |
|---|
| 439 |
crablfs> cmd tar xfz crablfs-0.1.tar.gz |
|---|
| 440 |
crablfs> cmd cd crablfs-0.1 |
|---|
| 441 |
crablfs> cmd python setup.py install --install-scripts=/usr/local/bin |
|---|
| 442 |
crablfs> cmd cd .. |
|---|
| 443 |
crablfs> cmd rm -rf crablfs-0.1 |
|---|
| 444 |
crablfs> commit |
|---|
| 445 |
|
|---|
| 446 |
*** Now the pexpect is optional *** |
|---|
| 447 |
# userpack install -f pexpect-2.1.tar.gz pexpect-2.1 |
|---|
| 448 |
crablfs> cmd tar xfz pexpect-2.1.tar.gz |
|---|
| 449 |
crablfs> cmd cd pexpect-2.1 |
|---|
| 450 |
crablfs> cmd python setup.py install |
|---|
| 451 |
crablfs> cmd cd .. |
|---|
| 452 |
crablfs> cmd rm -rf pexpect-2.1 |
|---|
| 453 |
crablfs> commit |
|---|
| 454 |
|
|---|
| 455 |
# unset PYTHONPATH |
|---|
| 456 |
# userpack packs |
|---|
| 457 |
python-2.4.1 |
|---|
| 458 |
crablfs-0.1 |
|---|
| 459 |
pexpect-2.1 |
|---|
| 460 |
|
|---|
| 461 |
****** |
|---|
| 462 |
Now there is a script 'scripts/setup-blfs' to do these all! |
|---|
| 463 |
****** |
|---|
| 464 |
|
|---|
| 465 |
And use the same way, I installed some packages: |
|---|
| 466 |
# userpack packs |
|---|
| 467 |
# cat /usr/src/packages.list |
|---|
| 468 |
python-2.4.1 |
|---|
| 469 |
crablfs-0.1.1 |
|---|
| 470 |
pexpect-2.1 |
|---|
| 471 |
net-tools-1.60 |
|---|
| 472 |
openssl-0.9.7g |
|---|
| 473 |
cracklib-2.8.3 |
|---|
| 474 |
Linux-PAM-0.80 |
|---|
| 475 |
iptables-1.3.3 |
|---|
| 476 |
gnupg-1.4.1 |
|---|
| 477 |
pcre-6.1 |
|---|
| 478 |
libxml-1.8.17 |
|---|
| 479 |
libxml2-2.6.20 |
|---|
| 480 |
libxslt-1.1.14 |
|---|
| 481 |
gdbm-1.8.3 |
|---|
| 482 |
pkg-config-0.19 |
|---|
| 483 |
glib-1.2.10 |
|---|
| 484 |
glib2-2.6.4 |
|---|
| 485 |
expat-1.95.8 |
|---|
| 486 |
libesmtp-1.0.3r1 |
|---|
| 487 |
lzo-2.01 |
|---|
| 488 |
libusb-0.1.10a |
|---|
| 489 |
libjpeg-6b |
|---|
| 490 |
libpng-1.2.8 |
|---|
| 491 |
which-2.16 |
|---|
| 492 |
unzip-5.52 |
|---|
| 493 |
zip-2.32 |
|---|
| 494 |
pciutils-2.1.11 |
|---|
| 495 |
cpio-2.6 |
|---|
| 496 |
libpcap-0.9.3 |
|---|
| 497 |
ppp-2.4.3 |
|---|
| 498 |
rp-pppoe-3.8 |
|---|
| 499 |
libsoup-2.2.3 |
|---|
| 500 |
subversion-1.1.4 |
|---|
| 501 |
wget-1.9.1 |
|---|
| 502 |
bind-9.3.1 |
|---|
| 503 |
gc-6.8 |
|---|
| 504 |
w3m-0.5.1 |
|---|
| 505 |
gpm-1.20.1 |
|---|
| 506 |
dhcpcd-1.3.22 |
|---|
| 507 |
freetype-2.1.10 |
|---|
| 508 |
fontconfig-2.3.2 |
|---|
| 509 |
Xorg-6.9.0 |
|---|
| 510 |
915resolution-0.5.2 |
|---|
| 511 |
gtk-1.2.10 |
|---|
| 512 |
pango-1.8.1 |
|---|
| 513 |
atk-1.9.1 |
|---|
| 514 |
gtk2-2.6.7 |
|---|
| 515 |
startup-notification-0.8 |
|---|
| 516 |
hicolor-icon-theme-0.8 |
|---|
| 517 |
xfce-4.2.2 |
|---|
| 518 |
mlterm-2.9.3 |
|---|
| 519 |
|
|---|
| 520 |
The X Window is OK and xfce is usable, so I try to *migrate*: |
|---|
| 521 |
# mv /usr/src/packages.list /blfs-sources/ |
|---|
| 522 |
# copy-profiles /usr/src |
|---|
| 523 |
// This will generate a profiles dir in current dir, |
|---|
| 524 |
// which contains all the profiles from $homepre(/usr/src) |
|---|
| 525 |
# mv profiles /blfs-sources |
|---|
| 526 |
# crablfs -t alfs \ |
|---|
| 527 |
-C /blfs-sources/profiles/ \ |
|---|
| 528 |
-F /blfs-sources/ \ |
|---|
| 529 |
/blfs-sources/packages.list |
|---|
| 530 |
|
|---|
| 531 |
If you have installed such a BLFS system and burned /usr/src all to |
|---|
| 532 |
the DVD-R, you can do the following for another system to install all |
|---|
| 533 |
package once a time: |
|---|
| 534 |
# crablfs -t crablfs[/default] \ |
|---|
| 535 |
-s /mnt/dvdrom/sources/ \ |
|---|
| 536 |
/mnt/dvdrom/sources/packages.list |
|---|
| 537 |
|
|---|
| 538 |
You may want to adjust 'packages.list' for your own needs, if you want |
|---|
| 539 |
, you can also edit the profiles. |
|---|
| 540 |
|
|---|
| 541 |
crablfs will record current successfully installed package name to |
|---|
| 542 |
/var/log/crablfs/.mark. Because of the packages dependencies |
|---|
| 543 |
problems, if one package failed, the 'crablfs' process terminated. |
|---|
| 544 |
After you clean up the problem, you can continue from the |
|---|
| 545 |
breakpoint. |
|---|
| 546 |
|
|---|
| 547 |
So if .mark point to the last item of packages.list, 'crablfs' will |
|---|
| 548 |
do nothing. Adjust it for you need. |
|---|
| 549 |
|
|---|
| 550 |
Moreover, 'crablfs' will check packages.list, illegal package name |
|---|
| 551 |
will terminate 'crablfs' and do nothing; if the name in .mark not in |
|---|
| 552 |
packages.list, you will get a "x not in list" error report, you can |
|---|
| 553 |
adjust corresponding, or just delete the .mark file. |
|---|
| 554 |
|
|---|
| 555 |
So far, there are few permission problems, and all can avoid by |
|---|
| 556 |
changing the installtion arguments. The wrappers for chmod, chgrp, |
|---|
| 557 |
chown, install may be needed, but so far I have not see the |
|---|
| 558 |
neccessary. To dicide this for further using and testing. |
|---|
| 559 |
|
|---|
| 560 |
(6) The next plan |
|---|
| 561 |
* Add upgrade part |
|---|
| 562 |
* Add gettext internationlized support |
|---|
| 563 |
* Whole infomations show of a package |
|---|
| 564 |
* PyUnit |
|---|
| 565 |
* Add code for cmdline to read .config history commands |
|---|
| 566 |
* Make cmdline can execute 'root' commands, as 'sudo', by IPC? |
|---|
| 567 |
* A command editor? |
|---|
| 568 |
* File lock of packages.list |
|---|
| 569 |
* Change .config to the form of '$pkgname-$version' |
|---|
| 570 |
* Enganced platform independent support: |
|---|
| 571 |
Add var and env var to cmdline for different $ARCH & $LOCALE |
|---|
| 572 |
* Support multi installation sources |
|---|
| 573 |
* Enganced classification mechanism |
|---|
| 574 |
* Intergrated checking |
|---|
| 575 |
* Enganced configuration getting & setting: Plain Tree & XML |
|---|
| 576 |
* Consider package dependencies problems |
|---|
| 577 |
* Better documents: internal, design doc and manual |
|---|
| 578 |
* Make 'userpack init' can adjust those dir items deleted from 'userpack.dirs' |
|---|
| 579 |
|
|---|
| 580 |
****** |
|---|
| 581 |
*** LIMITATIONS *** |
|---|
| 582 |
When want to install 'glib2-2.6.4', but type in error with |
|---|
| 583 |
'glib-2.6.4': |
|---|
| 584 |
# upm i -a -c profiles/glib2 glib-2.6.4 |
|---|
| 585 |
This will mistakenly remove all files of glib-1.2.10!!! Because when a |
|---|
| 586 |
package installation failed, the Manager will remove all the files |
|---|
| 587 |
that generated by 'install', 'cp', 'mv' commands during the process. |
|---|
| 588 |
|
|---|
| 589 |
So far, this limitation roots in the limitation of package version |
|---|
| 590 |
control, this also makes 'upgrade' not easy. |
|---|
| 591 |
****** |
|---|
| 592 |
|
|---|
| 593 |
ACKNOWLEDGEMENTS: |
|---|
| 594 |
Matthias S. Benkmann built the original principle |
|---|
| 595 |
|
|---|
| 596 |
CHANGELOG: |
|---|
| 597 |
2006-12-05: |
|---|
| 598 |
For crablfs-0.1.1beta. |
|---|
| 599 |
|
|---|
| 600 |
2006-10-25: |
|---|
| 601 |
crablfs-0.1 has been distributed at 2006-10-20, so I write this hint. |
|---|