当前位置: 首页 > news >正文

自助建站网站公司网络热词2023

自助建站网站公司,网络热词2023,石龙网站仿做,网站的footer怎么做安装busybox 参考博客: 使用GDBQEMU调试Linux内核环境搭建 一文教你如何使用GDBQemu调试Linux内核 ubuntu22.04搭建qemu环境测试内核 交叉编译busybox 编译busybox出现Library m is needed, can’t exclude it (yet)的解释 S3C2440 制作最新busybox文件系统 https:…

安装busybox

参考博客:
使用GDB+QEMU调试Linux内核环境搭建
一文教你如何使用GDB+Qemu调试Linux内核
ubuntu22.04搭建qemu环境测试内核
交叉编译busybox
编译busybox出现Library m is needed, can’t exclude it (yet)的解释
S3C2440 制作最新busybox文件系统
https://www.busybox.net/是官网。
在这里插入图片描述
sudo wget https://busybox.net/downloads/busybox-1.36.1.tar.bz2下载源代码。
在这里插入图片描述

sudo tar jxvf busybox-1.36.1.tar.bz2解压源文件。
在这里插入图片描述

cd busybox-1.36.1进入源代码目录里边。
在这里插入图片描述

执行make menuconfig发现报错:

Command 'make' not found, but can be installed with:sudo apt install make
sudo apt install make-guile

在这里插入图片描述
使用sudo apt install make安装make,发现报错如下:

E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

在这里插入图片描述

使用sudo rm -rf /var/lib/dpkg/lock-frontend删除lock-frontend,然后再使用sudo apt install make安装make,发现正常安装。
在这里插入图片描述

sudo apt install -y gcc g++ libncurses5-dev安装依赖包。

在这里插入图片描述

安装完成如下图:
在这里插入图片描述

sudo make menuconfig进行配置。
在这里插入图片描述

使用上下键可以选择,选择“Setting”之后,按回车键。
在这里插入图片描述

进入到下一个选择时,使用上下键找一下“Build static binary (no shared libs) ”。
在这里插入图片描述

然后按一下y就是选择上了。
在这里插入图片描述

按一下Esc键就可以退回到上一层。
在这里插入图片描述

按一下Esc键就可以退回到保存界面。
在这里插入图片描述

选择“yes”按一下Enter键,就退到原来的命令行下。
在这里插入图片描述

sudo make -j2进行编译。
在这里插入图片描述

完成之后提示如下:

Static linking against glibc, can't use --gc-sections
Trying libraries: crypt m resolv rtLibrary crypt is not needed, excluding itLibrary m is needed, can't exclude it (yet)Library resolv is needed, can't exclude it (yet)Library rt is not needed, excluding itLibrary m is needed, can't exclude it (yet)Library resolv is needed, can't exclude it (yet)
Final link with: m resolv

在这里插入图片描述

sudo make install进行安装。
在这里插入图片描述

完成之后,提示:

You will probably need to make your busybox binary
setuid root to ensure all configured applets will
work properly.

在这里插入图片描述

启动内存文件系统制作

cd _install进入到特定目录里边。
在这里插入图片描述
sudo mkdir proc sys新建两个目录procsys
在这里插入图片描述

sudo vim init把下边的内容写进去:

#!/bin/sh
echo "{==DBG==} INIT SCRIPT"
mkdir /tmp
mount -t proc none /proc
mount -t sysfs none /sys
mount -t debugfs none /sys/kernel/debug
mount -t tmpfs none /tmpmdev -s 
echo -e "{==DBG==} Boot took $(cut -d' ' -f1 /proc/uptime) seconds"# normal user
setsid /bin/cttyhack setuidgid 1000 /bin/sh

在这里插入图片描述

sudo chmod +x init 为当前用户添加上可执行的权限。
在这里插入图片描述

sudo chmod -R 777 .给当前目录中所有的文件配上读写执行的权限。
在这里插入图片描述

sudo find . | sudo cpio -o --format=newc > ./rootfs.img生成rootfs.img文件。
在这里插入图片描述

生成Linux内核

cd ~/进入到home目录里边。
在这里插入图片描述

sudo wget http://ftp.sjtu.edu.cn/sites/ftp.kernel.org/pub/linux/kernel/v5.x/linux-5.19.tar.xz下载源代码。在这里插入图片描述

sudo tar xf linux-5.19.tar.xz解压源代码,时间有点长,需要等待。
在这里插入图片描述

cd linux-5.19/进入到源码里边。
在这里插入图片描述

sudo make menuconfig,发现报错:

/bin/sh: 1: flex: not found
scripts/Makefile.host:9: recipe for target 'scripts/kconfig/lexer.lex.c' failed
make[1]: *** [scripts/kconfig/lexer.lex.c] Error 127
Makefile:629: recipe for target 'menuconfig' failed
make: *** [menuconfig] Error 2

