diff options
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/live-preseed | 23 | ||||
| -rwxr-xr-x | bin/live-set-selections | 92 | ||||
| -rwxr-xr-x | bin/live-snapshot | 2 |
3 files changed, 9 insertions, 108 deletions
diff --git a/bin/live-preseed b/bin/live-preseed index add29bd..c0933e6 100755 --- a/bin/live-preseed +++ b/bin/live-preseed @@ -4,29 +4,22 @@ set -e PATH=/usr/sbin:/usr/bin:/sbin:/bin -# Only do this once -if [ -z "${DEBCONF_REDIR}" ] -then - exec <&4 - export DEBIAN_HAS_FRONTEND=1 - export DEBCONF_REDIR=1 -fi - root="${1}" -. "$root/usr/share/debconf/confmodule" - question="${2}" value="${3}" seen="${4}" [ "${seen}" ] || seen=true -if ! db_set "${question}" "${value}" +if ! (echo "SET ${question} ${value}"; echo "FSET ${question} seen ${seen}") | chroot "${1}" /usr/bin/debconf-communicate -fnoninteractive live-boot >/dev/null then - db_register debian-installer/dummy "${question}" - db_set "${question}" "${value}" -fi -db_fset "${question}" seen "${seen}" +chroot "${1}" /usr/bin/debconf-communicate -fnoninteractive live-boot >/dev/null << EOF +REGISTER debian-installer/dummy ${question} +SET ${question} ${value} +FSET ${question} seen ${seen} +EOF + +fi exit 0 diff --git a/bin/live-set-selections b/bin/live-set-selections deleted file mode 100755 index c4c38dd..0000000 --- a/bin/live-set-selections +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/sh -# Cloned-and-hacked from preseed/debconf-set-selections for live-initramfs. -set -e - -OLDIFS="$IFS" -CR=$(echo -en "\r") -NL=" -" - -. /scripts/live-functions -load_confmodule - -# Returns the first field in the current line -first_field() { - echo "$line" | grep -q "[[:space:]]" || return 1 - echo "$line" | sed -r 's/^([^[:space:]]*).*/\1/' -} - -# Returns any fields after the first field in the current line -rest_line() { - if echo "$line" | grep -q "[[:space:]]"; then - echo "$line" | sed 's/^[^[:space:]]*[[:space:]]*//' - fi -} - -SEEN=1 -if [ "$1" = --unseen ]; then - SEEN= - shift -fi - -file="$1" - -parse_error() { - echo "Error parsing preconfiguration file: $*" >&2 - exit 1 -} - -IFS="$NL" -multiline="" -# TODO: this squashes \r elsewhere in the line too -for line in $(grep -v '^#\|^[[:space:]]*$' "$file" | sed "s/$CR//g"); do - IFS="$OLDIFS" - - line="$(echo "$line" | sed 's/^[[:space:]]*//')" - if echo "$line" | grep -q '\\$'; then - multiline="${multiline:+$multiline }$(echo "$line" | \ - sed 's/[[:space:]]*\\$//')" - continue - elif [ -n "$multiline" ]; then - line="$multiline $line" - multiline="" - fi - - package="" - var="" - type="" - val="" - if ! package="$(first_field)"; then - parse_error "Syntax error: unable to determine template owner" - fi - line="$(rest_line)" - if ! var="$(first_field)"; then - parse_error "Syntax error: unable to determine template name" - fi - line="$(rest_line)" - if ! type="$(first_field)"; then - # Allow for lines without separator before an empty value - if [ "$line" ]; then - type="$line" - else - parse_error "Syntax error: unable to determine template type" - fi - fi - line="$(rest_line)" - val="$line" - - if [ "$type" = seen ]; then - # Set seen flag. - db_fset "$var" "$type" "$val" || true # how to handle this error? - else - if ! db_set "$var" "$val"; then - # Question does not exist yet. - db_register debian-installer/dummy "$var" - db_set "$var" "$val" - db_subst "$var" ID "$var" - fi - if [ "$SEEN" ]; then - db_fset "$var" seen true - fi - fi -done diff --git a/bin/live-snapshot b/bin/live-snapshot index 55673bb..1e080c3 100755 --- a/bin/live-snapshot +++ b/bin/live-snapshot @@ -4,7 +4,7 @@ # # This program mounts a device (fallback to /tmpfs under $MOUNTP # and saves the /live/cow (or a different directory) filesystem in it -# for reuse in another live-initramfs session. +# for reuse in another live-boot session. # Look at the manpage for more informations. # # Copyright (C) 2006-2008 Marco Amadori <marco.amadori@gmail.com> |
