Changeset 945ccaa
- Timestamp:
- 04/09/2017 10:29:32 AM (7 years ago)
- Branches:
- ablfs-more, legacy, trunk
- Children:
- cee84ad
- Parents:
- 909ee37
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
BLFS/gen_pkg_book.sh
r909ee37 r945ccaa 27 27 declare DEP_LEVEL 28 28 declare SUDO 29 declare WRAP_INSTALL 29 30 30 31 #--------------------------# … … 45 46 optDependency=* | \ 46 47 MAIL_SERVER=* | \ 48 WRAP_INSTALL=* | \ 47 49 SUDO=* ) eval ${REPLY} # Define/set a global variable.. 48 50 continue ;; … … 63 65 DEP_LEVEL=$optDependency 64 66 SUDO=${SUDO:-n} 67 WRAP_INSTALL=${WRAP_INSTALL:-n} 65 68 } 66 69 … … 69 72 #--------------------------# 70 73 local -r dotSTR=".................." 71 local -r PARAM_LIST="DEP_LEVEL SUDO MAIL_SERVER "74 local -r PARAM_LIST="DEP_LEVEL SUDO MAIL_SERVER WRAP_INSTALL" 72 75 local -r PARAM_VALS='${config_param}${dotSTR:${#config_param}} ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}' 73 76 local config_param … … 180 183 xsltproc --xinclude --nonet \ 181 184 --stringparam sudo $SUDO \ 185 --stringparam wrap-install $WRAP_INSTALL \ 182 186 -o ./scripts/ ${MakeScripts} \ 183 187 ${BookXml} -
BLFS/xsl/gen_config.xsl
r909ee37 r945ccaa 59 59 Select if sudo will be used (you build as a normal user) 60 60 otherwise sudo is not needed (you build as root) 61 62 63 config WRAP_INSTALL 64 bool "Use `porg style' package management" 65 default n 66 help 67 Select if you want the installation commands to be wrapped 68 between "wrapInstall '" and "' ; packInstall" functions, 69 where wrapInstall is used to set up a LD_PRELOAD library (for 70 example using porg), and packInstall makes the package tarball 61 71 </xsl:text> 62 72 </xsl:template> -
BLFS/xsl/scripts.xsl
r909ee37 r945ccaa 21 21 </xsl:choose> 22 22 </xsl:variable> 23 24 <!-- Wrap "root" commands inside a wrapper function, allowing 25 "porg style" package management --> 26 <xsl:param name="wrap-install" select="'n'"/> 23 27 24 28 <!-- Build as user (y) or as root (n)? --> … … 70 74 <!-- Package page --> 71 75 <xsl:when test="sect2[@role='package']"> 72 <!-- We build in a subdirectory --> 73 <xsl:text>PKG_DIR=</xsl:text> 76 <!-- We build in a subdirectory, whose name may be needed 77 if using package management (see envars.conf), so 78 "export" it --> 79 <xsl:text>export PKG_DIR=</xsl:text> 74 80 <xsl:value-of select="$filename"/> 75 81 <xsl:text> … … 150 156 ;; 151 157 esac 158 export UNPACKDIR 152 159 cd $UNPACKDIR
 153 160 </xsl:text> … … 408 415 <xsl:choose> 409 416 <xsl:when test="@role = 'root'"> 410 <xsl:if test="$sudo = 'y'"> 411 <xsl:text>sudo -E sh << ROOT_EOF
