个人工具

UbuntuHelp:InstallCDCustomization/AccessDebconfFromYourScript

来自Ubuntu中文

Wikibot讨论 | 贡献2010年5月19日 (三) 22:52的版本 (以内容'{{From|https://help.ubuntu.com/community/InstallCDCustomization/AccessDebconfFromYourScript}} {{Languages|UbuntuHelp:InstallCDCustomization/AccessDebconfFromYourScript}} <p…'创建新页面)

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航, 搜索
#!/bin/sh
# A debconf-compatible script example.
. /usr/share/debconf/confmodule

# Create a template file, for our interaction with the user.
cat > /tmp/MyInstall.template <<'!EOF!'
Template: debian-installer/my-install/title
Type: text
# Main menu item
# :sl1:
Description: Installation of the core Operating System components has now completed.
 Additional software, and supporting applications, will now be installed.

Template: my-install/progress/title
Type: text
# :sl1:
Description: Installing Additional Components...

Template: my-install/asktheuser
Type: string
Description: Just type anything here.
!EOF!

debconf-loadtemplate snare-install /tmp/MyInstall.template

STEPS=10
db_progress START 0 $STEPS my-install/progress/title

# Do something or other
db_progress STEP 1

db_progress INFO snare-install/progress/title
# Do something or other
db_progress STEP 1

db_input critical my-install/asktheuser || true
db_go

db_get my-install/asktheuser
USERRESPONSE=$RET

echo $USERRESPONSE > /target/var/log/TheUsersResponse
chroot /target bash -c "cat /var/log/TheUsersResponse > /var/log/SomethingElse"