Skip to content

Commit

Permalink
fixed repo
Browse files Browse the repository at this point in the history
  • Loading branch information
mineyoshikawasnow committed Sep 11, 2020
1 parent a19f3a7 commit cae2cc3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lfbs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ make_basefs() {
remove "${work_dir}/${codename}"
_msg_info "Installing Fedora to '${work_dir}/${codename}/airootfs'..."
mkdir -p "${work_dir}/${codename}/airootfs"
dnf groupinstall core --releasever=${codename} --nogpgcheck --installroot="${work_dir}/${codename}/airootfs" -y
dnf --installroot="${work_dir}/${codename}/airootfs" $(${script_path}/system/repository-json-parser.py ${script_path}/system/repository.json) groupinstall core -y
_msg_info "${codename} installed successfully!"

echo 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${PATH}' >> "${work_dir}/airootfs/etc/bash.bashrc"
Expand Down
19 changes: 19 additions & 0 deletions system/repository-json-parser.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env python3
import json
import sys
def main():
args = sys.argv
if args.__len__() < 2:
print("Error !")
exit(-1)
json_fname=args[1]
json_f = open(json_fname,"r")
json_d=json.load(json_f)
repokun_str=""
enablekun_str=""
for jsobj in json_d["repo"]:
repokun_str = repokun_str + " --repofrompath " + jsobj["name"] + "," + jsobj["url"]
enablekun_str = enablekun_str + " --enablerepo=" + jsobj["name"]
output_str = repokun_str + " --disablerepo=* --nogpgcheck " + enablekun_str
print(output_str)
main()
8 changes: 8 additions & 0 deletions system/repository.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"repo":[
{
"name":"centos",
"url":"http://mirror.centos.org/centos/8.2.2004/BaseOS/x86_64/os/"
}
]
}

0 comments on commit cae2cc3

Please sign in to comment.