diff --git a/create-qcow2.sh b/create-qcow2.sh index 1dfc3194e3064ff8496dbdf13082ded496034084..42263bc1b5fc5fe83e0c2a9803723a2a6b4154f5 100755 --- a/create-qcow2.sh +++ b/create-qcow2.sh @@ -164,6 +164,18 @@ echo "BASEOS_REPO:$BASEOS_REPO" echo "APPSTREAM_REPO:$APPSTREAM_REPO" sed -i "s#^url --url=.*#url --url=\"$BASEOS_REPO\"#g" $KS_FILE sed -i "s#^repo --name=appstream --baseurl=.*#repo --name=appstream --baseurl=\"$APPSTREAM_REPO\"#g" $KS_FILE +#add other repos +sed -i '/###add otherrepos start###/,/###add otherrepos end###/{/###add otherrepos start###/!{/###add otherrepos end###/!d}}' $KS_FILE +for ((i=5; i>0; --i)) +do + tmp="OTHER_REPO$i" + if [ -z "${!tmp}" ]; then + continue + fi + repostr="repo --name=${tmp} --baseurl='${!tmp}' " + sed -i "/###add otherrepos start###/a $repostr" $KS_FILE +done + #add pkgs && groups sed -i '/###add packages start###/,/###add packages end###/{/###add packages start###/!{/###add packages end###/!d}}' $KS_FILE diff --git a/qcow2.conf b/qcow2.conf index 63c13157f22b2aabe14520324bf4eb7f74f86783..02f116e57922333bc8d1ff42cda0af1718ded5f1 100644 --- a/qcow2.conf +++ b/qcow2.conf @@ -5,6 +5,12 @@ BASEOS_REPO="http://mirrors.openanolis.cn/anolis/8.6/BaseOS/x86_64/os/" #BASEOS_REPO="http://kos.ieisystem.com/kos/5.8/BaseOS/x86_64/os/" APPSTREAM_REPO="http://mirrors.openanolis.cn/anolis/8.6/AppStream/x86_64/os/" #APPSTREAM_REPO="http://kos.ieisystem.com/kos/5.8/AppStream/x86_64/os/" +OTHER_REPO1="" +OTHER_REPO2="" +OTHER_REPO3="" +OTHER_REPO4="" +OTHER_REPO5="" + IMAGE_MAIN_NAME="Anolis-8.6" #IMAGE_MAIN_NAME="kos-5.8" RESULT_MAIN_DIR="qcow2" diff --git a/qcow2.ks b/qcow2.ks index 7ed25c3d8c6860f1c7710c0436ca07568da08d56..46ff61b64b49f02fd4bf0a0f8ef881fc00962028 100644 --- a/qcow2.ks +++ b/qcow2.ks @@ -7,6 +7,9 @@ firewall --enabled # Use network installation url --url="http://mirrors.openanolis.cn/anolis/8.6/BaseOS/x86_64/os/" repo --name=appstream --baseurl="http://mirrors.openanolis.cn/anolis/8.6/AppStream/x86_64/os/" +###add otherrepos start### +###add otherrepos end### + # Network information network --bootproto=dhcp --device=link --activate