debian系统打包(live build)

该文档用于记录一些指令,不涉及原理解读

系统:debian12.6

1.config

bash 复制代码
sudo lb config \
	--binary-images iso-hybrid \
	--compression xz \
	--iso-volume "debian" \
	--architecture amd64 \
	--distribution bookworm \
	--archive-areas "main contrib non-free" \
	--mirror-bootstrap "http://mirrors.aliyun.com/debian/" \
	--mirror-chroot "http://mirrors.aliyun.com/debian/" \
	--mirror-chroot-security "http://mirrors.aliyun.com/debian-security/" \
	--mirror-binary "http://mirrors.aliyun.com/debian/" \
	--mirror-binary-security "http://mirrors.aliyun.com/debian-security/" \
	--parent-mirror-bootstrap "http://mirrors.aliyun.com/debian/" \
	--parent-mirror-chroot "http://mirrors.aliyun.com/debian/" \
	--parent-mirror-chroot-security "http://mirrors.aliyun.com/debian-security/"

2.build

`sudo lb build`

lb build指令分解如下:

bash 复制代码
# 阶段1:清理旧构建残留(可选,建议执行) 
sudo lb clean --stage all 

# 阶段2:bootstrap(构建基础根文件系统) 
# 作用:下载debian基础包,创建最小根文件系统 
sudo lb bootstrap 2>&1 | tee bootstrap.log 

# 阶段3:chroot(配置根文件系统,安装自定义包/复制配置) 
# 作用:进入chroot环境,安装你在package-lists中定义的包,同步includes.chroot配置 
sudo lb chroot 2>&1 | tee chroot.log 

# 阶段4:binary(生成二进制镜像文件) 
# 作用:构建ISO的二进制核心(内核、initramfs、启动脚本等) 
sudo lb binary 2>&1 | tee binary.log 

# 阶段5:source(生成源码镜像,可选,按需执行) 
# 作用:若需要源码ISO则执行,仅需二进制ISO可跳过 
sudo lb source 2>&1 | tee source.log 

# 阶段6:build(整合所有文件生成最终ISO) 
# 作用:将binary阶段的文件打包为iso-hybrid格式 
sudo lb build 2>&1 | tee final-build.log 

# (可选)阶段7:验证ISO完整性 
sudo isohybrid live-image-amd64.hybrid.iso 
# 确保ISO支持U盘启动

3.执行无报错后生成一个文件*.iso,这个文件可以直接使用vm虚拟机启动(如果需要定制化系提供还需要其他的设置,在`工作文件/config/`中进行设置)

ps:目前直接将系统配置复制到对应的文件夹下无法起作用,正在探索中····

相关推荐
qetfw6 天前
Debian SSH 与 SFTP 分离:独立端口、Chroot 隔离与 internal-sftp
debian·ssh
qetfw8 天前
Debian Squid 代理与反向代理:ACL、3128 端口与验证
debian·squid
小祺先生11 天前
mt7921 debian系统 如何安装驱动
运维·网络·debian
qetfw11 天前
Debian 10 部署 Roundcube Webmail:Bind9、Postfix、Dovecot、SMTPS、IMAPS 与 HTTPS
debian·roundcube
黑色的白兔No111 天前
deepin 25安装mysql
数据库·mysql·debian
皓月盈江11 天前
Linux系统使用VSCode搭建GO开发环境
linux·vscode·ubuntu·golang·debian
qetfw13 天前
Debian Postfix + Dovecot + MariaDB 虚拟邮箱连接:SQL 用户、域名与别名配置
linux·debian
qetfw15 天前
Debian Postfix + Dovecot 基础配置:DNS、Maildir、IMAP 与邮件队列验证
linux·服务器·网络·debian
CedarQR15 天前
LubanCat-2 (RK3568) Debian 下让 H3C Magic USB 无线网卡(AIC8800)联网全记录
linux·网络·单片机·嵌入式硬件·debian·3568·h3c
qetfw18 天前
Debian 部署 phpMyAdmin:Apache、PHP 与 MariaDB 管理界面配置
linux·debian·php·apache