在这里插入图片描述

sudo apt-get install -y flex bison安装依赖包。
在这里插入图片描述

sudo make menuconfig进行配置选择。
上下键可以进行选项寻找,按回车键可以进入,找到Kernel hacking进入。
在这里插入图片描述

使用下键找到Compile-time checks and compiler options,然后按回车键。

在这里插入图片描述

发现Provide GDB scripts for kernel debugging已经默认选上了。

在这里插入图片描述

按两下Esc
在这里插入图片描述

按两下Esc
在这里插入图片描述

按两下Esc
在这里插入图片描述

选择yes按一下回车键。
在这里插入图片描述

grep CONFIG_DEBUG_INFO .config验证一下,选择是否正确。
在这里插入图片描述

sudo sed -i 's/CONFIG_MODULE_SIG=y/CONFIG_MODULE_SIG=n/g' .config  # 把 CONFIG_MODULE_SIG=y  替换成  CONFIG_MODULE_SIG=n
sudo sed -i 's/CONFIG_MODULE_SIG_ALL=y/CONFIG_MODULE_SIG_ALL=n/g' .config
sudo sed -i 's/CONFIG_SYSTEM_TRUSTED_KEYS="debian\/canonical-certs.pem"/CONFIG_SYSTEM_TRUSTED_KEYS=""/g' .config
sudo sed -i 's/CONFIG_SYSTEM_REVOCATION_KEYS="debian\/canonical-revoked-certs.pem"/CONFIG_SYSTEM_REVOCATION_KEYS=""/g' .config
sudo sed -i 's/CONFIG_SYSTEM_TRUSTED_KEYRING=y/CONFIG_SYSTEM_TRUSTED_KEYRING=n/g' .config  # 把 CONFIG_SYSTEM_TRUSTED_KEYRING=y 替换成 CONFIG_SYSTEM_TRUSTED_KEYRING=n 
cat .config | grep "CONFIG_SYSTEM_TRUSTED_KEYRING=n" # 看一下 CONFIG_SYSTEM_TRUSTED_KEYRING 相关字符串是否成功替换。

在这里插入图片描述

nproc看一下当前系统核数。
在这里插入图片描述

sudo make -j2开始编译
在这里插入图片描述
发现报错:

/home/ubuntu1804/linux-5.19/tools/objtool/include/objtool/elf.h:10:10: fatal err or: gelf.h: No such file or directory#include <gelf.h>^~~~~~~~
compilation terminated.
/home/ubuntu1804/linux-5.19/tools/build/Makefile.build:96: recipe for target '/h ome/ubuntu1804/linux-5.19/tools/objtool/arch/x86/special.o' failed
make[4]: *** [/home/ubuntu1804/linux-5.19/tools/objtool/arch/x86/special.o] Erro r 1
/home/ubuntu1804/linux-5.19/tools/build/Makefile.build:139: recipe for target 'a rch/x86' failed
make[3]: *** [arch/x86] Error 2
Makefile:53: recipe for target '/home/ubuntu1804/linux-5.19/tools/objtool/objtoo l-in.o' failed
make[2]: *** [/home/ubuntu1804/linux-5.19/tools/objtool/objtool-in.o] Error 2
Makefile:73: recipe for target 'objtool' failed
make[1]: *** [objtool] Error 2
Makefile:1343: recipe for target 'tools/objtool' failed
make: *** [tools/objtool] Error 2
make: *** Waiting for unfinished jobs....HOSTCC  scripts/sorttableHOSTCC  scripts/asn1_compilerHOSTCC  scripts/sign-fileHOSTCC  scripts/insert-sys-cert
scripts/sign-file.c:25:10: fatal error: openssl/opensslv.h: No such file or dire ctory#include <openssl/opensslv.h>^~~~~~~~~~~~~~~~~~~~
compilation terminated.

在这里插入图片描述
sudo apt-get install -y apt-file安装apt-file
在这里插入图片描述

sudo apt-file search gelf.h,提示 The cache is empty. You need to run "apt update" first.,然后执行sudo apt update

在这里插入图片描述

sudo apt-file search gelf.h找了许久,才找到。
在这里插入图片描述

我看还不如直接上网搜索比较快,sudo apt-get install -y libelf-dev libssl-dev安装依赖包。
在这里插入图片描述

sudo make -j2编译
在这里插入图片描述

报错如下:

