使用OpenWrt最新镜像构建mfslinux内存救援系统的方法

86次阅读

共计 2054 个字符,预计需要花费 6 分钟才能阅读完成。

使用 OpenWrt 最新镜像构建 mfslinux 内存救援系统的方法
# 创建临时文件夹 tmp 重启就没了
mount -t tmpfs tmpfs /tmp/
cd /tmp
# 下载 OpenWrt 镜像
wget https://downloads.openwrt.org/releases/22.03.0-rc1/targets/x86/64/openwrt-22.03.0-rc1-x86-64-generic-ext4-combined.img.gz
# 解压
gzip -kd openwrt-22.03.0-rc1-x86-64-generic-ext4-combined.img.gz
# 加载 img 镜像
kpartx -av openwrt-22.03.0-rc1-x86-64-generic-ext4-combined.img
add map loop1p1 (253:3): 0 32768 linear 7:7 512
add map loop1p2 (253:4): 0 212992 linear 7:7 33792
# 挂载 img 镜像分区
mount /dev/mapper/loop1p2 /mnt
# 进入 /mnt 目录
cd /mnt
# 修改 root 密码
openssl passwd -1 https://dns.google/
$1$JbwU3xW8$2tJF3BZ6NiSzEjDWXndBm1
nano etc/shadow
root:$1$JbwU3xW8$2tJF3BZ6NiSzEjDWXndBm1::0:99999:7:::
# 修改网络为 IPV4 & IPV6 DHCP Client
nano etc/config/network
config interface ‘loopback’
option device ‘lo’
option proto ‘static’
option ipaddr ‘127.0.0.1’
option netmask ‘255.0.0.0’
config device
option name ‘br-lan’
option type ‘bridge’
list ports ‘eth0’
config interface ‘lan’
option device ‘br-lan’
option proto ‘dhcp’
config interface ‘ipv6’
option device ‘br-lan’
option proto ‘dhcpv6’
# 复制 init 到 / 目录
cp sbin/init ./
# 压缩 openwrt / 目录为 initramfs.igz
find . | cpio -H newc -o | gzip > initramfs.igz
# 下载 OpenWrt 内核 并改名 vmlinuz
wget -O vmlinuz https://downloads.openwrt.org/releases/22.03.0-rc1/targets/x86/64/openwrt-22.03.0-rc1-x86-64-generic-kernel.bin
# 下载 mfslinux 镜像
wget https://mfsbsd.vx.sk/files/iso/mfslinux/mfslinux-0.1.10-f9c75a4.iso
# 把 initramfs.igz 和 vmlinuz 复制到 mfslinux-0.1.10-f9c75a4.iso
用 UltraISO 打开 mfslinux-0.1.10-f9c75a4.iso
把 initramfs.igz 拖入 mfslinux-0.1.10-f9c75a4.iso 覆盖
把 ivmlinuz 拖入 mfslinux-0.1.10-f9c75a4.iso 覆盖
然后保存
# 改启动菜单名字(可省略)
用 UltraISO 打开 mfslinux-0.1.10-f9c75a4.iso
修改 boot.txt 文件
mfslinux 0.1.10 f9c75a4
Copyright (c) 2022 Martin Matuska <mm at matuska dot de>
a – Boot mfslinux (OpenWrt 21.02.2)
# 官方镜像软件包没几个 需要按自己需求安装软件包
比如
opkg update
opkg install coreutils-dd
opkg install curl
opkg install kmod-fs-ntfs
opkg install kmod-fs-xfs
opkg install nano-full
opkg install openssh-sftp-server
# 求个大佬解答一下 Ubuntu 如何挂载 iso 并对其进行修改 谢谢
把 initramfs.igz 和 vmlinuz 复制到 mfslinux-0.1.10-f9c75a4.iso
用 UltraISO 打开 mfslinux-0.1.10-f9c75a4.iso
把 initramfs.igz 拖入 mfslinux-0.1.10-f9c75a4.iso 覆盖
把 ivmlinuz 拖入 mfslinux-0.1.10-f9c75a4.iso 覆盖
然后保存

正文完
 0