Ubuntu .deb安装期间的Debconf对话框
我成功地为Ubuntu创建了一个.deb安装文件,但我需要用户输入来完成安装后脚本的配置。这些问题是动态的,基于用户在其计算机上的界面Ubuntu .deb安装期间的Debconf对话框,ubuntu,deb,debconf,Ubuntu,Deb,Debconf,我成功地为Ubuntu创建了一个.deb安装文件,但我需要用户输入来完成安装后脚本的配置。这些问题是动态的,基于用户在其计算机上的界面 在Ubuntu软件中心的安装过程中,是否有一种方法可以使用debconf向用户提示带有动态答案的问题(即,他们计算机上的界面列表)?明白了。在模板文件中,创建一个替换变量,并将其填充到配置文件中 模板文件: Template: pkg/interfaces Type: select Choices: ${choices} Description: .....
在Ubuntu软件中心的安装过程中,是否有一种方法可以使用debconf向用户提示带有动态答案的问题(即,他们计算机上的界面列表)?明白了。在模板文件中,创建一个替换变量,并将其填充到配置文件中 模板文件:
Template: pkg/interfaces
Type: select
Choices: ${choices}
Description: .....
配置文件:
declare -a options;
count=0;
## Get interfaces from the operating system
for interface in $(ip link show | awk '/^[0-9]/ {print $2;} ' | sed 's/:$//');
do
if [ $interface != "lo" ] && [ $interface != "" ] ;
then
options[$count]=$interface;
count=$((count+1));
fi
done
# Set the choices the user has
db_subst pkg/outface choices $options