From 11f6195097148e7b5738ffe29dc16061b2cfd770 Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Fri, 8 Aug 2008 05:25:06 +0100 Subject: [PATCH] Silence a number of annoying and distracting bootup messages. --- scripts/live-bottom/10adduser | 8 ++++++-- scripts/live-bottom/20xconfig | 2 +- scripts/live-bottom/31disable_update_notifier | 5 ++++- scripts/live-bottom/38disable_restricted_manager | 7 +++++-- scripts/live-bottom/41apt_cdrom | 5 ++++- scripts/live-bottom/42disable_apparmor | 5 ++++- scripts/live-bottom/44pk_allow | 1 + 7 files changed, 25 insertions(+), 8 deletions(-) diff --git a/scripts/live-bottom/10adduser b/scripts/live-bottom/10adduser index 2277c9c..60d6028 100755 --- a/scripts/live-bottom/10adduser +++ b/scripts/live-bottom/10adduser @@ -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] diff --git a/scripts/live-bottom/20xconfig b/scripts/live-bottom/20xconfig index e2afe78..39a0aa4 100755 --- a/scripts/live-bottom/20xconfig +++ b/scripts/live-bottom/20xconfig @@ -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 diff --git a/scripts/live-bottom/31disable_update_notifier b/scripts/live-bottom/31disable_update_notifier index e67ce4f..e363049 100755 --- a/scripts/live-bottom/31disable_update_notifier +++ b/scripts/live-bottom/31disable_update_notifier @@ -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. diff --git a/scripts/live-bottom/38disable_restricted_manager b/scripts/live-bottom/38disable_restricted_manager index 208bf4e..d585d3c 100755 --- a/scripts/live-bottom/38disable_restricted_manager +++ b/scripts/live-bottom/38disable_restricted_manager @@ -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 diff --git a/scripts/live-bottom/41apt_cdrom b/scripts/live-bottom/41apt_cdrom index 9998e97..00606d5 100755 --- a/scripts/live-bottom/41apt_cdrom +++ b/scripts/live-bottom/41apt_cdrom @@ -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 diff --git a/scripts/live-bottom/42disable_apparmor b/scripts/live-bottom/42disable_apparmor index fd49aa9..f87cab4 100755 --- a/scripts/live-bottom/42disable_apparmor +++ b/scripts/live-bottom/42disable_apparmor @@ -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 diff --git a/scripts/live-bottom/44pk_allow b/scripts/live-bottom/44pk_allow index 84c4b6b..7fd026e 100755 --- a/scripts/live-bottom/44pk_allow +++ b/scripts/live-bottom/44pk_allow @@ -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 -- 2.1.4