Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自动安装、更新dadk #319

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions kernel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ crate-type = ["staticlib"]
x86 = "0.52.0"
x86_64 = "0.14.10"
bitflags = "1.3.2"
virtio-drivers = { git = "https://github.com/DragonOS-Community/virtio-drivers.git", rev = "f1d1cbb" }
virtio-drivers = { git = "https://git.mirrors.dragonos.org/DragonOS-Community/virtio-drivers.git", rev = "f1d1cbb" }
# 一个无锁MPSC队列
thingbuf = { version = "0.1.3", default-features = false, features = ["alloc"] }
# smoltcp 0.9.1
smoltcp = { git = "https://github.com/DragonOS-Community/smoltcp.git", rev = "9027825", default-features = false, features = ["log", "alloc", "socket-raw", "socket-udp", "socket-tcp", "socket-icmp", "socket-dhcpv4", "socket-dns", "proto-ipv4", "proto-ipv6"]}
smoltcp = { git = "https://git.mirrors.dragonos.org/DragonOS-Community/smoltcp.git", rev = "9027825", default-features = false, features = ["log", "alloc", "socket-raw", "socket-udp", "socket-tcp", "socket-icmp", "socket-dhcpv4", "socket-dns", "proto-ipv4", "proto-ipv6"]}
# num-traits 0.2.15
num-traits = { git = "https://github.com/DragonOS-Community/num-traits.git", rev="1597c1c", default-features = false }
num-traits = { git = "https://git.mirrors.dragonos.org/DragonOS-Community/num-traits.git", rev="1597c1c", default-features = false }
num = { version = "0.4.0", default-features = false }
num-derive = "0.3"
# 一个no_std的hashmap、hashset
Expand Down
12 changes: 10 additions & 2 deletions user/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ current_CFLAGS := $(CFLAGS)

DADK_VERSION = $(shell dadk -V | awk 'END {print $2}')
# 最小的DADK版本
MIN_DADK_VERSION = 0.1.1
MIN_DADK_VERSION = 0.1.2
DADK_CACHE_DIR = $(ROOT_PATH)/bin/dadk_cache

# 旧版的libc安装路径
Expand All @@ -34,9 +34,17 @@ ifeq ("$(DADK_VERSION)", "")
@echo "\nOr you can install dadk from source by running the following command:"
@echo "\n\tcargo install --git https://github.com/DragonOS-Community/DADK.git"
@echo "\n"
@exit 1
@echo "Auto installing dadk..."
CC=gcc AS=as AR=ar LD=ld OBJCOPY=objcopy NM=nm cargo install dadk
else
@echo "dadk version $(DADK_VERSION) installed"
# 如果DADK版本过低,则自动更新
ifeq ($(shell printf '%s\n' "$(DADK_VERSION)" "$(MIN_DADK_VERSION)" | sort -V | head -n1), $(MIN_DADK_VERSION))
@echo "dadk version is too low, please update to $(MIN_DADK_VERSION) or higher version"
@echo "Updating dadk..."
CC=gcc AS=as AR=ar LD=ld OBJCOPY=objcopy NM=nm cargo install dadk || (echo "dadk update failed" && exit 1)
@echo "dadk updated"
endif
endif

dadk_run: install_dadk
Expand Down
2 changes: 1 addition & 1 deletion user/dadk/config/relibc-0.1.0.dadk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"task_type": {
"BuildFromSource": {
"Git": {
"url": "https://github.com/DragonOS-Community/relibc.git",
"url": "https://git.mirrors.dragonos.org/DragonOS-Community/relibc.git",
"branch": "dragonos-relibc",
"revision": null
}
Expand Down