Silence a number of annoying and distracting bootup messages.
authorChris Lamb <chris@chris-lamb.co.uk>
Fri, 8 Aug 2008 04:25:06 +0000 (05:25 +0100)
committerDaniel Baumann <daniel@debian.org>
Wed, 9 Mar 2011 16:48:01 +0000 (17:48 +0100)
scripts/live-bottom/10adduser
scripts/live-bottom/20xconfig
scripts/live-bottom/31disable_update_notifier
scripts/live-bottom/38disable_restricted_manager
scripts/live-bottom/41apt_cdrom
scripts/live-bottom/42disable_apparmor
scripts/live-bottom/44pk_allow

index 2277c9c..60d6028 100755 (executable)
@@ -64,8 +64,12 @@ then
                echo "${USERNAME}  ALL=(ALL) NOPASSWD: ALL" >> /root/etc/sudoers
 
                chroot /root sudo -u "${USERNAME}" sh -c "echo 'SU_TO_ROOT_SU=sudo' >> /home/${USERNAME}/.su-to-rootrc"
-               chroot /root sudo -u "${USERNAME}" gconftool-2 -s -t bool /apps/gksu/sudo-mode true
-               chroot /root sudo -u "${USERNAME}" gconftool-2 -s -t bool /apps/gksu/display-no-pass-info false
+
+               if [ -x /root/usr/bin/gconftool-2 ]
+               then
+                       chroot /root sudo -u "${USERNAME}" gconftool-2 -s -t bool /apps/gksu/sudo-mode true
+                       chroot /root sudo -u "${USERNAME}" gconftool-2 -s -t bool /apps/gksu/display-no-pass-info false
+               fi
 
 chroot /root sudo -u "${USERNAME}" sh -c "umask 0077 && mkdir -p /home/${USERNAME}/.kde/share/config && cat > /home/${USERNAME}/.kde/share/config/kdesurc" << EOF
 [super-user-command]
index e2afe78..39a0aa4 100755 (executable)
@@ -77,7 +77,7 @@ ${setmodel}
 ${setoptions}
 EOF
 
-DEBUG_XORG_PACKAGE=1 DEBUG_XORG_DEBCONF=1 live-reconfigure /root xserver-xorg
+DEBUG_XORG_PACKAGE=1 DEBUG_XORG_DEBCONF=1 live-reconfigure /root xserver-xorg 2>/dev/null
 umount /root/sys
 umount /root/proc
 umount /root/dev
index e67ce4f..e363049 100755 (executable)
@@ -37,7 +37,10 @@ log_begin_msg "Disabling update-notifier"
 chroot /root dpkg-divert --add --rename --quiet \
        /usr/lib/update-notifier/apt-check
 
-ln -s /bin/true /root/usr/lib/update-notifier/apt-check
+if [ -e /root/usr/lib/update-notifier/apt-check ]
+then
+       ln -s /bin/true /root/usr/lib/update-notifier/apt-check
+fi
 
 # For KDE, adept_notifier's only useful function at the moment is an
 # 'apt-get update' equivalent, so we disable it entirely.
index 208bf4e..d585d3c 100755 (executable)
@@ -30,7 +30,10 @@ rm -f /root/etc/xdg/autostart/restricted-manager-kde.desktop
 # Since we disable restricted-manager, there isn't much point generating the
 # fglrx or nvidia modules either. The other restricted modules may still be
 # useful.
-sed -i 's/^DISABLED_MODULES=""/DISABLED_MODULES="fglrx nv"/' \
-       /root/etc/default/linux-restricted-modules-common
+if [ -e /root/etc/default/linux-restricted-modules-common ]
+then
+       sed -i 's/^DISABLED_MODULES=""/DISABLED_MODULES="fglrx nv"/' \
+               /root/etc/default/linux-restricted-modules-common
+fi
 
 log_end_msg
index 9998e97..00606d5 100755 (executable)
@@ -31,6 +31,9 @@ log_begin_msg "Adding APT-CDROM source"
 
 # live-initramfs script
 
-chroot /root apt-cdrom -m add
+if [ -d /root/cdrom ]
+then
+       chroot /root apt-cdrom -m add
+fi
 
 log_end_msg
index fd49aa9..f87cab4 100755 (executable)
@@ -31,6 +31,9 @@ log_begin_msg "Disabling AppArmor (does not work with stacked file systems)"
 
 # live-initramfs script
 
-chroot /root update-rc.d -f apparmor remove
+if [ -x /root/etc/init.d/apparmor ]
+then
+       chroot /root update-rc.d -f apparmor remove
+fi
 
 log_end_msg
index 84c4b6b..7fd026e 100755 (executable)
@@ -27,6 +27,7 @@ log_begin_msg "Grant administrative PolicyKit pivilieges to default user"
 # live-initramfs script
 
 # configure PolicyKit in live session
+mkdir -p /root/etc/PolicyKit
 cat << EOF > /root/etc/PolicyKit/PolicyKit.conf
 <?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->