Changeset 1067
- Timestamp:
- 01/28/07 22:52:53 (2 years ago)
- Files:
-
- trunk/crablfs.txt (modified) (24 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/crablfs.txt
r1065 r1067 1 AUTHOR: ????(Chowroc) <chowroc dot z at gmail dot com>2 3 DATE: 2006-1 0-251 AUTHOR: Zhou Peng(Chowroc) <chowroc dot z at gmail dot com> 2 3 DATE: 2006-12-05 4 4 5 5 LICENSE: GNU Free Documentation License Version 1.2 … … 8 8 9 9 DESCRIPTION: 10 Every package and its files belong to a system normal user, and10 Every package and its files belong to a system normal user, and 11 11 a batch script to rebuild or migrate your personalized LFS/BLFS 12 12 system by install all your packages all at once. 13 13 14 14 ATTACHMENTS: 15 http://cheeseshop.python.org/packages/source/c/crablfs/ 15 http://cheeseshop.python.org/pypi?:action=display&name=crablfs 16 https://sourceforge.net/project/showfiles.php?group_id=180695 16 17 17 18 PREREQUISITES: 18 python-2.419 pexpect-2.1 19 python-2.4 20 pexpect-2.1(optional) 20 21 21 22 HINT: 22 23 23 24 (1) Introduction: 24 crablfs: User Based Package Management System which is 25 written in python. Every package and its files belong to a system 26 normal user, and a batch script to rebuild or migrate your 27 personalized LFS/BLFS system by install all your packages 28 automatically all at once. The goal of "crablfs" is to exert more 29 control on packages that compiled from source, and reduce the costs 30 of system migration and backup. 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 31 32 32 The basic theory is: every package in the system has a corresponding … … 66 66 mode. 67 67 68 The script "crablfs" is a batch script write in python, it is 69 another ALFS instance in other words, which make use of the 70 automated ability of "userpack". It can use the list 71 file(/usr/src/packages.list) mentioned before, to operate the 72 compressed source archives and installation profiles you appointed 73 automatically. And you can also specified a directory that has the 74 same structure as $homepre(/usr/src) to build a ALFS system 75 automatically. This means that you can migrate from an old system to 76 new ones more easily -- and rebuild your personalized system more 77 quickly. 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. 78 77 79 78 The essential differences among Linux distributions is the 80 79 differences of the package management ways. As a distribution, LFS 81 actually does not has a mature package manager itself, this of 82 course roots to the flexibility of LFS, but for daily use, a mature 83 package management system is necessary. It is recommended to use 84 User Based Management in the BLFS document, but the LFS hints only 85 give the basic principles which is very creative, but the shell 86 scripts is not enough to form a self-consistency system. So I write 87 one regardless of unveil my superficialness, a hope that my crude 88 remarks may draw forth by abler people. 89 90 Of course crablfs is not only used for LFS, it aims to those 91 packages that build from source code, so it can used on other 92 distributions, too. 93 94 (2) Install crablfs 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 95 97 To make sure that crablfs also under the control of package 96 management, to install by th is way:98 management, to install by the following way to build the tools chain: 97 99 # export PYTHONPATH=/opt/lib/python2.4/site-packages 98 100 // sys.path will not be influenced by PYTHONPATH 101 102 *** Now the pexpect package is optional *** 99 103 # tar xfz pexpect-2.1.tar.gz 100 104 # cd pexpect-2.1 … … 105 109 # cd crablfs-0.1 106 110 # vi userpack.dirs 107 // define all key directory 108 // these dirs will belong to install group??and have g+s,o+t mode 111 *** define all key directories *** 112 *** these dirs will belong to 'install' group.and have g+s,o+t mode *** 109 113 /usr/local/ 110 114 /usr/local/bin/ … … 156 160 crablfs> commit 157 161 162 *** Now the pexpect package is optional *** 158 163 # userpack install -f /tmp/pexpect-2.1.tar.gz pexpect-2.1 159 164 crablfs> cmd tar xfz pexpect-2.1.tar.gz … … 166 171 # unset PYTHONPATH 167 172 168 (3) Package Management:169 manager: userpack 173 (3) package management: 174 Manager is 'userpack'. 170 175 171 176 a. install a package: … … 177 182 because the system support '.' for user name. 178 183 179 *** 184 The short way is: 185 # upm i $pkgname-$version 186 187 ****** 180 188 NOTICE: 181 189 * It is not true for LFS system,the shadow package that LFS use … … 183 191 /etc/passwd, /etc/group, /etc/shadow, /etc/gshadow directly. 184 192 185 *. The classification function have not been tested strictly.186 *** 193 *. So far the classification function have not been tested strictly. 194 ****** 187 195 188 196 Under the conditions above, the default action will taken, that is: … … 193 201 to make those archive and patches to be copied to HOME. 194 202 195 This command will start an interactive command line, it is simple 196 and only several command. In fact it is like a shell, you can type 197 any 'shell' command to install the package, only need add 'cmd' 198 before the command to make the 'userpack' records the commands. 199 These commands will be stored into HOME/.config(installation 200 profile). 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). 201 208 crablfs> cmd tar xfz rxvt-2.7.10.tar.gz 202 209 crablfs> cmd cd rxvt-2.7.10 … … 208 215 crablfs> commit 209 216 210 You should known that the current user is the package user, not 211 root; and current working directory is the user's HOME, so there may 212 beownership problem(What is the purpose of User Based Package217 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 213 220 Management System). 214 221 … … 224 231 command. 225 232 226 You must 'commit/cmt' at last, thus all the commands will be 227 recorded to the .config, the $pkgname-$version couple will been add 228 to list file(/usr/src/packages.list for default), to indicate that 229 the package has been installed. If there is a command error makes 230 the installation failed, and the fault can't been clean up by 231 yourself, just type 'quit' and the installation terminated, but the 232 archive and patches will still be copied to HOME. 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. 233 244 234 245 If there is any other supplementary files: … … 236 247 -p /mnt/file/packages/all-20060611.tar.bz2 \ 237 248 -p /mnt/file/packages/Blue-1.6.tar.bz2 mplayer-1.0pre8 238 // all is mplayer's codecs ??Blue is GUI Skin.249 // all is mplayer's codecs.Blue is GUI Skin. 239 250 240 251 If you have the installation profile before, you can use -a|--auto … … 257 268 -f ftp://192.168.0.1/pub/sources/mlterm-2.9.3.tar.gz mlterm-2.9.3 258 269 259 *** 270 ****** 260 271 If the package name(mlterm-2.9.3) is not given, it can be parsed 261 from the archive name(mlterm-2.9.3.tar.gz) automatically by 262 'userpack'. 263 *** 272 from the archive name(mlterm-2.9.3.tar.gz) automatically by 'userpack'. 273 ****** 264 274 265 275 If a archive has problem and makes installation failed, the archive 266 still has been copied to HOME, and the next time 'userpack' will 267 check whether the archive exists in HOME, if true, copy will not 268 occur. Tochange this, use -C|--copy-force: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: 269 279 # userpack install -Caf libesmtp-1.0.3r1.tar.bz2 270 280 271 281 About the user/group ID, 'userpack' can define its own range, 272 default from 1000 to 20000, U can define in /etc/login.defs: 273 PACK_UID_MIN 10000 274 PACK_UID_MAX 25000 275 PACK_GID_MIN 10000 276 PACK_GID_MAX 25000 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. 277 318 278 319 b. remove: 279 320 # userpack remove rxvt-2.7.10 321 or 322 # upm r rxvt-2.7.10 280 323 281 324 c. list all packages under the control: 282 325 # userpack packs 326 or 327 # upm a 283 328 rxvt-2.7.10 284 329 mplayer-1.0pre8 … … 289 334 d. query a file's package owner: 290 335 # userpack owner /usr/local/bin/mlterm 336 or 337 # upm o /usr/local/bin/mlterm 291 338 mlterm-2.9.3 292 339 293 340 e. list all files a package contains: 294 341 # userpack files pexpect-2.1 342 or 343 # upm l pexpect-2.1 295 344 /usr/lib/python2.4/site-packages/fdpexpect.py 296 345 /usr/lib/python2.4/site-packages/pxssh.py … … 299 348 /usr/lib/python2.4/site-packages/pexpect.pyc 300 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. 301 357 302 358 (4) About the pkgname & version rule: … … 333 389 This batch script is 'crablfs'. 334 390 335 *** 391 ****** 336 392 So far, it is only tested under the condition that the LFS base 337 393 system has been built, to use 'crablfs' to build a bunch of BLFS 338 394 packages, so it is the future to make the LFS base system under the 339 395 control of package management system. 340 *** 396 ****** 341 397 342 398 At first, adjust the tool chain: … … 352 408 353 409 # export PYTHONPATH=/opt/lib/python2.4/site-packages 410 411 *** Now pexpect is optional *** 354 412 # tar xfz pexpect-2.1.tar.gz 355 413 # cd pexpect-2.1 … … 386 444 crablfs> commit 387 445 446 *** Now the pexpect is optional *** 388 447 # userpack install -f pexpect-2.1.tar.gz pexpect-2.1 389 448 crablfs> cmd tar xfz pexpect-2.1.tar.gz … … 400 459 pexpect-2.1 401 460 461 ****** 462 Now there is a script 'scripts/setup-blfs' to do these all! 463 ****** 464 402 465 And use the same way, I installed some packages: 403 466 # userpack packs 404 467 # cat /usr/src/packages.list 405 468 python-2.4.1 406 crablfs-0.1 469 crablfs-0.1.1 407 470 pexpect-2.1 471 net-tools-1.60 408 472 openssl-0.9.7g 409 473 cracklib-2.8.3 … … 417 481 gdbm-1.8.3 418 482 pkg-config-0.19 483 glib-1.2.10 419 484 glib2-2.6.4 420 485 expat-1.95.8 … … 425 490 libpng-1.2.8 426 491 which-2.16 427 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*: 428 521 # mv /usr/src/packages.list /blfs-sources/ 429 # co nfig.copy/usr/src522 # copy-profiles /usr/src 430 523 // This will generate a profiles dir in current dir, 431 524 // which contains all the profiles from $homepre(/usr/src) 432 // This shell script will not be installed,433 // you can find it in the archive434 525 # mv profiles /blfs-sources 435 526 # crablfs -t alfs \ … … 439 530 440 531 If you have installed such a BLFS system and burned /usr/src all to 441 the DVD-R, you can do this: 532 the DVD-R, you can do the following for another system to install all 533 package once a time: 442 534 # crablfs -t crablfs[/default] \ 443 535 -s /mnt/dvdrom/sources/ \ 444 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. 445 540 446 541 crablfs will record current successfully installed package name to … … 463 558 neccessary. To dicide this for further using and testing. 464 559 465 (6) The Next Plans 466 * BLFS crablfs tool chain adjusting shell script 560 (6) The next plan 467 561 * Add upgrade part 468 562 * Add gettext internationlized support 469 563 * Whole infomations show of a package 470 564 * PyUnit 471 * Enganced cmdline completion function472 565 * Add code for cmdline to read .config history commands 566 * Make cmdline can execute 'root' commands, as 'sudo', by IPC? 473 567 * A command editor? 474 568 * File lock of packages.list … … 482 576 * Consider package dependencies problems 483 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 ****** 484 592 485 593 ACKNOWLEDGEMENTS: 486 Matthias S. Benkmann built the original principles 594 Matthias S. Benkmann built the original principle 487 595 488 596 CHANGELOG: 597 2006-12-05: 598 For crablfs-0.1.1beta. 599 489 600 2006-10-25: 490 crablfs-0.1 has been distributed at 2006-10-20, so I write this 491 hint. 601 crablfs-0.1 has been distributed at 2006-10-20, so I write this hint.