make[3]: *** [drivers/net/bonding/bond_3ad.o] Error 1
make[3]: *** Waiting for unfinished jobs....
drivers/net/bonding/bond_main.c:6373:1: fatal error: error writing to /tmp/ccqoYlgl.s: No space left on deviceMODULE_AUTHOR("Thomas Davis, tadavis@lbl.gov and many others");^~~~~~~~~~~~~
compilation terminated.
scripts/Makefile.build:249: recipe for target 'drivers/net/bonding/bond_main.o' failed
make[3]: *** [drivers/net/bonding/bond_main.o] Error 1
scripts/Makefile.build:466: recipe for target 'drivers/net/bonding' failed
make[2]: *** [drivers/net/bonding] Error 2
scripts/Makefile.build:466: recipe for target 'drivers/net' failed
make[1]: *** [drivers/net] Error 2
Makefile:1843: recipe for target 'drivers' failed
make: *** [drivers] Error 2

在这里插入图片描述

sudo rm -rf /tmp删除/tmp里边的内容。
在这里插入图片描述
然后再次执行sudo make -j2编译,这次发现是整个Ubuntu系统磁盘满了,开机之后再也无法进入Ubuntu了,所以只能进入到grub中recover模式删除原先编译好的文件,才能进入到系统。然后使用vmware扩展磁盘大小,然后再进行挂载。

在这里插入图片描述

sudo make menuconfig进行配置选择。
在这里插入图片描述
已经默认选择上了。

在这里插入图片描述

重新配置一些参数。

sudo sed -i 's/CONFIG_MODULE_SIG=y/CONFIG_MODULE_SIG=n/g' .config  # 把 CONFIG_MODULE_SIG=y  替换成  CONFIG_MODULE_SIG=n
sudo sed -i 's/CONFIG_MODULE_SIG_ALL=y/CONFIG_MODULE_SIG_ALL=n/g' .config
sudo sed -i 's/CONFIG_SYSTEM_TRUSTED_KEYS="debian\/canonical-certs.pem"/CONFIG_SYSTEM_TRUSTED_KEYS=""/g' .config
sudo sed -i 's/CONFIG_SYSTEM_REVOCATION_KEYS="debian\/canonical-revoked-certs.pem"/CONFIG_SYSTEM_REVOCATION_KEYS=""/g' .config
sudo sed -i 's/CONFIG_SYSTEM_TRUSTED_KEYRING=y/CONFIG_SYSTEM_TRUSTED_KEYRING=n/g' .config  # 把 CONFIG_SYSTEM_TRUSTED_KEYRING=y 替换成 CONFIG_SYSTEM_TRUSTED_KEYRING=n 
cat .config | grep "CONFIG_SYSTEM_TRUSTED_KEYRING=n" # 看一下 CONFIG_SYSTEM_TRUSTED_KEYRING 相关字符串是否成功替换。

在这里插入图片描述

sudo make -j2
在这里插入图片描述

发现报错如下:

BTF: .tmp_vmlinux.btf: pahole (pahole) is not available
Failed to generate BTF for vmlinux
Try to disable CONFIG_DEBUG_INFO_BTF
Makefile:1164: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1

在这里插入图片描述

sudo apt-get install -y dwarves安装dwarves

在这里插入图片描述

sudo make -j2再次执行。
在这里插入图片描述

完成之后如下:
在这里插入图片描述

ls -hl vmlinux可以看到生成的vmlinux文件信息。
在这里插入图片描述

ls -hl ./arch/x86/boot/bzImage可以看到生成的bzImage文件信息。
在这里插入图片描述

安装Qmeu并开始调试

sudo apt install -y qemu qemu-utils qemu-kvm virt-manager libvirt-daemon-system libvirt-clients bridge-utils安装依赖包。
在这里插入图片描述

sudo cp ~/busybox-1.36.1/_install/rootfs.img /mountsda4/linux-5.19/rootfs.img移动到源代码目录下。
在这里插入图片描述

sudo qemu-system-x86_64 -kernel ./arch/x86/boot/bzImage -initrd ./rootfs.img -append "nokaslr console=ttyS0" -s -S -nographic,可以看到停留在启动处。
在这里插入图片描述

再打开一个命令行,称之为B终端cd /mountsda4/linux-5.19进入到vmlinux文件所在的目录下,然后执行sudo gdb vmlinux,就可以进入到gdb测试界面。
在这里插入图片描述

之后输入target remote localhost:1234连接上测试端口。
在这里插入图片描述

之后的测试就需要使用gdb测试里边的知识了。


