summaryrefslogtreecommitdiff
path: root/scripts/live-bottom
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/live-bottom')
-rwxr-xr-xscripts/live-bottom/10adduser6
-rwxr-xr-xscripts/live-bottom/13swap10
-rwxr-xr-xscripts/live-bottom/14locales2
-rwxr-xr-xscripts/live-bottom/15autologin2
-rwxr-xr-xscripts/live-bottom/20xconfig2
-rwxr-xr-xscripts/live-bottom/42apt_upgrade49
6 files changed, 60 insertions, 11 deletions
diff --git a/scripts/live-bottom/10adduser b/scripts/live-bottom/10adduser
index f4c42f8..378f016 100755
--- a/scripts/live-bottom/10adduser
+++ b/scripts/live-bottom/10adduser
@@ -26,7 +26,7 @@ log_begin_msg "Adding live session user..."
# live-initramfs script
-if [ "${BUILD_SYSTEM}" == "Debian" ]; then
+if [ "${BUILD_SYSTEM}" = "Debian" ]; then
user_crypted="8Ab05sVQ4LLps" # as in `echo "live" | mkpasswd -s`
else
user_crypted="U6aMy0wojraho" # "ubuntu"
@@ -41,7 +41,7 @@ set passwd/username $USERNAME
set passwd/user-uid 999
EOF
-if [ "${BUILD_SYSTEM}" == "Debian" ]; then
+if [ "${BUILD_SYSTEM}" = "Debian" ]; then
chroot /root /usr/bin/env -i HOME="/root" \
TERM="${TERM}" PATH="/usr/sbin:/usr/bin:/sbin:/bin" \
/usr/lib/user-setup/user-setup-apply > /dev/null
@@ -62,7 +62,7 @@ if [ -z "${NOSUDO}" ]
then
if [ -f /root/etc/sudoers ]; then
- if [ "${BUILD_SYSTEM}" == "Ubuntu" ]; then
+ if [ "${BUILD_SYSTEM}" = "Ubuntu" ]; then
grep -q '^%admin' /root/etc/sudoers && sed -i -e '/^%admin/s/ALL$/NOPASSWD: ALL/' /root/etc/sudoers || echo '%admin ALL=(ALL) NOPASSWD: ALL' >> /root/etc/sudoers
# XXX - awful hack to stop xscreensaver locking the screen (#7150)
diff --git a/scripts/live-bottom/13swap b/scripts/live-bottom/13swap
index 4f6be9d..8b47a00 100755
--- a/scripts/live-bottom/13swap
+++ b/scripts/live-bottom/13swap
@@ -20,6 +20,11 @@ esac
# live-initramfs header
+if [ -n "${NOSWAP}" ]
+then
+ exit 0
+fi
+
. /scripts/live-functions
log_begin_msg "Setting up swap..."
@@ -28,11 +33,6 @@ log_begin_msg "Setting up swap..."
FSTAB=/root/etc/fstab
-if [ -n "${NOSWAP}" ]
-then
- exit 0
-fi
-
devices=""
for device in /dev/[hs]d[a-z][0-9]*; do
if ! [ -b "$device" ]; then
diff --git a/scripts/live-bottom/14locales b/scripts/live-bottom/14locales
index 3fe04c7..bdb1d8b 100755
--- a/scripts/live-bottom/14locales
+++ b/scripts/live-bottom/14locales
@@ -70,7 +70,7 @@ if [ "${set_locale}" ]; then
really_export LANG
- if [ "${BUILD_SYSTEM}" == "Ubuntu" ]; then
+ if [ "${BUILD_SYSTEM}" = "Ubuntu" ]; then
printf 'LANG="%s"\n' "${LANG}" > "${grep_file}"
chroot /root /usr/sbin/locale-gen "${LANG}"
live-preseed /root debian-installer/locale "${locale}"
diff --git a/scripts/live-bottom/15autologin b/scripts/live-bottom/15autologin
index b24d428..f15f033 100755
--- a/scripts/live-bottom/15autologin
+++ b/scripts/live-bottom/15autologin
@@ -36,7 +36,7 @@ else
fi
if chroot /root [ -f ${GDMCONF} ]; then
- if [ "${BUILD_SYSTEM}" == "Debian" ]; then
+ if [ "${BUILD_SYSTEM}" = "Debian" ]; then
# true hack ! -- nohar
chroot /root cp /usr/share/gdm/defaults.conf /etc/gdm/gdm.conf
fi
diff --git a/scripts/live-bottom/20xconfig b/scripts/live-bottom/20xconfig
index 161215b..1105e4a 100755
--- a/scripts/live-bottom/20xconfig
+++ b/scripts/live-bottom/20xconfig
@@ -43,7 +43,7 @@ if [ -n "${XDEBCONF}" -a -x /root/usr/sbin/xdebconfigurator ]; then
chroot /root /usr/sbin/xdebconfigurator
fi
-if [ "${BUILD_SYSTEM}" == "Ubuntu" ]; then
+if [ "${BUILD_SYSTEM}" = "Ubuntu" ]; then
chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null <<EOF
set xserver-xorg/autodetect_keyboard true
fset xserver-xorg/autodetect_keyboard seen true
diff --git a/scripts/live-bottom/42apt_upgrade b/scripts/live-bottom/42apt_upgrade
new file mode 100755
index 0000000..96ec814
--- /dev/null
+++ b/scripts/live-bottom/42apt_upgrade
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+ echo "${PREREQ}"
+}
+
+case "${1}" in
+ prereqs)
+ prereqs
+ exit 0
+ ;;
+esac
+
+# live-initramfs header
+
+if [ -z "${UPGRADE}" ]
+then
+ exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Enabling apt upgrade..."
+
+# live-initramfs script
+
+cat > /root/etc/init.d/apt-upgrade << EOF
+#!/bin/sh
+
+NOTTY="-q -y -o DPkg::Options::=--force-confdef"
+UPGRADEOPTS="dist-upgrade"
+DEBIAN_FRONTEND="noninteractive"
+export DEBIAN_FRONTEND
+
+apt-get -q=2 update && apt-get \${NOTTY} -u \${UPGRADEOPTS}
+EOF
+
+chmod 0755 /root/etc/init.d/apt-upgrade
+
+chroot /root update-rc.d apt-upgrade defaults 99
+
+log_end_msg