diff options
| author | Daniel Baumann <daniel@debian.org> | 2007-09-23 14:46:23 +0200 |
|---|---|---|
| committer | Daniel Baumann <daniel@debian.org> | 2007-09-23 14:46:23 +0200 |
| commit | 9a7f83110cfb153d853f5d074968a661121d4e07 (patch) | |
| tree | 37a8942eea32494575437686d615af4f8a7060eb /scripts/casper-bottom | |
| parent | f3299e0f07d9c0207db455cb9ea131e3b3c13784 (diff) | |
| download | live-boot-9a7f83110cfb153d853f5d074968a661121d4e07.tar.gz live-boot-9a7f83110cfb153d853f5d074968a661121d4e07.zip | |
Adding casper 1.63+debian-1.
Diffstat (limited to 'scripts/casper-bottom')
| -rwxr-xr-x | scripts/casper-bottom/01integrity_check | 2 | ||||
| -rwxr-xr-x | scripts/casper-bottom/05mountpoints | 4 | ||||
| -rwxr-xr-x | scripts/casper-bottom/10adduser | 34 | ||||
| -rwxr-xr-x | scripts/casper-bottom/14locales | 35 | ||||
| -rwxr-xr-x | scripts/casper-bottom/15autologin | 2 | ||||
| -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 | 21 | ||||
| -rwxr-xr-x | scripts/casper-bottom/33disable_binary_drivers | 4 |
9 files changed, 70 insertions, 44 deletions
diff --git a/scripts/casper-bottom/01integrity_check b/scripts/casper-bottom/01integrity_check index 637a1ff..8c8e153 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 /cdrom /cdrom/md5sum.txt < /dev/tty8 +grep integrity-check /proc/cmdline && casper-md5check /live_media /live_media/md5sum.txt < /dev/tty8 diff --git a/scripts/casper-bottom/05mountpoints b/scripts/casper-bottom/05mountpoints index ca8845a..33f265d 100755 --- a/scripts/casper-bottom/05mountpoints +++ b/scripts/casper-bottom/05mountpoints @@ -21,7 +21,7 @@ esac log_begin_msg "$DESCRIPTION" # Move to the new root filesystem so that programs there can get at it. -mkdir -p /root/cdrom -mount -n -o move /cdrom /root/cdrom +mkdir -p /root/live_media +mount -n -o move /live_media /root/live_media log_end_msg diff --git a/scripts/casper-bottom/10adduser b/scripts/casper-bottom/10adduser index a37d831..700f8c3 100755 --- a/scripts/casper-bottom/10adduser +++ b/scripts/casper-bottom/10adduser @@ -1,7 +1,7 @@ #!/bin/sh PREREQ="" -DESCRIPTION="Adding live CD user..." +DESCRIPTION="Adding live session user..." . /scripts/functions @@ -20,15 +20,18 @@ esac log_begin_msg "$DESCRIPTION" +# U6aMy0wojraho is just a blank password chroot /root debconf-communicate -fnoninteractive casper > /dev/null <<EOF set passwd/root-password-crypted * -set passwd/user-password-crypted U6aMy0wojraho +set passwd/user-password-crypted UMxWpqk1F1hww set passwd/user-fullname $USERFULLNAME set passwd/username $USERNAME set passwd/user-uid 999 EOF -chroot /root /usr/lib/user-setup/user-setup-apply > /dev/null +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 # Clear out debconf database again to avoid confusing ubiquity later. chroot /root debconf-communicate -fnoninteractive casper > /dev/null <<EOF @@ -40,18 +43,21 @@ set passwd/user-uid EOF if [ -f /root/etc/sudoers ]; 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 -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 + 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 -done +fi if [ -L /root/home/$USERNAME/Examples ]; then chroot /root install -o $USERNAME -g $USERNAME -d /home/$USERNAME/Desktop/ diff --git a/scripts/casper-bottom/14locales b/scripts/casper-bottom/14locales index d9343cd..0d4e171 100755 --- a/scripts/casper-bottom/14locales +++ b/scripts/casper-bottom/14locales @@ -20,18 +20,33 @@ esac log_begin_msg "$DESCRIPTION" -locale=en_US.UTF-8 +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 for x in $(cat /proc/cmdline); do - case $x in - debian-installer/locale=*) - locale=${x#debian-installer/locale=} - ;; - esac + case $x in + debian-installer/locale=*) + locale=${x#debian-installer/locale=} + set_locale="true" + ;; + esac done -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}" +if [ -z "${locale}" ]; then + # Set a default one + locale=en_US.UTF-8 + set_locale="true" +fi + +if [ "${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 log_end_msg diff --git a/scripts/casper-bottom/15autologin b/scripts/casper-bottom/15autologin index 5f7797a..745e6ce 100755 --- a/scripts/casper-bottom/15autologin +++ b/scripts/casper-bottom/15autologin @@ -27,6 +27,8 @@ else fi if chroot /root [ -f ${GDMCONF} ]; then + # true hack ! -- nohar + chroot /root cp /usr/share/gdm/defaults.conf /etc/gdm/gdm.conf # Configure GDM autologin chroot /root sed -i \ -e "s/^AutomaticLoginEnable=.*\$/AutomaticLoginEnable=true/" \ diff --git a/scripts/casper-bottom/22gnome_panel_data b/scripts/casper-bottom/22gnome_panel_data index b232c27..e87c94f 100755 --- a/scripts/casper-bottom/22gnome_panel_data +++ b/scripts/casper-bottom/22gnome_panel_data @@ -20,8 +20,10 @@ esac log_begin_msg "$DESCRIPTION" -if chroot /root /bin/sh -c laptop-detect; then - casper-reconfigure /root gnome-panel-data +if [ -x /root/usr/sbin/laptop-detect ]; then + if chroot /root laptop-detect; then + casper-reconfigure /root gnome-panel-data + fi 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 021aca9..7238773 100755 --- a/scripts/casper-bottom/23networking +++ b/scripts/casper-bottom/23networking @@ -27,7 +27,11 @@ iface lo inet loopback EOF -udevplug -Bpci -Iclass="0x02*" +if [ -x /sbin/udevplug ]; then + udevplug -Bpci -Iclass="0x02*" +else + udevtrigger +fi 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 12e6315..7c39478 100755 --- a/scripts/casper-bottom/25configure_init +++ b/scripts/casper-bottom/25configure_init @@ -23,14 +23,16 @@ log_begin_msg "$DESCRIPTION" # Arrange for shells on virtual consoles, rather than login prompts if [ -n "$USERNAME" ]; then - sed -i -e "s|^\([^:]*:[^:]*:[^:]*\):.*getty.*\<\(tty[0-9]*\).*$|\1:/bin/login -f $USERNAME </dev/\2 >/dev/\2 2>\&1|" /root/etc/inittab + sed -i -e "s|^\([^:]*:[^:]*:[^:]*\):.*getty.*\<\(tty[0-9].*\).*$|\1:/bin/login -f $USERNAME </dev/\2 >/dev/\2 2>\&1|" /root/etc/inittab 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 -for f in /root/etc/rc?.d/S??anacron; do - mv ${f} ${f%/*}/K00anacron -done +if [ -x /root/etc/init.d/anacron ]; then + for f in /root/etc/rc?.d/S??anacron; do + mv ${f} ${f%/*}/K00anacron + done +fi # No point, really rm -f /root/etc/rc?.d/[SK]??postfix @@ -40,15 +42,8 @@ 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. -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 +if [ -e /root/sbin/readahead-list ]; then + chmod -x /root/sbin/readahead-list fi log_end_msg diff --git a/scripts/casper-bottom/33disable_binary_drivers b/scripts/casper-bottom/33disable_binary_drivers index 52bcbf4..6bc2279 100755 --- a/scripts/casper-bottom/33disable_binary_drivers +++ b/scripts/casper-bottom/33disable_binary_drivers @@ -20,4 +20,6 @@ esac log_begin_msg "$DESCRIPTION" -echo 'DISABLED_MODULES="fglrx nv"' >> /root/etc/default/linux-restricted-modules-common +if [ -e /root/etc/default/linux-restricted-modules-common ]; then + echo 'DISABLED_MODULES="fglrx nv"' >> /root/etc/default/linux-restricted-modules-common +fi |
