From: Daniel Baumann Date: Sun, 18 Apr 2010 18:41:56 +0000 (+0200) Subject: Adding upstream version 1.139.1. X-Git-Tag: upstream/1.139.1^0 X-Git-Url: http://git.grml.org/?a=commitdiff_plain;h=f4238ae20312e1d36158ba70ac1076ba4da0211d;p=live-boot-grml.git Adding upstream version 1.139.1. --- diff --git a/Makefile b/Makefile index ed1af45..b9a9e6d 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,7 @@ build: install: test build # Installing configuration install -D -m 0644 conf/live.conf $(DESTDIR)/etc/live.conf + install -D -m 0644 conf/compcache $(DESTDIR)/usr/share/initramfs-tools/conf.d/compcache # Installing executables mkdir -p $(DESTDIR)/sbin diff --git a/bin/live-preseed b/bin/live-preseed index 36154ea..d98c4f3 100755 --- a/bin/live-preseed +++ b/bin/live-preseed @@ -11,10 +11,10 @@ seen="${4}" [ "${seen}" ] || seen=true -if ! (echo "SET ${question} ${value}"; echo "FSET ${question} seen ${seen}") | chroot "${1}" debconf-communicate -fnoninteractive live-initramfs >/dev/null +if ! (echo "SET ${question} ${value}"; echo "FSET ${question} seen ${seen}") | chroot "${1}" /usr/bin/debconf-communicate -fnoninteractive live-initramfs >/dev/null then -chroot "${1}" debconf-communicate -fnoninteractive live-initramfs >/dev/null << EOF +chroot "${1}" /usr/bin/debconf-communicate -fnoninteractive live-initramfs >/dev/null << EOF REGISTER debian-installer/dummy ${question} SET ${question} ${value} FSET ${question} seen ${seen} diff --git a/conf/compcache b/conf/compcache new file mode 100644 index 0000000..c93c776 --- /dev/null +++ b/conf/compcache @@ -0,0 +1 @@ +COMPCACHE_SIZE="25%" diff --git a/docs/AUTHORS b/docs/AUTHORS index e10c045..57494a6 100644 --- a/docs/AUTHORS +++ b/docs/AUTHORS @@ -2,6 +2,10 @@ Main Authors: * Daniel Baumann +Main Contributors: + + * Chris Lamb + Original Authors: live-initramfs is a fork of casper . diff --git a/docs/CREDITS b/docs/CREDITS index 495d6eb..2a1ae50 100644 --- a/docs/CREDITS +++ b/docs/CREDITS @@ -5,6 +5,8 @@ Patches (alphabetical order): * Arnaud Cornet * Bas Wijnen * Ben Armstrong + * Ben Voui + * Chris Lamb * Davide Natalini * Frederic Lehobey * Hadar Weiss @@ -14,8 +16,10 @@ Patches (alphabetical order): * Malcom Gilles * Marco Amadori * Mathieu Geli + * Michael Prokop * Michal Suchanek * Oliver Osburg * Otavio Salvador * Sebastian Raveau + * Steven Shiau * Thomas Lange diff --git a/docs/ChangeLog.casper b/docs/ChangeLog.casper index 564e69b..153901c 100644 --- a/docs/ChangeLog.casper +++ b/docs/ChangeLog.casper @@ -1,3 +1,31 @@ +casper (1.139) intrepid; urgency=low + + * add compcache conf.d configuration for initramfs-tools + + -- Oliver Grawert Thu, 14 Aug 2008 00:25:54 +0200 + +casper (1.138) intrepid; urgency=low + + [ Tormod Volden ] + * use full path for vol_id in swap-on-raid detection (LP: #136804) + + [ Martin Pitt ] + * 33enable_apport_crashes: Change the apport default file, not the + update-notifier gconf keys, to undo the corresponding change for disabling + apport right before the release. + * Add 45disable_guest_account: Purge the gdm-guest-session package from the + live system, since having guest sessions in a live session does not make + much sense. (See gdm-guest-login spec) + + -- Martin Pitt Thu, 31 Jul 2008 14:19:07 +0200 + +casper (1.137) intrepid; urgency=low + + * Update scripts/casper-bottom/15autologin for KDM from KDE 4. + * Update 32disable_hibernation for KDE 4. + + -- Jonathan Riddell Thu, 17 Jul 2008 13:41:38 +0100 + casper (1.136) intrepid; urgency=low * Remove bad-and-wrong setting of PATH to include directories under /root; @@ -38,10 +66,28 @@ casper (1.133) intrepid; urgency=low loopfile * Reverted changes to casper-helpers as requested by Mithrandir since replaying the journal on a hibernated system would lead to file system - corruption. + corruption (LP: #230703). -- Evan Dandrea Wed, 18 Jun 2008 12:34:58 -0400 +casper (1.132ubuntu0.2) hardy-proposed; urgency=low + + * Test if livemedia is a directory before trying to mount it as a + loopfile + * Reverted changes to casper-helpers as requested by Mithrandir since + replaying the journal on a hibernated system would lead to file system + corruption (LP: #230703). + + -- Agostino Russo Tue, 10 Jun 2008 00:27:12 +0100 + +casper (1.132ubuntu0.1) hardy-proposed; urgency=low + + * Do not scan only vfat volumes when looking for cow devices (LP: #230703) + * Allow casper to use a squashfs filesystem within an arbitrary path (LP: + #230716, #207137) + + -- Agostino Russo Thu, 15 May 2008 22:10:50 +0100 + casper (1.132) intrepid; urgency=low [ Colin Watson ] diff --git a/hooks/live b/hooks/live index 190fac5..dea7f0c 100755 --- a/hooks/live +++ b/hooks/live @@ -103,6 +103,9 @@ manual_add_modules nls_iso8859-1 manual_add_modules nls_utf8 manual_add_modules vfat +# Filesystem: ntfs +manual_add_modules ntfs + # Hardware: cdrom manual_add_modules ide-cd manual_add_modules ide-generic diff --git a/scripts/live b/scripts/live index 22d2210..0363daf 100755 --- a/scripts/live +++ b/scripts/live @@ -561,6 +561,9 @@ is_nice_device () if /lib/udev/path_id "${sysfs_path}" | grep -E -q "ID_PATH=(usb|pci-[^-]*-[ide|scsi|usb])" then return 0 + elif echo "${sysfs_path}" | grep -q '^/block/vd[a-z]$' + then + return 0 fi return 1 @@ -604,28 +607,28 @@ copy_live_to () fstype=$(get_fstype "${dev}") freespace=$(fs_size "${dev}") else - [ "$quiet" != "y" ] && log_warning_msg "${copytodev} is not a block device." + log_warning_msg "${copytodev} is not a block device." return 1 fi fi if [ "${freespace}" -lt "${size}" ] then - [ "${quiet}" != "y" ] && log_warning_msg "Not enough free ${free_string} (${freespace}k free, ${size}k needed) to copy live media in ${copytodev}." + log_warning_msg "Not enough free ${free_string} (${freespace}k free, ${size}k needed) to copy live media in ${copytodev}." return 1 fi # begin copying (or uncompressing) mkdir "${copyto}" echo "mount -t ${fstype} ${mount_options} ${dev} ${copyto}" - mount -t "${fstype}" ${mount_options} "${dev}" "${copyto}" + mount -n -t "${fstype}" ${mount_options} "${dev}" "${copyto}" if [ "${extension}" = "tgz" ] then cd "${copyto}" tar zxf "${copyfrom}/${LIVE_MEDIA_PATH}/$(basename ${FETCH})" rm -f "${copyfrom}/${LIVE_MEDIA_PATH}/$(basename ${FETCH})" - mount -r -o move "${copyto}" "${rootmnt}" + mount -n -r -o move "${copyto}" "${rootmnt}" cd "${OLDPWD}" else if [ -n "${MODULETORAMFILE}" ] @@ -637,7 +640,7 @@ copy_live_to () livefs_root umount ${copyfrom} - mount -r -o move ${copyto} ${copyfrom} + mount -n -r -o move ${copyto} ${copyfrom} fi rmdir ${copyto} @@ -685,7 +688,7 @@ do_netmount () NFSROOT=${ROOTSERVER}:${NFSROOT} fi - [ "${quiet}" != "y" ] && log_begin_msg "Trying netboot from ${NFSROOT}" + log_begin_msg "Trying netboot from ${NFSROOT}" if [ "${NETBOOT}" != "nfs" ] && do_cifsmount then @@ -697,7 +700,7 @@ do_netmount () rc=0 fi - [ "${quiet}" != "y" ] && log_end_msg + log_end_msg return ${rc} } @@ -705,7 +708,7 @@ do_httpmount () { rc=1 dest="${mountpoint}/${LIVE_MEDIA_PATH}" - mount -t ramfs ram "${mountpoint}" + mount -n -t ramfs ram "${mountpoint}" mkdir -p "${dest}" for webfile in HTTPFS FTPFS FETCH @@ -719,12 +722,20 @@ do_httpmount () squashfs|tgz|tar) if [ "${webfile}" = "FETCH" ] then - [ "${quiet}" != "y" ] && - log_begin_msg "Trying wget ${url} -O ${dest}/$(basename ${url})" - wget "${url}" -O "${dest}/$(basename ${url})" + case "$url" in + tftp*) + ip="$(dirname $url | sed -e 's|tftp://||g')" + log_begin_msg "Trying tftp -g -b 10240 -r $(basename ${url}) -l ${dest}/$(basename ${url}) $ip" + tftp -g -b 10240 -r $(basename ${url}) -l ${dest}/$(basename ${url}) $ip + ;; + + *) + log_begin_msg "Trying wget ${url} -O ${dest}/$(basename ${url})" + wget "${url}" -O "${dest}/$(basename ${url})" + ;; + esac else - [ "${quiet}" != "y" ] && - log_begin_msg "Trying to mount ${url} on ${dest}/$(basename ${url})" + log_begin_msg "Trying to mount ${url} on ${dest}/$(basename ${url})" if [ "${webfile}" = "FTPFS" ] then FUSE_MOUNT="curlftpfs" @@ -741,7 +752,7 @@ do_httpmount () ;; *) - [ "${quiet}" != "y" ] && log_begin_msg "Unrecognized archive extension for ${url}" + log_begin_msg "Unrecognized archive extension for ${url}" ;; esac fi @@ -766,7 +777,7 @@ do_nfsmount () NFSOPTS="" fi - [ "${quiet}" != "y" ] && log_begin_msg "Trying nfsmount -o nolock -o ro ${NFSOPTS} ${NFSROOT} ${mountpoint}" + log_begin_msg "Trying nfsmount -o nolock -o ro ${NFSOPTS} ${NFSROOT} ${mountpoint}" # FIXME: This for loop is an ugly HACK round an nfs bug for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13 @@ -791,7 +802,7 @@ do_cifsmount () CIFSOPTS="${NFSOPTS}" fi - [ "${quiet}" != "y" ] && log_begin_msg "Trying mount.cifs ${NFSROOT} ${mountpoint} ${CIFSOPTS}" + log_begin_msg "Trying mount.cifs ${NFSROOT} ${mountpoint} ${CIFSOPTS}" modprobe -q cifs if mount.cifs "${NFSROOT}" "${mountpoint}" "${CIFSOPTS}" @@ -833,7 +844,7 @@ do_snap_copy () if [ -n "${fstype}" ] then # Copying stuff... - mount -t "${fstype}" -o ro,noatime "${fromdev}" "${tomount}" + mount -n -t "${fstype}" -o ro,noatime "${fromdev}" "${tomount}" cp -a "${tomount}"/* ${todir} umount "${tomount}" else @@ -851,7 +862,7 @@ do_snap_copy () else return 1 - [ "${quiet}" != "y" ] && log_warning_msg "Unable to find the snapshot ${snap_type} medium" + log_warning_msg "Unable to find the snapshot ${snap_type} medium" fi } @@ -1016,7 +1027,7 @@ setup_unionfs () rofslist="${image} ${rofslist}" elif [ -f "${image}" ] then - if /sbin/losetup --help 2>&1 | grep -q -- "-r\b" + if losetup --help 2>&1 | grep -q -- "-r\b" then backdev=$(get_backing_device "${image}" "-r") else @@ -1030,8 +1041,9 @@ setup_unionfs () fi mkdir -p "${croot}/${imagename}" - echo "debug: Mounting backdev \"${backdev}\" (image = ${image}) on croot/imagename \"${croot}/${imagename}\"" - mount -t "${fstype}" -o ro,noatime "${backdev}" "${croot}/${imagename}" || panic "Can not mount ${backdev} (${image}) on ${croot}/${imagename}" && rofsstring="${croot}/${imagename}=${roopt}:${rofsstring}" && rofslist="${croot}/${imagename} ${rofslist}" + log_begin_msg "Mounting \"${image}\" on \"${croot}${imagename}\" via \"${backdev}\"" + mount -n -t "${fstype}" -o ro,noatime "${backdev}" "${croot}/${imagename}" || panic "Can not mount ${backdev} (${image}) on ${croot}/${imagename}" && rofsstring="${croot}/${imagename}=${roopt}:${rofsstring}" && rofslist="${croot}/${imagename} ${rofslist}" + log_end_msg fi done @@ -1082,7 +1094,7 @@ setup_unionfs () cow_fstype=$(get_fstype "${cowprobe}") cow_mountopt="rw,noatime" else - [ "${quiet}" != "y" ] && log_warning_msg "Unable to find the persistent medium" + log_warning_msg "Unable to find the persistent medium" cowdevice="tmpfs" cow_fstype="tmpfs" cow_mountopt="rw,noatime,mode=755" @@ -1109,18 +1121,17 @@ setup_unionfs () else cowdevice="tmpfs" cow_fstype="tmpfs" + cow_mountopt="rw,noatime,mode=755" fi if [ "${cow_fstype}" = "nfs" ] then - [ "${quiet}" != "y" ] && log_begin_msg \ + log_begin_msg \ "Trying nfsmount ${nfs_cow_opts} ${cowdevice} /cow" nfsmount ${nfs_cow_opts} ${cowdevice} /cow || \ panic "Can not mount ${cowdevice} (n: ${cow_fstype}) on /cow" else - # make sure cow_mountopt is set: - [ -n "$cow_mountopt" ] || cow_mountopt="rw,noatime,mode=755" - mount -t ${cow_fstype} -o ${cow_mountopt} ${cowdevice} /cow || \ + mount -n -t ${cow_fstype} -o ${cow_mountopt} ${cowdevice} /cow || \ panic "Can not mount ${cowdevice} (o: ${cow_fstype}) on /cow" fi @@ -1134,7 +1145,7 @@ setup_unionfs () fi exposedrootfs=${rofslist%% } - mount --bind ${exposedrootfs} ${rootmnt} || \ + mount -n --bind ${exposedrootfs} ${rootmnt} || \ panic "bind mount of ${exposedrootfs} failed" cow_dirs='/var/tmp /var/lock /var/run /var/log /var/spool @@ -1142,21 +1153,22 @@ setup_unionfs () for dir in ${cow_dirs}; do mkdir -p /cow${dir} - mount -t ${UNIONTYPE} \ + mount -n -t ${UNIONTYPE} \ -o rw,noatime,dirs=/cow${dir}=rw:${exposedrootfs}${dir}=ro \ ${UNIONTYPE} "${rootmnt}${dir}" || \ panic "mount ${UNIONTYPE} on ${rootmnt}${dir} failed with option \ rw,noatime,dirs=/cow${dir}=rw:${exposedrootfs}${dir}=ro" done else - mount -t ${UNIONTYPE} -o noatime,dirs=/cow=rw:${rofsstring} \ + mount -n -t ${UNIONTYPE} -o noatime,dirs=/cow=rw:${rofsstring} \ ${UNIONTYPE} "${rootmnt}" || panic "mount ${UNIONTYPE} on \ ${rootmnt} failed with option noatime,dirs=/cow=rw:${rofsstring}" fi # tmpfs file systems + touch /etc/fstab mkdir -p "${rootmnt}/live" - mount -t tmpfs tmpfs ${rootmnt}/live + mount -n -t tmpfs tmpfs ${rootmnt}/live # Adding other custom mounts if [ -n "${PERSISTENT}" ] && [ -z "${NOPERSISTENT}" ] @@ -1167,10 +1179,10 @@ setup_unionfs () if [ -b "${homecow}" ] then - mount -t $(get_fstype "${homecow}") -o rw,noatime "${homecow}" "${rootmnt}/home" + mount -n -t $(get_fstype "${homecow}") -o rw,noatime "${homecow}" "${rootmnt}/home" export HOMEMOUNTED=1 # used to proper calculate free space in do_snap_copy() else - [ "${quiet}" != "y" ] && log_warning_msg "Unable to find the persistent home medium" + log_warning_msg "Unable to find the persistent home medium" fi # Look for other snapshots to copy in @@ -1190,7 +1202,7 @@ setup_unionfs () ;; *) - mount -o move "${d}" "${rootmnt}/live/${d##*/}" + mount -n -o move "${d}" "${rootmnt}/live/${d##*/}" ;; esac done @@ -1198,7 +1210,7 @@ setup_unionfs () # shows cow fs on /cow for use by live-snapshot mkdir -p "${rootmnt}/live/cow" - mount -o move /cow "${rootmnt}/live/cow" || mount -o bind /cow "${rootmnt}/live/cow" || [ "${quiet}" != "y" ] && log_warning_msg "Unable to move or bind /cow to ${rootmnt}/live/cow" + mount -n -o move /cow "${rootmnt}/live/cow" >/dev/null 2>&1 || mount -n -o bind /cow "${rootmnt}/live/cow" || log_warning_msg "Unable to move or bind /cow to ${rootmnt}/live/cow" } check_dev () @@ -1214,7 +1226,7 @@ check_dev () if [ -d "${devname}" ] then - mount -o bind "${devname}" $mountpoint || continue + mount -n -o bind "${devname}" $mountpoint || continue if is_live_path $mountpoint then @@ -1235,7 +1247,7 @@ check_dev () if is_supported_fs ${fstype} then - mount -t ${fstype} -o ro,noatime "${devname}" ${mountpoint} || continue + mount -n -t ${fstype} -o ro,noatime "${devname}" ${mountpoint} || continue if is_live_path ${mountpoint} && \ ([ "${skip_uuid_check}" ] || matches_uuid ${mountpoint}) @@ -1337,12 +1349,15 @@ mountroot () tail -f live.log >&7 & tailpid="${!}" + # Ensure 'panic' function is overridden + . /scripts/live-functions + Arguments set_usplash_timeout - [ "${quiet}" != "y" ] && log_begin_msg "Running /scripts/live-premount" + log_begin_msg "Running /scripts/live-premount" run_scripts /scripts/live-premount - [ "${quiet}" != "y" ] && log_end_msg + log_end_msg # Needed here too because some things (*cough* udev *cough*) # changes the timeout @@ -1410,10 +1425,10 @@ mountroot () log_end_msg maybe_break live-bottom - [ "${quiet}" != "y" ] && log_begin_msg "Running /scripts/live-bottom" + log_begin_msg "Running /scripts/live-bottom" run_scripts /scripts/live-bottom - [ "${quiet}" != "y" ] && log_end_msg + log_end_msg exec 1>&6 6>&- exec 2>&7 7>&- diff --git a/scripts/live-bottom/02etc_live_conf b/scripts/live-bottom/02etc_live_conf index 1623de8..815e379 100755 --- a/scripts/live-bottom/02etc_live_conf +++ b/scripts/live-bottom/02etc_live_conf @@ -22,7 +22,7 @@ esac . /scripts/live-functions -log_begin_msg "Copying config on real root fs..." +log_begin_msg "Copying config on real root fs" # live-initramfs script diff --git a/scripts/live-bottom/02timezone b/scripts/live-bottom/02timezone index e4e91ff..64faf3b 100755 --- a/scripts/live-bottom/02timezone +++ b/scripts/live-bottom/02timezone @@ -27,7 +27,7 @@ fi . /scripts/live-functions -log_begin_msg "Setting timezone..." +log_begin_msg "Setting timezone" # live-initramfs script diff --git a/scripts/live-bottom/05mountpoints b/scripts/live-bottom/05mountpoints index a334af8..a8717d7 100755 --- a/scripts/live-bottom/05mountpoints +++ b/scripts/live-bottom/05mountpoints @@ -22,7 +22,7 @@ esac . /scripts/live-functions -log_begin_msg "Moving mount points..." +log_begin_msg "Moving mount points" # live-initramfs script diff --git a/scripts/live-bottom/06hostname b/scripts/live-bottom/06hostname index 446bc23..29a080f 100755 --- a/scripts/live-bottom/06hostname +++ b/scripts/live-bottom/06hostname @@ -27,7 +27,7 @@ fi . /scripts/live-functions -log_begin_msg "Setting hostname..." +log_begin_msg "Setting hostname" # live-initramfs script diff --git a/scripts/live-bottom/10adduser b/scripts/live-bottom/10adduser index 1a80e26..7498476 100755 --- a/scripts/live-bottom/10adduser +++ b/scripts/live-bottom/10adduser @@ -27,7 +27,7 @@ fi . /scripts/live-functions -log_begin_msg "Adding live session user..." +log_begin_msg "Adding live session user" # live-initramfs script @@ -40,12 +40,13 @@ set passwd/root-password-crypted * set passwd/user-password-crypted ${user_crypted} set passwd/user-fullname ${USERFULLNAME} set passwd/username ${USERNAME} -set passwd/user-uid 999 +set passwd/user-uid 1000 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 + /usr/lib/user-setup/user-setup-apply 2>&1 \ + | grep -v "Shadow passwords are now on" # Clear out debconf database again to avoid confusing ubiquity later. chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null << EOF @@ -64,8 +65,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/12fstab b/scripts/live-bottom/12fstab index 936eeae..ee242a4 100755 --- a/scripts/live-bottom/12fstab +++ b/scripts/live-bottom/12fstab @@ -28,7 +28,7 @@ then exit 0 fi -log_begin_msg "Configuring fstab..." +log_begin_msg "Configuring fstab" # live-initramfs script diff --git a/scripts/live-bottom/13swap b/scripts/live-bottom/13swap index 303fbbb..ecbdce1 100755 --- a/scripts/live-bottom/13swap +++ b/scripts/live-bottom/13swap @@ -27,7 +27,7 @@ fi . /scripts/live-functions -log_begin_msg "Setting up swap..." +log_begin_msg "Setting up swap" # live-initramfs script diff --git a/scripts/live-bottom/14locales b/scripts/live-bottom/14locales index 94e3cf2..aa75369 100755 --- a/scripts/live-bottom/14locales +++ b/scripts/live-bottom/14locales @@ -27,7 +27,7 @@ fi . /scripts/live-functions -log_begin_msg "Setting up locales..." +log_begin_msg "Setting up locales" # live-initramfs script @@ -75,34 +75,44 @@ then locale="${locale}_${uploc}.UTF-8" fi - LANG=$(grep "^${locale}" /root/usr/share/i18n/SUPPORTED | grep UTF-8 | sed -e 's, .*,,' -e q) + LANG= + language="$(echo ${locale} | cut -d. -f1)" + eval $(awk '/^'"${locale}"'/ { print "LANG=" $1 " codepage=" $2; exit; }' /root/usr/share/i18n/SUPPORTED) - language="${LANG%%.UTF-8*}" - if [ -d /root/etc/default/kdm.d/ ] + if [ -z "${LANG}" ] then + # Try and fallback to another codepage for this language. + eval $(awk '/^'"${language}"'/ { print "LANG=" $1 " codepage=" $2; exit; }' /root/usr/share/i18n/SUPPORTED) -cat > /root/etc/default/kdm.d/live-autologin << EOF -LANGUAGE=${language} -EOF + if [ -n "${LANG}" ] + then + log_warning_msg "Choosing locale '${LANG}' as '${locale}' is unsupported." + fi + fi - elif [ -f /root/etc/kde3/kdm/kdmrc ] + if [ -z "${LANG}" ] then - sed -i -r -e "s/#Language=.*/Language=${language}/" \ - /root/etc/kde3/kdm/kdmrc + log_warning_msg "Locale '${locale}' is unsupported." + codepage="UTF-8" + language="en_US" + locale="${language}.${codepage}" + LANG="${language}.${codepage}" fi - if [ -z "${LANG}" ] + if [ -d /root/etc/default/kdm.d/ ] then - log_warning_msg "Locale ${locale} is unsupported." - locale="en_US.UTF-8" - LANG="${locale}" + printf 'LANGUAGE=%s\n' "${LANG}" >> /root/etc/default/kdm.d/live-autologin + elif [ -f /root/etc/kde3/kdm/kdmrc ] + then + sed -i -r -e "s/#Language=.*/Language=${language}/" \ + /root/etc/kde3/kdm/kdmrc fi really_export LANG printf 'LANG="%s"\n' "${LANG}" >> /root/etc/default/locale printf 'LANG="%s"\n' "${LANG}" >> /root/etc/environment - printf '%s UTF-8\n' "${LANG}" > /root/etc/locale.gen + printf '%s %s\n' "${LANG}" "${codepage}" > /root/etc/locale.gen chroot /root /usr/sbin/locale-gen fi diff --git a/scripts/live-bottom/15autologin b/scripts/live-bottom/15autologin index 2c880b7..bb9902e 100755 --- a/scripts/live-bottom/15autologin +++ b/scripts/live-bottom/15autologin @@ -20,17 +20,17 @@ esac # live-initramfs header -. /scripts/live-functions - -log_begin_msg "Setting up automatic login..." - -# live-initramfs script - if [ -n "${NOXAUTOLOGIN}" ] then exit 0 fi +. /scripts/live-functions + +log_begin_msg "Setting up automatic login" + +# live-initramfs script + # chroot needed to handle symlinks correctly if chroot /root [ -f /etc/gdm/gdm-cdd.conf ] then @@ -71,13 +71,13 @@ then -e "s/^#?AutoLoginUser=.*\$/AutoLoginUser=${USERNAME}/" \ -e "s/^#?AutoReLogin=.*\$/AutoReLogin=true/" \ /root/etc/kde3/kdm/kdmrc -elif [ -f /root/usr/lib/kde4/etc/kde4/kdm/kdmrc ] +elif [ -f /root/etc/kde4/kdm/kdmrc ] then # Configure KDM-KDE4 autologin sed -i -r -e "s/^#?AutoLoginEnable=.*\$/AutoLoginEnable=true/" \ -e "s/^#?AutoLoginUser=.*\$/AutoLoginUser=$USERNAME/" \ -e "s/^#?AutoReLogin=.*\$/AutoReLogin=true/" \ - /root/usr/lib/kde4/etc/kde4/kdm/kdmrc + /root/etc/kde4/kdm/kdmrc fi log_end_msg diff --git a/scripts/live-bottom/19keyboard b/scripts/live-bottom/19keyboard index 784aa05..5f1d9e7 100755 --- a/scripts/live-bottom/19keyboard +++ b/scripts/live-bottom/19keyboard @@ -27,7 +27,7 @@ fi . /scripts/live-functions -log_begin_msg "Setting up console keyboard..." +log_begin_msg "Setting up console keyboard" # live-initramfs script diff --git a/scripts/live-bottom/20xconfig b/scripts/live-bottom/20xconfig index 8886af8..3e927a3 100755 --- a/scripts/live-bottom/20xconfig +++ b/scripts/live-bottom/20xconfig @@ -27,8 +27,6 @@ fi . /scripts/live-functions -log_begin_msg "Configuring X..." - # live-initramfs script if [ "${TERM_TYPE}" = "serial" ] @@ -43,6 +41,13 @@ then exit 0 fi +if [ ! -x /root/usr/bin/X ] +then + exit 0 +fi + +log_begin_msg "Configuring X" + locale=en_US.UTF-8 mount -n -o bind /sys /root/sys @@ -77,7 +82,9 @@ ${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>&1 \ + | grep -v "overwriting possibly-customised configuration" \ + | grep -v "file; backup in /etc/X11/xorg.conf" umount /root/sys umount /root/proc umount /root/dev diff --git a/scripts/live-bottom/21xdriver b/scripts/live-bottom/21xdriver index c96f0ea..075a53e 100755 --- a/scripts/live-bottom/21xdriver +++ b/scripts/live-bottom/21xdriver @@ -25,9 +25,14 @@ then exit 0 fi +if [ ! -x /root/usr/bin/X ] +then + exit 0 +fi + . /scripts/live-functions -log_begin_msg "Configuring X kludges..." +log_begin_msg "Configuring X video driver" # live-initramfs script @@ -49,3 +54,4 @@ EOF umount /root/dev fi +log_end_msg diff --git a/scripts/live-bottom/21xvidemode b/scripts/live-bottom/21xvidemode index a11dc77..24116e9 100755 --- a/scripts/live-bottom/21xvidemode +++ b/scripts/live-bottom/21xvidemode @@ -25,9 +25,14 @@ then exit 0 fi +if [ ! -x /root/usr/bin/X ] +then + exit 0 +fi + . /scripts/live-functions -log_begin_msg "Configuring X kludges..." +log_begin_msg "Configuring X video modes" # live-initramfs script diff --git a/scripts/live-bottom/22gnome_panel_data b/scripts/live-bottom/22gnome_panel_data index 8322c9c..9767e45 100755 --- a/scripts/live-bottom/22gnome_panel_data +++ b/scripts/live-bottom/22gnome_panel_data @@ -27,7 +27,7 @@ fi . /scripts/live-functions -log_begin_msg "Configuring gnome-panel-data..." +log_begin_msg "Configuring gnome-panel-data" # live-initramfs script diff --git a/scripts/live-bottom/22screensaver b/scripts/live-bottom/22screensaver index 967d8c9..584d234 100755 --- a/scripts/live-bottom/22screensaver +++ b/scripts/live-bottom/22screensaver @@ -27,7 +27,7 @@ fi . /scripts/live-functions -log_begin_msg "Configuring screensaver..." +log_begin_msg "Configuring screensaver" # live-initramfs script diff --git a/scripts/live-bottom/23etc_modules b/scripts/live-bottom/23etc_modules index 4cc300a..2240a1b 100755 --- a/scripts/live-bottom/23etc_modules +++ b/scripts/live-bottom/23etc_modules @@ -22,7 +22,7 @@ esac . /scripts/live-functions -log_begin_msg "Preconfiguring /etc/modules..." +log_begin_msg "Preconfiguring /etc/modules" # live-initramfs script diff --git a/scripts/live-bottom/23networking b/scripts/live-bottom/23networking index 5e9afe9..6a66996 100755 --- a/scripts/live-bottom/23networking +++ b/scripts/live-bottom/23networking @@ -27,7 +27,7 @@ fi . /scripts/live-functions -log_begin_msg "Preconfiguring networking..." +log_begin_msg "Preconfiguring networking" # live-initramfs script diff --git a/scripts/live-bottom/24preseed b/scripts/live-bottom/24preseed index a8f5a46..2536bd0 100755 --- a/scripts/live-bottom/24preseed +++ b/scripts/live-bottom/24preseed @@ -27,7 +27,7 @@ fi . /scripts/live-functions -log_begin_msg "Loading preseed file..." +log_begin_msg "Loading preseed file" # live-initramfs script diff --git a/scripts/live-bottom/25configure_init b/scripts/live-bottom/25configure_init index 6ca1775..bb06eb5 100755 --- a/scripts/live-bottom/25configure_init +++ b/scripts/live-bottom/25configure_init @@ -22,71 +22,68 @@ esac . /scripts/live-functions -log_begin_msg "Setting up init..." +log_begin_msg "Setting up init" # live-initramfs script # Arrange for shells on virtual consoles, rather than login prompts -if [ -z "${NOAUTOLOGIN}" ] +if [ -z "${NOAUTOLOGIN}" ] && [ -n "${USERNAME}" ] then - if [ -n "${USERNAME}" ] + if [ ! -z "${LIVE_GETTY}" ] then - if [ ! -z "${LIVE_GETTY}" ] + if echo "${DEFCONSOLE}" | grep -qs ttyS then - if echo "${DEFCONSOLE}" | grep -qs ttyS + # AUTOMATIC SERIAL CONSOLE # + PORT=$(echo "${DEFCONSOLE}" | \ + sed -e 's%,.*%%') + SPEED=$(echo "${DEFCONSOLE}" | \ + sed -e 's%ttyS[0-9]\+,%%' \ + -e's%\([0-9]\+\).*%\1%') + + if ! ( sed -n -e'/^[^#]/p' /root/etc/inittab | grep -qs ":respawn:/sbin/getty.*${PORT}" ) then - # AUTOMATIC SERIAL CONSOLE # - PORT=$(echo "${DEFCONSOLE}" | \ - sed -e 's%,.*%%') - SPEED=$(echo "${DEFCONSOLE}" | \ - sed -e 's%ttyS[0-9]\+,%%' \ - -e's%\([0-9]\+\).*%\1%') - - if ! ( sed -n -e'/^[^#]/p' /root/etc/inittab | grep -qs ":respawn:/sbin/getty.*${PORT}" ) - then - IDs="A B C D E F G H I J K L M N O P Q R S T Q U V V X Y Z 0 1 2 3 4 5 6 7 8 9" - - for ID1 in ${IDs} + IDs="A B C D E F G H I J K L M N O P Q R S T Q U V V X Y Z 0 1 2 3 4 5 6 7 8 9" + + for ID1 in ${IDs} + do + for ID2 in ${IDs} do - for ID2 in ${IDs} - do - ID="${ID1}${ID2}" - - if ! grep "^${ID}:" /etc/inittab - then - #make sure it is not already in use - break 2 - fi - done - done + ID="${ID1}${ID2}" - echo "${ID}:2345:respawn:/sbin/live-getty -L ${PORT} ${SPEED} vt100" >> /root/etc/inittab - fi - fi + if ! grep "^${ID}:" /etc/inittab + then + #make sure it is not already in use + break 2 + fi + done + done - if [ -f /root/etc/inittab ] - then - sed -i -e'/^[^#]/s%respawn:/sbin/getty%respawn:/sbin/live-getty%' /root/etc/inittab - fi - else - if [ -f /root/etc/inittab ] - then - sed -i -e "s|^\([^:]*:[^:]*:[^:]*\):.*getty.*\<\(tty[0-9]*\).*$|\1:/bin/login -f ${USERNAME} /dev/\2 2>\&1|" /root/etc/inittab + echo "${ID}:2345:respawn:/sbin/live-getty -L ${PORT} ${SPEED} vt100" >> /root/etc/inittab fi + fi - if [ "/root/etc/event.d/tty*" != "$(echo /root/etc/event.d/tty*)" ] - then - for f in /root/etc/event.d/tty* - do - sed -i -e "s|^respawn.*|respawn /bin/login -f ${USERNAME} /dev/$(basename ${f}) 2>\&1|" ${f} - done - fi + if [ -f /root/etc/inittab ] + then + sed -i -e'/^[^#]/s%respawn:/sbin/getty%respawn:/sbin/live-getty%' /root/etc/inittab + fi + else + if [ -f /root/etc/inittab ] + then + sed -i -e "s|^\([^:]*:[^:]*:[^:]*\):.*getty.*\<\(tty[0-9]*\).*$|\1:/bin/login -f ${USERNAME} /dev/\2 2>\&1|" /root/etc/inittab fi - # Since we use autologin, lastlog doesn't make sense on the console. - sed -i '/^[^#].*pam_lastlog\.so/s/^/# /' /root/etc/pam.d/login + if [ "/root/etc/event.d/tty*" != "$(echo /root/etc/event.d/tty*)" ] + then + for f in /root/etc/event.d/tty* + do + sed -i -e "s|^respawn.*|respawn /bin/login -f ${USERNAME} /dev/$(basename ${f}) 2>\&1|" ${f} + done + fi fi + + # Since we use autologin, lastlog doesn't make sense on the console. + sed -i '/^[^#].*pam_lastlog\.so/s/^/# /' /root/etc/pam.d/login fi # do not try to remove files if using file-rc diff --git a/scripts/live-bottom/30accessibility b/scripts/live-bottom/30accessibility index 6bfcc45..7753154 100755 --- a/scripts/live-bottom/30accessibility +++ b/scripts/live-bottom/30accessibility @@ -27,7 +27,7 @@ fi . /scripts/live-functions -log_begin_msg "Configuring accessibility options..." +log_begin_msg "Configuring accessibility options" # live-initramfs script diff --git a/scripts/live-bottom/31disable_update_notifier b/scripts/live-bottom/31disable_update_notifier index 7a6fef8..e363049 100755 --- a/scripts/live-bottom/31disable_update_notifier +++ b/scripts/live-bottom/31disable_update_notifier @@ -27,7 +27,7 @@ fi . /scripts/live-functions -log_begin_msg "Disabling update-notifier..." +log_begin_msg "Disabling update-notifier" # live-initramfs script @@ -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/32disable_hibernation b/scripts/live-bottom/32disable_hibernation index ec0e03a..8c9eb9a 100755 --- a/scripts/live-bottom/32disable_hibernation +++ b/scripts/live-bottom/32disable_hibernation @@ -27,7 +27,7 @@ fi . /scripts/live-functions -log_begin_msg "Configuring power management..." +log_begin_msg "Configuring power management" # live-initramfs script diff --git a/scripts/live-bottom/33enable_apport_crashes b/scripts/live-bottom/33enable_apport_crashes index f300652..47e650d 100755 --- a/scripts/live-bottom/33enable_apport_crashes +++ b/scripts/live-bottom/33enable_apport_crashes @@ -27,15 +27,13 @@ fi . /scripts/live-functions -log_begin_msg "Enabling notifications about program crashes..." +log_begin_msg "Enabling detection of crashes" # live-initramfs script -update_notifier_version=$(chroot /root dpkg-query -W --showformat='${Version}' update-notifier 2>/dev/null) || update_notifier_version="" - -if [ -n "${update_notifier_version}" ] +if [ -e /root/etc/default/apport ] then - chroot /root sudo -u "${USERNAME}" gconftool-2 -t bool -s /apps/update-notifier/show_apport_crashes true + sed -i 's/enabled=0/enabled=1/' /root/etc/default/apport fi log_end_msg diff --git a/scripts/live-bottom/34disable_kpersonalizer b/scripts/live-bottom/34disable_kpersonalizer index e19cf2a..d61c879 100755 --- a/scripts/live-bottom/34disable_kpersonalizer +++ b/scripts/live-bottom/34disable_kpersonalizer @@ -27,7 +27,7 @@ fi . /scripts/live-functions -log_begin_msg "Disabling kpersonalizer..." +log_begin_msg "Disabling kpersonalizer" # live-initramfs script diff --git a/scripts/live-bottom/35fix_language_selector b/scripts/live-bottom/35fix_language_selector index 70495c4..8452d12 100755 --- a/scripts/live-bottom/35fix_language_selector +++ b/scripts/live-bottom/35fix_language_selector @@ -27,7 +27,7 @@ fi . /scripts/live-functions -log_begin_msg "Fixing language selector..." +log_begin_msg "Fixing language selector" # live-initramfs script diff --git a/scripts/live-bottom/36disable_trackerd b/scripts/live-bottom/36disable_trackerd index 62ad1df..667131d 100755 --- a/scripts/live-bottom/36disable_trackerd +++ b/scripts/live-bottom/36disable_trackerd @@ -27,7 +27,7 @@ fi . /scripts/live-functions -log_begin_msg "Disabling trackerd..." +log_begin_msg "Disabling trackerd" # live-initramfs script diff --git a/scripts/live-bottom/38disable_restricted_manager b/scripts/live-bottom/38disable_restricted_manager index 16a78f3..d585d3c 100755 --- a/scripts/live-bottom/38disable_restricted_manager +++ b/scripts/live-bottom/38disable_restricted_manager @@ -2,8 +2,6 @@ PREREQ="" -. /scripts/live-functions - prereqs() { echo "$PREREQ" @@ -22,7 +20,9 @@ then exit 0 fi -log_begin_msg "Disabling restricted-manager..." +. /scripts/live-functions + +log_begin_msg "Disabling restricted-manager" rm -f /root/etc/xdg/autostart/restricted-manager.desktop rm -f /root/etc/xdg/autostart/restricted-manager-kde.desktop @@ -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 63da284..00606d5 100755 --- a/scripts/live-bottom/41apt_cdrom +++ b/scripts/live-bottom/41apt_cdrom @@ -27,10 +27,13 @@ fi . /scripts/live-functions -log_begin_msg "Adding APT-CDROM source..." +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 d325ddb..f87cab4 100755 --- a/scripts/live-bottom/42disable_apparmor +++ b/scripts/live-bottom/42disable_apparmor @@ -27,10 +27,13 @@ fi . /scripts/live-functions -log_begin_msg "Disabling AppArmor (does not work with stacked file systems)..." +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/43disable_updateinitramfs b/scripts/live-bottom/43disable_updateinitramfs index a973843..0a434ed 100755 --- a/scripts/live-bottom/43disable_updateinitramfs +++ b/scripts/live-bottom/43disable_updateinitramfs @@ -22,7 +22,7 @@ esac . /scripts/live-functions -log_begin_msg "Disabling update-initramfs (useless on a live CD)..." +log_begin_msg "Disabling update-initramfs" # live-initramfs script diff --git a/scripts/live-bottom/44pk_allow b/scripts/live-bottom/44pk_allow index 6ed8d96..7fd026e 100755 --- a/scripts/live-bottom/44pk_allow +++ b/scripts/live-bottom/44pk_allow @@ -22,11 +22,12 @@ esac . /scripts/live-functions -log_begin_msg "Grant administrative PolicyKit pivilieges to default user..." +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 diff --git a/scripts/live-bottom/99hook b/scripts/live-bottom/99hook index a27a96a..17895ca 100755 --- a/scripts/live-bottom/99hook +++ b/scripts/live-bottom/99hook @@ -27,7 +27,7 @@ fi . /scripts/live-functions -log_begin_msg "Executing custom hook script..." +log_begin_msg "Executing custom hook script" # live-initramfs script diff --git a/scripts/live-functions b/scripts/live-functions index c5055a0..0684dc0 100644 --- a/scripts/live-functions +++ b/scripts/live-functions @@ -1,8 +1,48 @@ -#!/bin/sh . /scripts/functions . /live.vars +# Override log_*_msg until #494257 is merged + +_log_msg() +{ + if [ "$quiet" = "y" ]; then return; fi + printf "$@" +} + +log_success_msg() +{ + _log_msg "Success: $@\n" +} + +log_failure_msg() +{ + _log_msg "Failure: $@\n" +} + +log_warning_msg() +{ + _log_msg "Warning: $@\n" +} + +log_begin_msg() +{ + if [ -x /sbin/usplash_write ]; then + /sbin/usplash_write "TEXT $@" + fi + _log_msg "Begin: $@ ... " +} + +log_end_msg() +{ + if [ -x /sbin/usplash_write ]; then + /sbin/usplash_write "SUCCESS ok" + fi + _log_msg "done.\n" +} + +## + log_wait_msg () { # Print a message and wait for enter @@ -12,7 +52,7 @@ log_wait_msg () read nunya < /dev/.initramfs/usplash_outfifo fi - _log_msg "Waiting: ${@} ..." + _log_msg "Waiting: ${@} ... \n" } really_export () @@ -58,3 +98,46 @@ lang2locale() { echo "C" fi } + +# Override panic from scripts/functions +panic() { + + DEB_1="\033[1;31m .''\`. \033[0m" + DEB_2="\033[1;31m: :' : \033[0m" + DEB_3="\033[1;31m\`. \`'\` \033[0m" + DEB_4="\033[1;31m \`- \033[0m" + + LIVELOG="\033[1;37m/live.log\033[0m" + DEBUG="\033[1;37mdebug\033[0m" + + # Reset redirections to avoid buffering + exec 1>&6 6>&- + exec 2>&7 7>&- + kill ${tailpid} + + printf "\n\n" + printf " ${DEB_1}\n" + printf " ${DEB_2} \033[1;37mBOOT FAILED!\033[0m\n" + printf " ${DEB_3}\n" + printf " ${DEB_4} This Debian Live image failed to boot.\n\n" + + printf " Please file a bug against the 'live-initramfs' package or email the Debian\n" + printf " Live mailing list at , making\n" + printf " sure to note the exact version, name and distribution of the image you were\n" + printf " attempting to boot.\n\n" + + printf " The file ${LIVELOG} contains some debugging information but booting with the\n" + printf " ${DEBUG} command-line parameter will greatly increase its verbosity which is\n" + printf " extremely useful when diagnosing issues.\n\n" + + if [ -n "${panic}" ]; then + printf " live-initramfs will now restart your system. " + else + printf " live-initramfs will now start a shell. " + fi + printf "The error message was:\n\n " + + # Call original panic + . /scripts/functions + panic "$@" +} diff --git a/scripts/live-helpers b/scripts/live-helpers index b8b9cf1..70c7f34 100644 --- a/scripts/live-helpers +++ b/scripts/live-helpers @@ -1,4 +1,3 @@ -#!/bin/sh # live-initramfs helper functions, used by live-initramfs on boot and by live-snapshot if [ ! -x "/bin/fstype" ] @@ -31,14 +30,37 @@ subdevices () is_supported_fs () { - # FIXME: do something better like the scan of supported filesystems fstype="${1}" - case ${fstype} in - vfat|iso9660|udf|ext2|ext3|ntfs|jffs2) + # Validate input first + if [ -z "${fstype}" ] + then + return 1 + fi + + # Try to look if it is already supported by the kernel + if grep -q ${fstype} /proc/filesystems + then return 0 - ;; - esac + else + # Then try to add support for it the gentle way using the initramfs capabilities + modprobe ${fstype} + if grep -q ${fstype} /proc/filesystems + then + return 0 + # Then try the hard way if /root is already reachable + else + kmodule="/root/lib/modules/`uname -r`/${fstype}/${fstype}.ko" + if [ -e "${kmodule}" ] + then + insmod "${kmodule}" + if grep -q ${fstype} /proc/filesystems + then + return 0 + fi + fi + fi + fi return 1 } @@ -124,7 +146,7 @@ fs_size () mountp="/mnt/tmp_fs_size" mkdir -p "${mountp}" - mount -t $(get_fstype "${dev}") -o ro "${dev}" "${mountp}" + mount -n -t $(get_fstype "${dev}") -o ro "${dev}" "${mountp}" doumount=1 fi @@ -167,7 +189,15 @@ setup_loop () local readonly=${6} modprobe -q -b "${module}" - udevsettle + + if [ -x /sbin/udevadm ] + then + # lenny + udevadm settle + else + # etch + udevsettle + fi for loopdev in ${pattern} do @@ -178,7 +208,7 @@ setup_loop () if [ -n ${readonly} ] then - if /sbin/losetup --help 2>&1 | grep -q -- "-r\b" + if losetup --help 2>&1 | grep -q -- "-r\b" then options="${options} -r" fi @@ -244,10 +274,10 @@ try_mount () if [ -n "${old_mountp}" ] then - mount -o remount,"${opts}" "${dev}" "${old_mountp}" || panic "Remounting ${dev} ${opts} on ${old_mountp} failed" - mount -o bind "${old_mountp}" "${mountp}" || panic "Cannot bind-mount ${old_mountp} on ${mountp}" + mount -n -o remount,"${opts}" "${dev}" "${old_mountp}" || panic "Remounting ${dev} ${opts} on ${old_mountp} failed" + mount -n -o bind "${old_mountp}" "${mountp}" || panic "Cannot bind-mount ${old_mountp} on ${mountp}" else - mount -t $(get_fstype "${dev}") -o "${opts}" "${dev}" "${mountp}" || panic "Cannot mount ${dev} on ${mountp}" + mount -n -t $(get_fstype "${dev}") -o "${opts}" "${dev}" "${mountp}" || panic "Cannot mount ${dev} on ${mountp}" fi }