diff options
author | Daniel Baumann <daniel@debian.org> | 2007-10-19 19:21:42 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 17:31:06 +0100 |
commit | e5ed5f84c8dff7855284b6d37f14da6a2e85f1c5 (patch) | |
tree | 733883143e7d99ef1c0902874078dc4ba071c086 | |
parent | 6bfe95a7c93d84d0a2f9071bbe3809c173287402 (diff) | |
download | live-boot-e5ed5f84c8dff7855284b6d37f14da6a2e85f1c5.tar.gz live-boot-e5ed5f84c8dff7855284b6d37f14da6a2e85f1c5.zip |
Removing ubuntu support.
-rw-r--r-- | Makefile | 7 | ||||
-rwxr-xr-x | bin/live-snapshot | 3 | ||||
-rw-r--r-- | conf/live.conf | 4 | ||||
-rw-r--r-- | debian/control | 2 | ||||
-rwxr-xr-x | debian/rules | 2 | ||||
-rwxr-xr-x | hooks/live | 9 | ||||
-rwxr-xr-x | scripts/live | 11 | ||||
-rwxr-xr-x | scripts/live-bottom/10adduser | 63 | ||||
-rwxr-xr-x | scripts/live-bottom/14locales | 13 | ||||
-rwxr-xr-x | scripts/live-bottom/15autologin | 7 | ||||
-rwxr-xr-x | scripts/live-bottom/20xconfig | 34 | ||||
-rwxr-xr-x | scripts/live-bottom/22screensaver | 4 | ||||
-rwxr-xr-x | scripts/live-bottom/25configure_init | 17 | ||||
-rwxr-xr-x | scripts/live-bottom/30accessibility | 21 | ||||
-rwxr-xr-x | scripts/live-bottom/32disable_hibernation | 5 | ||||
-rwxr-xr-x | scripts/live-bottom/40install_driver_updates | 53 | ||||
-rw-r--r-- | scripts/live-helpers | 12 | ||||
-rwxr-xr-x | scripts/live-premount/10driver_updates | 229 |
18 files changed, 41 insertions, 455 deletions
@@ -1,7 +1,5 @@ # Makefile -BUILD_SYSTEM := $(shell lsb_release --short --id) - TRANSLATIONS="it" all: build @@ -13,12 +11,10 @@ test: done build: - # Setting BUILD_SYSTEM - sed -e 's/\(BUILD_SYSTEM="\).*"/\1'$(BUILD_SYSTEM)'"/g' conf/live.conf > live.conf install: test build # Installing configuration - install -D -m 0644 live.conf $(DESTDIR)/etc/live.conf + install -D -m 0644 conf/live.conf $(DESTDIR)/etc/live.conf # Installing executables mkdir -p $(DESTDIR)/sbin @@ -116,7 +112,6 @@ update: done clean: - rm -f live.conf distclean: diff --git a/bin/live-snapshot b/bin/live-snapshot index e508c2a..a6b4154 100755 --- a/bin/live-snapshot +++ b/bin/live-snapshot @@ -35,10 +35,9 @@ then else USERNAME=$(cat /etc/passwd | grep "999" | cut -f1 -d ':') HOSTNAME=$(hostname) - BUILD_SYSTEM="Debian" fi -export USERNAME USERFULLNAME HOSTNAME BUILD_SYSTEM +export USERNAME USERFULLNAME HOSTNAME # Source helper functions helpers="/usr/share/initramfs-tools/scripts/live-helpers" diff --git a/conf/live.conf b/conf/live.conf index ecfcb0a..0de5b6c 100644 --- a/conf/live.conf +++ b/conf/live.conf @@ -1,9 +1,7 @@ # /etc/live.conf - configuration file for live-initramfs(7) -BUILD_SYSTEM="Debian" - USERNAME="user" USERFULLNAME="Debian Live user" HOSTNAME="debian" -export BUILD_SYSTEM USERNAME USERFULLNAME HOSTNAME +export USERNAME USERFULLNAME HOSTNAME diff --git a/debian/control b/debian/control index e7cb8d7..2e80807 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: misc Priority: optional Maintainer: Debian Live <debian-live-maint@lists.alioth.debian.org> Uploaders: Daniel Baumann <daniel@debian.org> -Build-Depends: debhelper (>= 5), asciidoc, docbook-xsl, lsb-release, xsltproc +Build-Depends: debhelper (>= 5), asciidoc, docbook-xsl, xsltproc Standards-Version: 3.7.2 XS-Homepage: http://debian-live.alioth.debian.org/ XS-Upstream-Depends: git-core diff --git a/debian/rules b/debian/rules index bc3385c..bf12dad 100755 --- a/debian/rules +++ b/debian/rules @@ -12,7 +12,6 @@ build-stamp: dh_testdir # Building package - $(MAKE) $(MAKE) -C manpages touch build-stamp @@ -23,7 +22,6 @@ clean: rm -f build-stamp # Cleaning package - $(MAKE) clean $(MAKE) -C manpages clean dh_clean @@ -109,15 +109,6 @@ fi copy_exec /usr/bin/md5sum /bin # Program: udev -if [ "${BUILD_SYSTEM}" = "Ubuntu" ] -then - mkdir -p "${DESTDIR}"/lib/udev - - copy_exec /lib/udev/cdrom_id /lib/udev - copy_exec /lib/udev/path_id /lib/udev - copy_exec /lib/udev/vol_id /lib/udev -fi - copy_exec /sbin/udevtrigger /sbin copy_exec /sbin/udevsettle /sbin copy_exec /usr/bin/udevinfo /bin diff --git a/scripts/live b/scripts/live index 27221ef..b4254e1 100755 --- a/scripts/live +++ b/scripts/live @@ -18,12 +18,11 @@ home_snapshot_label="home-sn" USERNAME="user" USERFULLNAME="Live user" HOSTNAME="host" -BUILD_SYSTEM="Custom" mkdir -p "${mountpoint}" [ -f /etc/live.conf ] && . /etc/live.conf -export USERNAME USERFULLNAME HOSTNAME BUILD_SYSTEM +export USERNAME USERFULLNAME HOSTNAME . /scripts/live-helpers @@ -618,7 +617,7 @@ do_netmount () { rc=1 - modprobe "${MP_QUIET}" af_packet # For DHCP + modprobe -q af_packet # For DHCP udevtrigger udevsettle @@ -688,7 +687,7 @@ do_nfsmount () { rc=1 - modprobe "${MP_QUIET}" nfs + modprobe -q nfs if [ -z "${NFSOPTS}" ] then @@ -721,7 +720,7 @@ do_cifsmount () fi [ "${quiet}" != "y" ] && log_begin_msg "Trying mount.cifs ${NFSROOT} ${mountpoint} ${CIFSOPTS}" - modprobe "${MP_QUIET}" cifs + modprobe -q cifs if mount.cifs "${NFSROOT}" "${mountpoint}" "${CIFSOPTS}" then @@ -861,7 +860,7 @@ setup_unionfs () image_directory="${1}" rootmnt="${2}" - modprobe "${MP_QUIET}" -b ${UNIONTYPE} + modprobe -q -b ${UNIONTYPE} # run-init can't deal with images in a subdir, but we're going to # move all of these away before it runs anyway. No, we're not, diff --git a/scripts/live-bottom/10adduser b/scripts/live-bottom/10adduser index d76f143..e5067dd 100755 --- a/scripts/live-bottom/10adduser +++ b/scripts/live-bottom/10adduser @@ -31,12 +31,7 @@ log_begin_msg "Adding live session user..." # live-initramfs script -if [ "${BUILD_SYSTEM}" = "Debian" ] -then - user_crypted="8Ab05sVQ4LLps" # as in $(echo "live" | mkpasswd -s) -else - user_crypted="U6aMy0wojraho" # "ubuntu" -fi +user_crypted="8Ab05sVQ4LLps" # as in $(echo "live" | mkpasswd -s) # U6aMy0wojraho is just a blank password chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null << EOF @@ -48,14 +43,9 @@ set passwd/username ${USERNAME} set passwd/user-uid 999 EOF -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 -else - chroot /root /usr/lib/user-setup/user-setup-apply > /dev/null -fi +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 live-initramfs > /dev/null << EOF @@ -71,43 +61,25 @@ if [ -z "${NOSUDO}" ] then if [ -f /root/etc/sudoers ] 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) - 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 - elif [ "${BUILD_SYSTEM}" = "Debian" ] - then - echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> /root/etc/sudoers + 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 + 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 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] super-user-command=sudo EOF - if [ -f /root/usr/share/apps/konsole/sumc.desktop ] - then - chroot /root sudo -u "${USERNAME}" sh -c "umask 0077 && mkdir -p /home/${USERNAME}/.kde/share/apps/konsole && sed -e's/Exec=su.*$/Exec=sudo mc -c/' /usr/share/apps/konsole/sumc.desktop > /home/${USERNAME}/.kde/share/apps/konsole/sumc.desktop" - fi + if [ -f /root/usr/share/apps/konsole/sumc.desktop ] + then + chroot /root sudo -u "${USERNAME}" sh -c "umask 0077 && mkdir -p /home/${USERNAME}/.kde/share/apps/konsole && sed -e's/Exec=su.*$/Exec=sudo mc -c/' /usr/share/apps/konsole/sumc.desktop > /home/${USERNAME}/.kde/share/apps/konsole/sumc.desktop" + fi - if [ -f /root/usr/share/apps/konsole/su.desktop ] - then - chroot /root sudo -u "${USERNAME}" sh -c "umask 0077 && mkdir -p /home/${USERNAME}/.kde/share/apps/konsole && sed -e's/Exec=su.*$/Exec=sudo -i/' /usr/share/apps/konsole/su.desktop > /home/${USERNAME}/.kde/share/apps/konsole/su.desktop" - fi + if [ -f /root/usr/share/apps/konsole/su.desktop ] + then + chroot /root sudo -u "${USERNAME}" sh -c "umask 0077 && mkdir -p /home/${USERNAME}/.kde/share/apps/konsole && sed -e's/Exec=su.*$/Exec=sudo -i/' /usr/share/apps/konsole/su.desktop > /home/${USERNAME}/.kde/share/apps/konsole/su.desktop" fi fi fi @@ -118,9 +90,4 @@ then mv /root/home/${USERNAME}/Examples /root/home/${USERNAME}/Desktop/ fi -if [ -f "/root/usr/share/apps/khelpcenter/plugins/kubuntu/about-kubuntu.desktop.tobemoved" ] -then - chroot /root install -D -o ${USERNAME} -g ${USERNAME} /usr/share/apps/khelpcenter/plugins/kubuntu/about-kubuntu.desktop.tobemoved /home/${USERNAME}/Desktop/about-kubuntu.desktop -fi - log_end_msg diff --git a/scripts/live-bottom/14locales b/scripts/live-bottom/14locales index 2de535e..3653e1b 100755 --- a/scripts/live-bottom/14locales +++ b/scripts/live-bottom/14locales @@ -88,16 +88,9 @@ then really_export LANG - 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}" - else - printf 'LANG=%s\n' "${LANG}" > "${grep_file}" - printf '%s UTF-8\n' "${LANG}" > /root/etc/locale.gen - chroot /root /usr/sbin/locale-gen - fi + printf 'LANG=%s\n' "${LANG}" > "${grep_file}" + printf '%s UTF-8\n' "${LANG}" > /root/etc/locale.gen + chroot /root /usr/sbin/locale-gen fi log_end_msg diff --git a/scripts/live-bottom/15autologin b/scripts/live-bottom/15autologin index b0ce90d..03b66f4 100755 --- a/scripts/live-bottom/15autologin +++ b/scripts/live-bottom/15autologin @@ -42,11 +42,8 @@ fi # chroot needed to handle symlinks correctly if chroot /root [ -f ${GDMCONF} ] then - if [ "${BUILD_SYSTEM}" = "Debian" ] - then - # true hack ! -- nohar - chroot /root cp /usr/share/gdm/defaults.conf /etc/gdm/gdm.conf - fi + # true hack ! -- nohar + chroot /root cp /usr/share/gdm/defaults.conf /etc/gdm/gdm.conf # Configure GDM autologin chroot /root \ diff --git a/scripts/live-bottom/20xconfig b/scripts/live-bottom/20xconfig index 779a1c2..8886af8 100755 --- a/scripts/live-bottom/20xconfig +++ b/scripts/live-bottom/20xconfig @@ -55,30 +55,20 @@ then chroot /root /usr/sbin/xdebconfigurator fi -if [ "${BUILD_SYSTEM}" = "Ubuntu" ] +if [ -n "${KOPTIONS}" ] then + setoptions="set xserver-xorg/config/inputdevice/keyboard/options ${KOPTIONS}" +fi -chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null << EOF -set xserver-xorg/autodetect_keyboard true -fset xserver-xorg/autodetect_keyboard seen true -EOF - -else - # d-i code not present, so: - if [ -n "${KOPTIONS}" ] - then - setoptions="set xserver-xorg/config/inputdevice/keyboard/options ${KOPTIONS}" - fi - - if [ -n "${KVARIANT}" ] - then - setvariant="set xserver-xorg/config/inputdevice/keyboard/variant ${KVARIANT}" - fi +if [ -n "${KVARIANT}" ] +then + setvariant="set xserver-xorg/config/inputdevice/keyboard/variant ${KVARIANT}" +fi - if [ -n "${KMODEL}" ] - then - setmodel="set xserver-xorg/config/inputdevice/keyboard/model ${KMODEL}" - fi +if [ -n "${KMODEL}" ] +then + setmodel="set xserver-xorg/config/inputdevice/keyboard/model ${KMODEL}" +fi chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null << EOF set xserver-xorg/config/inputdevice/keyboard/layout ${kbd} @@ -87,8 +77,6 @@ ${setmodel} ${setoptions} EOF -fi - DEBUG_XORG_PACKAGE=1 DEBUG_XORG_DEBCONF=1 live-reconfigure /root xserver-xorg umount /root/sys umount /root/proc diff --git a/scripts/live-bottom/22screensaver b/scripts/live-bottom/22screensaver index 0b70452..967d8c9 100755 --- a/scripts/live-bottom/22screensaver +++ b/scripts/live-bottom/22screensaver @@ -40,8 +40,4 @@ then chroot /root sudo -u "${USERNAME}" gconftool-2 -t bool -s /apps/gnome-screensaver/lock_enabled false fi -if [ -d /root/usr/share/kubuntu-default-settings/kde-profile/default/share/config ]; then - printf "[ScreenSaver]\nLock=false\n" >> /root/usr/share/kubuntu-default-settings/kde-profile/default/share/config/kdesktoprc -fi - log_end_msg diff --git a/scripts/live-bottom/25configure_init b/scripts/live-bottom/25configure_init index bec5608..6ca1775 100755 --- a/scripts/live-bottom/25configure_init +++ b/scripts/live-bottom/25configure_init @@ -81,23 +81,6 @@ then do sed -i -e "s|^respawn.*|respawn /bin/login -f ${USERNAME} </dev/$(basename ${f}) > /dev/$(basename ${f}) 2>\&1|" ${f} done - - if [ "${BUILD_SYSTEM}" = "Ubuntu" ] - then - for x in $(cat /proc/cmdline) - do - case ${x} in - noninteractive) - sed -i -e "s|^exec.*|exec /usr/bin/ubiquity noninteractive </dev/tty1 > /dev/tty1 2>\&1|" /root/etc/event.d/tty1 - rm -f /root/etc/rc?.d/[SK]??[gkx]dm - ;; - - textonly) - rm -f /root/etc/rc?.d/[SK]??[gkx]dm - ;; - esac - done - fi fi fi diff --git a/scripts/live-bottom/30accessibility b/scripts/live-bottom/30accessibility index 4726a75..9c20265 100755 --- a/scripts/live-bottom/30accessibility +++ b/scripts/live-bottom/30accessibility @@ -41,14 +41,6 @@ gct () fi } -kderc_addtoprefixes () -{ - if [ -e "/root/etc/kderc" ] - then - sed -i "s|\\(prefixes=/usr/share/kubuntu-default-settings/kde-profile/default/\\)|\\1,$1|" /root/etc/kderc - fi -} - case ${ACCESS} in access=v1) # Lesser Visual Impairment @@ -64,13 +56,6 @@ case ${ACCESS} in gct -s -t string /desktop/gnome/background/color_shading_type solid gct -s -t int /desktop/gnome/peripherals/mouse/cursor_size 48 gct -s -t string /desktop/gnome/peripherals/mouse/cursor_theme whiteglass - - kderc_addtoprefixes /usr/share/kubuntu-default-settings/kde-profile/lesser-visual-impairment/ - - if [ -d /root/usr/share/xubuntu-default-settings/accessibility ] - then - cp -a /root/usr/share/xubuntu-default-settings/accessibility/* /root/etc/xdg/ - fi ;; access=v2) @@ -83,8 +68,6 @@ case ${ACCESS} in then sed -i '/^enableSpeech\W/ s/True/False/;/^enableMagnifier/ s/False/True/' /root/usr/share/pycentral/gnome-orca/site-packages/orca/settings.py fi - - kderc_addtoprefixes /usr/share/kubuntu-default-settings/kde-profile/lesser-visual-impairment/,/usr/share/kubuntu-default-settings/kde-profile/moderate-visual-impairment/ ;; access=v3) @@ -120,8 +103,6 @@ case ${ACCESS} in gct -s -t int /desktop/gnome/peripherals/keyboard/rate 10 gct -s -t bool /apps/gksu/disable-grab true - kderc_addtoprefixes /usr/share/kubuntu-default-settings/kde-profile/minor-motor-difficulties/ - if [ -e /root/etc/xdg/xfce4/mcs_settings/keyboard.xml ] then sed -i 's/0/1/' /root/etc/xdg/xfce4/mcs_settings/keyboard.xml @@ -137,8 +118,6 @@ case ${ACCESS} in gct -s -t bool /desktop/accessibility/gnome/keyboard/stickykeys_two_key_off false gct -s -t list --list-type=string /desktop/gnome/accessibility/startup/exec_ats [onboard] - kderc_addtoprefixes /usr/share/kubuntu-default-settings/kde-profile/minor-motor-difficulties/,/usr/share/kubuntu-default-settings/kde-profile/motor-difficulties-pointing-devices/ - if [ -e /root/etc/xdg/xfce4/mcs_settings/keyboard.xml ] then sed -i '/Sticky/ s/0/1/' /root/etc/xdg/xfce4/mcs_settings/keyboard.xml diff --git a/scripts/live-bottom/32disable_hibernation b/scripts/live-bottom/32disable_hibernation index f77c668..ec0e03a 100755 --- a/scripts/live-bottom/32disable_hibernation +++ b/scripts/live-bottom/32disable_hibernation @@ -42,9 +42,4 @@ then chroot /root sudo -u "${USERNAME}" gconftool-2 -s -t bool /apps/gnome-power-manager/general/can_hibernate false fi -if [ -d /root/usr/share/kubuntu-default-settings/kde-profile/default/share/config ] -then - echo "disableHibernate=1" >> /root/usr/share/kubuntu-default-settings/kde-profile/default/share/config/power-managerrc -fi - log_end_msg diff --git a/scripts/live-bottom/40install_driver_updates b/scripts/live-bottom/40install_driver_updates deleted file mode 100755 index 584dcd0..0000000 --- a/scripts/live-bottom/40install_driver_updates +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -#set -e - -# initramfs-tools header - -PREREQ="" - -prereqs() -{ - echo "${PREREQ}" -} - -case "${1}" in - prereqs) - prereqs - exit 0 - ;; -esac - -# live-initramfs header - -. /scripts/live-functions - -# live-initramfs script - -if [ ! -d /tmp/driver-updates ] -then - exit 0 -fi - -log_begin_msg "Installing driver updates..." - -install_dir=/var/cache/driver-updates - -mkdir "/root${install_dir}" -cp -a /tmp/driver-updates/*.deb "/root${install_dir}/" - -# We cannot leave packages in a bad state. So if the install fails, remove -# it. This will get caught in live.log. -for deb in "/root${install_dir}"/* -do - [ -f "${deb}" ] || continue - - debbase="${deb##*/}" - - if ! chroot /root dpkg -i "${install_dir}/${debbase}" - then - chroot /root dpkg -P "${debbase%%_*}" - fi -done - -log_end_msg diff --git a/scripts/live-helpers b/scripts/live-helpers index e74108c..ccc3a4a 100644 --- a/scripts/live-helpers +++ b/scripts/live-helpers @@ -1,16 +1,6 @@ #!/bin/sh # live-initramfs helper functions, used by live-initramfs on boot and by live-snapshot -if [ "${BUILD_SYSTEM}" = "Ubuntu" ] -then - MP_QUIET="-Q" -elif [ "${BUILD_SYSTEM}" = "Debian" ] -then - MP_QUIET="-q" -else - MP_QUIET="" -fi - if [ ! -x "/bin/fstype" ] then # klibc not in path -> not in initramfs @@ -157,7 +147,7 @@ setup_loop () local offset=${4} local encryption=${5} - modprobe ${MP_QUIET} -b "${module}" + modprobe -q -b "${module}" udevsettle for loopdev in ${pattern} diff --git a/scripts/live-premount/10driver_updates b/scripts/live-premount/10driver_updates deleted file mode 100755 index eda8bbf..0000000 --- a/scripts/live-premount/10driver_updates +++ /dev/null @@ -1,229 +0,0 @@ -#!/bin/sh - -#set -e - -# initramfs-tools header - -PREREQ="" - -prereqs() -{ - echo "${PREREQ}" -} - -case "${1}" in - prereqs) - prereqs - exit 0 - ;; -esac - -# live-initramfs header - -if [ -n "${NOUSER}" ] -then - exit 0 -fi - -. /scripts/live-functions -. /scripts/live-helpers - -log_begin_msg "Adding live session user..." - -# live-initramfs script - -mountpoint=/cdrom - -is_updates_path () -{ - # Driver packages are stored in ubuntu-drivers/<kver>/ - # subdirectory. Each package contains a module for a specific - # kernel flavour. - - path=${1} - abi="$(uname -r)" - kver="$(echo "$abi" | cut -d- -f1,2)" - kbase="$(echo "$abi" | cut -d- -f1)" - - for leaf in "$abi" "$kver" "$kbase" - do - update_dir="$path/ubuntu-drivers/$leaf" - - [ -d "$update_dir" ] || continue - - if [ "$(echo ${update_dir}/*_${DPKG_ARCH}.deb)" != \ - "${update_dir}/*_${DPKG_ARCH}.deb" ] - then - echo "${update_dir}" - return 0 - fi - done - - return 1 -} - -is_nice_device () -{ - sysfs_path="${1#/sys}" - - if /lib/udev/path_id "${sysfs_path}" | grep -E -q "ID_PATH=(usb|pci-[^-]*-(ide|scsi|usb))" - then - return 0 - fi - - return 1 -} - -is_supported_fs () -{ - # FIXME: do something better like the scan of supported filesystems - fstype="${1}" - - case ${fstype} in - vfat|iso9660|udf|ext2|ext3|ntfs) - return 0 - ;; - esac - - return 1 -} - -check_dev_updates () -{ - sysdev="${1}" - devname="${2}" - - if [ -z "${devname}" ] - then - devname=$(sys2dev "${sysdev}") - fi - - fstype=$(get_fstype "${devname}") - - if is_supported_fs ${fstype} - then - mount -t ${fstype} -o ro "${devname}" $mountpoint || continue - - if is_updates_path ${mountpoint} - then - return 0 - else - umount ${mountpoint} - fi - fi - - return 1 -} - -find_driver_updates () -{ - for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram) - do - devname=$(sys2dev "${sysblock}") - fstype=$(get_fstype "${devname}") - - if /lib/udev/cdrom_id ${devname} > /dev/null - then - if check_dev_updates "null" "${devname}" - then - return 0 - fi - elif is_nice_device "${sysblock}" - then - for dev in $(subdevices "${sysblock}") - do - if check_dev_updates "${dev}" - then - return 0 - fi - done - fi - done - - return 1 -} - -pulsate () -{ - if [ -x /sbin/usplash_write ] - then - /sbin/usplash_write "PULSATE" - fi -} - -updates="false" - -for x in $(cat /proc/cmdline) -do - case ${x} in - debian-installer/driver-update=*) - updates=${x#debian-installer/driver-update=} - ;; - esac -done - -if [ "${updates}" != "true" ] -then - log_end_msg - exit 0 -fi - -# Not sure what to do for network installs. I assume there isn't even a CD -# for this anyway, so fail. -if [ -n "${NETBOOT}" ] -then - log_end_msg - exit 0; -fi - -#if chroot /root [ -f /etc/gdm/gdm-cdd.conf ] -#then -# GDMCONF=/etc/gdm/gdm-cdd.conf -#else -# GDMCONF=/etc/gdm/gdm.conf -#fi - -if [ -x /usr/bin/eject ] -then - eject -fi - -log_wait_msg "Insert a driver CD and press ENTER (${DPKG_ARCH})" - -log_begin_msg "Looking for driver update CD" - -for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13 -do - updates_root=$(find_driver_updates) - - if [ "${updates_root}" ] - then - break; - fi - - sleep 1 -done - -log_end_msg - -if [ -z "${updates_root}" ] -then - log_begin_msg "Could not find driver updates" - log_wait_msg "Re-insert install CD and press ENTER" - exit 0 -fi - -log_begin_msg "Copying driver updates to temporary location" - -mkdir -p /tmp/driver-updates -cp ${updates_root}/*_${DPKG_ARCH}.deb /tmp/driver-updates/ -umount ${mountpoint} - -if [ -x /usr/bin/eject ] -then - eject -fi - -log_end_msg - -log_wait_msg "Re-insert install CD and press ENTER." |