diff options
Diffstat (limited to 'scripts/casper-bottom')
| -rwxr-xr-x | scripts/casper-bottom/01integrity_check | 2 | ||||
| -rwxr-xr-x | scripts/casper-bottom/10adduser | 29 | ||||
| -rwxr-xr-x | scripts/casper-bottom/14locales | 35 | ||||
| -rwxr-xr-x | scripts/casper-bottom/22gnome_panel_data | 6 | ||||
| -rwxr-xr-x | scripts/casper-bottom/23networking | 6 | ||||
| -rwxr-xr-x | scripts/casper-bottom/25configure_init | 19 | ||||
| -rwxr-xr-x | scripts/casper-bottom/33disable_binary_drivers | 4 |
7 files changed, 39 insertions, 62 deletions
diff --git a/scripts/casper-bottom/01integrity_check b/scripts/casper-bottom/01integrity_check index 8c8e153..637a1ff 100755 --- a/scripts/casper-bottom/01integrity_check +++ b/scripts/casper-bottom/01integrity_check @@ -15,4 +15,4 @@ prereqs) ;; esac -grep integrity-check /proc/cmdline && casper-md5check /live_media /live_media/md5sum.txt < /dev/tty8 +grep integrity-check /proc/cmdline && casper-md5check /cdrom /cdrom/md5sum.txt < /dev/tty8 diff --git a/scripts/casper-bottom/10adduser b/scripts/casper-bottom/10adduser index dc8aaa8..a37d831 100755 --- a/scripts/casper-bottom/10adduser +++ b/scripts/casper-bottom/10adduser @@ -28,9 +28,7 @@ set passwd/username $USERNAME set passwd/user-uid 999 EOF -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 +chroot /root /usr/lib/user-setup/user-setup-apply > /dev/null # Clear out debconf database again to avoid confusing ubiquity later. chroot /root debconf-communicate -fnoninteractive casper > /dev/null <<EOF @@ -42,22 +40,19 @@ set passwd/user-uid EOF if [ -f /root/etc/sudoers ]; then - if [ -x /sbin/udevplug ]; then - # FIXME: ugly hack, admin is not present in debian so we do here ubuntu stuff - # XXX - awful hack to stop xscreensaver locking the screen (#7150) - echo 'RUNNING_UNDER_GDM="yes"' >> /root/etc/environment - 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 - for file in /usr/share/applications/ubiquity-gtkui.desktop /usr/share/applications/kde/ubiquity-kdeui.desktop; do - if [ -f "/root/$file" ]; then - chroot /root install -D -o $USERNAME -g $USERNAME $file /home/$USERNAME/Desktop/$(basename "$file") - break - fi - done - else # We are in debian :-) - echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> /root/etc/sudoers - fi + 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 fi +# XXX - awful hack to stop xscreensaver locking the screen (#7150) +echo 'RUNNING_UNDER_GDM="yes"' >> /root/etc/environment + +for file in /usr/share/applications/ubiquity-gtkui.desktop /usr/share/applications/kde/ubiquity-kdeui.desktop; do + if [ -f "/root/$file" ]; then + chroot /root install -D -o $USERNAME -g $USERNAME $file /home/$USERNAME/Desktop/$(basename "$file") + break + fi +done + if [ -L /root/home/$USERNAME/Examples ]; then chroot /root install -o $USERNAME -g $USERNAME -d /home/$USERNAME/Desktop/ mv /root/home/$USERNAME/Examples /root/home/$USERNAME/Desktop/ diff --git a/scripts/casper-bottom/14locales b/scripts/casper-bottom/14locales index 6d5b73c..d9343cd 100755 --- a/scripts/casper-bottom/14locales +++ b/scripts/casper-bottom/14locales @@ -20,33 +20,18 @@ esac log_begin_msg "$DESCRIPTION" -if [ -e /root/etc/default/locale ]; then - grep_file=/root/etc/default/locale - locale=$(grep 'LANG=' ${grep_file} | sed s/'LANG='// | tr -d '"' ) -elif [ -e /root/etc/environment ]; then # Old locales policy - grep_file=/root/etc/environment -fi - -# commandline +locale=en_US.UTF-8 for x in $(cat /proc/cmdline); do - case $x in - debian-installer/locale=*) - locale=${x#debian-installer/locale=} - set_locale="true" - ;; - esac + case $x in + debian-installer/locale=*) + locale=${x#debian-installer/locale=} + ;; + esac done -if [ -z "${locale}" ]; then - # Set a default one - locale=en_US.UTF-8 - set_locale="true" -fi - -if [ ! -z "${set_locale}" ]; then - LANG=$(grep "^${locale}" /root/usr/share/i18n/SUPPORTED | grep UTF-8 |sed -e 's, .*,,' -e q) - printf 'LANG="%s"\n' "${LANG}" >> "${grep_file}" - chroot /root /usr/sbin/locale-gen "${LANG}" -fi +LANG=$(grep "^${locale}" /root/usr/share/i18n/SUPPORTED | grep UTF-8 |sed -e 's, .*,,' -e q) + +printf 'LANG="%s"\n' "${LANG}" >> /root/etc/environment +chroot /root /usr/sbin/locale-gen "${LANG}" log_end_msg diff --git a/scripts/casper-bottom/22gnome_panel_data b/scripts/casper-bottom/22gnome_panel_data index 7bedd7a..b232c27 100755 --- a/scripts/casper-bottom/22gnome_panel_data +++ b/scripts/casper-bottom/22gnome_panel_data @@ -20,10 +20,8 @@ esac log_begin_msg "$DESCRIPTION" -if [ -x /root/usr/sbin/laptop-detect ]; then - if chroot /root /bin/sh -c /usr/sbin/laptop-detect; then - casper-reconfigure /root gnome-panel-data - fi +if chroot /root /bin/sh -c laptop-detect; then + casper-reconfigure /root gnome-panel-data fi panel_version=$(chroot /root /usr/bin/dpkg-query -W --showformat='${Version}' gnome-panel-data 2>/dev/null) || panel_version="" diff --git a/scripts/casper-bottom/23networking b/scripts/casper-bottom/23networking index 7238773..021aca9 100755 --- a/scripts/casper-bottom/23networking +++ b/scripts/casper-bottom/23networking @@ -27,11 +27,7 @@ iface lo inet loopback EOF -if [ -x /sbin/udevplug ]; then - udevplug -Bpci -Iclass="0x02*" -else - udevtrigger -fi +udevplug -Bpci -Iclass="0x02*" for interface in /sys/class/net/eth* /sys/class/net/ath* /sys/class/net/wlan*; do [ -e $interface ] || continue diff --git a/scripts/casper-bottom/25configure_init b/scripts/casper-bottom/25configure_init index 0c5c43e..12e6315 100755 --- a/scripts/casper-bottom/25configure_init +++ b/scripts/casper-bottom/25configure_init @@ -28,11 +28,9 @@ fi # This has the nice side effect of the cron.{daily,weekly,monthly} jobs in # /etc/crontab remaining disabled, yet also not run by anacron -if [ -x /root/etc/init.d/anacron ]; then - for f in /root/etc/rc?.d/S??anacron; do - mv ${f} $(dirname ${f})/K00anacron - done -fi +for f in /root/etc/rc?.d/S??anacron; do + mv ${f} ${f%/*}/K00anacron +done # No point, really rm -f /root/etc/rc?.d/[SK]??postfix @@ -42,8 +40,15 @@ rm -f /root/etc/rc?.d/K??hwclock.sh # Disable readahead since it doesn't play well with squashfs + unionfs # use chmod instead of mv to not trigger unionfs bugs. -if [ -e /root/sbin/readahead-list ]; then - chmod -x /root/sbin/readahead-list +chmod -x /root/sbin/readahead-list + +# Install shutdown script +cp -a /lib/casper/shutdown /root/etc/init.d/casper-shutdown +if [ -f /root/etc/rc0.d/S90halt ]; then + ln -s ../init.d/casper-shutdown /root/etc/rc0.d/S89casper +fi +if [ -f /root/etc/rc6.d/S90reboot ]; then + ln -s ../init.d/casper-shutdown /root/etc/rc6.d/S89casper fi log_end_msg diff --git a/scripts/casper-bottom/33disable_binary_drivers b/scripts/casper-bottom/33disable_binary_drivers index 4e4fec3..52bcbf4 100755 --- a/scripts/casper-bottom/33disable_binary_drivers +++ b/scripts/casper-bottom/33disable_binary_drivers @@ -20,6 +20,4 @@ esac log_begin_msg "$DESCRIPTION" -if [ -e /root/etc/default/linux-restricted-modules-common ]; then - echo 'DISABLED_MODULES="fglrx nv"' >> /root/etc/default/linux-restricted-modules-common -fi +echo 'DISABLED_MODULES="fglrx nv"' >> /root/etc/default/linux-restricted-modules-common |