</xsl:text> 417 <xsl:if test="not(preceding-sibling::screen[1][@role='root'])"> 418 <xsl:if test="$sudo = 'y'"> 419 <xsl:text>sudo -E sh << ROOT_EOF
</xsl:text> 420 </xsl:if> 421 <xsl:if test="$wrap-install = 'y' and 422 ancestor::sect2[@role='installation']"> 423 <xsl:text>if [ -r "$PACK_INSTALL" ]; then 424 source $PACK_INSTALL 425 export -f wrapInstall 426 export -f packInstall 427 fi 428 wrapInstall ' 429 </xsl:text> 430 </xsl:if> 412 431 </xsl:if> 413 432 <xsl:apply-templates mode="root"/> 414 <xsl:if test="$sudo = 'y'"> 415 <xsl:text>
ROOT_EOF</xsl:text> 433 <xsl:if test="not(following-sibling::screen[1][@role='root'])"> 434 <xsl:if test="$wrap-install = 'y' and 435 ancestor::sect2[@role='installation']"> 436 <xsl:text>'
packInstall</xsl:text> 437 </xsl:if> 438 <xsl:if test="$sudo = 'y'"> 439 <xsl:text>
ROOT_EOF</xsl:text> 440 </xsl:if> 416 441 </xsl:if> 417 442 </xsl:when> … … 515 540 </xsl:template> 516 541 542 <xsl:variable name="APOS">'</xsl:variable> 543 517 544 <xsl:template name="output-root"> 518 545 <xsl:param name="out-string" select="''"/> … … 562 589 </xsl:call-template> 563 590 </xsl:when> 591 <xsl:when test="contains($out-string,string($APOS)) 592 and $wrap-install = 'y' 593 and ancestor::sect2[@role='installation']"> 594 <xsl:call-template name="output-root"> 595 <xsl:with-param name="out-string" 596 select="substring-before($out-string,string($APOS))"/> 597 </xsl:call-template> 598 <xsl:text>'\''</xsl:text> 599 <xsl:call-template name="output-root"> 600 <xsl:with-param name="out-string" 601 select="substring-after($out-string,string($APOS))"/> 602 </xsl:call-template> 603 </xsl:when> 564 604 <xsl:otherwise> 565 605 <xsl:value-of select="$out-string"/> -
Config.in
r909ee37 r945ccaa 758 758 # You will have to select between: 759 759 # 760 # - Only final system Glibc, GCC and Binutilstestsuites760 # - Only critical final system testsuites 761 761 # - All final system testsuites 762 762 # - Both temporary tools and final system testsuites … … 764 764 # HLFS and CLFS have no testsuites available in the 765 765 # temporary tools phase 766 767 766 # You will be prompted also about the "flavour" of the 768 767 # testsuites run: … … 772 771 # 773 772 773 menu "Test settings" 774 depends CONFIG_TESTS 774 775 choice 775 776 prompt "Tests level" 776 depends CONFIG_TESTS777 777 default TST_1 778 778 779 779 config TST_1 780 bool "Only final critical testsuites" if !BOOK_CLFS2 && !BOOK_CLFS3 780 bool "Only final system critical testsuites" 781 help 782 #-- Critical tests: 783 # Only Glibc, Binutils, GMP, MPFR, MPC and GCC 784 # testsuites for final system 781 785 782 786 config TST_2 … … 784 788 785 789 config TST_3 786 bool "Both temporary tools and final system testsuites" if !BOOK_HLFS && !BOOK_CLFS 790 bool "All testsuites" if !BOOK_HLFS && !BOOK_CLFS 791 help 792 #-- All tests: 793 # Runs all the testsuites for both temporary tools 794 # and final system 795 endchoice 796 797 choice 798 prompt "Flavour" 799 800 config NO_BOMB 801 bool "Don't stop on test failures" 802 803 config BOMB 804 bool "Abort the build on the first test failure" 787 805 endchoice 788 806 … … 794 812 default "3" if TST_3 795 813 796 choice797 prompt "Flavour"798 depends CONFIG_TESTS799 800 config NO_BOMB801 bool "Don't stop on testsuite failures"802 803 config BOMB804 bool "Abort the build on the first testsuite failure"805 endchoice806 807 814 config BOMB_TEST 808 815 bool … … 811 818 812 819 #--- End Test Suites 820 endmenu # test settings 813 821 814 822 #--- Package Management … … 820 828 #-- Use package management 821 829 # 822 # If set, the packages in the final phase are built 823 # in a separate directory, PKG_DEST. 824 # You should provide a bash function for packing 825 # and installing the package. 830 # If set, you'll have to choose between 831 # two package management styles: 832 # - Build and install: 833 # the packages in the final phase are built 834 # in a separate directory, PKG_DEST. 835 # You should provide a bash function for 836 # packaing and installing the package. 837 # - Preload a library before install: 838 # Run the install instructions inside a 839 # wrapper command, which monitors the 840 # installed files. 841 # 826 842 # Also, you have to provide the instructions 827 843 # to build the package manager during the … … 831 847 # 832 848 # For now, this only works with LFS 833 849 choice 850 depends PKGMNGT 851 prompt "Package management style" 852 default PKG_PACK 853 854 config PKG_PACK 855 bool "Build and pack (pacman or dpkg style)" 856 857 config LIB_LOAD 858 bool "Preload a library before installing (porg style)" 859 endchoice 860 861 config WRAP_INSTALL 862 bool 863 default y if LIB_LOAD 864 default n if PKG_PACK 834 865 #--- End package management 835 866 … … 844 875 #--- End Installed files logs 845 876 877 config STRIP 878 bool "Strip Installed Binaries/Libraries" 879 default n 880 depends on !BOOK_CLFS3 881 882 config NO_PROGRESS_BAR 883 bool "DO NOT use/display progress_bar " 884 default n 885 help 886 #-- Do not use the progress bar routine. On slower machines 887 # this function consumes precious CPU cycles. 888 889 #--- End Build Settings 890 endmenu 891 892 menu "System configuration 893 depends !BOOK_BLFS 894 846 895 #--- FSTAB 847 896 config HAVE_FSTAB … … 850 899 help 851 900 #-- Select this if you have an fstab file with entries 852 901 # for the target system 853 902 854 903 config FSTAB … … 881 930 #--- End Kernel 882 931 883 config STRIP884 bool "Strip Installed Binaries/Libraries"885 default n886 depends on !BOOK_CLFS3887 888 932 config VIMLANG 889 933 bool "Install vim-lang package" … … 894 938 # NOTE: This option is obsolete with the 7.3 release of Vim 895 939 # which is included in all recent releases of LFS. 896 897 config NO_PROGRESS_BAR898 bool "DO NOT use/display progress_bar "899 default n900 help901 #-- Do not use the progress bar routine. On slower machines902 # this function consumes precious CPU cycles.903 940 904 941 config TIMEZONE … … 947 984 #--- End Groff page 948 985 949 #--- End Build Settings 950 endmenu 986 config HOSTNAME 987 string "Hostname" 988 default "**EDITME**" 989 990 menu "Network configuration" 991 config INTERFACE 992 string "netword card name" 993 default "eth0" 994 config IP_ADDR 995 string "Static IP address" 996 default "10.0.2.9" 997 config GATEWAY 998 string "Gateway" 999 default "10.0.2.2" 1000 config PREFIX 1001 string "Subnet prefix" 1002 default "24" 1003 config BROADCAST 1004 string "Broadcast address" 1005 default "10.0.2.255" 1006 config DOMAIN 1007 string "Domain name" 1008 default "lfs.org" 1009 config DNS1 1010 string "Primary Name server" 1011 default "10.0.2.3" 1012 config DNS2 1013 string "Secondary Name server" 1014 default "8.8.8.8" 1015 endmenu # Network configuration 1016 1017 menu "Console configuration" 1018 config FONT 1019 string "Console font" 1020 default "lat0-16" 1021 config FONTMAP 1022 string "Font map (-m option to setfont)" 1023 default "8859-1" 1024 config UNICODE 1025 bool "Unicode mode" 1026 default y 1027 config KEYMAP 1028 string "Keymap name" 1029 default "us" 1030 endmenu # Console configuration 1031 1032 endmenu #--- System configuration 951 1033 952 1034 menu "Advanced Features" -
LFS/lfs.xsl
r909ee37 r945ccaa 9 9 version="1.0"> 10 10 11 <!-- Parameters --> 12 11 13 <!-- which revision attribute to include: can only be sysv or systemd, 12 14 but we leave checking to the caller--> … … 17 19 y = yes, add PKG_DEST to scripts in install commands of chapter06-08 18 20 --> 19 <xsl:param name="pkgmngt" select="n"/> 21 <xsl:param name="pkgmngt" select="'n'"/> 22 23 <!-- Package management with "porg style" ? 24 n = no, same as pkgmngt description above 25 y = yes, wrap install commands of chapter06-08 into a bash function. 26 note that pkgmngt must be 'y' in this case 27 --> 28 <xsl:param name="wrap-install" select='"n"'/> 20 29 21 30 <!-- Run test suites? 22 31 0 = none 23 1 = only chapter06 Glibc, GCC and Binutilstestsuites32 1 = only chapter06 critical testsuites 24 33 2 = all chapter06 testsuites 25 34 3 = all chapter05 and chapter06 testsuites … … 31 40 y = yes, bomb at the first test suite failure to can review the build dir 32 41 --> 33 <xsl:param name="bomb-testsuite" select=" n"/>42 <xsl:param name="bomb-testsuite" select="'n'"/> 34 43 35 44 <!-- Install vim-lang package? OBSOLETE should always be 'n'--> 36 <xsl:param name="vim-lang" select=" n"/>45 <xsl:param name="vim-lang" select="'n'"/> 37 46 38 47 <!-- Time zone --> 39 <xsl:param name="timezone" select=" GMT"/>48 <xsl:param name="timezone" select="'GMT'"/> 40 49 41 50 <!-- Page size --> 42 <xsl:param name="page" select=" letter"/>51 <xsl:param name="page" select="'letter'"/> 43 52 44 53 <!-- Locale settings --> 45 <xsl:param name="lang" select=" C"/>54 <xsl:param name="lang" select="'C'"/> 46 55 47 56 <!-- Install the whole set of locales --> 48 <xsl:param name='full-locale' select=' n'/>57 <xsl:param name='full-locale' select='"n"'/> 49 58 59 <!-- Hostname --> 60 <xsl:param name='hostname' select='"HOSTNAME"'/> 61 62 <!-- Network parameters: interface, ip, gateway, prefix, broadcast, domain 63 and nameservers --> 64 <xsl:param name='interface' select="'eth0'"/> 65 <xsl:param name='ip' select='"10.0.2.9"'/> 66 <xsl:param name='gateway' select='"10.0.2.2"'/> 67 <xsl:param name='prefix' select='24'/> 68 <xsl:param name='broadcast' select='"10.0.2.255"'/> 69 <xsl:param name='domain' select='"lfs.org"'/> 70 <xsl:param name='nameserver1' select='"10.0.2.3"'/> 71 <xsl:param name='nameserver2' select='"8.8.8.8"'/> 72 73 <!-- End parameters --> 74 50 75 <xsl:template match="/"> 51 76 <xsl:apply-templates select="//sect1[not(@revision) or … … 177 202 @role != 'nodump']/userinput[ 178 203 @remap='install']"> 179 <xsl:text>mkdir -pv $PKG_DEST/{boot,etc,lib,bin,sbin} 204 <xsl:choose> 205 <xsl:when test="$wrap-install='y'"> 206 <xsl:text>wrapInstall ' 207 </xsl:text> 208 </xsl:when> 209 <xsl:otherwise> 210 <xsl:text>mkdir -pv $PKG_DEST/{boot,etc,lib,bin,sbin} 180 211 mkdir -pv $PKG_DEST/usr/{lib,bin,sbin,include} 181 212 mkdir -pv $PKG_DEST/usr/share/{doc,info,man} … … 186 217 esac 187 218 </xsl:text> 219 </xsl:otherwise> 220 </xsl:choose> 188 221 </xsl:if> 189 222 <xsl:if test="../@id = 'ch-system-glibc' and 190 223 @role='installation' and 191 $pkgmngt = 'y'"> 224 $pkgmngt = 'y' and 225 $wrap-install = 'n'"> 192 226 <xsl:text>mkdir -pv $PKG_DEST/usr/include/{rpc,rpcsvc} 193 227 </xsl:text> … … 203 237 @role != 'nodump']/userinput[ 204 238 @remap='install']"> 205 <xsl:if test="../@id = 'ch-system-man-pages'"> 239 <xsl:choose> 240 <xsl:when test="$wrap-install='y'"> 241 <xsl:if test="../@id = 'ch-system-man-pages'"> 206 242 <!-- these files are provided by the shadow package --> 207 <xsl:text>rm -fv $PKG_DEST/usr/share/man/{man3/getspnam.3,man5/passwd.5}208 </xsl:text> 209 </xsl:if>243 <xsl:text>rm -fv /usr/share/man/{man3/getspnam.3,man5/passwd.5} 244 </xsl:text> 245 </xsl:if> 210 246 <!-- Attr man/man2 pages are already installed by man-pages. As of 211 247 March 2013, they are the same pages. 212 248 November 2015: now they are more accurate 213 249 in man-pages, and the man5 section is also in man-pages... --> 214 <xsl:if test="../@id = 'ch-system-attr'"> 215 <xsl:text>rm -fv $PKG_DEST/usr/share/man/man2/* 250 <xsl:if test="../@id = 'ch-system-attr'"> 251 <xsl:text>rm -fv /usr/share/man/man2/* 252 rm -fv /usr/share/man/man5/* 253 </xsl:text> 254 </xsl:if> 255 <!-- nologin is installed by util-linux. remove it from shadow --> 256 <xsl:if test="../@id = 'ch-system-shadow'"> 257 <xsl:text>rm -fv /usr/share/man/man8/nologin.8 258 rm -fv /sbin/nologin 259 </xsl:text> 260 </xsl:if> 261 <xsl:text>' 262 packInstall 263 </xsl:text> 264 </xsl:when> 265 <xsl:otherwise> 266 <xsl:if test="../@id = 'ch-system-man-pages'"> 267 <!-- these files are provided by the shadow package --> 268 <xsl:text>rm -fv $PKG_DEST/usr/share/man/{man3/getspnam.3,man5/passwd.5} 269 </xsl:text> 270 </xsl:if> 271 <!-- Attr man/man2 pages are already installed by man-pages. As of 272 March 2013, they are the same pages. 273 November 2015: now they are more accurate 274 in man-pages, and the man5 section is also in man-pages... --> 275 <xsl:if test="../@id = 'ch-system-attr'"> 276 <xsl:text>rm -fv $PKG_DEST/usr/share/man/man2/* 216 277 rm -fv $PKG_DEST/usr/share/man/man5/* 217 278 </xsl:text> 218 </xsl:if>279 </xsl:if> 219 280 <!-- nologin is installed by util-linux. remove it from shadow --> 220 <xsl:if test="../@id = 'ch-system-shadow'">221 <xsl:text>rm -fv $PKG_DEST/usr/share/man/man8/nologin.8281 <xsl:if test="../@id = 'ch-system-shadow'"> 282 <xsl:text>rm -fv $PKG_DEST/usr/share/man/man8/nologin.8 222 283 rm -fv $PKG_DEST/sbin/nologin 223 284 </xsl:text> 224 </xsl:if>225 <xsl:text>rm -fv $PKG_DEST/{,usr/}lib64285 </xsl:if> 286 <xsl:text>rm -fv $PKG_DEST/{,usr/}lib64 226 287 rm -fv $PKG_DEST/usr/{man,doc,info} 227 288 for dir in $PKG_DEST/usr/share/man/man{1..8}; do … … 240 301 rm -rf $PKG_DEST 241 302 </xsl:text> 303 </xsl:otherwise> 304 </xsl:choose> 242 305 </xsl:if> 243 306 <xsl:if test="$testsuite='3' and … … 310 373 <xsl:if test="$dirname = 'chapter06'"> 311 374 <xsl:text>packInstall 312 rm -rf $PKG_DEST375 rm -rf "$PKG_DEST" 313 376 </xsl:text> 314 377 </xsl:if> … … 453 516 </xsl:choose> 454 517 </xsl:when> 455 <xsl:otherwise><!--pkgmngt = 'y'--> 518 <xsl:when test="$wrap-install='y'"> 519 <xsl:choose> 520 <xsl:when test="./literal"> 521 <xsl:call-template name="output-wrap"> 522 <xsl:with-param name="commands" select="text()[1]"/> 523 </xsl:call-template> 524 <xsl:apply-templates select="literal"/> 525 <xsl:call-template name="output-wrap"> 526 <xsl:with-param name="commands" select="text()[2]"/> 527 </xsl:call-template> 528 </xsl:when> 529 <xsl:otherwise> 530 <xsl:call-template name="output-wrap"> 531 <xsl:with-param name="commands" select="string()"/> 532 </xsl:call-template> 533 </xsl:otherwise> 534 </xsl:choose> 535 <xsl:text>
</xsl:text> 536 </xsl:when> 537 <xsl:otherwise><!--pkgmngt = 'y' and wrap-install='n'--> 456 538 <xsl:choose> 457 539 <xsl:when test="./literal"> … … 477 559 <xsl:when test="contains(string(),'tzdata') and $pkgmngt='y'"> 478 560 <xsl:text> 479 OLD_PKG_DEST= $PKG_DEST561 OLD_PKG_DEST="$PKG_DEST" 480 562 OLD_PKGDIR=$PKGDIR 481 563 PKG_DEST=$(dirname $OLD_PKG_DEST)/001-tzdata … … 486 568 <xsl:text> 487 569 </xsl:text> 488 <xsl:copy-of select="substring-before(string(),'ZONEINFO=')"/> 489 <xsl:text>ZONEINFO=$PKG_DEST</xsl:text> 490 <xsl:copy-of select="substring-after(string(),'ZONEINFO=')"/> 491 <xsl:text> 570 <xsl:choose> 571 <xsl:when test="$wrap-install='n'"> 572 <xsl:copy-of select="substring-before(string(),'ZONEINFO=')"/> 573 <xsl:text>ZONEINFO=$PKG_DEST</xsl:text> 574 <xsl:copy-of select="substring-after(string(),'ZONEINFO=')"/> 575 <xsl:text> 492 576 packInstall 493 577 rm -rf $PKG_DEST 578 </xsl:text> 579 </xsl:when> 580 <xsl:otherwise><!-- wrap-install='y' --> 581 <xsl:copy-of select="substring-before(string(),'ZONEINFO=')"/> 582 <xsl:text> 583 wrapInstall ' 584 ZONEINFO=</xsl:text> 585 <xsl:copy-of select="substring-after(string(),'ZONEINFO=')"/> 586 <xsl:text>' 587 packInstall 588 </xsl:text> 589 </xsl:otherwise> 590 </xsl:choose> 591 <xsl:text> 494 592 PKG_DEST=$OLD_PKG_DEST 495 593 unset OLD_PKG_DEST … … 518 616 <xsl:value-of select="$lang"/> 519 617 </xsl:when> 618 <xsl:when test="contains(string(.),'Domain')"> 619 <xsl:value-of select="$domain"/> 620 </xsl:when> 621 <xsl:when test="contains(string(.),'primary')"> 622 <xsl:value-of select="$nameserver1"/> 623 </xsl:when> 624 <xsl:when test="contains(string(.),'secondary')"> 625 <xsl:value-of select="$nameserver2"/> 626 </xsl:when> 627 <xsl:when test="contains(string(.),'192.168.1.1')"> 628 <xsl:value-of select="$ip"/> 629 </xsl:when> 630 <xsl:when test="contains(string(.),'192.168.0.2')"> 631 <xsl:value-of select="$ip"/> 632 </xsl:when> 633 <!-- Only adapted to LFS-20170310 and later --> 634 <xsl:when test="contains(string(.),'HOSTNAME')"> 635 <xsl:value-of select="$hostname"/> 636 </xsl:when> 637 <xsl:when test="contains(string(.),'FQDN')"> 638 <xsl:value-of select="$hostname"/> 639 <xsl:text>.</xsl:text> 640 <xsl:value-of select="$domain"/> 641 </xsl:when> 642 <xsl:when test="contains(string(.),'alias')"/> 643 <xsl:when test="contains(string(.),'<lfs>')"> 644 <xsl:value-of select="$hostname"/> 645 </xsl:when> 520 646 <xsl:otherwise> 521 647 <xsl:text>**EDITME</xsl:text> … … 526 652 </xsl:template> 527 653 654 <xsl:template match="literal"> 655 <xsl:choose> 656 <xsl:when test="contains(string(),'ONBOOT')"> 657 <xsl:call-template name="outputnet"> 658 <xsl:with-param name="netstring" select="string()"/> 659 </xsl:call-template> 660 </xsl:when> 661 <xsl:when test="contains(string(),'[Match]')"> 662 <xsl:call-template name="outputsysdnet"> 663 <xsl:with-param name="netstring" select="string()"/> 664 </xsl:call-template> 665 </xsl:when> 666 <xsl:otherwise> 667 <xsl:apply-templates/> 668 </xsl:otherwise> 669 </xsl:choose> 670 </xsl:template> 671 672 <xsl:template name="outputnet"> 673 <xsl:param name="netstring" select="''"/> 674 <!-- We suppose that book example has the following values: 675 - interface: eth0 676 - ip: 192.168.1.2 677 - gateway: 192.168.1.1 678 - prefix: 24 679 - broadcast: 192.168.1.255 680 Change below if book changes --> 681 <xsl:choose> 682 <xsl:when test="contains($netstring,'eth0')"> 683 <xsl:call-template name="outputnet"> 684 <xsl:with-param name="netstring" 685 select="substring-before($netstring,'eth0')"/> 686 </xsl:call-template> 687 <xsl:value-of select="$interface"/> 688 <xsl:call-template name="outputnet"> 689 <xsl:with-param name="netstring" 690 select="substring-after($netstring,'eth0')"/> 691 </xsl:call-template> 692 </xsl:when> 693 <xsl:when test="contains($netstring,'192.168.1.1')"> 694 <xsl:call-template name="outputnet"> 695 <xsl:with-param name="netstring" 696 select="substring-before($netstring,'192.168.1.1')"/> 697 </xsl:call-template> 698 <xsl:value-of select="$gateway"/> 699 <xsl:call-template name="outputnet"> 700 <xsl:with-param name="netstring" 701 select="substring-after($netstring,'192.168.1.1')"/> 702 </xsl:call-template> 703 </xsl:when> 704 <!-- must test this before the following, because 192.168.1.255 contains 705 192.168.1.2! --> 706 <xsl:when test="contains($netstring,'192.168.1.255')"> 707 <xsl:call-template name="outputnet"> 708 <xsl:with-param name="netstring" 709 select="substring-before($netstring,'192.168.1.255')"/> 710 </xsl:call-template> 711 <xsl:value-of select="$broadcast"/> 712 <xsl:call-template name="outputnet"> 713 <xsl:with-param name="netstring" 714 select="substring-after($netstring,'192.168.1.255')"/> 715 </xsl:call-template> 716 </xsl:when> 717 <xsl:when test="contains($netstring,'192.168.1.2')"> 718 <xsl:call-template name="outputnet"> 719 <xsl:with-param name="netstring" 720 select="substring-before($netstring,'192.168.1.2')"/> 721 </xsl:call-template> 722 <xsl:value-of select="$ip"/> 723 <xsl:call-template name="outputnet"> 724 <xsl:with-param name="netstring" 725 select="substring-after($netstring,'192.168.1.2')"/> 726 </xsl:call-template> 727 </xsl:when> 728 <xsl:when test="contains($netstring,'24')"> 729 <xsl:call-template name="outputnet"> 730 <xsl:with-param name="netstring" 731 select="substring-before($netstring,'24')"/> 732 </xsl:call-template> 733 <xsl:value-of select="$prefix"/> 734 <xsl:call-template name="outputnet"> 735 <xsl:with-param name="netstring" 736 select="substring-after($netstring,'24')"/> 737 </xsl:call-template> 738 </xsl:when> 739 <xsl:otherwise> 740 <xsl:value-of select="$netstring"/> 741 </xsl:otherwise> 742 </xsl:choose> 743 </xsl:template> 744 745 <xsl:template name="outputsysdnet"> 746 <xsl:param name="netstring" select="''"/> 747 <!-- We suppose that book example has the following values: 748 - interface: eth0 749 - ip: 192.168.0.2 750 - gateway: 192.168.0.1 751 - prefix: 24 752 - DNS: 192.168.0.1 753 - Domain: <Your Domain Name> 754 and gateway comes before DNS. Change below if book changes --> 755 <xsl:choose> 756 <xsl:when test="contains($netstring,'eth0')"> 757 <xsl:call-template name="outputsysdnet"> 758 <xsl:with-param name="netstring" 759 select="substring-before($netstring,'eth0')"/> 760 </xsl:call-template> 761 <xsl:value-of select="$interface"/> 762 <xsl:call-template name="outputsysdnet"> 763 <xsl:with-param name="netstring" 764 select="substring-after($netstring,'eth0')"/> 765 </xsl:call-template> 766 </xsl:when> 767 <xsl:when test="contains($netstring,'192.168.0.1') and 768 contains($netstring,'Gateway')"> 769 <xsl:call-template name="outputsysdnet"> 770 <xsl:with-param name="netstring" 771 select="substring-before($netstring,'192.168.0.1')"/> 772 </xsl:call-template> 773 <xsl:value-of select="$gateway"/> 774 <xsl:call-template name="outputsysdnet"> 775 <xsl:with-param name="netstring" 776 select="substring-after($netstring,'192.168.0.1')"/> 777 </xsl:call-template> 778 </xsl:when> 779 <xsl:when test="contains($netstring,'192.168.0.1') and 780 not(contains($netstring,'Gateway'))"> 781 <xsl:call-template name="outputsysdnet"> 782 <xsl:with-param name="netstring" 783 select="substring-before($netstring,'192.168.0.1')"/> 784 </xsl:call-template> 785 <xsl:value-of select="$nameserver1"/> 786 <xsl:text> 787 DNS=</xsl:text> 788 <xsl:value-of select="$nameserver2"/> 789 <xsl:call-template name="outputsysdnet"> 790 <xsl:with-param name="netstring" 791 select="substring-after($netstring,'192.168.0.1')"/> 792 </xsl:call-template> 793 </xsl:when> 794 <xsl:when test="contains($netstring,'192.168.0.2')"> 795 <xsl:call-template name="outputsysdnet"> 796 <xsl:with-param name="netstring" 797 select="substring-before($netstring,'192.168.0.2')"/> 798 </xsl:call-template> 799 <xsl:value-of select="$ip"/> 800 <xsl:call-template name="outputsysdnet"> 801 <xsl:with-param name="netstring" 802 select="substring-after($netstring,'192.168.0.2')"/> 803 </xsl:call-template> 804 </xsl:when> 805 <xsl:when test="contains($netstring,'24')"> 806 <xsl:call-template name="outputsysdnet"> 807 <xsl:with-param name="netstring" 808 select="substring-before($netstring,'24')"/> 809 </xsl:call-template> 810 <xsl:value-of select="$prefix"/> 811 <xsl:call-template name="outputsysdnet"> 812 <xsl:with-param name="netstring" 813 select="substring-after($netstring,'24')"/> 814 </xsl:call-template> 815 </xsl:when> 816 <xsl:when test="contains($netstring,'<Your Domain Name>')"> 817 <xsl:call-template name="outputsysdnet"> 818 <xsl:with-param name="netstring" 819 select="substring-before($netstring,'<Your Domain Name>')"/> 820 </xsl:call-template> 821 <xsl:value-of select="$domain"/> 822 <xsl:call-template name="outputsysdnet"> 823 <xsl:with-param name="netstring" 824 select="substring-after($netstring,'<Your Domain Name>')"/> 825 </xsl:call-template> 826 </xsl:when> 827 <xsl:otherwise> 828 <xsl:value-of select="$netstring"/> 829 </xsl:otherwise> 830 </xsl:choose> 831 </xsl:template> 832 528 833 <xsl:template name="outputpkgdest"> 529 834 <xsl:param name="outputstring" select="foo"/> … … 624 929 </xsl:choose> 625 930 </xsl:template> 931 932 <xsl:variable name="APOS">'</xsl:variable> 933 <xsl:template name="output-wrap"> 934 <xsl:param name="commands" select="''"/> 935 <xsl:choose> 936 <xsl:when test="contains($commands,string($APOS))"> 937 <xsl:call-template name="output-wrap"> 938 <xsl:with-param name="commands" 939 select="substring-before($commands,string($APOS))"/> 940 </xsl:call-template> 941 <xsl:text>'\''</xsl:text> 942 <xsl:call-template name="output-wrap"> 943 <xsl:with-param name="commands" 944 select="substring-after($commands,string($APOS))"/> 945 </xsl:call-template> 946 </xsl:when> 947 <xsl:otherwise> 948 <xsl:value-of select="$commands"/> 949 </xsl:otherwise> 950 </xsl:choose> 951 </xsl:template> 952 626 953 </xsl:stylesheet> -
README.PACKAGE_MANAGEMENT
r909ee37 r945ccaa 7 7 There are several hints discussing package management for LFS, but 8 8 nothing under jhalfs. There used to be a patch for PACO that I cannot 9 find now. This is a modification ("DESTDIR install" automation), which10 allows to use a package manager inside jhalfs. I hope it is flexible enough11 to support several package managers, at least among those who use DESTDIR12 install. My initial implementation used dpkg, from Debian, in a very13 crude way (Debian has a sophisticated package management system, which14 I have not tried to use here). There is also a port to Pacman from15 Arch Linux (http://www.archlinux.org). I am sorry to say I have (almost)16 no experience with rpm, so I cannottell whether it would fit.9 find now. So there was a need for such a tool, and an infrastructure, 10 which allows using a package manager inside jhalfs, has been developped. 11 I hope it is flexible enough to support several package managers, at least 12 among those who use DESTDIR install and/or LD_PRELOAD during install. 13 It has been tested with dpkg from Debian, pacman from Arch Linux, 14 and porg. Sample configuration files are given for those three packages. 15 I am sorry to say I have (almost) no experience with rpm, so I cannot 16 tell whether it would fit. 17 17 18 18 2. OVERVIEW OF THE SYSTEM: 19 19 20 Presently, package management is only available for LFS. I plan to 21 upgrade BLFS tools, but nothing usable right now. I have not attempted 22 to adapt this tool for the other flavours of LFS. 20 For now, package management is only available for LFS. The `porg style' 21 (see below) package management has been ported to BLFS, but not the distro 22 style one (the book layout makes it rather difficult). I have not attempted 23 to adapt this tool for the other flavours of LFS (TODO). 23 24 24 To use package management, you need to create the required files in 25 the pkgmngt directory (see below), and to select "package management" in 26 the build settings. Note that this is incompatible with creating an SBU 27 and usage report. 25 This tool comes in two flavours: 26 - for distros package managers (e.g dpkg or pacman), it basically performs 27 a "DESTDIR install" for all pages in chapter 6, 7 and 8 of the book. The 28 name of the DESTDIR directory is the same as the one of the executed 29 script. The path to this directory is available to the scriplets through 30 the PKG_DEST variable. The details of the DESTDIR part are given below. 31 After the package is installed in $PKG_DEST, a function "packInstall" is 32 called, which is supposed to create a binary package (e.g. make a .deb 33 file), store it to a repository and install it to the system. 34 - for porg style package manager, the install instructions are wrapped 35 between pairs of single quotes ('). This allows passing those instructions 36 to a function ("wrapInstall"), which may itself call porg or another 37 (e.g. fakeroot, not tested) instruction wrapper. Note that if the 38 instructions contain single quote charaters, they are changed to '\'', 39 which pass them literally. At the end of the installation, a function 40 "packInstall" is called, with a slighly different aim compared to the 41 DESTDIR one: it is used to make a tarball of the installed files (e.g. 42 using "porgball") and store them into some repository. But there is no 43 need to install them to the system, since this has already been done. 28 44 29 3. DETAILS OF OPERATION: 45 Note that with carefully crafted "packInstall" and "wrapInstall" 46 functions, a combination of the two methods could be used, for example for 47 DESTDIR installs using fakeroot. This is work in progress and not fully 48 implemented yet. 30 49 31 This system performs basically a "DESTDIR install" for all pages 32 in chapter 6, 7 and 8 of the book. The name of the DESTDIR directory is the 33 same as the one of the executed script. The path to this directory is 34 made available to the scriplets through the PKG_DEST variable. 50 3. DETAILS: 51 35 52 The XSL stylesheet used for generating the scriptlets, automatically 36 53 adds DESTDIR install instructions when "package management" is selected. … … 44 61 directory. Empty directories are then removed before packing the 45 62 binary package. 63 46 64 In order to use the package manager, it has to be installed at the end of 47 65 chapter 5 (temporary installation in /tools) and chapter 6 (final install). … … 52 70 This file should reside in the `pkgmngt' directory and be named 53 71 `packageManager.xml'. A template named `packageManager.xml.template' is 54 provided in the `pkgmngt' subdirectory. There are also two XML files for 55 dpkg and pacman, respectively `packageManager.xml.dpkg' and 56 `packageManager.xml.pacman', that you can copy to `packageManager.xml'. 72 provided in the `pkgmngt' subdirectory. There are also three XML files for 73 dpkg, pacman, and porg, respectively `packageManager.xml.dpkg', 74 `packageManager.xml.pacman', and `packageManager.xml.porg', that you can 75 copy to `packageManager.xml' and modify to suit your needs. 57 76 They are not updated often, so the versions used can be rather old. 58 The last thing to do is to tell how to use the package manager. When 59 the binary package is ready, the scriptlets call a shell function named60 `packInstall', which should pack the binary package and install it on the61 system. Note that nothing has been done to manage configuration files,77 78 The last thing to do is to tell how to use the package manager. The user 79 has to provide two functions, "wrapInstall" and "packInstall", as described 80 above. Please note that nothing has been done to manage configuration files, 62 81 which are ususally treated specially by package managers: depending on 63 82 the book layout, it is sometimes possible to create those files afterwards, 64 83 and sometimes not, which means that you have to check them after each 65 upgrade. The user has to write his own `packInstall' function. The shell66 function should be defined in a file named `packInstall.sh', residing in67 the `pkgmngt' directory. A template is provided, as well as two example68 scripts for dpkg and pacman. Note that, due to the way pacman checks the69 available space on disk, the root directory in chroot must be a mount point,70 otherwise theinstallation of packages fails.84 upgrade. Both functions should be defined in a file named `packInstall.sh', 85 residing in the `pkgmngt' directory. A template is provided (actually a copy 86 of the file for dpkg), as well as three example scripts for dpkg, pacman, 87 and porg. Pacman Note: due to the way pacman checks the available space on 88 disk, the root directory in chroot must be a mount point, otherwise the 89 installation of packages fails. -
common/libs/func_book_parser
r909ee37 r945ccaa 165 165 popd > /dev/null 166 166 167 xsltproc --nonet \ 168 --xinclude \ 169 --stringparam revision $INITSYS \ 170 --stringparam testsuite $TEST \ 171 --stringparam bomb-testsuite $BOMB_TEST \ 172 --stringparam vim-lang $VIMLANG \ 173 --stringparam full-locale $FULL_LOCALE \ 174 --stringparam timezone $TIMEZONE \ 175 --stringparam page $PAGE \ 176 --stringparam lang $LANG \ 177 --stringparam pkgmngt $PKGMNGT \ 178 --output ./${PROGNAME}-commands/ \ 179 $XSL \ 167 xsltproc --nonet \ 168 --xinclude \ 169 --stringparam revision $INITSYS \ 170 --stringparam testsuite $TEST \ 171 --stringparam bomb-testsuite $BOMB_TEST \ 172 --stringparam vim-lang $VIMLANG \ 173 --stringparam full-locale $FULL_LOCALE \ 174 --stringparam timezone $TIMEZONE \ 175 --stringparam page $PAGE \ 176 --stringparam lang $LANG \ 177 --stringparam pkgmngt $PKGMNGT \ 178 --stringparam wrap-install $WRAP_INSTALL \ 179 --stringparam hostname $HOSTNAME \ 180 --stringparam interface $INTERFACE \ 181 --stringparam ip $IP_ADDR \ 182 --stringparam gateway $GATEWAY \ 183 --stringparam prefix $PREFIX \ 184 --stringparam broadcast $BROADCAST \ 185 --stringparam domain $DOMAIN \ 186 --stringparam nameserver1 $DNS1 \ 187 --stringparam nameserver2 $DNS2 \ 188 --output ./${PROGNAME}-commands/ \ 189 $XSL \ 180 190 $BOOK/index.xml >> $LOGDIR/$LOG 2>&1 181 191 ;; -
common/libs/func_install_blfs
r909ee37 r945ccaa 13 13 cp $COMMON_DIR/progress_bar.sh ${BUILDDIR}${BLFS_ROOT} 14 14 cp README.BLFS ${BUILDDIR}${BLFS_ROOT} 15 if [ "$WRAP_INSTALL" = y ]; then 16 sed -e 's/PKGDIR/UNPACKDIR/' \ 17 -e 's/PKG_DEST/PKG_DIR/' \ 18 $PKGMNGTDIR/packInstall.sh > ${BUILDDIR}${BLFS_ROOT}/packInstall.sh 19 fi 15 20 16 21 # Clean-up … … 116 121 optDependency=2 117 122 SUDO=n 123 WRAP_INSTALL=$WRAP_INSTALL 118 124 EOF 119 125 -
common/libs/func_validate_configs.sh
r909ee37 r945ccaa 42 42 43 43 # Build Settings by book 44 local -r LFS_build="$BUILD_chroot VIMLANG $BUILD_common PKGMNGT FULL_LOCALE "44 local -r LFS_build="$BUILD_chroot VIMLANG $BUILD_common PKGMNGT FULL_LOCALE WRAP_INSTALL" 45 45 local -r HLFS_build="$BUILD_chroot $BUILD_common" 46 46 local -r CLFS_build="$BUILD_chroot VIMLANG $BUILD_common" … … 48 48 local -r CLFS3_build=" $BUILD_common" 49 49 50 # System Settings by book (only LFS for now) 51 local -r LFS_system="HOSTNAME INTERFACE IP_ADDR GATEWAY PREFIX BROADCAST DOMAIN DNS1 DNS2 FONT CONSOLE_MAP UNICODE KEYMAP" 52 50 53 # Full list of books settings 51 local -r lfs_PARAM_LIST="$LFS_book $GENERAL_common $LFS_build $ADVANCED_chroot $ADVANCED_common"54 local -r lfs_PARAM_LIST="$LFS_book $GENERAL_common $LFS_build $LFS_system $ADVANCED_chroot $ADVANCED_common" 52 55 local -r hlfs_PARAM_LIST="$HLFS_book $GENERAL_common $HLFS_build $ADVANCED_chroot $ADVANCED_common" 53 56 local -r clfs_PARAM_LIST="$CLFS_book $GENERAL_common $CLFS_build $ADVANCED_chroot $ADVANCED_common" … … 194 197 ;; 195 198 199 # Treatment of HOSTNAME 200 HOSTNAME) echo -e "`eval echo $PARAM_VALS`" 201 [[ "${!config_param}" = "**EDIT ME**" ]] && write_error_and_die 202 ;; 203 196 204 # Case of PKGMNGT: two files, packageManager.xml and packInstall.sh 197 205 # must exist in $PKGMNGTDIR if PKGMNGT='y': -
common/makefile-functions
r909ee37 r945ccaa 116 116 echo "source packInstall.sh" >> envars; \ 117 117 echo "export -f packInstall" >> envars; \ 118 echo "export -f wrapInstall" >> envars; \ 118 119 fi; 119 120 endef -
jhalfs
r909ee37 r945ccaa 125 125 RUN_ICA=${RUN_ICA:-n} 126 126 PKGMNGT=${PKGMNGT:-n} 127 WRAP_INSTALL=${WRAP_INSTALL:-n} 127 128 BOMB_TEST=${BOMB_TEST:-n} 128 129 STRIP=${STRIP:=n} … … 142 143 SET_MISC=${SET_MISC:=n} 143 144 SET_BLOWFISH=${SET_BLOWFISH:=n} 145 UNICODE=${UNICODE:=n} 144 146 145 147 if [[ "${NO_PROGRESS_BAR}" = "y" ]] ; then
Note:
See TracChangeset
for help on using the changeset viewer.