From 29eb124631401448d16ce981f006f08b8e84cfa0 Mon Sep 17 00:00:00 2001 From: Jiayi Yin Date: Tue, 6 Jun 2023 19:00:43 +0800 Subject: [PATCH] Initial commit --- 85-display-manager.preset | 10 + 90-default.preset | 99 ++++++ 99-default-disable.preset | 1 + dot-bash_logout | 2 + dot-bash_profile | 12 + dot-bashrc | 12 + dot-cshrc | 7 + dot-tcshrc | 10 + generic-release-1.0/License/LICENSE | 127 +++++++ generic-release-1.0/autorun-template | 18 + generic-release-1.0/color.sh | 27 ++ generic-release-1.0/enterprisedocs-man.css | 393 +++++++++++++++++++++ generic-release-1.0/performance.sh | 18 + generic-release-1.0/supportinfo | 16 + generic-release-1.0/system-info.sh | 86 +++++ generic-release.spec | 217 ++++++++++++ 16 files changed, 1055 insertions(+) create mode 100644 85-display-manager.preset create mode 100644 90-default.preset create mode 100644 99-default-disable.preset create mode 100644 dot-bash_logout create mode 100644 dot-bash_profile create mode 100644 dot-bashrc create mode 100644 dot-cshrc create mode 100644 dot-tcshrc create mode 100644 generic-release-1.0/License/LICENSE create mode 100644 generic-release-1.0/autorun-template create mode 100644 generic-release-1.0/color.sh create mode 100644 generic-release-1.0/enterprisedocs-man.css create mode 100644 generic-release-1.0/performance.sh create mode 100644 generic-release-1.0/supportinfo create mode 100644 generic-release-1.0/system-info.sh create mode 100644 generic-release.spec diff --git a/85-display-manager.preset b/85-display-manager.preset new file mode 100644 index 0000000..c1d3069 --- /dev/null +++ b/85-display-manager.preset @@ -0,0 +1,10 @@ +# We enable all display managers by default. Since only one can +# actually be enabled at the same time the one which is installed +# first wins + +enable gdm.service +enable lightdm.service +enable slim.service +enable lxdm.service +enable kdm.service +enable xdm.service diff --git a/90-default.preset b/90-default.preset new file mode 100644 index 0000000..b761b48 --- /dev/null +++ b/90-default.preset @@ -0,0 +1,99 @@ +#systemd service for disable +disable systemd-resolved.service + +# systemd +enable remote-fs.target +enable getty@tty1.service +enable systemd-readahead-replay.service +enable systemd-readahead-collect.service + +# System stuff +enable sshd.service +enable atd.* +enable crond.* +enable chronyd.service +enable rpcbind.* +enable NetworkManager.service +enable NetworkManager-dispatcher.service +enable ModemManager.service +enable auditd.service +enable restorecond.service +enable bluetooth.* +enable avahi-daemon.* +enable cups.* + +# The various syslog implementations +enable rsyslog.* +enable syslog-ng.* +enable sysklogd.* + +# Network facing +enable firewalld.service +enable libvirtd.service +enable xinetd.service +enable ladvd.service + +# Storage +enable multipathd.service +enable libstoragemgmt.service +enable lvm2-monitor.* +enable lvm2-lvmetad.* +enable dm-event.* +enable dmraid-activation.service + +enable mdmonitor.service +enable mdmonitor-takeover.service + +enable spice-vdagentd.service + +enable qemu-guest-agent.service + +enable dnf-makecache.timer + +enable initial-setup-graphical.service +#enable initial-setup-text.service + +enable vmtoolsd.service + +enable kdump.service + +enable tuned.service + +# Hardware +enable gpm.* +enable gpsd.* +enable irqbalance.service +enable lm_sensors.service +enable mcelog.* +enable microcode.service +enable acpid.* +enable smartd.service +enable pcscd.socket +enable rngd.service + +# Other stuff +enable abrtd.service +enable abrt-ccpp.service +enable abrt-oops.service +enable abrt-xorg.service +enable abrt-vmcore.service +enable lttng-sessiond.service +enable ksm.service +enable ksmtuned.service +enable rootfs-resize.service +enable sysstat.service +enable uuidd.service +enable xendomains.service +enable xenstored.service +enable xenconsoled.service +enable hypervkvpd.service +enable hypervvssd.service + +# Desktop stuff +enable accounts-daemon.service +enable rtkit-daemon.service +enable upower.service +enable udisks2.service +enable polkit.service +enable packagekit-offline-update.service +enable PackageKit.service diff --git a/99-default-disable.preset b/99-default-disable.preset new file mode 100644 index 0000000..1f29b50 --- /dev/null +++ b/99-default-disable.preset @@ -0,0 +1 @@ +disable * diff --git a/dot-bash_logout b/dot-bash_logout new file mode 100644 index 0000000..af7c6fd --- /dev/null +++ b/dot-bash_logout @@ -0,0 +1,2 @@ +# ~/.bash_logout + diff --git a/dot-bash_profile b/dot-bash_profile new file mode 100644 index 0000000..3dc099a --- /dev/null +++ b/dot-bash_profile @@ -0,0 +1,12 @@ +# .bash_profile + +# Get the aliases and functions +if [ -f ~/.bashrc ]; then + . ~/.bashrc +fi + +# User specific environment and startup programs + +PATH=$PATH:$HOME/bin + +export PATH diff --git a/dot-bashrc b/dot-bashrc new file mode 100644 index 0000000..6e6d1e1 --- /dev/null +++ b/dot-bashrc @@ -0,0 +1,12 @@ +# .bashrc + +# User specific aliases and functions + +alias rm='rm -i' +alias cp='cp -i' +alias mv='mv -i' + +# Source global definitions +if [ -f /etc/bashrc ]; then + . /etc/bashrc +fi diff --git a/dot-cshrc b/dot-cshrc new file mode 100644 index 0000000..d087a90 --- /dev/null +++ b/dot-cshrc @@ -0,0 +1,7 @@ +# .cshrc + +# User specific aliases and functions + +alias rm 'rm -i' +alias cp 'cp -i' +alias mv 'mv -i' diff --git a/dot-tcshrc b/dot-tcshrc new file mode 100644 index 0000000..e68e89e --- /dev/null +++ b/dot-tcshrc @@ -0,0 +1,10 @@ +# .tcshrc + +# User specific aliases and functions + +alias rm 'rm -i' +alias cp 'cp -i' +alias mv 'mv -i' + +set prompt='[%n@%m %c]# ' + diff --git a/generic-release-1.0/License/LICENSE b/generic-release-1.0/License/LICENSE new file mode 100644 index 0000000..9e32cde --- /dev/null +++ b/generic-release-1.0/License/LICENSE @@ -0,0 +1,127 @@ + 木兰宽松许可证, 第2版 + + 木兰宽松许可证, 第2版 + 2020年1月 http://license.coscl.org.cn/MulanPSL2 + + + 您对“软件”的复制、使用、修改及分发受木兰宽松许可证,第2版(“本许可证”)的如下条款的约束: + + 0. 定义 + + “软件”是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。 + + “贡献”是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。 + + “贡献者”是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。 + + “法人实体”是指提交贡献的机构及其“关联实体”。 + + “关联实体”是指,对“本许可证”下的行为方而言,控制、受控制或与其共同受控制的机构,此处的控制是指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。 + + 1. 授予版权许可 + + 每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、分发其“贡献”,不论修改与否。 + + 2. 授予专利许可 + + 每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权行动之日终止。 + + 3. 无商标许可 + + “本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可,但您为满足第4条规定的声明义务而必须使用除外。 + + 4. 分发限制 + + 您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。 + + 5. 免责声明与责任限制 + + “软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。 + + 6. 语言 + “本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文版为准。 + + 条款结束 + + 如何将木兰宽松许可证,第2版,应用到您的软件 + + 如果您希望将木兰宽松许可证,第2版,应用到您的新软件,为了方便接收者查阅,建议您完成如下三步: + + 1, 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字; + + 2, 请您在软件包的一级目录下创建以“LICENSE”为名的文件,将整个许可证文本放入该文件中; + + 3, 请将如下声明文本放入每个源文件的头部注释中。 + + Copyright (c) [Year] [name of copyright holder] + [Software Name] is licensed under Mulan PSL v2. + You can use this software according to the terms and conditions of the Mulan PSL v2. + You may obtain a copy of Mulan PSL v2 at: + http://license.coscl.org.cn/MulanPSL2 + THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. + See the Mulan PSL v2 for more details. + + + Mulan Permissive Software License,Version 2 + + Mulan Permissive Software License,Version 2 (Mulan PSL v2) + January 2020 http://license.coscl.org.cn/MulanPSL2 + + Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions: + + 0. Definition + + Software means the program and related documents which are licensed under this License and comprise all Contribution(s). + + Contribution means the copyrightable work licensed by a particular Contributor under this License. + + Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License. + + Legal Entity means the entity making a Contribution and all its Affiliates. + + Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity. + + 1. Grant of Copyright License + + Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not. + + 2. Grant of Patent License + + Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken. + + 3. No Trademark License + + No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in Section 4. + + 4. Distribution Restriction + + You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software. + + 5. Disclaimer of Warranty and Limitation of Liability + + THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + 6. Language + + THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL. + + END OF THE TERMS AND CONDITIONS + + How to Apply the Mulan Permissive Software License,Version 2 (Mulan PSL v2) to Your Software + + To apply the Mulan PSL v2 to your work, for easy identification by recipients, you are suggested to complete following three steps: + + i Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner; + + ii Create a file named “LICENSE” which contains the whole context of this License in the first directory of your software package; + + iii Attach the statement to the appropriate annotated syntax at the beginning of each source file. + + + Copyright (c) [Year] [name of copyright holder] + [Software Name] is licensed under Mulan PSL v2. + You can use this software according to the terms and conditions of the Mulan PSL v2. + You may obtain a copy of Mulan PSL v2 at: + http://license.coscl.org.cn/MulanPSL2 + THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. + See the Mulan PSL v2 for more details. diff --git a/generic-release-1.0/autorun-template b/generic-release-1.0/autorun-template new file mode 100644 index 0000000..22a0264 --- /dev/null +++ b/generic-release-1.0/autorun-template @@ -0,0 +1,18 @@ +#!/bin/sh +#Copyright (c) [2019] Huawei Technologies Co., Ltd. +#generic-release is licensed under the Mulan PSL v2. +#You can use this software according to the terms and conditions of the Mulan PSL v2. +#You may obtain a copy of Mulan PSL v2 at: +# http://license.coscl.org.cn/MulanPSL2 +#THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +#PURPOSE. +#See the Mulan PSL v2 for more details. + +dir=$(echo $0 |sed 's/autorun//') +cd "$dir" +tree=$(pwd) + +# Change directories so we can unmount the CD-ROM Drive +cd / +exec /usr/bin/system-cdinstall-helper $tree diff --git a/generic-release-1.0/color.sh b/generic-release-1.0/color.sh new file mode 100644 index 0000000..92a3f87 --- /dev/null +++ b/generic-release-1.0/color.sh @@ -0,0 +1,27 @@ +#/bin/bash +#Copyright (c) [2019] Huawei Technologies Co., Ltd. +#generic-release is licensed under the Mulan PSL v2. +#You can use this software according to the terms and conditions of the Mulan PSL v2. +#You may obtain a copy of Mulan PSL v2 at: +# http://license.coscl.org.cn/MulanPSL2 +#THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +#PURPOSE. +#See the Mulan PSL v2 for more details. + +alias ls='ls --color=auto' +alias ll='ls -lh' +alias la='ls -lAh' +alias l.='ls -d .* --color=auto' + +alias grep='grep --color=auto' +alias egrep='egrep --color=auto' +alias fgrep='fgrep --color=auto' + +alias zgrep='zgrep --color=auto' +alias zfgrep='zfgrep --color=auto' +alias zegrep='zegrep --color=auto' + +alias xzgrep='xzgrep --color=auto' +alias xzfgrep='xzfgrep --color=auto' +alias xzegrep='xzegrep --color=auto' diff --git a/generic-release-1.0/enterprisedocs-man.css b/generic-release-1.0/enterprisedocs-man.css new file mode 100644 index 0000000..a3b3a84 --- /dev/null +++ b/generic-release-1.0/enterprisedocs-man.css @@ -0,0 +1,393 @@ +body { + background-color: #ffffff; + color: #000000; + margin: 0; + padding: 0; + font-family: helvetica, arial,sans-serif; + font-size: 12pt; + /* needed so buttons created with css don't bleed into text */ + line-height: 1.3; + } + +body.book, body.article, body.chapter, body.part, body.preface, body.sect1, body.index, body.colophon, body.glossary, body.reference, body.refentry { + font-family: helvetica, arial,sans-serif; + font-size: 12pt; + background-color: #ffffff; + margin: 0; + padding : 0; + } + +p, td, th, .variablelist { + font-family: helvetica, arial, sans-serif; + font-size: 12pt; + /* left must be 0 so it lines up */ + margin : 10px 0px 10px 0px; + } + +div.article p { + font-family: helvetica, arial, sans-serif; + font-size: 12pt; + /* if in article made from XML left must be 10 so it lines up */ + margin : 10px 10px 10px 10px; + } + +li { + font-family: helvetica, arial, sans-serif; + font-size: 12pt; + } + +table { + width: 90%; + font-family: helvetica, arial, sans-serif; + font-size: 12pt; + margin : 0px 0px 0px 0px; + } + +table.note, table.tip, table.important, table.caution, table.warning { + width: 95%; + font-family: helvetica, arial, sans-serif; + font-size: 12pt; + border: 2px solid #B0C4DE; + background-color: #F0F8FF; + color: #000000; + /* padding inside table area */ + padding: 0.5em; + margin-bottom: 0.5em; + margin-top: 0.5em; + } + +/* set width smaller and IE is happy */ +ul table.note, ul table.tip, ul table.important, ul table.caution, ul table.warning, ol table.note, ol table.tip, ol table.important, ol table.caution, ol table.warning { + width: 95%; + } + +.computeroutput, .command { + font-family: courier, courier new, monospace; + font-size: 12pt; + } + +.userinput { + font-family: courier, courier new, monospace; + font-size: 12pt; + font-weight: bold; + } + +table.screen { + width: 95%; + font-family: courier, courier new, monospace; + font-size: 12pt; + border: 2px solid #A9A9A9; + background-color: #DCDCDC; + color: #000000; + padding: 0.5em; + margin-bottom: 0.5em; + margin-top: 0.5em; + } + +table.calstable { + width: 95%; + font-family: helvetica, arial, sans-serif; + font-size: 12pt; + background-color: #DCDCDC; + color: #000000; + } + +table.calstable td { + font-family: helvetica, arial, sans-serif; + font-size: 12pt; + border: 1px solid #A9A9A9; + background-color: #DCDCDC; + color: #000000; + padding: 0.5em; + margin-bottom: 0.5em; + margin-top: 2px; + margin : 0px 0px 0px 10px; + } + +table.calstable th { + border: 2px solid #A9A9A9; + background-color: #A9A9A9; + color: #000000; + } + +.navheader, .navfooter { + background-color: #ffffff; + color: #000000; + /* need top margin so title line isn't touching the top */ + margin : 10px 20px 0px 20px; + font-family: helvetica, arial,sans-serif; + font-size: 12pt; + } + +div.navheader hr, div.navfooter hr { + background-color: #CCCCCC; + margin: 0px 0px 0px 0px; + height: 1px; + border-style: none; + } + +div.navheader table, div.navfooter table { + width: 95%; + background-color: #ffffff; + margin: 0px 0px 0px 0px; + padding: 0; + font-family: helvetica, arial,sans-serif; + font-size: 12pt; + } + +body>div.navheader table, body>div.navfooter table { + /* Hidden from IE */ + width: 100%; + } + +/* top hr on index page is not in a div so it needs div margins */ +hr { + background-color: #CCCCCC; + margin: 0px 10px 0px 10px; + height: 1px; + border-style: none; + } + +h2, h2.indexdiv { + + font-family: helvetica, arial, sans-serif; + font-size: 12pt; + font-weight: bold; + color: #3399FF; + } + +h3 + { + font-family: helvetica, arial, sans-serif; + font-size: 12pt; + font-weight: bold; + line-height: 1.4em; + color: #3399FF; + } + +h4 + { + font-family: helvetica, arial, sans-serif; + font-size: 12pt; + font-weight: bold; + color: #3399FF; + } + +h5 + { + font-family: helvetica, arial, sans-serif; + font-size: 12pt; + font-weight: bold; + color: #3399FF; + } + +h6 { + font-family: helvetica, arial, sans-serif; + font-size: 12pt; + font-weight: bold; + color: #666666; + } + +a:link { + color: #000066; + } + +a:visited + { + color: #333399; + } + +/* not in a div, so need standard left margin */ +.footnotes { + width: 95%; + margin : 10px 20px 10px 20px; + font-size: 12pt; + } + +div.preface, div.colophon, div.chapter, div.appendix, div.index, div.partintro, div.legalnotice, div.glossary, div.refnamediv, div.refsect1 { + margin : 0px 20px 0px 20px; + font-family: helvetica, arial, sans-serif; + } + +/* A, B, etc. in Index */ +div.indexdiv { + font-family: helvetica, arial, sans-serif; + } + +div.titlepage { + margin : 0px 10px 0px 10px; + font-family: helvetica, arial, sans-serif; + } + +/* div.sect1 for an article doesn't have the extra padding from a div.chapter */ +div.article div.sect1 { + margin : 0px 10px 0px 10px; + font-family: helvetica, arial, sans-serif; + } + +/* div.sect1 on same page as div.chapter, etc. with margins and padding already */ +div.chapter div.sect1, div.preface div.sect1, div.appendix div.sect1, div.colophon div.sect1 { + margin : 0px 0px 0px 0px; + font-family: helvetica, arial, sans-serif; + padding: 0; + } + +/* on separate page without div.chapter, so need same padding */ +div.sect1 { + margin : 0px 20px 0px 20px; + font-family: helvetica, arial, sans-serif; + } + +/* same as dev.sect1 except no padding because div.sect1 doesn't end before div.sect2, etc.*/ +div.sect2, div.sect3, div.sect4 { + margin : 0px 0px 0px 0px; + font-family: helvetica, arial, sans-serif; + padding: 0; + } + +/* chapter, preface, and colophon titles don't have a class */ +h1 { + margin : 0px 0px 0px 0px; + font-family: helvetica, arial, sans-serif; + font-size: 18pt; + font-weight: bold; + color: #3399FF; + } + +h1.sect1, h2.sect1 { + /* already in div.sect1, so no margins */ + margin : 0px 0px 0px 0px; + font-family: helvetica, arial, sans-serif; + font-size: 18pt; + font-weight: bold; + color: #3399FF; + } + +h2.sect2, h2.title { + /* already in div.sect1, so no margins */ + margin : 0px 0px 0px 0px; + font-family: helvetica, arial, sans-serif; + font-size: 16pt; + font-weight: bold; + color: #3399FF; + } + +h3.sect3, h3.title { + /* already in div.sect1, so no margins */ + margin : 0px 0px 0px 0px; + font-family: helvetica, arial, sans-serif; + font-size: 14pt; + font-weight: bold; + color: #3399FF; + } + + +h4.sect4, h5.sect5, h6.sect6 { + /* already in div.sect1, so no margins */ + margin : 0px 0px 0px 0px; + font-family: helvetica, arial, sans-serif; + font-size: 12pt; + font-weight: bold; + color: #3399FF; + } + +/* book and article titles on index.html page and part title pages */ +h1.title { + font-family: helvetica, arial, sans-serif; + font-size: 22pt; + font-weight: bold; + color: #3399FF; + margin : 10px 10px 10px 10px; + /* add padding so title is not touching top margin */ + padding: 10 0 0; + } + +body.refentry h1 { + margin: 0 0 0 20px; +} + +div.glossary h1 { + font-family: helvetica, arial, sans-serif; + font-size: 22pt; + font-weight: bold; + color: #3399FF; + margin : 10px 10px 10px 0px; + /* add padding so title is not touching top margin */ + padding: 10 0 0; + } + + +.subtitle { + font-family: helvetica, arial, sans-serif; + font-size: 18pt; + color:#666666; + font-weight: bold; + margin : 10px 10px 10px 10px; + padding: 0; + } + +b.othername { + font-family: helvetica, arial, sans-serif; + font-size: 18pt; + color:#666666; + font-weight: bold; + margin : 10px 10px 10px 10px; + padding: 0; + } + +.copyright, .affiliation { + font-family: helvetica, arial, sans-serif; + font-size: 12pt; + color:#666666; + margin : 10px 10px 10px 10px; + padding: 0; + } + +isbn.isbn { + font-family: helvetica, arial, sans-serif; + font-size: 12pt; + color:#666666; + margin : 10px 10px 10px 10px; + padding: 0; + } + +.toc { + font-family: helvetica, arial, sans-serif; + font-size: 12pt; + padding: 0; + margin : 10px 20px 10px 20px; + } + +.citetitle { + font-family: helvetica, arial, sans-serif; + font-size: 12pt; + color:#666666; + font-weight: bold; + } + +div.qandaset big { + font-family: helvetica, arial, sans-serif; + font-size: 12pt; + color: #3399FF; + } + +.author { + font-family: helvetica, arial, sans-serif; + font-size: 12pt; + color:#3399FF; + font-weight: bold; + margin : 10px; + line-height: 1.4em; + } + +/* make guibuttons look like real buttons */ +.guibutton { + color: #000000; + font-family: helvetica, arial, sans-serif; + background-color: #DCDCDC; + padding: 1px 3px; + font-size: 10pt; + border: outset 2px; + text-decoration: none; + } + diff --git a/generic-release-1.0/performance.sh b/generic-release-1.0/performance.sh new file mode 100644 index 0000000..55df23e --- /dev/null +++ b/generic-release-1.0/performance.sh @@ -0,0 +1,18 @@ +#/bin/bash +#Copyright (c) [2019] Huawei Technologies Co., Ltd. +#generic-release is licensed under the Mulan PSL v2. +#You can use this software according to the terms and conditions of the Mulan PSL v2. +#You may obtain a copy of Mulan PSL v2 at: +# http://license.coscl.org.cn/MulanPSL2 +#THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +#PURPOSE. +#See the Mulan PSL v2 for more details. + +#Disable for GOMP issue with rpmbuild +#CPUNO=`cat /proc/cpuinfo|grep processor|wc -l` +#export GOMP_CPU_AFFINITY=0-$[CPUNO - 1] + +#sysctl -w vm.min_free_kbytes=112640 &> /dev/null +#sysctl -w vm.dirty_ratio=60 &> /dev/null +#sysctl -w kernel.sched_autogroup_enabled=0 &> /dev/null diff --git a/generic-release-1.0/supportinfo b/generic-release-1.0/supportinfo new file mode 100644 index 0000000..01773cc --- /dev/null +++ b/generic-release-1.0/supportinfo @@ -0,0 +1,16 @@ +# Copyright (c) [2019] Huawei Technologies Co., Ltd. +# generic-release is licensed under the Mulan PSL v2. +# You can use this software according to the terms and conditions of the Mulan PSL v2. +# You may obtain a copy of Mulan PSL v2 at: +# http://license.coscl.org.cn/MulanPSL2 +#THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +#PURPOSE. +#See the Mulan PSL v2 for more details. +# +# supported hardware descriptor for {os_name} 1.0 +# + +Variant: AS +MinRAM: 256 MB + diff --git a/generic-release-1.0/system-info.sh b/generic-release-1.0/system-info.sh new file mode 100644 index 0000000..182368b --- /dev/null +++ b/generic-release-1.0/system-info.sh @@ -0,0 +1,86 @@ +#/bin/bash +#Copyright (c) [2019] Huawei Technologies Co., Ltd. +#generic-release is licensed under the Mulan PSL v2. +#You can use this software according to the terms and conditions of the Mulan PSL v2. +#You may obtain a copy of Mulan PSL v2 at: +# http://license.coscl.org.cn/MulanPSL2 +#THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +#PURPOSE. +#See the Mulan PSL v2 for more details. + +# Welcome +welcome=$(uname -r) + +# Memory +memory_total=$(cat /proc/meminfo | awk '/^MemTotal:/ {printf($2)}') +memory_free=$(cat /proc/meminfo | awk '/^MemFree:/ { printf($2)}') +buffers=$(cat /proc/meminfo | awk '/^Buffers:/ { printf($2)}') +cached=$(cat /proc/meminfo | awk '/^Cached:/ { printf($2)}') +sreclaimable=$(cat /proc/meminfo | awk '/^SReclaimable:/ { printf($2)}') +swap_total=$(cat /proc/meminfo | awk '/^SwapTotal:/ { printf($2)}') +swap_free=$(cat /proc/meminfo | awk '/^SwapFree:/ { printf($2)}') + +if [[ $memory_total -gt 0 ]] +then + memory_usage=`echo "scale=1; ($memory_total - $memory_free - $buffers - $cached - $sreclaimable) * 100.0 / $memory_total" |bc` + memory_usage="${memory_usage}%" +else + memory_usage=0.0% +fi + +# Swap memory +if [[ $swap_total -gt 0 ]] +then + swap_mem=`echo "scale=1; ($swap_total - $swap_free) * 100.0 / $swap_total" |bc` + swap_mem="${swap_mem}%" +else + swap_mem=0.0% +fi + +# Usage +usageof=$(df -h / | awk '/\// {print $(NF-1)}') + +# System load +load_average=$(awk '{print $1}' /proc/loadavg) + +# WHO I AM +whoiam=$(whoami) + +# Time +time_cur=$(date) + +# Processes +processes=$(ps aux | wc -l) + +# Users +user_num=$(users | wc -w) + +# Ip address +ip_pre="" +if [ -x "/sbin/ip" ] +then + ip_pre=$(/sbin/ip a | grep inet | grep -v "127.0.0.1" | grep -v inet6 | awk '{print $2}') +fi + +echo -e "\n" +echo -e "Welcome to $welcome\n" +echo -e "System information as of time: \t$time_cur\n" +echo -e "System load: \t\033[0;33;40m$load_average\033[0m" +echo -e "Processes: \t$processes" +echo -e "Memory used: \t$memory_usage" +echo -e "Swap used: \t$swap_mem" +echo -e "Usage On: \t$usageof" +for line in $ip_pre +do + ip_address=${line%/*} + echo -e "IP address: \t$ip_address" +done +echo -e "Users online: \t$user_num" +if [ "$whoiam" == "root" ] +then + echo -e "\n" +else + echo -e "To run a command as administrator(user \"root\"),use \"sudo \"." +fi + diff --git a/generic-release.spec b/generic-release.spec new file mode 100644 index 0000000..c7fcccc --- /dev/null +++ b/generic-release.spec @@ -0,0 +1,217 @@ +%define debug_package %{nil} +%define product_family {os_name} +%define variant_titlecase Server +%define variant_lowercase server +%define dist_release_version 8 +%define generic_version {os_version} +%define generic_release 1 +%define builtin_release_version 1.0 + +%define current_arch %{_arch} +%ifarch i386 +%define current_arch x86 +%endif + +%global boot_args fpi_to_tail=off + +Name: %{product_family}-release +Version: {rpm_version} +Release: %{generic_release} +Summary: %{product_family} release file +License: Mulan PSL v2 +Provides: %{product_family}-release +Provides: %{_vendor}-release +Provides: generic-release +Provides: system-release = {rpm_version} +Source0: generic-release-%{builtin_release_version}.tar.gz +Source1: 85-display-manager.preset +Source2: 90-default.preset +Source3: 99-default-disable.preset + +%if "%{product_family}" != "openEuler" +Provides: openEuler-release +Obsoletes: openEuler-release +Provides: openEuler-latest-release +Obsoletes: openEuler-latest-release +Provides: openEuler-rootfiles +Obsoletes: openEuler-rootfiles +Provides: openEuler-release-custom +Obsoletes: openEuler-release-custom +%endif + +Source4: dot-bashrc +Source5: dot-bash_profile +Source6: dot-bash_logout +Source7: dot-tcshrc +Source8: dot-cshrc + +BuildRequires: python3 +Requires: %{product_family}-repos +Requires: %{product_family}-release-custom +Obsoletes: yum-utils yum-utils-help yum-utils-plugins + +%description +%{product_family} release files + +%package -n %{product_family}-performance +Requires: coreutils systemd setup + +Summary: performance script +%description -n %{product_family}-performance +performance script + +%package -n %{product_family}-rootfiles +Summary: Basic required files for the root user's account +BuildArch: noarch +Conflicts: rootfiles + +%description -n %{product_family}-rootfiles +The rootfiles package contains basic required files that are placed +in the root user's account. These files are basically the same as +those in /etc/skel, which are placed in regular users' home directories. + +%package -n %{product_family}-release-custom +Summary: {os_name}-release-custom +BuildArch: noarch + +%description -n %{product_family}-release-custom +{os_name}-release-custom + +%prep +%setup -q -n generic-release-%{builtin_release_version} + +%postun -n %{product_family}-release-custom +vendorid=`lscpu | grep "Vendor ID:" | awk '{print $3}'` +model=`lscpu | grep "Model:" | awk '{print $2}'` + +if [ "0x70" == "${vendorid}" -a "3" == "${model}" ]; then + grep "%{boot_args}" /etc/grub.d/10_linux > /dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "ERROR: failed to clean up boot args in /etc/grub.d/10_linux because they have been modified" + exit 1 + fi + sed -i "s/%{boot_args} //g" /etc/grub.d/10_linux +fi + +%posttrans -n %{product_family}-release-custom + +# parameters for grub2 + +vendorid=`lscpu | grep "Vendor ID:" | awk '{print $3}'` +model=`lscpu | grep "Model:" | awk '{print $2}'` + +if [ "0x70" == "${vendorid}" -a "3" == "${model}" ]; then + sed -i "s/ ro .*args/ ro %{boot_args} \$\{args/g" /etc/grub.d/10_linux +fi + +%build +echo OK + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT/etc +echo "%{product_family} release %{generic_version}" > $RPM_BUILD_ROOT/etc/%{product_family}-release +ln -sf %{product_family}-release $RPM_BUILD_ROOT/etc/system-release + +# create /etc/os-release +cat << EOF >>$RPM_BUILD_ROOT/etc/os-release +NAME="%{product_family}" +VERSION="%{generic_version}" +ID="%{product_family}" +VERSION_ID="%{generic_version}" +PRETTY_NAME="%{product_family} %{generic_version}" +ANSI_COLOR="0;31" + +EOF + +mkdir -p -m 755 $RPM_BUILD_ROOT/etc/profile.d +cp -a color.sh $RPM_BUILD_ROOT/etc/profile.d/ +cp -a system-info.sh $RPM_BUILD_ROOT/etc/profile.d/ +cp -a performance.sh $RPM_BUILD_ROOT/etc/profile.d/ + +# write cpe to /etc/system/release-cpe +echo "cpe:/o:%{product_family}:%{product_family}:%{generic_version}:ga:server" > $RPM_BUILD_ROOT/etc/system-release-cpe + +# create /etc/issue and /etc/issue.net +echo '\S' > $RPM_BUILD_ROOT/etc/issue +echo 'Kernel \r on an \m' >> $RPM_BUILD_ROOT/etc/issue +cp $RPM_BUILD_ROOT/etc/issue $RPM_BUILD_ROOT/etc/issue.net +echo >> $RPM_BUILD_ROOT/etc/issue + +mkdir -p $RPM_BUILD_ROOT/usr/share/eula +cp eula.[!py]* $RPM_BUILD_ROOT/usr/share/eula + +mkdir -p $RPM_BUILD_ROOT/var/lib +cp supportinfo $RPM_BUILD_ROOT/var/lib/supportinfo + +# set up the dist tag macros +install -d -m 755 $RPM_BUILD_ROOT/etc/rpm +cat >> $RPM_BUILD_ROOT/etc/rpm/macros.dist << EOF +# dist macros. + +%%dist %%{nil} +%%%{product_family} 2 +EOF + +# use unbranded datadir +mkdir -p -m 755 $RPM_BUILD_ROOT/%{_datadir}/%{product_family}-release +install -m 644 EULA $RPM_BUILD_ROOT/%{_datadir}/%{product_family}-release + +# use unbranded docdir +mkdir -p -m 755 $RPM_BUILD_ROOT/%{_docdir}/%{product_family}-release +cp -p License/LICENSE $RPM_BUILD_ROOT/%{_docdir}/%{product_family}-release + +# copy systemd presets +mkdir -p %{buildroot}%{_prefix}/lib/systemd/system-preset/ +install -m 0644 %{SOURCE1} %{buildroot}%{_prefix}/lib/systemd/system-preset/ +install -m 0644 %{SOURCE2} %{buildroot}%{_prefix}/lib/systemd/system-preset/ +install -m 0644 %{SOURCE3} %{buildroot}%{_prefix}/lib/systemd/system-preset/ + +# set root's bash profile +mkdir -p %{buildroot}/root + +install -p -m 644 %{SOURCE4} %{buildroot}/root/.bashrc +install -p -m 644 %{SOURCE5} %{buildroot}/root/.bash_profile +install -p -m 644 %{SOURCE6} %{buildroot}/root/.bash_logout +install -p -m 644 %{SOURCE7} %{buildroot}/root/.tcshrc +install -p -m 644 %{SOURCE8} %{buildroot}/root/.cshrc + +%posttrans -n %{product_family}-rootfiles +if [ $1 -eq 0 ] ; then + cp -ndr --preserve=ownership,timestamps /etc/skel/. /root/ || : +fi + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(0644,root,root,0755) +/etc/system-release +/etc/profile.d/color.sh +/etc/profile.d/system-info.sh +/etc/%{product_family}-release +%config(noreplace) /etc/os-release +%config /etc/system-release-cpe +%config(noreplace) /etc/issue +%config(noreplace) /etc/issue.net +/etc/rpm/macros.dist +%{_docdir}/%{product_family}-release/* +%{_datadir}/%{product_family}-release/* +%{_prefix}/lib/systemd/system-preset/* +/var/lib/supportinfo +/usr/share/eula/eula.* + +%files -n %{product_family}-performance +%defattr(0644,root,root,0755) +/etc/profile.d/performance.sh + +%files -n %{product_family}-rootfiles +%config(noreplace) /root/.bashrc +%config(noreplace) /root/.bash_profile +%config(noreplace) /root/.bash_logout +%config(noreplace) /root/.tcshrc +%config(noreplace) /root/.cshrc + +%files -n %{product_family}-release-custom + +%changelog