mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-18 08:06:32 +00:00
Feat(tty): Supplement process group logic (#1139)
* 添加busybox的编译 * 完善tty job control的逻辑 * 修改copy_sighand的逻辑,符合Linux语义 * 以busybox作为启动shell去运行 * 修改setsid的逻辑 * 解决前台进程组无法处理信号的问题 * 移除ProcessBasicInfo其中的pgid和sid信息 * 修改setsid * 新增get_pcb_info * 在etc目录下新增必要的文件 * 改用busybox init作为引导程序 * 恢复dragonreach文件 * 修改busybox编译选项,能够读取环境变量 * 先让SYS_RT_SIGTIMEDWAIT返回Ok(0),能够正常进入系统 * 一些小更改 * 删除get_pcb_info * 增加对默认termios的判断 * 完成backspace的修复 * 更改inittab,在shell启动之后更改termios * 增加executable_path信息 * 补充proc下的exe链接文件以及读取逻辑 * 更改PosixTermios,使用stty完成erase的设置 * 用busybox作为引导程序 * 修改波特率的获取 * 修改函数方法 * 在baud_rate方法中添加对于cbaud的与操作 * 为rv64下的SigSet实现From<Signal> * refactor(driver): 移除`#[derive(Debug)]`并手动实现`Debug` trait 移除`VirtIOBlkDevice`、`VirtIOConsoleDevice`和`VirtIONetDevice`的`#[derive(Debug)]`,并手动实现`Debug` trait以提供更详细的调试信息。 Co-authored-by: longjin <longjin@DragonOS.org>
This commit is contained in:
3
user/apps/busybox/.gitignore
vendored
Normal file
3
user/apps/busybox/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
build/
|
||||
busybox-1.35.0.tar.bz2
|
||||
busybox-1.35.0.tar.bz2.md5sum
|
76
user/apps/busybox/Makefile
Normal file
76
user/apps/busybox/Makefile
Normal file
@ -0,0 +1,76 @@
|
||||
ARCH ?= x86_64
|
||||
busybox_version := 1.35.0
|
||||
busybox_tarball := busybox-$(busybox_version).tar.bz2
|
||||
busybox_tarball_path := $(busybox_tarball)
|
||||
build_dir := build/$(ARCH)
|
||||
busybox_dir := $(build_dir)/busybox-$(busybox_version)
|
||||
prefix := $(ARCH)-linux-musl-
|
||||
bin := build/$(ARCH)/busybox
|
||||
|
||||
# 特殊架构处理
|
||||
ifeq ($(ARCH), mipsel)
|
||||
prefix := mipsel-linux-musln32-
|
||||
endif
|
||||
|
||||
cc := $(prefix)gcc
|
||||
strip := $(prefix)strip
|
||||
|
||||
# 下载 busybox 的 md5sum 文件
|
||||
$(busybox_tarball_path).md5sum:
|
||||
wget https://mirrors.dragonos.org.cn/pub/third_party/busybox/$(busybox_tarball).md5sum
|
||||
|
||||
# 下载源码
|
||||
$(busybox_tarball_path): $(busybox_tarball_path).md5sum
|
||||
@if [ ! -f $@ ] || ! md5sum -c $(busybox_tarball_path).md5sum; then \
|
||||
echo "Downloading $@..."; \
|
||||
wget https://mirrors.dragonos.org.cn/pub/third_party/busybox/$(busybox_tarball); \
|
||||
fi
|
||||
|
||||
# 解压源码包
|
||||
$(busybox_dir): $(busybox_tarball_path)
|
||||
mkdir -p $(build_dir)
|
||||
tar -xjf $< -C $(build_dir)
|
||||
|
||||
# 配置和编译
|
||||
$(bin): $(busybox_dir)
|
||||
@# 应用必要补丁和配置调整
|
||||
cd $(busybox_dir) && \
|
||||
make defconfig && \
|
||||
sed -i '/CONFIG_STATIC/s/.*/CONFIG_STATIC=y/' .config && \
|
||||
sed -i '/CONFIG_PIE/d' .config && \
|
||||
sed -i '/CONFIG_FEATURE_EDITING/s/=y/=n/' .config && \
|
||||
sed -i '/CONFIG_HUSH/s/=y/=n/' .config && \
|
||||
sed -i '/CONFIG_NOMMU/s/=y/=n/' .config && \
|
||||
echo "CONFIG_CROSS_COMPILER_PREFIX=\"$(prefix)\"" >> .config && \
|
||||
echo "CONFIG_FEATURE_STATIC=y" >> .config && \
|
||||
echo "CONFIG_STATIC_LIBGCC=y" >> .config && \
|
||||
echo "CONFIG_ASH=y" >> .config && \
|
||||
echo "CONFIG_ASH_READ_PROFILE=y" >> .config && \
|
||||
echo "CONFIG_FEATURE_EDITING=y" >> .config && \
|
||||
echo "CONFIG_HUSH=y" >> .config
|
||||
|
||||
@# 执行编译
|
||||
cd $(busybox_dir) && \
|
||||
KCONFIG_NOTIMESTAMP=1 make CC="$(cc)" CFLAGS_EXTRA="-static -Os" LDFLAGS="--static" -j$(nproc)
|
||||
|
||||
@# 处理编译输出
|
||||
mkdir -p $(dir $(bin))
|
||||
cp $(busybox_dir)/busybox $(bin)
|
||||
$(strip) $(bin)
|
||||
|
||||
.PHONY: all clean menuconfig
|
||||
|
||||
all: $(bin)
|
||||
|
||||
install: all
|
||||
mv $(bin) $(DADK_CURRENT_BUILD_DIR)/busybox
|
||||
|
||||
# 交互式配置菜单
|
||||
menuconfig: $(busybox_dir)
|
||||
cd $(busybox_dir) && make menuconfig
|
||||
|
||||
clean:
|
||||
rm -rf build/
|
||||
|
||||
distclean: clean
|
||||
rm -f $(busybox_tarball_path) $(busybox_tarball_path).md5sum
|
Reference in New Issue
Block a user