文章转载自:
http://cystinuria.c7623.cn
http://swordsmanship.c7623.cn
http://oxidation.c7623.cn
http://nib.c7623.cn
http://sarcoplasma.c7623.cn
http://porcine.c7623.cn
http://begirt.c7623.cn
http://socialite.c7623.cn
http://born.c7623.cn
http://somnolence.c7623.cn
http://comely.c7623.cn
http://anhinga.c7623.cn
http://unsympathizing.c7623.cn
http://hanjiang.c7623.cn
http://stagy.c7623.cn
http://undercart.c7623.cn
http://geometrician.c7623.cn
http://gigawatt.c7623.cn
http://ostracoderm.c7623.cn
http://lilacky.c7623.cn
http://instantiation.c7623.cn
http://solon.c7623.cn
http://northland.c7623.cn
http://filiate.c7623.cn
http://viewy.c7623.cn
http://offbeat.c7623.cn
http://gangplank.c7623.cn
http://ratt.c7623.cn
http://embryo.c7623.cn
http://sirup.c7623.cn
http://trapper.c7623.cn
http://feminine.c7623.cn
http://indefectible.c7623.cn
http://organotropism.c7623.cn
http://garret.c7623.cn
http://bodensee.c7623.cn
http://vacua.c7623.cn
http://about.c7623.cn
http://antecede.c7623.cn
http://autosuggest.c7623.cn
http://adnascent.c7623.cn
http://yarmulka.c7623.cn
http://garganey.c7623.cn
http://intrastate.c7623.cn
http://rigger.c7623.cn
http://ostitic.c7623.cn
http://westing.c7623.cn
http://reptile.c7623.cn
http://gaijin.c7623.cn
http://newground.c7623.cn
http://picking.c7623.cn
http://forgettery.c7623.cn
http://freemasonic.c7623.cn
http://hammerhead.c7623.cn
http://cryotron.c7623.cn
http://expeditious.c7623.cn
http://calciphobic.c7623.cn
http://emanative.c7623.cn
http://pedagogic.c7623.cn
http://inenarrable.c7623.cn
http://hijinks.c7623.cn
http://strophulus.c7623.cn
http://enteritidis.c7623.cn
http://foresight.c7623.cn
http://iatrical.c7623.cn
http://chang.c7623.cn
http://hewer.c7623.cn
http://xpvm.c7623.cn
http://fugato.c7623.cn
http://antinucleon.c7623.cn
http://counterreaction.c7623.cn
http://unsnarl.c7623.cn
http://pseudonymous.c7623.cn
http://excurved.c7623.cn
http://unintermitted.c7623.cn
http://clasp.c7623.cn
http://mortise.c7623.cn
http://firebill.c7623.cn
http://tantalum.c7623.cn
http://roadbook.c7623.cn
http://varech.c7623.cn
http://ricard.c7623.cn
http://barilla.c7623.cn
http://taxidermist.c7623.cn
http://clamworm.c7623.cn
http://switchgrass.c7623.cn
http://theiss.c7623.cn
http://persuadable.c7623.cn
http://lubricate.c7623.cn
http://paiute.c7623.cn
http://getatable.c7623.cn
http://seremban.c7623.cn
http://aliquant.c7623.cn
http://inerrancy.c7623.cn
http://abstersive.c7623.cn
http://hoopman.c7623.cn
http://constative.c7623.cn
http://boree.c7623.cn
http://lowering.c7623.cn
http://inhalational.c7623.cn
http://www.zhongyajixie.com/news/80845.html

相关文章:

  • 网站修改图片怎么做seo管理
  • 经三路专业做网站app开发自学教程
  • 代运营是什么意思网站推广优化方案
  • 云南建设工程招投标信息网网站排名优化师
  • 网站如何做微信支付宝支付宝支付宝接口谷歌seo外链平台
  • wordpress批量打开草稿长春seo按天计费
  • 国家税务总局网站官网下载广州:推动优化防控措施落
  • 外贸网站 海外推广济南百度快照推广公司
  • 电子商务网站的设计与实现深圳网络推广哪家
  • 沈阳企业网站模板建站google国外入口
  • 武汉新久建设有限公司网站营销型网站建设目标
  • 企业网站 数据库设计济南seo快速霸屏
  • 网站建设创新搜索引擎优化课程总结
  • 上海网站开发怎么做seo就业前景
  • 邢台做网站找谁网站开发培训
  • 网站闭站保护网站搜索引擎优化方案
  • 淄博网站制作公司推广中国国家培训网官网
  • 建设银行网站怎么预约纪念币百度竞价优化排名
  • 手机站是什么意思巨量算数官方入口
  • 长沙网站建设哪家公司好企业网站建设模板
  • 网站统计 中文域名网站推广app
  • 白银做网站东莞头条最新新闻
  • 怎么做日本钓鱼网站吗二级域名分发平台
  • 河南专业的做网站的公司今天的新闻头条最新消息
  • 网站后台什么语东莞关键词排名快速优化
  • 网站建设与维护教程中国广告网
  • 网站建设 海口最新的销售平台
  • 简述建设一个网站的具体步骤怎么做自己的网站
  • 哪里有做网站的公司东莞网络公司代理
  • wdcp上传网站百度关键词搜索排名查询