From ba8bc283647ce17eecf04442c79f03906c6c3e9e Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 25 Aug 2008 14:30:41 +0200 Subject: [PATCH] Resync with Debian's 1.139.1-1 version --- Makefile | 1 + conf/compcache | 1 + debian/changelog | 7 +++ scripts/live | 32 ++++++------- scripts/live-bottom/25configure_init | 91 +++++++++++++++++------------------- scripts/live-helpers | 8 ++-- 6 files changed, 73 insertions(+), 67 deletions(-) create mode 100644 conf/compcache 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/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/debian/changelog b/debian/changelog index 3b3f9d8..a742efe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +live-initramfs (1.139.1-2~grml.01) unstable; urgency=low + + * Resync with Debian's 1.139.1-1 version. + [Closes: issue497] + + -- Michael Prokop Mon, 25 Aug 2008 14:28:10 +0200 + live-initramfs (1.136.3-2~grml.04) unstable; urgency=low * Activate all grml specific patches again (as we have diff --git a/scripts/live b/scripts/live index caaf45b..0363daf 100755 --- a/scripts/live +++ b/scripts/live @@ -621,14 +621,14 @@ copy_live_to () # 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}" ] @@ -640,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} @@ -708,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 @@ -844,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 @@ -1042,7 +1042,7 @@ setup_unionfs () mkdir -p "${croot}/${imagename}" log_begin_msg "Mounting \"${image}\" on \"${croot}${imagename}\" via \"${backdev}\"" - 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}" + 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 @@ -1131,7 +1131,7 @@ setup_unionfs () nfsmount ${nfs_cow_opts} ${cowdevice} /cow || \ panic "Can not mount ${cowdevice} (n: ${cow_fstype}) on /cow" else - 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 @@ -1145,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 @@ -1153,14 +1153,14 @@ 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 @@ -1168,7 +1168,7 @@ setup_unionfs () # 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}" ] @@ -1179,7 +1179,7 @@ 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 log_warning_msg "Unable to find the persistent home medium" @@ -1202,7 +1202,7 @@ setup_unionfs () ;; *) - mount -o move "${d}" "${rootmnt}/live/${d##*/}" + mount -n -o move "${d}" "${rootmnt}/live/${d##*/}" ;; esac done @@ -1210,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" >/dev/null 2>&1 || mount -o bind /cow "${rootmnt}/live/cow" || 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 () @@ -1226,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 @@ -1247,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}) diff --git a/scripts/live-bottom/25configure_init b/scripts/live-bottom/25configure_init index 3c2f765..bb06eb5 100755 --- a/scripts/live-bottom/25configure_init +++ b/scripts/live-bottom/25configure_init @@ -28,65 +28,62 @@ log_begin_msg "Setting up init" # 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-helpers b/scripts/live-helpers index bb5653c..70c7f34 100644 --- a/scripts/live-helpers +++ b/scripts/live-helpers @@ -146,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 @@ -274,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 } -- 2.1.4