summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaximilian attems <maks@debian.org>2007-04-05 21:48:20 +0200
committermaximilian attems <maks@debian.org>2007-04-05 21:48:20 +0200
commit60ee14df535436fc3dfc537017ba944f62e559ae (patch)
tree115b2cf486394f0c8f54d70d8597544aaaaeed3b
parente5bc704cb8be07ecdd419f3630f8ce98129615c0 (diff)
downloadinitramfs-tools-60ee14df535436fc3dfc537017ba944f62e559ae.tar.gz
initramfs-tools-60ee14df535436fc3dfc537017ba944f62e559ae.zip
scripts/functions, mkinitramfs: better backup file handling
* don't panick on backup files on boot, just ignore them * don't include backup file in initramfs * cleanup changelog this is quite a fundamental change need to double check that it works on nfs root too.. :)
-rw-r--r--debian/changelog20
-rwxr-xr-xmkinitramfs20
-rw-r--r--scripts/functions12
-rwxr-xr-xupdate-initramfs2
4 files changed, 42 insertions, 12 deletions
diff --git a/debian/changelog b/debian/changelog
index 509e41b..1f972ed 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,6 @@
-initramfs-tools (0.86) experimental; urgency=low
+initramfs-tools (0.86) UNRELEASED; urgency=low
* update-initramfs: Bound the mode and version variable. (closes: 403905)
- Thanks "Nikita V. Youshchenko" <yoush@debian.org> for report.
* init: Set once the MODPROBE_OPTIONS environment variable and export it.
Don't forget to set -b to have the modprobe.d blacklists respected.
@@ -20,12 +19,12 @@ initramfs-tools (0.86) experimental; urgency=low
* scripts/local: Improve panic message and printed order. (closes: 414640)
Thanks Vincent.McIntyre@csiro.au for patch.
- * scripts/functions: Check if panic is set befor using it. (closes: 406107)
+ * scripts/functions: Check if panic is set before using it. (closes: 406107)
Thanks martin f krafft <madduck@debian.org> for report.
* hook-functions: Copy all kernel/drivers/{block,ide,scsi} subdir modules
instead of hardcoding the list of "supported" drivers. As consequence
- the initramfs might be larger, but none of those should be missed.
+ the initramfs might be larger, but none of those should be missed!
As bonus syncs with Ubuntu.
* init: Mount /sys and /proc nodev, noexec, nosuid - Ubuntu sync.
@@ -38,7 +37,18 @@ initramfs-tools (0.86) experimental; urgency=low
fixes issue of UUID resume dev. (LP: #67932) While there remove the
conffile mv handling of 0.61.
- -- maximilian attems <maks@debian.org> Mon, 2 Apr 2007 22:43:33 +0200
+ * scripts/functions: set_initlist() needs to add only script names with
+ alphabetics, numerics and underscores - skip any other. Bad enough
+ backup scripts get added, but they shouldn't lead to a panic. Also skip
+ directories that might lay around. (closes: 398347) (LP: #76131)
+
+ * mkinitramfs: Don't add backup scripts to initramfs. (closes: 378682)
+ (LP: #78348)
+
+ * scripts/functions: run_scripts() return immediately if passed dir
+ does not exist. Empty dirs without boot script aren't created anymore.
+
+ -- maximilian attems <maks@debian.org> Thu, 5 Apr 2007 21:16:45 +0200
initramfs-tools (0.85f) unstable; urgency=high
diff --git a/mkinitramfs b/mkinitramfs
index 0c278d5..c348516 100755
--- a/mkinitramfs
+++ b/mkinitramfs
@@ -199,13 +199,21 @@ ln -s /lib/klibc-*.so ${DESTDIR}/lib
rm -f ${DESTDIR}/bin/kinit ${DESTDIR}/bin/gzip
copy_exec /usr/share/initramfs-tools/init /init
-cp -a /usr/share/initramfs-tools/scripts/* "${DESTDIR}/scripts"
-for f in $(cd ${CONFDIR}/scripts && \
- find . \( -name '*.dpkg*' -prune -o -name '*~' -prune \) \
- -o -type f -print); do
- mkdir --parents "${DESTDIR}/scripts/$(dirname "${f}")"
-cp -p "${CONFDIR}/scripts/${f}" "${DESTDIR}/scripts/$(dirname "${f}")"
+
+# add existant boot scripts
+for b in $(cd /usr/share/initramfs-tools/scripts/ && find . \
+ -regex '.*/[a-z0-9_]+$' -type f); do
+ [ -d "${DESTDIR}/scripts/$(dirname "${b}")" ] \
+ || mkdir -p "${DESTDIR}/scripts/$(dirname "${b}")"
+ cp -p "/usr/share/initramfs-tools/scripts/${b}" \
+ "${DESTDIR}/scripts/$(dirname "${b}")"
+done
+for b in $(cd "${CONFDIR}/scripts" && find . -regex '.*/[a-z0-9_]+$' -type f); do
+ [ -d "${DESTDIR}/scripts/$(dirname "${b}")" ] \
+ || mkdir -p "${DESTDIR}/scripts/$(dirname "${b}")"
+ cp -p "${CONFDIR}/scripts/${b}" "${DESTDIR}/scripts/$(dirname "${b}")"
done
+
echo "DPKG_ARCH=${DPKG_ARCH}" > ${DESTDIR}/conf/arch.conf
copy_exec "${CONFDIR}/initramfs.conf" /conf
for i in ${EXTRA_CONF}; do
diff --git a/scripts/functions b/scripts/functions
index 7ae9c78..d8e0411 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -85,9 +85,20 @@ set_initlist()
{
unset initlist
for si_x in ${initdir}/*; do
+ # only allow variable name chars
+ case ${si_x#${initdir}/} in
+ *[!A-Za-z0-9_]*)
+ continue
+ ;;
+ esac
+ # skip non executable scripts
if [ ! -x ${si_x} ]; then
continue
fi
+ # skip directories
+ if [ -d ${si_x} ]; then
+ continue
+ fi
initlist="${initlist} ${si_x#${initdir}/}"
done
}
@@ -187,6 +198,7 @@ call_scripts()
run_scripts()
{
initdir=${1}
+ [ ! -d ${initdir} ] && return
get_prereqs
reduce_prereqs
call_scripts
diff --git a/update-initramfs b/update-initramfs
index f4c637b..3c67f89 100755
--- a/update-initramfs
+++ b/update-initramfs
@@ -148,7 +148,7 @@ run_lilo()
{
# show lilo errors on failure
if ! lilo -t > /dev/null 2>&1 ; then
- echo "Error lilo fails for new ${initramfs}:"
+ echo "ERROR lilo fails for new ${initramfs}:"
echo
lilo -t
fi