From 1ffb4970e714ee7f9ce5d87b99b9a642a4f14095 Mon Sep 17 00:00:00 2001 From: immarvin Date: Thu, 26 Nov 2015 02:35:42 -0500 Subject: [PATCH] add the doc of diskless exlist; update the exlist for sles12 ppc64le diskless osimage --- .../deployment/trim_diskless_rootimg.rst | 130 ++++++++++++++++++ .../diskless/customize_image/index.rst | 1 + .../customize_image/trim_diskless_rootimg.rst | 1 + .../sles/compute.sles12.ppc64le.exlist | 24 ++-- 4 files changed, 144 insertions(+), 12 deletions(-) create mode 100644 docs/source/guides/admin-guides/manage_clusters/common/deployment/trim_diskless_rootimg.rst create mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/trim_diskless_rootimg.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/trim_diskless_rootimg.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/trim_diskless_rootimg.rst new file mode 100644 index 000000000..cbb344d23 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/trim_diskless_rootimg.rst @@ -0,0 +1,130 @@ +Trim diskless rootimg +===================== + + +the exclude list attribute: linuximage.exlist +---------------------------------------------- + +To reduce the memory occupation and boot-up time for the diskless node, the initrd and rootimg.gz should be kept as compact as possible under the premise of meeting the user's requirements. + +xCAT provides an **exclude list** attribute ``linuximage.exlist`` in the **osimage** object definition, which enables user to trim the rootimg on the diskless node after the rpms are installed into the rootimg directory by ``genimage`` on management node. + + +Take the osimage **sles12.1-ppc64le-netboot-compute** for example:: + + # lsdef -t osimage -o sles12.1-ppc64le-netboot-compute + Object name: sles12.1-ppc64le-netboot-compute + exlist=/opt/xcat/share/xcat/netboot/sles/compute.sles12.ppc64le.exlist + imagetype=linux + osarch=ppc64le + osdistroname=sles12.1-ppc64le + osname=Linux + osvers=sles12.1 + otherpkgdir=/install/post/otherpkgs/sles12.1/ppc64le + permission=755 + pkgdir=/install/sles12.1/ppc64le + pkglist=/opt/xcat/share/xcat/netboot/sles/compute.sles12.ppc64le.pkglist + postinstall=/opt/xcat/share/xcat/netboot/sles/compute.sles12.ppc64le.postinstall + profile=compute + provmethod=netboot + rootimgdir=/install/netboot/sles12.1/ppc64le/compute + + +the content of exlist file +-------------------------- + +The file specified in ``linuximage.exlist`` includes **relative path** of the directories and files that will be excluded from the **rootimg.gz** generated by ``packimage``. The **relative path** suppose the ``rootimg`` directory, ``/install/netboot/sles12.1/ppc64le/compute/rootimg`` here, to be the base directory. [1]_ [2]_ + +xCAT ships a default exlist file, user can add or remove entries based on it according to their need. + +The content of the default exlist file ``/opt/xcat/share/xcat/netboot/sles/compute.sles12.ppc64le.exlist`` is: :: + + # cat /opt/xcat/share/xcat/netboot/sles/compute.sles12.ppc64le.exlist + ./boot* + ./etc/bootsplash/themes/SLES/images* + ./opt/sci/include* + ./usr/include* + ./usr/lib/locale* + ./usr/lib/perl[0-9]/[0-9.]*/ppc64le-linux-thread-multi/auto/Encode/CN* + ./usr/lib/perl[0-9]/[0-9.]*/ppc64le-linux-thread-multi/auto/Encode/JP* + ./usr/lib/perl[0-9]/[0-9.]*/ppc64le-linux-thread-multi/auto/Encode/TW* + ./usr/lib/perl[0-9]/[0-9.]*/ppc64le-linux-thread-multi/auto/Encode/KR* + ./usr/lib/perl[0-9]/[0-9.]*/ppc64le-linux-thread-multi/Encode/CN* + ./usr/lib/perl[0-9]/[0-9.]*/ppc64le-linux-thread-multi/Encode/JP* + ./usr/lib/perl[0-9]/[0-9.]*/ppc64le-linux-thread-multi/Encode/KR* + ./usr/lib/perl[0-9]/[0-9.]*/ppc64le-linux-thread-multi/Encode/TW* + ./usr/lib64/gcc/powerpc64le-suse-linux/4.8/include* + ./usr/local/include* + ./usr/local/man* + ./usr/powerpc64le-suse-linux/include* + ./usr/share/X11/locale/* + +./usr/share/X11/locale/en_US.UTF-8* + +./usr/share/X11/locale/C* + ./usr/share/cracklib* + ./usr/share/doc* + ./usr/share/doc/packages/cyrus-sasl/doc* + ./usr/share/gnome* + ./usr/share/i18n* + ./usr/share/info* + ./usr/share/locale/* + +./usr/share/locale/en_US* + +./usr/share/locale/C* + ./usr/share/man* + ./usr/share/omf* + ./usr/share/vim/site/doc* + ./usr/share/vim/vim[0-9]*/doc* + ./var/cache/man* + ./var/cache/zypp* + +The content above presents some syntax supported in exlist file: + +* exclude entry:: + + ./usr/share/X11/locale/* + +all the files and subdirectories under ``rootimg/usr/share/X11/locale/`` will be excluded. + +* include entry:: + + +./usr/share/locale/C* + +all the files and subdirectories with the name matching pattern ``C*`` under ``/usr/share/locale/`` will be included in the **rootimg.gz**, it is quite useful to use ``+`` initialed entries following an exclude entry to include some specific files or directories under the excluded parent directory. + +* pattern of the file name and directory [3]_:: + + ./usr/lib/perl[0-9]/[0-9.]*/ppc64le-linux-thread-multi/Encode/JP* + +all the files and subdirectories matching the pattern ``./usr/lib/perl[0-9]/[0-9.]*/ppc64le-linux-thread-multi/Encode/JP*`` will be excluded, such as :: + + ./usr/lib/perl5/5.18.2/ppc64le-linux-thread-multi/Encode/JP + ./usr/lib/perl5/5.18.2/ppc64le-linux-thread-multi/Encode/JP/H2Z.pm + ./usr/lib/perl5/5.18.2/ppc64le-linux-thread-multi/Encode/JP/JIS7.pm + ./usr/lib/perl5/5.18.2/ppc64le-linux-thread-multi/Encode/JP.pm + + +customize the exlist file and the osimage definition +---------------------------------------------------- + +Please check the default exlist file and make sure: + + * all files and directories you do not want in the image will be excluded from the rootimg. + + * no file or directory you need will be excluded from the rootimg. + + +If you want to customize the osimage ``sles12.1-ppc64le-netboot-compute`` with your own exlist file, please follow the following steps: :: + + #create a customized exlist file based on the default one + cp /opt/xcat/share/xcat/netboot/sles/compute.sles12.ppc64le.exlist /install/custom/netboot/sles/compute.sles12.ppc64le.exlist + + #edit the newly created exlist file according to your need + vi /install/custom/netboot/sles/compute.sles12.ppc64le.exlist + + #specify the newly created exlist file in the osimage definition + chdef -t osimage -o sles12.1-ppc64le-netboot-compute exlist=/install/custom/netboot/sles/compute.sles12.ppc64le.exlist + +.. [1] It would only make sense to use an absolute path name here. It means that this entry will never match anything: ``/usr/share/locale/*``. + +.. [2] The exlist file entry should not be ended with a slash ``/``, it means that this entry will never match anything: ``./usr/lib/perl[0-9]/[0-9.]*/ppc64le-linux-thread-multi/Encode/``. + +.. [3] Pattern match test applies to the whole file name,starting from one of the start points specified in the exlist file entry. The regex syntax comply the with the regex syntax of system command ``find -path``, please refer to its doc for details. diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/index.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/index.rst index 68919653b..1e076c7eb 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/index.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/index.rst @@ -14,3 +14,4 @@ Optional means all the subitems in this page are not necessary to finish an OS d enable_kdump.rst install_new_kernel.rst acc_initrd_rootimg_gen_ppc64le.rst + trim_diskless_rootimg.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/trim_diskless_rootimg.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/trim_diskless_rootimg.rst new file mode 100644 index 000000000..a384e0706 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/trim_diskless_rootimg.rst @@ -0,0 +1 @@ +.. include:: ../../../common/deployment/trim_diskless_rootimg.rst diff --git a/xCAT-server/share/xcat/netboot/sles/compute.sles12.ppc64le.exlist b/xCAT-server/share/xcat/netboot/sles/compute.sles12.ppc64le.exlist index 6c5278630..6712ca910 100755 --- a/xCAT-server/share/xcat/netboot/sles/compute.sles12.ppc64le.exlist +++ b/xCAT-server/share/xcat/netboot/sles/compute.sles12.ppc64le.exlist @@ -3,18 +3,18 @@ ./opt/sci/include* ./usr/include* ./usr/lib/locale* -./usr/lib/perl5/5.10.0/ppc64-linux-thread-multi/auto/Encode/CN* -./usr/lib/perl5/5.10.0/ppc64-linux-thread-multi/auto/Encode/JP* -./usr/lib/perl5/5.10.0/ppc64-linux-thread-multi/auto/Encode/TW* -./usr/lib/perl5/5.10.0/ppc64-linux-thread-multi/auto/Encode/KR* -./usr/lib/perl5/5.10.0/ppc64-linux-thread-multi/Encode/CN* -./usr/lib/perl5/5.10.0/ppc64-linux-thread-multi/Encode/JP* -./usr/lib/perl5/5.10.0/ppc64-linux-thread-multi/Encode/KR* -./usr/lib/perl5/5.10.0/ppc64-linux-thread-multi/Encode/TW* -./usr/lib64/gcc/powerpc64-suse-linux/4.3/include* +./usr/lib/perl[0-9]/[0-9.]*/ppc64le-linux-thread-multi/auto/Encode/CN* +./usr/lib/perl[0-9]/[0-9.]*/ppc64le-linux-thread-multi/auto/Encode/JP* +./usr/lib/perl[0-9]/[0-9.]*/ppc64le-linux-thread-multi/auto/Encode/TW* +./usr/lib/perl[0-9]/[0-9.]*/ppc64le-linux-thread-multi/auto/Encode/KR* +./usr/lib/perl[0-9]/[0-9.]*/ppc64le-linux-thread-multi/Encode/CN* +./usr/lib/perl[0-9]/[0-9.]*/ppc64le-linux-thread-multi/Encode/JP* +./usr/lib/perl[0-9]/[0-9.]*/ppc64le-linux-thread-multi/Encode/KR* +./usr/lib/perl[0-9]/[0-9.]*/ppc64le-linux-thread-multi/Encode/TW* +./usr/lib64/gcc/powerpc64le-suse-linux/4.8/include* ./usr/local/include* ./usr/local/man* -./usr/powerpc64-suse-linux/include* +./usr/powerpc64le-suse-linux/include* ./usr/share/X11/locale/* +./usr/share/X11/locale/en_US.UTF-8* +./usr/share/X11/locale/C* @@ -30,7 +30,7 @@ ./usr/share/man* ./usr/share/omf* ./usr/share/vim/site/doc* -./usr/share/vim/vim72/doc* +./usr/share/vim/vim[0-9]*/doc* ./var/cache/man* -./var/cache/yum* +./var/cache/zypp*