diff options
| author | Daniel Baumann <daniel@debian.org> | 2010-05-01 13:31:18 +0200 |
|---|---|---|
| committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 17:48:09 +0100 |
| commit | c967ebfc4e43fb16a0c2c140c66900712be95ab7 (patch) | |
| tree | 74a8a142d7d6ceadcd9c4cb23ee3819fd8739336 /scripts | |
| parent | 65721717c4e37f6cec9e66f2ac355746490338ab (diff) | |
| download | live-boot-c967ebfc4e43fb16a0c2c140c66900712be95ab7.tar.gz live-boot-c967ebfc4e43fb16a0c2c140c66900712be95ab7.zip | |
Merging casper 1.216.
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/live | 29 | ||||
| -rwxr-xr-x | scripts/live-bottom/10adduser | 29 | ||||
| -rwxr-xr-x | scripts/live-bottom/22sslcert | 1 | ||||
| -rwxr-xr-x | scripts/live-bottom/24preseed | 12 | ||||
| -rwxr-xr-x | scripts/live-bottom/30accessibility | 21 | ||||
| -rw-r--r-- | scripts/live-functions | 13 |
6 files changed, 63 insertions, 42 deletions
diff --git a/scripts/live b/scripts/live index 6f4f5c1..26a6a46 100755 --- a/scripts/live +++ b/scripts/live @@ -1885,6 +1885,28 @@ mountroot () mount -n -o bind /dev "${rootmnt}/dev" fi + # Open up two fifo's fd's for debconf-communicate to use. Speeds up + # the live-initramfs process considerably. + log_begin_msg "Creating debconf-communicate fifo mechanism" + mkfifo /tmp/debconf-in.fifo + mkfifo /tmp/debconf-out.fifo + + chroot /root debconf-communicate -fnoninteractive live-initramfs > /tmp/debconf-out.fifo < /tmp/debconf-in.fifo & + + # Save the PID so it can be killed later. + DEBCONF_COMMUNICATE_PID="$!" + + if [ ! -p /tmp/debconf-in.fifo ] || [ ! -p /tmp/debconf-out.fifo ] + then + log_warning_msg "failed to setup debconf-communicate channel" + fi + log_end_msg + + # Order matters! + # These file descriptors must stay open until we're finished with + # debconf-communicate. + exec 4</tmp/debconf-out.fifo 3>/tmp/debconf-in.fifo + maybe_break live-bottom log_begin_msg "Running /scripts/live-bottom\n" @@ -1896,6 +1918,13 @@ mountroot () umount "${rootmnt}/dev" fi + # Kill the debconf-communicate instance and close fd's associated with· + # debconf-communicate. + kill $DEBCONF_COMMUNICATE_PID + exec 3>&- 4<&- + rm -f /tmp/debconf-in.fifo + rm -f /tmp/debconf-out.fifo + exec 1>&6 6>&- exec 2>&7 7>&- kill ${tailpid} diff --git a/scripts/live-bottom/10adduser b/scripts/live-bottom/10adduser index c7adad2..51868d4 100755 --- a/scripts/live-bottom/10adduser +++ b/scripts/live-bottom/10adduser @@ -26,6 +26,7 @@ then fi . /scripts/live-functions +load_confmodule log_begin_msg "Adding live session user" @@ -34,14 +35,12 @@ log_begin_msg "Adding live session user" user_crypted="8Ab05sVQ4LLps" # as in $(echo "live" | mkpasswd -s) # U6aMy0wojraho is just a blank password -chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null << EOF -set passwd/make-user true -set passwd/root-password-crypted * -set passwd/user-password-crypted ${user_crypted} -set passwd/user-fullname ${USERFULLNAME} -set passwd/username ${USERNAME} -set passwd/user-uid 1000 -EOF +db_set passwd/make-user true +db_set passwd/root-password-crypted '*' +db_set passwd/user-password-crypted ${user_crypted} +db_set passwd/user-fullname "$USERFULLNAME" +db_set passwd/username "$USERNAME" +db_set passwd/user-uid 999 chroot /root /usr/bin/env -i HOME="/root" \ TERM="${TERM}" PATH="/usr/sbin:/usr/bin:/sbin:/bin" \ @@ -49,14 +48,12 @@ chroot /root /usr/bin/env -i HOME="/root" \ | grep -v "Shadow passwords are now on" # Clear out debconf database again to avoid confusing ubiquity later. -chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null << EOF -set passwd/make-user -set passwd/root-password-crypted -set passwd/user-password-crypted -set passwd/user-fullname -set passwd/username -set passwd/user-uid -EOF +db_set passwd/make-user +db_set passwd/root-password-crypted +db_set passwd/user-password-crypted +db_set passwd/user-fullname +db_set passwd/username +db_set passwd/user-uid if ! grep -qs "${USERNAME}" /root/etc/passwd then diff --git a/scripts/live-bottom/22sslcert b/scripts/live-bottom/22sslcert index 1950eef..d54dc29 100755 --- a/scripts/live-bottom/22sslcert +++ b/scripts/live-bottom/22sslcert @@ -21,6 +21,7 @@ esac # live-initramfs header . /scripts/live-functions +load_confmodule log_begin_msg "Regenerating SSL certificate..." diff --git a/scripts/live-bottom/24preseed b/scripts/live-bottom/24preseed index 7dd6394..9a77ef5 100755 --- a/scripts/live-bottom/24preseed +++ b/scripts/live-bottom/24preseed @@ -26,6 +26,7 @@ then fi . /scripts/live-functions +load_confmodule log_begin_msg "Loading preseed file" @@ -33,14 +34,14 @@ log_begin_msg "Loading preseed file" if [ -e /preseed.cfg ] then - chroot /root debconf-set-selections < /preseed.cfg + live-set-selections /preseed.cfg fi if [ -n "${LOCATIONS}" ] then for item in ${LOCATIONS} do - chroot /root debconf-set-selections < "/root${ITEM}" + live-set-selections "/root$item" done fi @@ -55,12 +56,9 @@ then done fi -reply="$(echo "GET preseed/early_command" | chroot /root debconf-communicate -fnoninteractive live-initramfs)" - -if [ "${reply#0 }" != "${reply}" ] +if db_get preseed/early_command && [ "$RET" ] then - reply="${reply#0 }" - sh -c "${reply}" + sh -c "$RET" fi # Clear out debconf database backup files to save memory. diff --git a/scripts/live-bottom/30accessibility b/scripts/live-bottom/30accessibility index 4624077..75bfae4 100755 --- a/scripts/live-bottom/30accessibility +++ b/scripts/live-bottom/30accessibility @@ -109,20 +109,12 @@ case ${ACCESS} in gct -s -t bool /desktop/gnome/interface/accessibility true gct -s -t bool /desktop/gnome/applications/at/visual/startup true gct -s -t string /desktop/gnome/applications/at/visual/exec orca + gct -s -t string /apps/empathy/conversation/theme classic gct -s -t bool /apps/gksu/disable-grab true gct -s -t string /desktop/gnome/applications/window_manager/default /usr/bin/metacity sed -i -e 's/# Host alias specification/Defaults\tenv_keep = "ORBIT_SOCKETDIR XDG_SESSION_COOKIE GTK_MODULES"\n\n# Host alias specification/g' /root/etc/sudoers remove_applet fast_user_switch - if [ -x /root/usr/bin/pulse-session ] - then - mkdir -p /root/var/lib/pulseaudio - touch /root/var/lib/pulseaudio/pulse_a11y_nostart - chroot /root chown root.root /var/lib/pulseaudio/pulse_a11y_nostart - mkdir -p /root/home/$USERNAME/.pulse - echo "autospawn = no" > /root/home/$USERNAME/.pulse/client.conf - chroot /root chown -R $USERNAME.$USERNAME /home/$USERNAME/.pulse - fi if [ -x /root/usr/bin/orca ] then mkdir -p /root/home/$USERNAME/.orca @@ -137,6 +129,7 @@ case ${ACCESS} in gct -s -t string /desktop/gnome/applications/at/visual/exec orca gct -s -t bool /apps/gksu/disable-grab true gct -s -t string /desktop/gnome/applications/window_manager/default /usr/bin/metacity + gct -s -t string /apps/empathy/conversation/theme classic sed -i -e 's/# Host alias specification/Defaults\tenv_keep = "ORBIT_SOCKETDIR XDG_SESSION_COOKIE GTK_MODULES"\n\n# Host alias specification/g' /root/etc/sudoers if [ -x /root/usr/bin/orca ] @@ -149,16 +142,6 @@ case ${ACCESS} in chroot /root chown -R ${USERNAME}:${USERNAME} /home/${USERNAME}/.orca fi - if [ -x /root/usr/bin/pulse-session ] - then - mkdir -p /root/var/lib/pulseaudio - touch /root/var/lib/pulseaudio/pulse_a11y_nostart - chroot /root chown root.root /var/lib/pulseaudio/pulse_a11y_nostart - mkdir -p /root/home/$USERNAME/.pulse - echo "autospawn = no" > /root/home/$USERNAME/.pulse/client.conf - chroot /root chown -R $USERNAME.$USERNAME /home/$USERNAME/.pulse - fi - remove_applet fast_user_switch ;; diff --git a/scripts/live-functions b/scripts/live-functions index 4a23e69..4c37f4b 100644 --- a/scripts/live-functions +++ b/scripts/live-functions @@ -111,3 +111,16 @@ panic() { . /scripts/functions panic "$@" } + +load_confmodule () +{ + # Only do this once + if [ -z "$DEBCONF_REDIR" ] + then + exec <&4 + export DEBIAN_HAS_FRONTEND=1 + export DEBCONF_REDIR=1 + fi + + . /root/usr/share/debconf/confmodule +} |
