diff options
| author | Daniel Baumann <daniel@debian.org> | 2007-09-23 14:46:22 +0200 |
|---|---|---|
| committer | Daniel Baumann <daniel@debian.org> | 2007-09-23 14:46:22 +0200 |
| commit | 4a0b1ba4d428c623d14bae7f0db85c80abb0da0a (patch) | |
| tree | de03aceffba0ce13f098d970cc89f806db7af5d7 /bin | |
| download | live-boot-4a0b1ba4d428c623d14bae7f0db85c80abb0da0a.tar.gz live-boot-4a0b1ba4d428c623d14bae7f0db85c80abb0da0a.zip | |
Adding casper 1.59+debian-1.
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/casper-preseed | 17 | ||||
| -rwxr-xr-x | bin/casper-reconfigure | 52 |
2 files changed, 69 insertions, 0 deletions
diff --git a/bin/casper-preseed b/bin/casper-preseed new file mode 100755 index 0000000..6967fe2 --- /dev/null +++ b/bin/casper-preseed @@ -0,0 +1,17 @@ +#! /bin/sh +set -e +PATH=/usr/sbin:/usr/bin:/sbin:/bin + +root="$1" +question="$2" +value="$3" + +if ! (echo "SET $question $value"; echo "FSET $question seen true") | chroot "$1" debconf-communicate -fnoninteractive casper >/dev/null; then + chroot "$1" debconf-communicate -fnoninteractive casper >/dev/null <<EOF +REGISTER debian-installer/dummy $question +SET $question $value +FSET $question seen true +EOF +fi + +exit 0 diff --git a/bin/casper-reconfigure b/bin/casper-reconfigure new file mode 100755 index 0000000..628bff3 --- /dev/null +++ b/bin/casper-reconfigure @@ -0,0 +1,52 @@ +#!/bin/sh + +set -e +export PATH=/usr/bin:/usr/sbin:/sbin:/bin + +frontend=noninteractive + +findcommandinroot() { + ROOT="$1/" + shift + while [ "$#" -ge 1 ]; do + P="$PATH" + while [ "$P" ]; do + D=${P%%:*} + P=${P#*:} + if [ "$D" = "$P" ]; then + P= + fi + if [ -z "$D" ]; then + D=. + fi + if [ -x "$ROOT$D/$1" ]; then + echo "$D/$1" + return 0 + fi + done + shift + done + return 1 +} + +runcommandinroot() { + C=$(findcommandinroot "$1" "$2") + ROOT="$1" + shift + shift + [ -n "$C" ] && chroot "$ROOT" "$C" "$@" +} + +root="$1" +package="$2" + +version=$(runcommandinroot "$root" dpkg-query -W --showformat='${Version}' "$package" 2>/dev/null) || version="" + +if [ -z "$version" ]; then + echo "$0: package '$package' is not installed" + exit 0 +fi + +runcommandinroot "$root" dpkg-reconfigure -fnoninteractive --no-reload -phigh "$package" + +exit 0 |
