diff --git a/README.en.md b/README.en.md index ce681d10efb49fe04729c600140d787c01e0f8a2..a07d8caddefe0d27f37a188b7a8b82ca42880dbe 100644 --- a/README.en.md +++ b/README.en.md @@ -1,7 +1,7 @@ -# openeuler-os-build +# ci_build #### Description -A tool for build openeuler os +{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} #### Software Architecture Software architecture description diff --git a/README.md b/README.md index 06a6523c58615694cb31efe85f432dae2718c714..875f7f67d951a1259948396d7a6be7599f558c17 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ -# openeuler-os-build +# ci_build #### 介绍 -A tool for build openeuler os +{**以下是码云平台说明,您可以替换此简介** +码云是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 +无论是个人、团队、或是企业,都能够用码云实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} #### 软件架构 软件架构说明 @@ -27,11 +29,11 @@ A tool for build openeuler os 4. 新建 Pull Request -#### 特技 +#### 码云特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) +2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) +3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 +4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 +5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) +6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/build.py b/build.py new file mode 100644 index 0000000000000000000000000000000000000000..209664a3b2a2f1505f2b03952190ec5cdfb7c56a --- /dev/null +++ b/build.py @@ -0,0 +1,174 @@ +#!/usr/bin/env python +# -*- coding=utf-8 -*- +# EulerOS build main file +# Author: yhon +# Copyright Huawei Technologies Co., Ltd. 2010-2018. All rights reserved. +""" +make image +""" +import os +import sys +from log import log_init +from utils import rm, trace_execute + +CUR_DIR = os.path.dirname(os.path.realpath(__file__)) +PARAMS = ['all', 'set_release_dir', 'update_release_info', 'build_and_wait', 'make_tar', 'make_hmi', + 'make_iso', 'make_docker_image', 'make_raspi_image', 'make_compile_env_cross', + 'make_compile_env_cross_storage', 'make_iso_debug', 'make_livecd', 'make_compile_env', + 'make_compile_env_storage', 'make_euleros_certdb', 'make_vm_qcow2', 'make_compile_tools', 'make_images_slim', + 'make_tools_lib_storage', 'make_container_tools', 'make_tools_debug_tools', 'make_upgrade_patch', + 'make_tools_dockertools', 'make_other_tools', 'upload_to_cmc', 'make_upload_cmc_image', 'make_iso_everything', + 'make_iso_everysrc', 'make_debug_everything', 'push_lts_dir', 'make_netinst_iso', 'get_epol_rpms'] + + +class Build(object): + """ + build + """ + version = "" + obs_ip = "" + local_dist_dir = "" + local_build_shell_path = "" + local_project_path = "" + env = os.environ.copy() + + def __init__(self): + """ + 初始化构建过程中需要用到的本地目录和构建所需要的参数 + """ + self.init_dir() + + def init_dir(self): + """ + 初始化构建过程中需要用到的本地目录 + """ + self.local_project_path = os.path.join(CUR_DIR, "..", "..") + self.local_dist_dir = os.path.join(CUR_DIR, "..", "output") + self.local_build_shell_path = os.path.join(CUR_DIR, "script", "make_version.sh") + return True + + def prepare_env(self, logger): + """ + 注入shell构建脚本所需要的环境变量 + @param logger: for log handle + """ + logger.info("* start prepare_env *") + self.env["MYVERSION"] = self.version + self.env["OUTPUT_PATH"] = self.local_dist_dir + self.env["PROJECT_PATH"] = self.local_project_path + self.env["ISCI"] = "0" + if self.env["LOCAL_BUILD"] == "1": + logger.info("start to set_release_dir") + code = trace_execute("bash {0} {1}".format(self.local_build_shell_path, "set_release_dir"), env=self.env, + logger=logger) + if code != 0 and code != "0": + return False + return True + + def set_obs_project(self, obs_standard_prj, obs_epol_prj, obs_extras_prj): + """ + obs_standard_prj: + obs_epo_prj: + obs_extras_prj: + """ + cmd = "sed -i 's/OBS_STANDARD_PROJECT=.*/OBS_STANDARD_PROJECT=%s/g' script/setup_env.sh" % obs_standard_prj + rmsg = os.popen(cmd).read() + print(rmsg) + cmd = "sed -i 's/OBS_EPOL_PROJECT=.*/OBS_EPOL_PROJECT=%s/g' script/setup_env.sh" % obs_epol_prj + rmsg = os.popen(cmd).read() + print(rmsg) + cmd = "sed -i 's/OBS_EXTRAS_PROJECT=.*/OBS_EXTRAS_PROJECT=%s/g' script/setup_env.sh" % obs_extras_prj + rmsg = os.popen(cmd).read() + print(rmsg) + + def clean(self): + """ + 清空构建目录 + """ + print("start clean output dir") + rm(os.path.join(self.local_dist_dir, "*")) + rm(os.path.join(CUR_DIR, "__pycache__")) + rm(os.path.join(CUR_DIR, "*.pyc")) + print("end") + return 0 + + def build(self, step=None): + """ + 执行本地构建 + @param step: 本地构建步骤名,详情参考使用说明 + """ + self.clean() + + logger = log_init() + if not self.prepare_env(logger): + return -1 + + if step: + code = trace_execute("bash -x {0} {1}".format( + self.local_build_shell_path, step), env=self.env, logger=logger) + if code != 0 and code != "0": + logger.error("build fail") + return -1 + else: + logger.info("build success") + return 0 + else: + logger.error("step be required") + return -1 + + +def usage(): + """ + build 使用说明 + """ + print(" zero or one parameter be needed ") + print("***********************************") + print("* usage for this build script *") + print("* *") + print("* build.py COMMAND *") + print("* *") + print("* Commands: *") + print("* all default *") + print("* clean *") + print("* make_tar *") + print("* make_hmi *") + print("* make_iso *") + print("* make_livecd *") + print("* build_and_wait *") + print("* make_iso_debug *") + print("* make_netinst_iso *") + print("* make_compile_env *") + print("* make_euleros_certdb *") + print("* update_release_info *") + print("* make_upgrade_patch *") + print("* make_docker_image *") + print("* make_raspi_image *") + print("* make_container_tools *") + print("* make_tools_othertools *") + print("* make_tools_lib_storage *") + print("* make_tools_debug_tools *") + print("* get_epol_rpms *") + print("* *") + print("***********************************") + return -1 + + +if __name__ == "__main__": + import argparse + par = argparse.ArgumentParser() + par.add_argument("-i", "--step_info", help="what you want to do", required=True) + par.add_argument("-s", "--obs_standard_prj", help="obs standard project", required=True) + par.add_argument("-ep", "--obs_epol_prj", help="obs epol project", required=True) + par.add_argument("-ex", "--obs_extras_prj", help="obs extras project", required=True) + args = par.parse_args() + + build = Build() + build.set_obs_project(args.obs_standard_prj, args.obs_epol_prj, args.obs_extras_prj) + one_step = args.step_info + if one_step == "clean": + ret = build.clean() + elif one_step not in PARAMS: + ret = usage() + else: + ret = build.build(one_step) + exit(ret) diff --git a/log.py b/log.py new file mode 100644 index 0000000000000000000000000000000000000000..2079bca8ea3ba89f3a7b723dd69aa6f1478efe22 --- /dev/null +++ b/log.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python +# -*- coding=utf-8 -*- +# init log file,two ways for log,one is log file other one is console output +# Author: yhon +# Copyright Huawei Technologies Co., Ltd. 2010-2018. All rights reserved. +""" +log +""" +import logging +import os.path +import time + +CUR_DIR = os.path.dirname(os.path.realpath(__file__)) + + +def log_init(): + """ + init log handle + """ + log = logging.getLogger() + log.setLevel(logging.INFO) + + # set log file location,the file on the output dir + log_path = os.path.join(os.path.join(CUR_DIR, ".."), "output") + if not os.path.exists(log_path): + os.makedirs(log_path) + # set log format + formatter = logging.Formatter("%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s") + + # if log file path exist, init log file handler + if os.path.exists(log_path): + rq = time.strftime('build', time.localtime(time.time())) + logfile = os.path.join(log_path, "{0}.log".format(rq)) + + # set file handler + fh = logging.FileHandler(logfile, mode='w') + fh.setLevel(logging.DEBUG) + fh.setFormatter(formatter) + log.addHandler(fh) + + # set console output handler + ch = logging.StreamHandler() + ch.setLevel(logging.INFO) + ch.setFormatter(formatter) + log.addHandler(ch) + + return log + diff --git a/script/common_function.sh b/script/common_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..4978592701aa4efa1361499e934b7243109bad93 --- /dev/null +++ b/script/common_function.sh @@ -0,0 +1,129 @@ +#!/bin/bash +# Author: yhon +# Copyright Huawei Technologies Co., Ltd. 2010-2018. All rights reserved. +set -e + +###################### +# 修改远程配置 +# Globals: +# Arguments: +# Returns: +###################### +function modify_remote_config() +{ + ITEM="$1" + ITEM="${ITEM%_in_docker}" + STATUS="$2" + for exclude_script in "${EXCLUDE_REGISTER_SCRIPT[@]}" + do + if [ "${ITEM}" == "BUILD_${exclude_script}" ]; then + return 0 + fi + done + product_list='' + for product in $(echo "${PRODUCTS}") + do + product_list="config_${product} ${product_list}" + done + #SSH_CMD="pushd ${HTTP_DIR}/${PRE_VERSION}/${VERSION}; sed -i \"/${ITEM}=/d\" ${product_list}; sed -i \"/#BUILD_RESULT/a ${ITEM}=${STATUS}\" ${product_list}; chmod -R 755 ${product_list}; popd" + #sshcmd "${SSH_CMD}" +} + +###################### +# clear and exit +# Globals: +# Arguments: +# Returns: +###################### +function clean_and_exit() +{ + if [ "$1" -ne "0" ]; then + modify_remote_config "BUILD_${SCRIPT}" 3 + echo "=========error start=========" + cat "${ERROR_LOG}" + echo "=========error end=========" + exit "$1" + fi +} + +###################### +# 执行对应的函数 +# Globals: +# Arguments:函数名、函数所需要参数 +# Returns: +###################### +function run_srcipt() +{ + script="$1" + shift + args="$@" + export SCRIPT="${script}" + modify_remote_config "BUILD_${SCRIPT}" 1 + log_info "Start run ${script} ${args} at $(date)" + eval "${script}" "${args}" + if [ $? -ne 0 ]; then + echo "[ERROR]: Run ${script} ${args} failed at $(date)" + clean_and_exit 1 + fi + log_info "Finished run ${script} ${args} at $(date)" + modify_remote_config "BUILD_${SCRIPT}" 2 + clean_and_exit 0 +} + +###################### +# 执行ALL_SCRIPT中所有的函数 +# Globals: +# Arguments: +# Returns: +###################### +function run_srcipt_all() +{ + scripts="$@" + for script in "${ALL_SCRIPT[@]}" + do + run_srcipt "${script}" + done + +} +source "${BUILD_SCRIPT_DIR}"/setup_env.sh +source "${BUILD_SCRIPT_DIR}"/make_tools/init.sh +source "${BUILD_SCRIPT_DIR}"/make_tools/common.sh +#source "${BUILD_SCRIPT_DIR}"/make_tools/container_tools.sh +source "${BUILD_SCRIPT_DIR}"/make_tools/debug_tools.sh +source "${BUILD_SCRIPT_DIR}"/make_tools/lib_storage_tools.sh ## x86 +source "${BUILD_SCRIPT_DIR}"/make_tools/docker_tools.sh +#source "${BUILD_SCRIPT_DIR}"/make_tools/other_tool.sh +source "${BUILD_SCRIPT_DIR}"/step/get_version.sh +source "${BUILD_SCRIPT_DIR}"/step/release_dir.sh +#source "${BUILD_SCRIPT_DIR}"/step/createrepo.sh +source "${BUILD_SCRIPT_DIR}"/step/make_docker_image.sh +source "${BUILD_SCRIPT_DIR}"/step/make_raspi_image.sh +source "${BUILD_SCRIPT_DIR}"/step/make_gcov.sh +source "${BUILD_SCRIPT_DIR}"/step/merge_release_html.sh +#source "${BUILD_SCRIPT_DIR}"/step/build_and_wait.sh +source "${BUILD_SCRIPT_DIR}"/step/make_iso.sh +source "${BUILD_SCRIPT_DIR}"/step/get_epol_rpms.sh +source "${BUILD_SCRIPT_DIR}"/step/make_iso_debug.sh +source "${BUILD_SCRIPT_DIR}"/step/make_netinst_iso.sh +source "${BUILD_SCRIPT_DIR}"/step/make_iso_everything.sh +source "${BUILD_SCRIPT_DIR}"/step/make_debug_everything.sh +source "${BUILD_SCRIPT_DIR}"/step/make_iso_everysrc.sh +source "${BUILD_SCRIPT_DIR}"/step/make_tar.sh +#source "${BUILD_SCRIPT_DIR}"/step/make_compile_env.sh +#source "${BUILD_SCRIPT_DIR}"/step/make_compile_env_cross.sh +#source "${BUILD_SCRIPT_DIR}"/step/make_livecd.sh +source "${BUILD_SCRIPT_DIR}"/step/make_images_slim.sh +#source "${BUILD_SCRIPT_DIR}"/step/make_euleros_certdb.sh +#source "${BUILD_SCRIPT_DIR}"/step/make_compile_tools.sh +#source "${BUILD_SCRIPT_DIR}"/step/make_upgrade_patch.sh +source "${BUILD_SCRIPT_DIR}"/step/make_hmi.sh +#source "${BUILD_SCRIPT_DIR}"/step/push_lts_dir.sh +### common +source "${BUILD_SCRIPT_DIR}"/step/merge_release_html.sh +#source "${BUILD_SCRIPT_DIR}"/step/make_upload_cmc_image.sh +#source "${BUILD_SCRIPT_DIR}"/step/upload_to_cmc.sh +source "${BUILD_SCRIPT_DIR}"/step/update_release_info.sh +#source "${BUILD_SCRIPT_DIR}"/step/make_cmc_file.sh +### arm +source "${BUILD_SCRIPT_DIR}"/step/make_vm_qcow2.sh +source "${BUILD_SCRIPT_DIR}"/step/mkdliso_hyperstackos.sh diff --git a/script/config.sh b/script/config.sh new file mode 100644 index 0000000000000000000000000000000000000000..11c3cc04626d9299985c1f5257e8b80fd8f1c6b9 --- /dev/null +++ b/script/config.sh @@ -0,0 +1,5 @@ +#!/bin/bash +export REPO_ROOT="/usr1/Euleros_yum" +export YUM_CONF_FLAG=0 +set -ue + diff --git a/script/config/compile_tools.xml b/script/config/compile_tools.xml new file mode 100644 index 0000000000000000000000000000000000000000..ddd5292d165a462e195f95f96f2938851401fde8 --- /dev/null +++ b/script/config/compile_tools.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/script/config/config_temp b/script/config/config_temp new file mode 100644 index 0000000000000000000000000000000000000000..3a8d8a38b6f25279286f6939c54bb58b0c1fa21f --- /dev/null +++ b/script/config/config_temp @@ -0,0 +1,51 @@ +#!/usr/bin/env + +VERSION_C="openeuler" +TAR_NAME="" +VERSION_B="" +PRODUCT="PANGEA" +ARCH="ARM64" +TIME="" + +####RELEASE########## +RELEASE_USER="root" +RELEASE_PASSWD="$dogshengpwd82" + +CI_PROJECT="openeuler_ARM64" +HTTP_RELEASE_DIR="http://${RELEASE_IP}/internal_use_only/EulerOS/${VERSION_C}/${CI_PROJECT}" +SSH_RELEASE_DIR="/repo/openeuler/dailybuild/internal_use_only/EulerOS/${VERSION_C}/${CI_PROJECT}" +RELEASE_FILE="release" +RELEASE_CONFIG_FILE="${SSH_RELEASE_DIR}/config_${PRODUCT}" + + +############################for pxe##################### +PXE_SERVER_IP="10.175.124.178" +PXE_SERVER_USER="root" +PXE_SERVER_PASSWD="huawei1abc" +pxe_tftpboot="/tftpboot" +pxe_config_dir="${pxe_tftpboot}/pxelinux.cfg" +pxe_boot_dir="${pxe_tftpboot}/boot_image/${VERSION_C}/${PRODUCT}/${ARCH}/${VERSION_B}" +pxe_repo_dir="/srv/ftp/auto_version/${VERSION_C}/${PRODUCT}/${ARCH}/${VERSION_B}" + +HTTP_TESTCASE_DIR="http://${PXE_SERVER_IP}/EulerOS_test/${VERSION_C}/${PRODUCT}/${ARCH}/${VERSION_B}/testcase_bin" +HTTP_TESTFRAME_DIR="http://${PXE_SERVER_IP}/EulerOS_test/${VERSION_C}/${PRODUCT}/${ARCH}/${VERSION_B}/testframe_bin" +SSH_TESTCASE_DIR="/repo/openeuler/dailybuild/EulerOS_test/${VERSION_C}/${PRODUCT}/${ARCH}/${VERSION_B}/testcase_bin" +SSH_TESTFRAME_DIR="/repo/openeuler/dailybuild/EulerOS_test/${VERSION_C}/${PRODUCT}/${ARCH}/${VERSION_B}/testframe_bin" + +pxe_config_string="LABEL ${PRODUCT}-${ARCH}-${VERSION_B}\n\ +kernel /boot_image/${VERSION_C}/${PRODUCT}/${ARCH}/${VERSION_B}/lastest/boot/linux\n\ +append initrd=/boot_image/${VERSION_C}/${PRODUCT}/${ARCH}/${VERSION_B}/lastest/boot/initrd install_mode=install install_media=pxe install_repo=ftp://${PXE_SERVER_IP}/auto_version/${VERSION_C}/${PRODUCT}/${ARCH}/${VERSION_B}/lastest/?u=anonymous&p= net_cfg=eth0,,dhcp,, log_level=7 install_log=nfs://${PXE_SERVER_IP}/srv/nfs/install_log/xxx_ip disk_scan_timeout=30" + + +#0:not start, 1:doing, 2:success, 3:failed +#BUILD_RESULT +BUILD_STATUS=1 +BUILD_build_and_wait=0 +BUILD_make_tar=0 +BUILD_make_euleros_certdb=0 +BUILD_make_compile_tools=0 +BUILD_make_compile_env_cross=0 + +#TEST_RESULT +AT_STATUS=0 +AT_run_testcase=0 diff --git a/script/config/docker_image/Env.pm b/script/config/docker_image/Env.pm new file mode 100644 index 0000000000000000000000000000000000000000..4440a8f74cb73cc0ad16be70249feb1f9ce762a0 --- /dev/null +++ b/script/config/docker_image/Env.pm @@ -0,0 +1,254 @@ +package Env; + +our $VERSION = '1.04'; + +=head1 NAME + +Env - perl module that imports environment variables as scalars or arrays + +=head1 SYNOPSIS + + use Env; + use Env qw(PATH HOME TERM); + use Env qw($SHELL @LD_LIBRARY_PATH); + +=head1 DESCRIPTION + +Perl maintains environment variables in a special hash named C<%ENV>. For +when this access method is inconvenient, the Perl module C allows +environment variables to be treated as scalar or array variables. + +The C function ties environment variables with suitable +names to global Perl variables with the same names. By default it +ties all existing environment variables (C) to scalars. If +the C function receives arguments, it takes them to be a list of +variables to tie; it's okay if they don't yet exist. The scalar type +prefix '$' is inferred for any element of this list not prefixed by '$' +or '@'. Arrays are implemented in terms of C and C, using +C<$Config::Config{path_sep}> as the delimiter. + +After an environment variable is tied, merely use it like a normal variable. +You may access its value + + @path = split(/:/, $PATH); + print join("\n", @LD_LIBRARY_PATH), "\n"; + +or modify it + + $PATH .= ":."; + push @LD_LIBRARY_PATH, $dir; + +however you'd like. Bear in mind, however, that each access to a tied array +variable requires splitting the environment variable's string anew. + +The code: + + use Env qw(@PATH); + push @PATH, '.'; + +is equivalent to: + + use Env qw(PATH); + $PATH .= ":."; + +except that if C<$ENV{PATH}> started out empty, the second approach leaves +it with the (odd) value "C<:.>", but the first approach leaves it with "C<.>". + +To remove a tied environment variable from +the environment, assign it the undefined value + + undef $PATH; + undef @LD_LIBRARY_PATH; + +=head1 LIMITATIONS + +On VMS systems, arrays tied to environment variables are read-only. Attempting +to change anything will cause a warning. + +=head1 AUTHOR + +Chip Salzenberg EFE +and +Gregor N. Purdy EFE + +=cut + +sub import { + my ($callpack) = caller(0); + my $pack = shift; + my @vars = grep /^[\$\@]?[A-Za-z_]\w*$/, (@_ ? @_ : keys(%ENV)); + return unless @vars; + + @vars = map { m/^[\$\@]/ ? $_ : '$'.$_ } @vars; + + eval "package $callpack; use vars qw(" . join(' ', @vars) . ")"; + die $@ if $@; + foreach (@vars) { + my ($type, $name) = m/^([\$\@])(.*)$/; + if ($type eq '$') { + tie ${"${callpack}::$name"}, Env, $name; + } else { + if ($^O eq 'VMS') { + tie @{"${callpack}::$name"}, Env::Array::VMS, $name; + } else { + tie @{"${callpack}::$name"}, Env::Array, $name; + } + } + } +} + +sub TIESCALAR { + bless \($_[1]); +} + +sub FETCH { + my ($self) = @_; + $ENV{$$self}; +} + +sub STORE { + my ($self, $value) = @_; + if (defined($value)) { + $ENV{$$self} = $value; + } else { + delete $ENV{$$self}; + } +} + +###################################################################### + +package Env::Array; + +use Config; +use Tie::Array; + +@ISA = qw(Tie::Array); + +my $sep = $Config::Config{path_sep}; + +sub TIEARRAY { + bless \($_[1]); +} + +sub FETCHSIZE { + my ($self) = @_; + return 1 + scalar(() = $ENV{$$self} =~ /\Q$sep\E/g); +} + +sub STORESIZE { + my ($self, $size) = @_; + my @temp = split($sep, $ENV{$$self}); + $#temp = $size - 1; + $ENV{$$self} = join($sep, @temp); +} + +sub CLEAR { + my ($self) = @_; + $ENV{$$self} = ''; +} + +sub FETCH { + my ($self, $index) = @_; + return (split($sep, $ENV{$$self}))[$index]; +} + +sub STORE { + my ($self, $index, $value) = @_; + my @temp = split($sep, $ENV{$$self}); + $temp[$index] = $value; + $ENV{$$self} = join($sep, @temp); + return $value; +} + +sub EXISTS { + my ($self, $index) = @_; + return $index < $self->FETCHSIZE; +} + +sub DELETE { + my ($self, $index) = @_; + my @temp = split($sep, $ENV{$$self}); + my $value = splice(@temp, $index, 1, ()); + $ENV{$$self} = join($sep, @temp); + return $value; +} + +sub PUSH { + my $self = shift; + my @temp = split($sep, $ENV{$$self}); + push @temp, @_; + $ENV{$$self} = join($sep, @temp); + return scalar(@temp); +} + +sub POP { + my ($self) = @_; + my @temp = split($sep, $ENV{$$self}); + my $result = pop @temp; + $ENV{$$self} = join($sep, @temp); + return $result; +} + +sub UNSHIFT { + my $self = shift; + my @temp = split($sep, $ENV{$$self}); + my $result = unshift @temp, @_; + $ENV{$$self} = join($sep, @temp); + return $result; +} + +sub SHIFT { + my ($self) = @_; + my @temp = split($sep, $ENV{$$self}); + my $result = shift @temp; + $ENV{$$self} = join($sep, @temp); + return $result; +} + +sub SPLICE { + my $self = shift; + my $offset = shift; + my $length = shift; + my @temp = split($sep, $ENV{$$self}); + if (wantarray) { + my @result = splice @temp, $offset, $length, @_; + $ENV{$$self} = join($sep, @temp); + return @result; + } else { + my $result = scalar splice @temp, $offset, $length, @_; + $ENV{$$self} = join($sep, @temp); + return $result; + } +} + +###################################################################### + +package Env::Array::VMS; +use Tie::Array; + +@ISA = qw(Tie::Array); + +sub TIEARRAY { + bless \($_[1]); +} + +sub FETCHSIZE { + my ($self) = @_; + my $i = 0; + while ($i < 127 and defined $ENV{$$self . ';' . $i}) { $i++; }; + return $i; +} + +sub FETCH { + my ($self, $index) = @_; + return $ENV{$$self . ';' . $index}; +} + +sub EXISTS { + my ($self, $index) = @_; + return $index < $self->FETCHSIZE; +} + +sub DELETE { } + +1; diff --git a/script/config/docker_image/config.xml b/script/config/docker_image/config.xml new file mode 100644 index 0000000000000000000000000000000000000000..d2aff903a62effc136f81544706a403886a835ac --- /dev/null +++ b/script/config/docker_image/config.xml @@ -0,0 +1,195 @@ + + + + + openEuler + community@openeuler.org + openEuler V1.0 docker container + + + + + + + + + 1.0.0 + yum + false + true + en_US + us.map.gz + utc + Asia/Beijing + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/script/config/docker_image/group b/script/config/docker_image/group new file mode 100644 index 0000000000000000000000000000000000000000..d7538267ccab6be121344593e104b6cc63573f52 --- /dev/null +++ b/script/config/docker_image/group @@ -0,0 +1,24 @@ +root:x:0: +bin:x:1: +daemon:x:2: +sys:x:3: +adm:x:4: +tty:x:5: +disk:x:6: +lp:x:7: +mem:x:8: +kmem:x:9: +wheel:x:10: +cdrom:x:11: +mail:x:12: +man:x:15: +dialout:x:18: +floppy:x:19: +games:x:20: +tape:x:30: +video:x:39: +ftp:x:50: +lock:x:54: +audio:x:63: +nobody:x:99: +users:x:100: diff --git a/script/config/docker_image/images.sh b/script/config/docker_image/images.sh new file mode 100644 index 0000000000000000000000000000000000000000..fe439bd805abe8a414aeedaac86d27ebf2561148 --- /dev/null +++ b/script/config/docker_image/images.sh @@ -0,0 +1,70 @@ +#!/bin/bash +# Author: xudengfeng +# Copyright Huawei Technologies Co., Ltd. 2010-2018. All rights reserved. +set -e +test -f /.kconfig && . /.kconfig +test -f /.profile && . /.profile + +echo "Configure image: [${kiwi_iname}]..." + +euler_version=${kiwi_iname%%-*} +compile_time=${kiwi_iname#*-} +echo "eulerversion=${euler_version}" > /etc/EulerLinux.conf +echo "compiletime=${compile_time}" >> /etc/EulerLinux.conf + +set +e +# Security enforce +export EULEROS_SECURITY=0 +# TODO remove +/usr/sbin/security-tool.sh -d / -c /etc/openEuler_security/security.conf -u /etc/openEuler_security/usr-security.conf -l /var/log/openEuler-security.log -s +echo "export TMOUT=300" >> /etc/bashrc + +[ -n /boot ] && rm -rf /boot + +#a few systemd things +[ -n /etc/machine-id ] && rm -rf /etc/machine-id +[ -n /usr/lib/systemd/system/multi-user.target.wants/getty.target ] && rm -rf /usr/lib/systemd/system/multi-user.target.wants/getty.target +[ -n /usr/lib/systemd/system/multi-user.target.wants/systemd-logind.service ] && rm -rf /usr/lib/systemd/system/multi-user.target.wants/systemd-logind.service + +#locales +#strip most of the languages from the archive. +localedef --delete-from-archive $(localedef --list-archive | grep -v -i ^en_US | xargs ) +#prep the archive template +mv /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl +#rebuild archive +/usr/sbin/build-locale-archive +#empty the template +:>/usr/lib/locale/locale-archive.tmpl + +cd /usr/share/i18n/charmaps;rm -rf $(ls | grep -v ^UTF-8.gz$ | xargs ) +cd /usr/share/i18n/locales;rm -rf $(ls | grep -v ^en_US$ | xargs ) +rm -rf /usr/share/locale/* + +#Generate installtime file record +#/bin/date +%Y%m%d_%H%M > /etc/BUILDTIME + +#man pages and documentation +#find /usr/share/{man,doc,info} -type f | xargs /bin/rm +rm -rf /usr/share/{man,doc,info,mime} + +#sln +rm -f /sbin/sln + +#ldconfig +[ -n /etc/ld.so.cache ] && rm -rf /etc/ld.so.cache +[ -d /var/cache/ldconfig ] && rm -rf /var/cache/ldconfig/* +[ -d /var/cache/yum ] && rm -rf /var/cache/yum/* + +[ -n /var/lib/yum ] && rm -rf /var/lib/yum +[ -n /var/lib/systemd/catalog/database ] && rm -rf /var/lib/systemd/catalog/database +[ -d /var/log ] && rm -rf /var/log/*.log +[ -d /var/lib/dnf ] && rm -rf /var/lib/dnf/* +[ -d /var/lib/systemd ] && rm -rf /var/lib/systemd/random-seed +set -e +rpm -e --nodeps shadow +[ -d /var/lib/rpm ] && rm -rf /var/lib/rpm/__db.* +rm -f /etc/default/useradd.rpmsave /etc/login.defs.rpmsave +# openEuler_chroot will change /etc/hosts in host, we should change it back with hosts.rpmnew +# mv /etc/hosts.rpmnew /etc/hosts + +exit diff --git a/script/config/docker_image/passwd b/script/config/docker_image/passwd new file mode 100644 index 0000000000000000000000000000000000000000..c1da9487cd02b376ba6d10fbab0a9cfaa8e891f6 --- /dev/null +++ b/script/config/docker_image/passwd @@ -0,0 +1,13 @@ +root:x:0:0:root:/root:/bin/bash +bin:x:1:1:bin:/bin:/sbin/nologin +daemon:x:2:2:daemon:/sbin:/sbin/nologin +adm:x:3:4:adm:/var/adm:/sbin/nologin +lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin +sync:x:5:0:sync:/sbin:/bin/sync +shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown +halt:x:7:0:halt:/sbin:/sbin/halt +mail:x:8:12:mail:/var/spool/mail:/sbin/nologin +operator:x:11:0:operator:/root:/sbin/nologin +games:x:12:100:games:/usr/games:/sbin/nologin +ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin +nobody:x:99:99:Nobody:/:/sbin/nologin diff --git a/script/config/livecd/bep_conf/bep_clean.conf b/script/config/livecd/bep_conf/bep_clean.conf new file mode 100644 index 0000000000000000000000000000000000000000..62104d6388c51093726a8e4b035137b3528803c8 --- /dev/null +++ b/script/config/livecd/bep_conf/bep_clean.conf @@ -0,0 +1,8 @@ +/var/log/anaconda/anaconda.log +/var/log/anaconda/dbus.log +/var/log/anaconda/dnf.librepo.log +/var/log/anaconda/packaging.log +/var/log/anaconda/program.log +/var/log/anaconda/hawkey.log +/var/lib/systemd/catalog/database +/var/lib/systemd/random-seed diff --git a/script/config/livecd/bep_conf/bep_remove.conf b/script/config/livecd/bep_conf/bep_remove.conf new file mode 100644 index 0000000000000000000000000000000000000000..f0a693fb03482b1e057b012cf4fc364774eeeb06 --- /dev/null +++ b/script/config/livecd/bep_conf/bep_remove.conf @@ -0,0 +1,5 @@ +/var/lib/dnf/history.sqlite +/var/lib/dnf/history.sqlite-shm +/var/lib/dnf/history.sqlite-wal +/var/log/anaconda/ks-script* +/tmp/ks-script* diff --git a/script/config/livecd/euleros-livecd_aarch64.ks b/script/config/livecd/euleros-livecd_aarch64.ks new file mode 100644 index 0000000000000000000000000000000000000000..f7bbda9725811a03741d59f338ffa5cfdda8f7cc --- /dev/null +++ b/script/config/livecd/euleros-livecd_aarch64.ks @@ -0,0 +1,63 @@ +# Minimal Disk Image +# +# Firewall configuration +firewall --enabled +# Use network installation +url --url="http://euleros-obs-repo.huawei.com:82/EulerOS_ALL_V3R1/PRODUCT_NAME/" +# Root password +rootpw --iscrypted $6$tmWZYrc3$Eyo4oYekTBYDrU0Okyw2vFWuJaqp4mY3cJro9qBdXl24kiarFENlIkcNYHmEtf/AO3cTqFjVitmRZcXajOpU00 + +# Network information +network --bootproto=dhcp --onboot=on --activate +# System keyboard +keyboard --xlayouts=us --vckeymap=us +# System language +lang en_US.UTF-8 +# SELinux configuration +selinux --enforcing +# Installation logging level +logging --level=info +# Shutdown after installation +shutdown +# System timezone +timezone Asia/Beijing +# System bootloader configuration +bootloader --location=mbr +# Clear the Master Boot Record +zerombr +# Partition clearing information +clearpart --all +# Disk partitioning information +part / --fstype="ext4" --size=4000 +part swap --size=1000 + +%post + +touch /etc/sysconfig/network + +cat << EOF > /etc/sysconfig/network-scripts/ifcfg-eth0 +TYPE=Ethernet +BOOTPROTO=dhcp +NAME=eth0 +DEVICE=eth0 +ONBOOT=yes +EOF + +rm -rf /etc/systemd/system/multi-user.target.wants/kbox.service +rm -rf /etc/systemd/system/multi-user.target.wants/kdump.service +rm -rf /usr/lib/systemd/system/kbox.service +rm -rf /usr/lib/systemd/system/kdump.service +rm -rf /boot/initramfs* + +%end + +%packages --excludedocs +@core --nodefaults +dracut-live +dracut-network +grub2 +grub2-efi-aa64-cdboot +shim +euleros-logos +kernel +%end diff --git a/script/config/livecd/euleros-livecd_x86_64.ks b/script/config/livecd/euleros-livecd_x86_64.ks new file mode 100644 index 0000000000000000000000000000000000000000..867a66a393d3b4ac5aefe9315277645f262c83ac --- /dev/null +++ b/script/config/livecd/euleros-livecd_x86_64.ks @@ -0,0 +1,104 @@ +# Minimal Disk Image +# +# Firewall configuration +firewall --enabled +# Use network installation +url --url="http://euleros-obs-repo.huawei.com:82/EulerOS_ALL_V3R1/PRODUCT_NAME/" +# Root password +rootpw --iscrypted $6$tmWZYrc3$Eyo4oYekTBYDrU0Okyw2vFWuJaqp4mY3cJro9qBdXl24kiarFENlIkcNYHmEtf/AO3cTqFjVitmRZcXajOpU00 + +# Network information +network --bootproto=dhcp --onboot=on --activate +# System keyboard +keyboard --xlayouts=us --vckeymap=us +# System language +lang en_US.UTF-8 +# SELinux configuration +selinux --enforcing +# Installation logging level +logging --level=info +# Shutdown after installation +shutdown +# System timezone +timezone Asia/Beijing +# System bootloader configuration +bootloader --location=mbr +# Clear the Master Boot Record +zerombr +# Partition clearing information +clearpart --all +# Disk partitioning information +part / --fstype="ext4" --size=4000 +part swap --size=1000 + +%post + +touch /etc/sysconfig/network + +cat << EOF > /etc/sysconfig/network-scripts/ifcfg-eth0 +TYPE=Ethernet +BOOTPROTO=dhcp +NAME=eth0 +DEVICE=eth0 +ONBOOT=yes +EOF + +rm -rf /etc/systemd/system/multi-user.target.wants/kbox.service +rm -rf /etc/systemd/system/multi-user.target.wants/kdump.service +rm -rf /usr/lib/systemd/system/kbox.service +rm -rf /usr/lib/systemd/system/kdump.service + +%end + +%packages --excludedocs +@core --nodefaults +gtk2.x86_64 +strace +vim-minimal +openssh-server +setup +passwd +findutils +sudo +util-linux +net-tools +iproute +rsyslog +rootfiles +openssh-clients +dhclient +yum-plugin-priorities.noarch +euleros-latest-release +kernel +memtest86+ +grub2-efi-x64 +grub2 +shim-x64 +syslinux +grub2-efi-x64-cdboot +euleros-logos +smartmontools +pciutils +pciutils-libs +libpciaccess +lsscsi +libnl +lftp +zip +unzip +dosfstools +btrfs-progs +genisoimage +nfs-utils +iscsi-initiator-utils +libiscsi +dhcp +dracut-live +-dracut-config-rescue +-grub2-efi-ia32-cdboot +-kbox-kmod +-kdump +-kexec-tools +-dump_mem_tool +-libnl +%end diff --git a/script/config/livecd/live/aarch64.tmpl b/script/config/livecd/live/aarch64.tmpl new file mode 100644 index 0000000000000000000000000000000000000000..8121efe4040251f04a85e3fc0f3f97c4b9aef456 --- /dev/null +++ b/script/config/livecd/live/aarch64.tmpl @@ -0,0 +1,85 @@ +<%page args="kernels, runtime_img, basearch, inroot, outroot, product, isolabel"/> +<% +configdir="tmp/config_files/aarch64" +PXEBOOTDIR="images/pxeboot" +KERNELDIR=PXEBOOTDIR +LORAXDIR="usr/share/lorax/" +LIVEDIR="LiveOS" + + +from os.path import basename +%> + +## Test ${runtime_img} to see if udf is needed +<% + import os + from pylorax.sysutils import joinpaths + if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3: + udfargs = "-allow-limited-size" + else: + udfargs = "" +%> +mkdir ${LIVEDIR} +install ${runtime_img} ${LIVEDIR}/squashfs.img +treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img + + +## install kernels +mkdir ${KERNELDIR} +%for kernel in kernels: + ## normal aarch64 + installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz + installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img +%endfor + +#FIXME: this will need adjusted when we have a real bootloader. +## WHeeeeeeee, EFI. +## We could remove the basearch restriction someday.. +<% efiargs=""; efigraft="" %> +%if exists("boot/efi/EFI/*/gcdaa64.efi"): + <% + efiarch32 = None + efiarch64 = 'AA64' + efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot) + images = ["images/efiboot.img"] + %> + %for img in images: + <% + efiargs += " -eltorito-alt-boot -e {0} -no-emul-boot".format(img) + efigraft += " {0}={1}/{0}".format(img,outroot) + %> + treeinfo images-${basearch} ${img|basename} ${img} + %endfor + <%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=efiarch32, efiarch64=efiarch64, isolabel=isolabel"/> +%endif + +# Create optional product.img and updates.img +<% filegraft=""; images=["product", "updates"] %> +%for img in images: + %if exists("%s/%s/" % (LORAXDIR, img)): + installimg ${LORAXDIR}/${img}/ images/${img}.img + treeinfo images-${basearch} ${img}.img images/${img}.img + <% filegraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %> + %endif +%endfor + +runcmd cp ${outroot}/../../step/make_livecd_bep.sh ${outroot}/ +runcmd cp ${outroot}/../../step/make_livecd_bep_entry.sh ${outroot}/ +runcmd cp ${outroot}/../../config/livecd/bep_conf/bep_clean.conf ${outroot}/ +runcmd cp ${outroot}/../../config/livecd/bep_conf/bep_remove.conf ${outroot}/ +runcmd bash ${outroot}/make_livecd_bep_entry.sh +runcmd rm ${outroot}/make_livecd_bep.sh +runcmd rm ${outroot}/make_livecd_bep_entry.sh +runcmd rm ${outroot}/bep_clean.conf +runcmd rm ${outroot}/bep_remove.conf + +%if exists("boot/efi/EFI/*/gcdaa64.efi"): +## make boot.iso +runcmd mkisofs -o ${outroot}/images/boot.iso \ + ${efiargs} -R -J -V '${isolabel}' -T ${udfargs} \ + -graft-points \ + ${KERNELDIR}=${outroot}/${KERNELDIR} \ + ${LIVEDIR}=${outroot}/${LIVEDIR} \ + ${efigraft} ${filegraft} +treeinfo images-${basearch} boot.iso images/boot.iso +%endif diff --git a/script/config/livecd/live/config_files/aarch64/boot.msg b/script/config/livecd/live/config_files/aarch64/boot.msg new file mode 100644 index 0000000000000000000000000000000000000000..ff54899e1c1ab37cd2859a5a74bab6edac1082d2 --- /dev/null +++ b/script/config/livecd/live/config_files/aarch64/boot.msg @@ -0,0 +1,5 @@ + +splash.lss + + - Press the 0107 key to begin the installation process. + diff --git a/script/config/livecd/live/config_files/aarch64/grub.conf b/script/config/livecd/live/config_files/aarch64/grub.conf new file mode 100644 index 0000000000000000000000000000000000000000..7e5e93447e8bb1665c0d4bed964701cda06ad7a5 --- /dev/null +++ b/script/config/livecd/live/config_files/aarch64/grub.conf @@ -0,0 +1,9 @@ +#debug --graphics +default=0 +splashimage=@SPLASHPATH@ +timeout 60 +hiddenmenu +title Start @PRODUCT@ @VERSION@ + findiso + kernel @KERNELPATH@ @ROOT@ quiet inst.text rd.live.ram net.ifnames=0 biosdevname=0 rd.shell=0 + initrd @INITRDPATH@ diff --git a/script/config/livecd/live/config_files/aarch64/grub2-efi.cfg b/script/config/livecd/live/config_files/aarch64/grub2-efi.cfg new file mode 100644 index 0000000000000000000000000000000000000000..7d04ac9d05f0e9bd8fe26f14e1d2c340e8259d8b --- /dev/null +++ b/script/config/livecd/live/config_files/aarch64/grub2-efi.cfg @@ -0,0 +1,38 @@ +set default="0" + +function load_video { + if [ x$feature_all_video_module = xy ]; then + insmod all_video + else + insmod efi_gop + insmod efi_uga + insmod ieee1275_fb + insmod vbe + insmod vga + insmod video_bochs + insmod video_cirrus + fi +} + +load_video +set gfxpayload=keep +insmod gzio +insmod part_gpt +insmod ext2 + +set timeout=60 +### END /etc/grub.d/00_header ### + +search --no-floppy --set=root -l '@ISOLABEL@' + +### BEGIN /etc/grub.d/10_linux ### +menuentry 'Start @PRODUCT@ @VERSION@ with text mode' --class red --class gnu-linux --class gnu --class os { + linux @KERNELPATH@ @ROOT@ ro inst.text console=ttyAMA0 console=tty0 rd.live.ram net.ifnames=0 biosdevname=0 rd.shell=0 + initrd @INITRDPATH@ +} +submenu 'Troubleshooting -->' { + menuentry 'Rescue a @PRODUCT@ system' --class red --class gnu-linux --class gnu --class os { + linux @KERNELPATH@ @ROOT@ rescue console=ttyAMA0 console=tty0 rd.live.ram net.ifnames=0 biosdevname=0 rd.shell=0 + initrd @INITRDPATH@ + } +} diff --git a/script/config/livecd/live/config_files/x86/boot.msg b/script/config/livecd/live/config_files/x86/boot.msg new file mode 100644 index 0000000000000000000000000000000000000000..ff54899e1c1ab37cd2859a5a74bab6edac1082d2 --- /dev/null +++ b/script/config/livecd/live/config_files/x86/boot.msg @@ -0,0 +1,5 @@ + +splash.lss + + - Press the 0107 key to begin the installation process. + diff --git a/script/config/livecd/live/config_files/x86/grub.conf b/script/config/livecd/live/config_files/x86/grub.conf new file mode 100644 index 0000000000000000000000000000000000000000..0077343f5ee5a2bee24d26f4c70691358dd88c52 --- /dev/null +++ b/script/config/livecd/live/config_files/x86/grub.conf @@ -0,0 +1,9 @@ +#debug --graphics +default=0 +splashimage=@SPLASHPATH@ +timeout 60 +hiddenmenu +title Start @PRODUCT@ @VERSION@ + findiso + kernel @KERNELPATH@ @ROOT@ rd.live.ram net.ifnames=0 biosdevname=0 rd.shell=0 + initrd @INITRDPATH@ diff --git a/script/config/livecd/live/config_files/x86/grub2-efi-lockdown.cfg b/script/config/livecd/live/config_files/x86/grub2-efi-lockdown.cfg new file mode 100644 index 0000000000000000000000000000000000000000..9886baf2d69195041646e7bf628315887ec5bb46 --- /dev/null +++ b/script/config/livecd/live/config_files/x86/grub2-efi-lockdown.cfg @@ -0,0 +1,36 @@ +set default="0" + +function load_video { + insmod efi_gop + insmod efi_uga + insmod video_bochs + insmod video_cirrus + insmod all_video +} + +load_video +set gfxpayload=keep +insmod gzio +insmod part_gpt +insmod ext2 + +set timeout=60 +### END /etc/grub.d/00_header ### + +search --no-floppy --set=root -l '@ISOLABEL@' + +### BEGIN /etc/grub.d/10_linux ### +menuentry 'Start @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os { + linuxefi @KERNELPATH@ @ROOT@ rd.live.ram net.ifnames=0 biosdevname=0 rd.shell=0 + initrdefi @INITRDPATH@ +} + +submenu 'Troubleshooting -->' { + menuentry 'Rescue a @PRODUCT@ system' --class fedora --class gnu-linux --class gnu --class os { + linuxefi @KERNELPATH@ @ROOT@ rd.live.ram rescue net.ifnames=0 biosdevname=0 rd.shell=0 + initrdefi @INITRDPATH@ + } + menuentry '@PRODUCT@ @VERSION@ Secure Boot Lockdown' { + chainloader /EFI/BOOT/lockdown.efi + } +} diff --git a/script/config/livecd/live/config_files/x86/grub2-efi.cfg b/script/config/livecd/live/config_files/x86/grub2-efi.cfg new file mode 100644 index 0000000000000000000000000000000000000000..196002505bdf02645a1096b21c47640be66d5894 --- /dev/null +++ b/script/config/livecd/live/config_files/x86/grub2-efi.cfg @@ -0,0 +1,33 @@ +set default="0" + +function load_video { + insmod efi_gop + insmod efi_uga + insmod video_bochs + insmod video_cirrus + insmod all_video +} + +load_video +set gfxpayload=keep +insmod gzio +insmod part_gpt +insmod ext2 + +set timeout=60 +### END /etc/grub.d/00_header ### + +search --no-floppy --set=root -l '@ISOLABEL@' + +### BEGIN /etc/grub.d/10_linux ### +menuentry 'Start @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os { + linuxefi @KERNELPATH@ @ROOT@ rd.live.ram net.ifnames=0 biosdevname=0 rd.shell=0 + initrdefi @INITRDPATH@ +} + +submenu 'Troubleshooting -->' { + menuentry 'Rescue a @PRODUCT@ system' --class fedora --class gnu-linux --class gnu --class os { + linuxefi @KERNELPATH@ @ROOT@ rd.live.ram rescue net.ifnames=0 biosdevname=0 rd.shell=0 + initrdefi @INITRDPATH@ + } +} diff --git a/script/config/livecd/live/config_files/x86/isolinux.cfg b/script/config/livecd/live/config_files/x86/isolinux.cfg new file mode 100644 index 0000000000000000000000000000000000000000..2174a412d16a64c62f8ba088702c5a72c870ee96 --- /dev/null +++ b/script/config/livecd/live/config_files/x86/isolinux.cfg @@ -0,0 +1,84 @@ +default vesamenu.c32 +timeout 600 + +display boot.msg + +# Clear the screen when exiting the menu, instead of leaving the menu displayed. +# For vesamenu, this means the graphical background is still displayed without +# the menu itself for as long as the screen remains in graphics mode. +menu clear +menu background splash.png +menu title @PRODUCT@ @VERSION@ +menu vshift 8 +menu rows 18 +menu margin 8 +#menu hidden +menu helpmsgrow 15 +menu tabmsgrow 13 + +# Border Area +menu color border * #00000000 #00000000 none + +# Selected item +menu color sel 0 #ffffffff #00000000 none + +# Title bar +menu color title 0 #ff7ba3d0 #00000000 none + +# Press [Tab] message +menu color tabmsg 0 #ff3a6496 #00000000 none + +# Unselected menu item +menu color unsel 0 #84b8ffff #00000000 none + +# Selected hotkey +menu color hotsel 0 #84b8ffff #00000000 none + +# Unselected hotkey +menu color hotkey 0 #ffffffff #00000000 none + +# Help text +menu color help 0 #ffffffff #00000000 none + +# A scrollbar of some type? Not sure. +menu color scrollbar 0 #ffffffff #ff355594 none + +# Timeout msg +menu color timeout 0 #ffffffff #00000000 none +menu color timeout_msg 0 #ffffffff #00000000 none + +# Command prompt text +menu color cmdmark 0 #84b8ffff #00000000 none +menu color cmdline 0 #ffffffff #00000000 none + +# Do not display the actual menu unless the user presses a key. All that is displayed is a timeout message. + +menu tabmsg Press Tab for full configuration options on menu items. + +menu separator # insert an empty line +menu separator # insert an empty line + +label linux + menu label ^Start @PRODUCT@ @VERSION@ + menu default + kernel vmlinuz + append initrd=initrd.img @ROOT@ rd.live.ram net.ifnames=0 biosdevname=0 rd.shell=0 + +menu separator # insert an empty line + +# utilities submenu +menu begin ^Troubleshooting + menu title Troubleshooting + +label local + menu label Boot from ^local drive + localboot 0xffff + +menu separator # insert an empty line +menu separator # insert an empty line + +label returntomain + menu label Return to ^main menu + menu exit + +menu end diff --git a/script/config/livecd/live/efi.tmpl b/script/config/livecd/live/efi.tmpl new file mode 100644 index 0000000000000000000000000000000000000000..fe270e38f55c59e99cfdc67fe7eb0fdba31c95b5 --- /dev/null +++ b/script/config/livecd/live/efi.tmpl @@ -0,0 +1,65 @@ +<%page args="configdir, KERNELDIR, efiarch32, efiarch64, isolabel"/> +<% +EFIBOOTDIR="EFI/BOOT" +APPLE_EFI_ICON=inroot+"/usr/share/pixmaps/bootloader/fedora.icns" +APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol" +%> + +mkdir ${EFIBOOTDIR} +mkdir ${EFIBOOTDIR}/fonts/ +%if exists("usr/share/shim/lockdown.efi"): + install usr/share/shim/lockdown.efi ${EFIBOOTDIR}/ +%endif +%if efiarch64: +install boot/efi/EFI/*/shim${efiarch64|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch64}.EFI +install boot/efi/EFI/*/mm${efiarch64|lower}.efi ${EFIBOOTDIR}/ +install boot/efi/EFI/*/gcd${efiarch64|lower}.efi ${EFIBOOTDIR}/grub${efiarch64|lower}.efi +%endif +%if efiarch32: +install boot/efi/EFI/*/shim${efiarch32|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch32}.EFI +install boot/efi/EFI/*/mm${efiarch32|lower}.efi ${EFIBOOTDIR}/ +install boot/efi/EFI/*/gcd${efiarch32|lower}.efi ${EFIBOOTDIR}/grub${efiarch32|lower}.efi +%endif +install boot/efi/EFI/*/fonts/unicode.pf2 ${EFIBOOTDIR}/fonts/ + +## actually make the EFI images +${make_efiboot("images/efiboot.img")} +%if domacboot: + ${make_efiboot("images/macboot.img", imgtype="apple")} +%endif + +## This is kinda gross, but then... so's EFI. +<%def name="make_efiboot(img, include_kernel=False, disk=False, imgtype='default')"> + <% + kdir = EFIBOOTDIR if include_kernel else KERNELDIR + eficonf = "%s/grub.cfg" % (EFIBOOTDIR, ) + args = "--label=ANACONDA" + if disk: args += " --disk" + if imgtype == "apple": args += ' --apple --icon=%s --diskname=%s --product="%s %s"' % (APPLE_EFI_ICON, APPLE_EFI_DISKNAME, product.name, product.version) + %> + %if include_kernel: + copy ${KERNELDIR}/vmlinuz ${EFIBOOTDIR} + copy ${KERNELDIR}/initrd.img ${EFIBOOTDIR} + %endif + %if exists("usr/share/shim/lockdown.efi"): + install ${configdir}/grub2-efi-lockdown.cfg ${eficonf} + %else: + install ${configdir}/grub2-efi.cfg ${eficonf} + %endif + replace @PRODUCT@ '${product.name}' ${eficonf} + replace @VERSION@ ${product.version} ${eficonf} + replace @KERNELNAME@ vmlinuz ${eficonf} + replace @KERNELPATH@ /${kdir}/vmlinuz ${eficonf} + replace @INITRDPATH@ /${kdir}/initrd.img ${eficonf} + replace @ISOLABEL@ '${isolabel}' ${eficonf} + %if disk: + replace @ROOT@ root=live:LABEL=ANACONDA ${eficonf} + %else: + replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${eficonf} + %endif + runcmd mkefiboot ${args} ${outroot}/${EFIBOOTDIR} ${outroot}/${img} + %if include_kernel: + remove ${EFIBOOTDIR}/vmlinuz + remove ${EFIBOOTDIR}/initrd.img + %endif + diff --git a/script/config/livecd/live/x86.tmpl b/script/config/livecd/live/x86.tmpl new file mode 100644 index 0000000000000000000000000000000000000000..62670859e16da42ace25ad0ca845cc9df9ed2f9b --- /dev/null +++ b/script/config/livecd/live/x86.tmpl @@ -0,0 +1,93 @@ +<%page args="kernels, runtime_img, basearch, outroot, product, isolabel"/> +<% +configdir="tmp/config_files/x86" +SYSLINUXDIR="usr/share/syslinux" +PXEBOOTDIR="images/pxeboot" +BOOTDIR="isolinux" +KERNELDIR=PXEBOOTDIR +LIVEDIR="LiveOS" +LORAXDIR="usr/share/lorax/" +%> + +mkdir ${LIVEDIR} +install ${runtime_img} ${LIVEDIR}/squashfs.img +treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img + +## install bootloader and config files +mkdir ${BOOTDIR} +install ${SYSLINUXDIR}/isolinux.bin ${BOOTDIR} +install ${SYSLINUXDIR}/vesamenu.c32 ${BOOTDIR} +install ${configdir}/isolinux.cfg ${BOOTDIR} +install ${SYSLINUXDIR}/ldlinux.c32 ${BOOTDIR} +install ${SYSLINUXDIR}/libcom32.c32 ${BOOTDIR} +install ${SYSLINUXDIR}/libutil.c32 ${BOOTDIR} +install ${configdir}/boot.msg ${BOOTDIR} +install ${configdir}/grub.conf ${BOOTDIR} +install boot/memtest* ${BOOTDIR}/memtest + +## configure bootloader +replace @VERSION@ ${product.version} ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg +replace @PRODUCT@ '${product.name}' ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg +replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${BOOTDIR}/isolinux.cfg + +## install kernels +mkdir ${KERNELDIR} +%for kernel in kernels: + %if kernel.flavor: + installkernel images-xen ${kernel.path} ${KERNELDIR}/vmlinuz-${kernel.flavor} + installinitrd images-xen ${kernel.initrd.path} ${KERNELDIR}/initrd-${kernel.flavor}.img + %else: + installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz + installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img + %endif +%endfor + +hardlink ${KERNELDIR}/vmlinuz ${BOOTDIR} +hardlink ${KERNELDIR}/initrd.img ${BOOTDIR} +%if basearch == 'x86_64': + treeinfo images-xen kernel ${KERNELDIR}/vmlinuz + treeinfo images-xen initrd ${KERNELDIR}/initrd.img +%endif + +## WHeeeeeeee, EFI. +<% efiargs=""; efigraft=""; efihybrid=""; efiarch32=None; efiarch64=None %> +%if exists("boot/efi/EFI/*/gcdia32.efi"): + <% efiarch32 = 'IA32' %> +%endif +%if exists("boot/efi/EFI/*/gcdx64.efi"): + <% efiarch64 = 'X64' %> +%endif +%if efiarch32 or efiarch64: + <% + efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot) + images = ["images/efiboot.img"] + if domacboot: + images.append("images/macboot.img") + for img in images: + efiargs += " -eltorito-alt-boot -e {0} -no-emul-boot".format(img) + efigraft += " {0}={1}/{0}".format(img,outroot) + efihybrid = "--uefi --mac" if domacboot else "--uefi" + %> + <%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=efiarch32, efiarch64=efiarch64, isolabel=isolabel"/> +%endif + +# Create optional product.img and updates.img +<% imggraft=""; images=["product", "updates"] %> +%for img in images: + %if exists("%s/%s/" % (LORAXDIR, img)): + installimg ${LORAXDIR}/${img}/ images/${img}.img + <% imggraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %> + %endif +%endfor + +## make boot.iso +runcmd mkisofs -o ${outroot}/images/boot.iso \ + -b ${BOOTDIR}/isolinux.bin -c ${BOOTDIR}/boot.cat \ + -boot-load-size 4 -boot-info-table -no-emul-boot \ + ${efiargs} -R -J -V '${isolabel}' -T -graft-points \ + ${BOOTDIR}=${outroot}/${BOOTDIR} \ + ${KERNELDIR}=${outroot}/${KERNELDIR} \ + ${LIVEDIR}=${outroot}/${LIVEDIR} \ + ${efigraft} ${imggraft} +runcmd isohybrid ${efihybrid} ${outroot}/images/boot.iso +treeinfo images-${basearch} boot.iso images/boot.iso diff --git a/script/config/product_version.conf b/script/config/product_version.conf new file mode 100644 index 0000000000000000000000000000000000000000..9d5aae73cf018b865c242e0fa9b4d5a700b76615 --- /dev/null +++ b/script/config/product_version.conf @@ -0,0 +1,8 @@ +[versoninfo_config] +static_token = (@LVdhn$IQ378AGWTB5nvfifhX!~UXwGFt2OtgF4K]ps8MzW>H(1537942791216 +product_offering = EulerOS Server +product_version = Version_time +product_operator = zwx365138 + +[57F9FE16-C528-4479-9DA7-530ABDB35792/EULEROS_UK_SUSE12SP4_V1_20190308/Success] +[539314C5-9F9A-4B28-B738-8534FBA59B85/EulerOS_CSI_SUSE12SP4_V1_20190319_obsworker/Success] diff --git a/script/config/raspi_image/99-com.rules b/script/config/raspi_image/99-com.rules new file mode 100644 index 0000000000000000000000000000000000000000..b41e9dbf81d174db47e5b9c5f4629b863924cab3 --- /dev/null +++ b/script/config/raspi_image/99-com.rules @@ -0,0 +1,61 @@ +SUBSYSTEM=="input", GROUP="input", MODE="0660" +SUBSYSTEM=="i2c-dev", GROUP="i2c", MODE="0660" +SUBSYSTEM=="spidev", GROUP="spi", MODE="0660" +SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660" +SUBSYSTEM=="rpivid-*", GROUP="video", MODE="0660" + +KERNEL=="vcsm-cma", GROUP="video", MODE="0660" +SUBSYSTEM=="dma_heap", GROUP="video", MODE="0660" + +SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660" +SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\ + chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\ + chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770 /sys/devices/virtual/gpio;\ + chown -R root:gpio /sys$devpath && chmod -R 770 /sys$devpath\ +'" + +SUBSYSTEM=="pwm*", PROGRAM="/bin/sh -c '\ + chown -R root:gpio /sys/class/pwm && chmod -R 770 /sys/class/pwm;\ + chown -R root:gpio /sys/devices/platform/soc/*.pwm/pwm/pwmchip* && chmod -R 770 /sys/devices/platform/soc/*.pwm/pwm/pwmchip*\ +'" + +KERNEL=="ttyAMA0", PROGRAM="/bin/sh -c '\ + ALIASES=/proc/device-tree/aliases; \ + if cmp -s $$ALIASES/uart0 $$ALIASES/serial0; then \ + echo 0;\ + elif cmp -s $$ALIASES/uart0 $$ALIASES/serial1; then \ + echo 1; \ + else \ + exit 1; \ + fi\ +'", SYMLINK+="serial%c" + +KERNEL=="ttyAMA1", PROGRAM="/bin/sh -c '\ + ALIASES=/proc/device-tree/aliases; \ + if [ -e /dev/ttyAMA0 ]; then \ + exit 1; \ + elif cmp -s $$ALIASES/uart0 $$ALIASES/serial0; then \ + echo 0;\ + elif cmp -s $$ALIASES/uart0 $$ALIASES/serial1; then \ + echo 1; \ + else \ + exit 1; \ + fi\ +'", SYMLINK+="serial%c" + +KERNEL=="ttyS0", PROGRAM="/bin/sh -c '\ + ALIASES=/proc/device-tree/aliases; \ + if cmp -s $$ALIASES/uart1 $$ALIASES/serial0; then \ + echo 0; \ + elif cmp -s $$ALIASES/uart1 $$ALIASES/serial1; then \ + echo 1; \ + else \ + exit 1; \ + fi \ +'", SYMLINK+="serial%c" + +ACTION=="add", SUBSYSTEM=="vtconsole", KERNEL=="vtcon1", RUN+="/bin/sh -c '\ + if echo RPi-Sense FB | cmp -s /sys/class/graphics/fb0/name; then \ + echo 0 > /sys$devpath/bind; \ + fi; \ +'" diff --git a/script/config/raspi_image/LICENCE.raspberrypi-sys-mods b/script/config/raspi_image/LICENCE.raspberrypi-sys-mods new file mode 100644 index 0000000000000000000000000000000000000000..bb23a05024edcc76fb2a96ffd7e6c07fe06a14c4 --- /dev/null +++ b/script/config/raspi_image/LICENCE.raspberrypi-sys-mods @@ -0,0 +1,32 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: raspberrypi-sys-mods +Source: https://github.com/RPi-Distro/raspberrypi-sys-mods + +Files: * +Copyright: 2015 Raspberry Pi Foundation +License: BSD-3-Clause + +License: BSD-3-Clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE HOLDERS OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/script/config/raspi_image/chroot.sh b/script/config/raspi_image/chroot.sh new file mode 100644 index 0000000000000000000000000000000000000000..93f68599880f4289ddd490f7500bda201920c902 --- /dev/null +++ b/script/config/raspi_image/chroot.sh @@ -0,0 +1,16 @@ +#!/bin/bash +systemctl enable sshd +systemctl enable systemd-timesyncd +systemctl enable hciuart +systemctl enable haveged +echo openEuler > /etc/hostname +echo "openeuler" | passwd --stdin root +if [ -f /usr/share/zoneinfo/Asia/Shanghai ]; then + if [ -f /etc/localtime ]; then + rm -f /etc/localtime + fi + ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +fi +if [ -f /etc/rc.d/rc.local ]; then + chmod +x /etc/rc.d/rc.local +fi \ No newline at end of file diff --git a/script/config/raspi_image/config.txt b/script/config/raspi_image/config.txt new file mode 100644 index 0000000000000000000000000000000000000000..9a8ef128917d7577e52e4043631dda8389104955 --- /dev/null +++ b/script/config/raspi_image/config.txt @@ -0,0 +1,65 @@ +# For more options and information see +# http://rpf.io/configtxt +# Some settings may impact device functionality. See link above for details + +# uncomment if you get no picture on HDMI for a default "safe" mode +#hdmi_safe=1 + +# uncomment this if your display has a black border of unused pixels visible +# and your display can output without overscan +#disable_overscan=1 + +# uncomment the following to adjust overscan. Use positive numbers if console +# goes off screen, and negative if there is too much border +#overscan_left=16 +#overscan_right=16 +#overscan_top=16 +#overscan_bottom=16 + +# uncomment to force a console size. By default it will be display's size minus +# overscan. +#framebuffer_width=1280 +#framebuffer_height=720 + +# uncomment if hdmi display is not detected and composite is being output +#hdmi_force_hotplug=1 + +# uncomment to force a specific HDMI mode (this will force VGA) +#hdmi_group=1 +#hdmi_mode=1 + +# uncomment to force a HDMI mode rather than DVI. This can make audio work in +# DMT (computer monitor) modes +#hdmi_drive=2 + +# uncomment to increase signal to HDMI, if you have interference, blanking, or +# no display +#config_hdmi_boost=4 + +# uncomment for composite PAL +#sdtv_mode=2 + +#uncomment to overclock the arm. 700 MHz is the default. +#arm_freq=800 + +# Uncomment some or all of these to enable the optional hardware interfaces +#dtparam=i2c_arm=on +#dtparam=i2s=on +#dtparam=spi=on + +# Uncomment this to enable infrared communication. +#dtoverlay=gpio-ir,gpio_pin=17 +#dtoverlay=gpio-ir-tx,gpio_pin=18 + +# Additional overlays and parameters are documented /boot/overlays/README + +# Enable audio (loads snd_bcm2835) +dtparam=audio=on + +[pi4] +# Enable DRM VC4 V3D driver on top of the dispmanx display stack +dtoverlay=vc4-fkms-v3d +max_framebuffers=2 + +[all] +#dtoverlay=vc4-fkms-v3d diff --git a/script/config/raspi_image/hosts b/script/config/raspi_image/hosts new file mode 100644 index 0000000000000000000000000000000000000000..832902498c200b703a6bb8851a2c62db0de8a099 --- /dev/null +++ b/script/config/raspi_image/hosts @@ -0,0 +1,2 @@ +127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 +::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 \ No newline at end of file diff --git a/script/config/raspi_image/ifup-eth0 b/script/config/raspi_image/ifup-eth0 new file mode 100644 index 0000000000000000000000000000000000000000..c91969b3e2066d7dda0c7d59794119403e0005f9 --- /dev/null +++ b/script/config/raspi_image/ifup-eth0 @@ -0,0 +1,16 @@ +TYPE=Ethernet +PROXY_METHOD=none +BROWSER_ONLY=no +BOOTPROTO=dhcp +DEFROUTE=yes +IPV4_FAILURE_FATAL=no +IPV6INIT=yes +IPV6_AUTOCONF=yes +IPV6_DEFROUTE=yes +IPV6_FAILURE_FATAL=no +IPV6_ADDR_GEN_MODE=stable-privacy +NAME=eth0 +UUID=851a6f36-e65c-3a43-8f4a-78fd0fc09dc9 +ONBOOT=yes +AUTOCONNECT_PRIORITY=-999 +DEVICE=eth0 \ No newline at end of file diff --git a/script/config/raspi_image/rpmlist b/script/config/raspi_image/rpmlist new file mode 100644 index 0000000000000000000000000000000000000000..26d14f4d13ec5e60c5df4877a6e5534ad0b57655 --- /dev/null +++ b/script/config/raspi_image/rpmlist @@ -0,0 +1,19 @@ +dnf +alsa-utils +haveged +wpa_supplicant +vim +net-tools +iproute +iputils +NetworkManager +openssh-server +passwd +hostname +bluez +pulseaudio-module-bluetooth +raspberrypi-kernel +raspberrypi-firmware +raspberrypi-bluetooth +sudo +openEuler-repos \ No newline at end of file diff --git a/script/config/repo_conf/EulerOS-base.repo b/script/config/repo_conf/EulerOS-base.repo new file mode 100644 index 0000000000000000000000000000000000000000..c27357dacf67e9e1dfebe86b012c87d5d5871de2 --- /dev/null +++ b/script/config/repo_conf/EulerOS-base.repo @@ -0,0 +1,5 @@ +[EulerOS-base] +name=EulerOS-base +baseurl=http://euleros-obs-repo.huawei.com:82/EulerOS:/V3R1:/STANDARD/standard_aarch64/ +enabled=1 +gpgcheck=0 diff --git a/script/config/repo_conf/kiwi.repo b/script/config/repo_conf/kiwi.repo new file mode 100644 index 0000000000000000000000000000000000000000..fb17a5b53441742fd0026f38d89112d49e40a205 --- /dev/null +++ b/script/config/repo_conf/kiwi.repo @@ -0,0 +1,5 @@ +[kiwi] +name=kiwi +baseurl=http://euleros-obs-repo.huawei.com:82/EulerOS:/V3R1:/KIWI/standard_aarch64/ +gpgcheck=0 +gpgkey= diff --git a/script/config/repo_conf/mkeuleros.repo b/script/config/repo_conf/mkeuleros.repo new file mode 100644 index 0000000000000000000000000000000000000000..874a999955b1d4dc31ee0036f55f75e0688d2574 --- /dev/null +++ b/script/config/repo_conf/mkeuleros.repo @@ -0,0 +1,5 @@ +[mkeuleros] +name=mkeuleros +baseurl=http://openeuler-obs-repo.huawei.com:82/openEuler:/20.03:/LTS:/SP1/standard_aarch64/ +enabled=1 +gpgcheck=0 diff --git a/script/config/repo_conf/obs-pangea-aarch64.conf b/script/config/repo_conf/obs-pangea-aarch64.conf new file mode 100644 index 0000000000000000000000000000000000000000..c38137ca0355f8bbcee18183e692b46ba511243d --- /dev/null +++ b/script/config/repo_conf/obs-pangea-aarch64.conf @@ -0,0 +1,61 @@ +[main] +cachedir=/var/cache/yum/xxx +keepcache=0 +debuglevel=2 +logfile=/var/log/yum.log +exactarch=1 +obsoletes=1 +gpgcheck=1 +plugins=1 +installonly_limit=3 +reposdir=/xxx + +# This is the default, if you make this bigger yum won't see if the metadata +# is newer on the remote and so you'll "gain" the bandwidth of not having to +# download the new metadata and "pay" for it by yum not having correct +# information. +# It is esp. important, to have correct metadata, for distributions like +# Fedora which don't keep old packages around. If you don't like this checking +# interupting your command line usage, it's much better to have something +# manually check the metadata once an hour (yum-updatesd will do this). +# metadata_expire=90m + +# PUT YOUR REPOS HERE OR IN separate files named file.repo +# in /etc/yum.repos.d + +[obs-1] +name=obs-1 +baseurl=http://euleros-obs-repo.huawei.com:82/EulerOS:/V3R1:/KIWI/standard_aarch64/ +enabled=1 +gpgcheck=0 + +[obs-2] +name=obs-2 +baseurl=http://euleros-obs-repo.huawei.com:82/EulerOS:/V3R1:/COMMOM/standard_aarch64/ +enabled=1 +gpgcheck=0 + +[obs-3] +name=obs-3 +baseurl=http://euleros-obs-repo.huawei.com:82/EulerOS:/V3R1:/PANGEA/standard_aarch64/ +enabled=1 +gpgcheck=0 + +[obs-4] +name=obs-4 +baseurl=http://euleros-obs-repo.huawei.com:82/EulerOS:/V3R1:/PANGEA:/Custom/standard_aarch64/ +enabled=1 +gpgcheck=0 + +[obs-5] +name=obs-5 +baseurl=http://euleros-obs-repo.huawei.com:82/EulerOS:/V3R1:/GENERAL:/Kernel/standard_aarch64/ +enabled=1 +gpgcheck=0 + +[obs-6] +name=obs-6 +baseurl=http://euleros-obs-repo.huawei.com:82/EulerOS:/V3R1:/STANDARD/standard_aarch64/ +enabled=1 +gpgcheck=0 + diff --git a/script/config/repo_conf/obs-pangea-x86_64.conf b/script/config/repo_conf/obs-pangea-x86_64.conf new file mode 100644 index 0000000000000000000000000000000000000000..8a23132ae3d3fb13d23046497fe473e73e53b043 --- /dev/null +++ b/script/config/repo_conf/obs-pangea-x86_64.conf @@ -0,0 +1,67 @@ +[main] +cachedir=/var/cache/yum/xxx +keepcache=0 +debuglevel=2 +logfile=/var/log/yum.log +exactarch=1 +obsoletes=1 +gpgcheck=1 +plugins=1 +installonly_limit=3 +reposdir=/xxx + +# This is the default, if you make this bigger yum won't see if the metadata +# is newer on the remote and so you'll "gain" the bandwidth of not having to +# download the new metadata and "pay" for it by yum not having correct +# information. +# It is esp. important, to have correct metadata, for distributions like +# Fedora which don't keep old packages around. If you don't like this checking +# interupting your command line usage, it's much better to have something +# manually check the metadata once an hour (yum-updatesd will do this). +# metadata_expire=90m + +# PUT YOUR REPOS HERE OR IN separate files named file.repo +# in /etc/yum.repos.d + +[obs-1] +name=obs-1 +baseurl=http://euleros-obs-repo.huawei.com:82/EulerOS:/V3R1:/KIWI/standard_x86_64/ +enabled=1 +gpgcheck=0 + +[obs-2] +name=obs-2 +baseurl=http://euleros-obs-repo.huawei.com:82/EulerOS:/V3R1:/COMMOM/standard_x86_64/ +enabled=1 +gpgcheck=0 + +[obs-3] +name=obs-3 +baseurl=http://euleros-obs-repo.huawei.com:82/EulerOS:/V3R1:/PANGEA/standard_x86_64/ +enabled=1 +gpgcheck=0 + +[obs-4] +name=obs-4 +baseurl=http://euleros-obs-repo.huawei.com:82/EulerOS:/V3R1:/PANGEA:/Custom/standard_x86_64/ +enabled=1 +gpgcheck=0 + +[obs-5] +name=obs-5 +baseurl=http://euleros-obs-repo.huawei.com:82/EulerOS:/V3R1:/PANGEA:/Kernel/standard_x86_64/ +enabled=1 +gpgcheck=0 + +[obs-6] +name=obs-6 +baseurl=http://euleros-obs-repo.huawei.com:82/EulerOS:/V3R1:/PANGEA:/Storage/standard_x86_64/ +enabled=1 +gpgcheck=0 + +[obs-7] +name=obs-7 +baseurl=http://euleros-obs-repo.huawei.com:82/EulerOS:/V3R1:/STANDARD/standard_aarch64/ +enabled=1 +gpgcheck=0 + diff --git a/script/config/repo_conf/obs-repo.conf b/script/config/repo_conf/obs-repo.conf new file mode 100644 index 0000000000000000000000000000000000000000..27805b34b47e7629a5d3fc4526fcadcc4753781c --- /dev/null +++ b/script/config/repo_conf/obs-repo.conf @@ -0,0 +1,42 @@ +[main] +cachedir=/var/cache/yum/xxx +keepcache=0 +debuglevel=2 +logfile=/var/log/yum.log +exactarch=1 +obsoletes=1 +gpgcheck=1 +plugins=1 +installonly_limit=3 +reposdir=/xxx + +# This is the default, if you make this bigger yum won't see if the metadata +# is newer on the remote and so you'll "gain" the bandwidth of not having to +# download the new metadata and "pay" for it by yum not having correct +# information. +# It is esp. important, to have correct metadata, for distributions like +# Fedora which don't keep old packages around. If you don't like this checking +# interupting your command line usage, it's much better to have something +# manually check the metadata once an hour (yum-updatesd will do this). +# metadata_expire=90m + +# PUT YOUR REPOS HERE OR IN separate files named file.repo +# in /etc/yum.repos.d +[obs-standard] +name=obs-standard +baseurl=http://172.16.1.95:82/openEuler:/20.03:/LTS:/SP1/standard_aarch64/ +enabled=1 +gpgcheck=0 + +[obs-Extras] +name=obs-Extras +baseurl=http://172.16.1.95/openEuler:/20.03:/LTS:/SP1:/Extras/standard_aarch64/ +enabled=1 +gpgcheck=0 + +[obs-Epol] +name=obs-Epol +baseurl=http://172.16.1.95/openEuler:/20.03:/LTS:/SP1:/Epol/standard_aarch64/ +enabled=1 +gpgcheck=0 + diff --git a/script/config/service_list_aarch64.xml b/script/config/service_list_aarch64.xml new file mode 100644 index 0000000000000000000000000000000000000000..87610b8d04924f667f363c48cb7235b786c83cc6 --- /dev/null +++ b/script/config/service_list_aarch64.xml @@ -0,0 +1,4 @@ + + + + diff --git a/script/config/service_list_x86_64.xml b/script/config/service_list_x86_64.xml new file mode 100644 index 0000000000000000000000000000000000000000..c8b712d8dd54ae4f286ef805de5791c6bb96a8c5 --- /dev/null +++ b/script/config/service_list_x86_64.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/script/config/vm_qcow2/grub.cfg b/script/config/vm_qcow2/grub.cfg new file mode 100644 index 0000000000000000000000000000000000000000..b747e10804202083845e00c56d39f11ca6526672 --- /dev/null +++ b/script/config/vm_qcow2/grub.cfg @@ -0,0 +1,33 @@ +set default="1" + +function load_video { + if [ x = xy ]; then + insmod all_video + else + insmod efi_gop + insmod efi_uga + insmod ieee1275_fb + insmod vbe + insmod vga + insmod video_bochs + insmod video_cirrus + fi +} + +load_video +set gfxpayload=keep +insmod gzio +insmod part_gpt +insmod ext2 + +set timeout=10 +### END /etc/grub.d/00_header ### + +search --no-floppy --set=root -l 'EulerOS V3.0SP1 aarch64' + +### BEGIN /etc/grub.d/10_linux ### +menuentry 'Install EulerOS V3.0SP1' --class red --class gnu-linux --class gnu --class os { + set root=(tftp,192.168.1.1) + linux /vmlinuz rdinit=/sbin/init inst.stage2=hd:LABEL=EulerOS\x20V3.0SP1\x20aarch64 nomodeset inst.ks=http://192.168.1.1/ks/euleros-ks.cfg + initrd /initrd.img +} diff --git a/script/config/vm_qcow2/ks/euleros-ks.cfg b/script/config/vm_qcow2/ks/euleros-ks.cfg new file mode 100644 index 0000000000000000000000000000000000000000..81c9c03ab9a7b65f45f905bfafd0abee42e8bf04 --- /dev/null +++ b/script/config/vm_qcow2/ks/euleros-ks.cfg @@ -0,0 +1,47 @@ +#version=DEVEL +# System authorization information +auth --enableshadow --passalgo=sha512 +# Use CDROM installation media +cdrom +# Use text install +text +# Run the Setup Agent on first boot +firstboot --enable +ignoredisk --only-use=sda +# Keyboard layouts +keyboard --vckeymap=us --xlayouts='us' +# System language +lang en_US.UTF-8 + +# Network information +network --bootproto=dhcp --device=eth0 --ipv6=auto --activate +network --hostname=localhost.localdomain + +# shutdown after finishing installation +shutdown + +# Root password +#rootpw --iscrypted $6$q9jTKWU.vkqsrYe.$LaUnX6nvW0AxFs6pSoyKofnxHZLf.gtXsHn3Tn/9J8bzzakPJxc/LEavkSvLfia77eXjAGLTqbWSFu93chHcf1 +rootpw --iscrypted $6$o4rTi3d/.hh6JUYC$ClnCxd2mAQHlt0UloC4ystQg0CiuSVyhXz0sP1mDCNCgWV0rBwegwJ/bCWfjN4WxbahDa7F9U3c6/vFaNgsvX +# System services +services --enabled="chronyd" +# System timezone +timezone America/New_York --isUtc +# System bootloader configuration +bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda +autopart --type=lvm +# Partition clearing information +clearpart --none --initlabel + +%packages +@^base-sys +@base +@core +chrony +kexec-tools + +%end + +%addon com_redhat_kdump --enable --reserve-mb='auto' + +%end diff --git a/script/config/vm_qcow2/vm-install.xml b/script/config/vm_qcow2/vm-install.xml new file mode 100644 index 0000000000000000000000000000000000000000..0c841e0ea76553f00a66eb3276be488345ee2587 --- /dev/null +++ b/script/config/vm_qcow2/vm-install.xml @@ -0,0 +1,105 @@ + + + VM_NAME + 14049280 + 14049280 + 4 + + /machine + + + hvm + /usr/share/edk2/aarch64/QEMU_EFI-pflash.raw + /usr/share/edk2/aarch64/euler.fd + + + + + + + + + destroy + restart + restart + + /usr/bin/qemu-kvm + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + + + + + +
+ + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +