From ac222142f849ed340c3b7a0300a57cc3153e0436 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Thu, 9 Jun 2005 17:23:35 +0000 Subject: Add hookscripts --- scripts/init-top/test | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 scripts/init-top/test (limited to 'scripts/init-top') diff --git a/scripts/init-top/test b/scripts/init-top/test new file mode 100644 index 0000000..e4d59fb --- /dev/null +++ b/scripts/init-top/test @@ -0,0 +1,18 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +echo "Got here!" -- cgit v1.2.3 From 8d503582491ccf26b6925e5eb7cf77d9158fc65b Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Mon, 13 Jun 2005 01:40:55 +0000 Subject: Update with new dependancy based init system, call the right script directories, always use busybox now, sigh. --- debian/control | 4 +- init | 14 +++- mkinitramfs | 8 ++- scripts/functions | 178 ++++++++++++++++++++++---------------------------- scripts/init-top/test | 18 ----- scripts/local | 6 +- scripts/local-top/md | 18 +++++ scripts/nfs | 6 +- 8 files changed, 122 insertions(+), 130 deletions(-) delete mode 100644 scripts/init-top/test create mode 100644 scripts/local-top/md (limited to 'scripts/init-top') diff --git a/debian/control b/debian/control index fe8d332..89c37e4 100644 --- a/debian/control +++ b/debian/control @@ -2,11 +2,11 @@ Source: initramfs-tools Section: utils Priority: optional Maintainer: Jeff Bailey -Build-Depends-Indep: debhelper (>= 4.0.0), cdbs, busybox-cvs-static +Build-Depends-Indep: debhelper (>= 4.0.0), cdbs Standards-Version: 3.6.1 Package: initramfs-tools Architecture: all -Depends: klibc-utils +Depends: klibc-utils, busybox-cvs-static Description: tools for generting an Ubuntu-style initramfs This package generates an initramfs for an Ubuntu system. diff --git a/init b/init index c09074f..733e7fd 100644 --- a/init +++ b/init @@ -1,4 +1,14 @@ #!/bin/sh -x + +/bin/busybox ln -s /bin/busybox /bin/[ +/bin/busybox ln -s /bin/busybox /bin/basename +/bin/busybox ln -s /bin/busybox /bin/mount +/bin/busybox ln -s /bin/busybox /bin/mkdir +/bin/busybox ln -s /bin/busybox /bin/umount +/bin/busybox ln -s /bin/busybox /bin/sed +/bin/busybox ln -s /bin/busybox /bin/grep +/bin/busybox ln -s /bin/busybox /bin/cat + mkdir /sys mkdir /proc mkdir /tmp @@ -40,7 +50,7 @@ for x in $(cat /proc/cmdline); do esac done -run_scripts /scripts/init_top +run_scripts /scripts/init-top . /scripts/${BOOT} @@ -59,7 +69,7 @@ fi mountroot -run_scripts /scripts/init_bottom +run_scripts /scripts/init-bottom umount /sys umount /proc diff --git a/mkinitramfs b/mkinitramfs index 359ecd2..e1c9a6b 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -99,7 +99,7 @@ done ln -s /usr/lib/klibc/bin/* ${TMPDIR}/bin ln -s /usr/lib/klibc/lib/* ${TMPDIR}/lib ln -s /usr/share/initramfs-tools/init ${TMPDIR}/init -ln -s /usr/share/initramfs-tools/scripts/* ${TMPDIR}/scripts +cp -a /usr/share/initramfs-tools/scripts/* ${TMPDIR}/scripts ln -s ${CONFDIR}/initramfs.conf ${TMPDIR}/conf ln -s /etc/udev ${TMPDIR}/etc @@ -112,14 +112,16 @@ rm ${TMPDIR}/lib/*lsb* # Busybox if [ "x${BUSYBOX}" = "xy" ]; then + rm ${TMPDIR}/bin/sh ln -s /bin/busybox ${TMPDIR}/bin + ln -s /bin/busybox ${TMPDIR}/bin/sh fi # Raid ln -s /sbin/mdadm ${TMPDIR}/bin ln -s /sbin/mdrun ${TMPDIR}/bin -ln -s /bin/grep ${TMPDIR}/bin -ln -s /bin/sed ${TMPDIR}/bin +#ln -s /bin/grep ${TMPDIR}/bin +#ln -s /bin/sed ${TMPDIR}/bin (cd ${TMPDIR} && find . | cpio --quiet --dereference -o -H newc | gzip -9 >${outfile}) diff --git a/scripts/functions b/scripts/functions index 4a92011..a2ffd54 100644 --- a/scripts/functions +++ b/scripts/functions @@ -8,124 +8,104 @@ panic() fi } -# this function finds scripts with empty depends and adds them -# to the ordered list -dep_reduce() +render() { - i=0 - j=0 - unset neworder - - for entry in "${array[@]}"; do - set - ${entry} + eval "echo -n \${$@}" +} - if [ "$#" -eq "0" ]; then +set_initlist() +{ + unset initlist + for si_x in ${initdir}/*; do + if [ ! -x ${si_x} ]; then continue - elif [ "$#" -eq "1" ]; then - if [ $end -eq 0 ] || - [ x"${order[$((end-1))]}" != x"$1" ]; then - order[$((end))]=$1 - end=$((end+1)) - neworder[$((j))]=$1 - j=$((j+1)) - fi - - array[$((i))]= fi - - i=$((i+1)) + initlist="${initlist} $(basename ${si_x})" done } -dep_remove() +reduce_satisfied() { - i=0 - - # for each row in the array - for entry in "${array[@]}"; do - unset newentry - - set - ${entry} - - # for each dependency of the script - for dep in "$@"; do - new=1 - - # for each new dependency - for tmp in "${order[@]}"; do - if [ x"$dep" = x"$tmp" ]; then - new=0 - fi - done - - if [ x"$new" = x"1" ]; then - newentry="$newentry $dep" - fi - done + deplist="$(render array_${1})" + for rs_x in ${runlist}; do + pop_list_item ${rs_x} ${deplist} + deplist=${tmppop} + done + eval array_${1}=\"${deplist}\" +} - array[$((i))]="$newentry" - i=$((i+1)) +get_prereqs() +{ + set_initlist + for gp_x in ${initlist}; do + tmp=$(${initdir}/${gp_x} prereqs) + eval array_${gp_x}=\"${tmp}\" done } -run_scripts() +count_unsatisfied() { - initdir=${1} - scripts=$(ls ${initdir}) - order= - end=0 - array= + set - ${@} + return ${#} +} - # FIXME: New algorithm - # array of strings: "$file $prereqs" - # iterate over all strings; find empty strings (just $file) - # add to order, delete from all strings and zero out entry - # repeat until all strings are empty - - i=0 - for file in $scripts; do - # if it's not a regular file, or if it's not executable, skip it - if ! [ -f ${initdir}/${file} ] || ! [ -x ${initdir}/${file} ]; then +# Removes $1 from initlist +pop_list_item() +{ + item=${1} + shift + set - ${@} + unset tmppop + # Iterate + for pop in ${@}; do + if [ ${pop} = ${item} ]; then continue fi - - array[$((i))]="$file $(${initdir}/${file} prereqs)" - i=$((i+1)) + tmppop="${tmppop} ${pop}" done - # No scripts in directory, bail. - if [ ${i} -eq 0 ]; then - return 0 - fi - - while /bin/true; do - set - ${array[@]} - - if [ "$#" -eq "0" ]; then - break - fi - - dep_reduce - - dep_remove - - if [ "${#neworder}" -eq "0" ]; then - for x in "${array[@]}"; do - if [ x"$x" != x"" ]; then - printf "could not reduce further; " - printf "circular dependencies\n" - return 1 - fi - done - - # we're done! - break +} + +# This function generates the runlist, so we clear it first. +reduce_prereqs() +{ + unset runlist + set_initlist + set - ${initlist} + i=$# + # Loop until there's no more in the queue to loop through + while [ ${i} -ne 0 ]; do + oldi=${i} + for rp_x in ${initlist}; do + reduce_satisfied ${rp_x} + count_unsatisfied $(render array_${rp_x}) + cnt=${?} + if [ ${cnt} -eq 0 ]; then + runlist="${runlist} ${rp_x}" + pop_list_item ${rp_x} ${initlist} + initlist=${tmppop} + i=$((${i} - 1)) + fi + done + if [ ${i} -eq ${oldi} ]; then + echo "PANIC: Circular dependancy. Exiting." >&2 + exit 1 fi done - - # run the initscripts - for script in "${order[@]}"; do - ${initdir}/${script} +} + +call_scripts() +{ + echo ${runlist} + for cs_x in ${runlist}; do + ${initdir}/${cs_x} done -} +} +run_scripts() +{ + initdir=${1} + get_prereqs + reduce_prereqs + call_scripts +} diff --git a/scripts/init-top/test b/scripts/init-top/test deleted file mode 100644 index e4d59fb..0000000 --- a/scripts/init-top/test +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -echo "Got here!" diff --git a/scripts/local b/scripts/local index ffbd230..b322f09 100644 --- a/scripts/local +++ b/scripts/local @@ -3,7 +3,7 @@ # Parameter: Where to mount the filesystem mountroot () { - run_scripts /scripts/local_top + run_scripts /scripts/local-top # Get the root filesystem type if [ ! -e ${ROOT} ]; then @@ -12,10 +12,10 @@ mountroot () eval $(fstype < ${ROOT}) - run_scripts /scripts/local_premount + run_scripts /scripts/local-premount # Mount root mount ${ro} -t ${FSTYPE} ${ROOT} ${rootmnt} - run_scripts /scripts/local_bottom + run_scripts /scripts/local-bottom } diff --git a/scripts/local-top/md b/scripts/local-top/md new file mode 100644 index 0000000..d6f7e94 --- /dev/null +++ b/scripts/local-top/md @@ -0,0 +1,18 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +/bin/mdrun /dev diff --git a/scripts/nfs b/scripts/nfs index d0f1600..9860ea7 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -2,7 +2,7 @@ # Paramter: Where the root should be mounted mountroot () { - run_scripts /scripts/nfs_top + run_scripts /scripts/nfs-top ipconfig ${DEVICE} . /tmp/net-${DEVICE}.conf @@ -10,10 +10,10 @@ mountroot () NFSROOT=${ROOTSERVER}:${ROOTPATH} fi - run_scripts /scripts/nfs_premount + run_scripts /scripts/nfs-premount nfsmount ${NFSROOT} ${rootmnt} - run_scripts /scripts/nfs_bottom + run_scripts /scripts/nfs-bottom } -- cgit v1.2.3 From 5d46a04527bd3023e4f34cc99029ffc281f42110 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 29 Jul 2006 14:49:39 +0200 Subject: - take care of partial mdadm/lvm Sarge upgrades this compat stuff can go once Etch is released - framebuffer stuff for usplash - don't leave modules file behind - thanks piuparts! --- debian/changelog | 38 ++++++++++++++++++++++++++++++++++++++ debian/initramfs-tools.postrm | 1 + hooks/lvm | 27 --------------------------- mkinitramfs | 17 +++++++++++++++++ scripts/init-top/framebuffer | 41 +++++++++++++++++++++++++++++++++++++++++ scripts/local-top/lvm | 6 +++++- scripts/local-top/mdraid | 41 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 143 insertions(+), 28 deletions(-) delete mode 100755 hooks/lvm create mode 100755 scripts/init-top/framebuffer create mode 100755 scripts/local-top/mdraid (limited to 'scripts/init-top') diff --git a/debian/changelog b/debian/changelog index e6f271b..a43c6b0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,41 @@ +initramfs-tools (0.73) unstable; urgency=high + + * debian/initramfs-tools.postrm: Don't forget to remove config file + modules on purge. Thanks piuparts verification. + + * mkinitramfs: Add sections that deals with sarge mdadm and lvm2. + Does nothing if etch package hooks are installed, will be dropped + postetch as then we upgrade from mdadm and lvm2 packages with hooks. + Taken from Dapper initramfs-tools-0.40ubuntu32. Adapt to add more + modules and no need for mdrun. + + * hooks/lvm: Remove handled by mkinitramfs itself. + + * scripts/local-top/lvm: Add prereqs lvm2 + mdraid. Exit if lvm2 hook is + present. Eases transition of lvm hooks to lvm2. + + * scripts/local-top/mdraid: Enable all raid devices. Add mdadm as prereqs. + Only run if no mdadm hook is in initramfs. (closes: 380089) + + * urgency high upload to get RC fixes into testing. + + -- maximilian attems Sat, 29 Jul 2006 13:35:43 +0200 + +initramfs-tools (0.72) unstable; urgency=low + + * Add scripts/init-top/framebuffer, reduces ubuntu diff even more. + fb is only activated with splash or vga boot param. + * Upload sponsored by Petter Reinholdtsen. + + -- maximilian attems Tue, 25 Jul 2006 09:11:18 +0200 + +initramfs-tools (0.71b) unstable; urgency=low + + * This time caught on bzr dotfiles, removed. + Thanks a lot to Frederik Schüler for review. + + -- maximilian attems Mon, 24 Jul 2006 15:06:04 +0200 + initramfs-tools (0.71) unstable; urgency=low * initramfs.conf.5, initramfs-tools.8, mkinitramfs.8, mkinitramfs-kpkg.8, diff --git a/debian/initramfs-tools.postrm b/debian/initramfs-tools.postrm index b2f40bd..6896636 100644 --- a/debian/initramfs-tools.postrm +++ b/debian/initramfs-tools.postrm @@ -2,6 +2,7 @@ if [ "x${1}" = "xpurge" ]; then rm -f /etc/initramfs-tools/conf.d/resume + rm -f /etc/initramfs-tools/modules fi #DEBHELPER# diff --git a/hooks/lvm b/hooks/lvm deleted file mode 100755 index 49a8887..0000000 --- a/hooks/lvm +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -prereqs) - prereqs - exit 0 - ;; -esac - -if [ ! -x /sbin/vgchange -a ! -d /lib/lvm-200 ]; then - exit 0 -fi - -. /usr/share/initramfs-tools/hook-functions - -copy_exec /lib/lvm-200/vgchange /sbin - -for x in dm_mod dm_snapshot dm_mirror; do - manual_add_modules ${x} -done diff --git a/mkinitramfs b/mkinitramfs index 52dea45..799b77e 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -228,6 +228,23 @@ cp -a /etc/modprobe.d/* "${DESTDIR}/etc/modprobe.d" run_scripts /usr/share/initramfs-tools/hooks run_scripts "${CONFDIR}"/hooks +# FIXME: Remove this Raid block after Etch releases +if [ -x /sbin/mdadm -a ! -f /usr/share/initramfs-tools/hooks/mdadm ]; then + mdadm --examine --scan > $DESTDIR/conf/mdadm.conf + copy_exec /sbin/mdadm /sbin + for x in md linear multipath raid0 raid1 raid456 raid5 raid6 raid10; do + manual_add_modules ${x} + done +fi + +# FIXME: Remove this LVM block after Etch releases +if [ -x /sbin/vgchange -a -d /lib/lvm-200 -a ! -f /usr/share/initramfs-tools/hooks/lvm2 ]; then + copy_exec /lib/lvm-200/vgchange /sbin + for x in dm_mod dm_snapshot dm_mirror; do + manual_add_modules ${x} + done +fi + # Apply DSDT to initramfs if [ -e "${CONFDIR}/DSDT.aml" ]; then copy_exec "${CONFDIR}/DSDT.aml" / diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer new file mode 100755 index 0000000..4f0ab62 --- /dev/null +++ b/scripts/init-top/framebuffer @@ -0,0 +1,41 @@ +#!/bin/sh + +PREREQ="" +prereqs() +{ + echo "$PREREQ" +} +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +SPLASH=false; +VESA=false; + +for x in $(cat /proc/cmdline); do + case $x in + splash*) + SPLASH=true; + ;; + vga=*) + VESA=true; + ;; + esac +done + +if [ $SPLASH = "true" -o $VESA = "true" ]; then + modprobe -q fbcon + if [ $VESA = "true" ]; then + modprobe -q vesafb + else + modprobe -q vga16fb + fi + mknod /dev/fb0 c 29 0 + for i in 0 1 2 3 4 5 6 7 8; do + mknod /dev/tty$i c 4 $i + done +fi diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm index 9a45220..f9d1490 100755 --- a/scripts/local-top/lvm +++ b/scripts/local-top/lvm @@ -1,6 +1,6 @@ #!/bin/sh -PREREQ="mdadm" +PREREQ="mdadm mdraid lvm2" prereqs() { @@ -56,6 +56,10 @@ activate_vg() vgchange -ay ${vg} } +if [ -e /scripts/local-top/lvm2 ]; then + exit 0 +fi + if [ ! -e /sbin/vgchange ]; then exit 0 fi diff --git a/scripts/local-top/mdraid b/scripts/local-top/mdraid new file mode 100755 index 0000000..2cf3b5d --- /dev/null +++ b/scripts/local-top/mdraid @@ -0,0 +1,41 @@ +#!/bin/sh + +PREREQ="udev_helper" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +if [ -e /scripts/local-top/mdadm ]; then + exit 0 +fi + +unset raidlvl +gotraid=n + +# Detect raid level +for x in /dev/hd[a-z][0-9]* /dev/sd[a-z][0-9]*; do + if [ ! -e ${x} ]; then + continue + fi + raidlvl=$(mdadm --examine ${x} 2>/dev/null | grep "Level" | sed -e 's/.*Raid Level : \(.*\)/\1/') + if [ "$raidlvl" ]; then + modprobe -q ${raidlvl} 2>/dev/null + gotraid=y + fi +done + +[ "${gotraid}" = y ] || exit + +# Assemble all raid devices +mkdir /dev/md +mdadm --assemble --config=/etc/mdadm.conf --scan --run --auto=yes -- cgit v1.2.3 From 849c7c5f29f3689a4879204c23a6e89e2e6c0d7e Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 13 Oct 2006 08:52:12 +0200 Subject: - add backup handling to initramfs-tools - allow conservative settings for skipping updated initramfs. - debug output to screen - parse mbr for lilo + small fixes --- conf/update-initramfs.conf | 11 ++++++ debian/changelog | 38 ++++++++++++++++++++ debian/initramfs-tools.install | 1 + debian/initramfs-tools.manpages | 1 + debian/initramfs-tools.preinst | 2 +- hooks/kernelextras | 1 - init | 4 +++ initramfs-tools.8 | 9 +++-- initramfs.conf.5 | 6 ++-- mkinitramfs.8 | 6 ++-- scripts/init-top/framebuffer | 69 +++++++++++++++++++++++++++++++----- update-initramfs | 78 +++++++++++++++++++++++++++++++++++++---- update-initramfs.8 | 6 ++-- update-initramfs.conf.5 | 26 ++++++++++++++ 14 files changed, 228 insertions(+), 30 deletions(-) create mode 100644 conf/update-initramfs.conf create mode 100644 update-initramfs.conf.5 (limited to 'scripts/init-top') diff --git a/conf/update-initramfs.conf b/conf/update-initramfs.conf new file mode 100644 index 0000000..36c3dde --- /dev/null +++ b/conf/update-initramfs.conf @@ -0,0 +1,11 @@ +# +# Configuration file for update-initramfs(8) +# + +# +# update_initramfs [ yes | no ] +# +# Default is yes +# If set to no disables any update to initramfs beside kernel upgrade + +update_initramfs=yes diff --git a/debian/changelog b/debian/changelog index 2990625..1eaf2f9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,41 @@ +initramfs-tools (0.83) unstable; urgency=high + + Release "Ois was du verzapfst is a koida Kaffee" + + * update-initramfs: Keep an initramfs backup while we are running. Do also + keep the booted initramfs as .bak in /boot. First helps on power cut. + Second is a good conservative approach and demanded feature. + Thanks Thiemo Nagel for report. (closes: 387780) + + * init: When debug is invoked with an additional arg, write output to + console. Thanks Christian Aichinger for the idea. + Should ease remote debugging. + + * initramfs-tools.8: Document new debug= feature. + + * initramfs-tools.preinstall: Check for right arg. (closes: 391619) + + * update-initramfs: Try to guess harder if lilo might need to be run + if grub is also around. On old installs we get _zero_ information from + /etc/kernel.img. Parse mbr for lilo signature. (closes: 385949) + Thanks to Michael Prokop for finetuning. + + * scripts/init-top/framebuffer: Parse video bootarg and refactor script. + This add support for custom framebuffer modules. (closes: 386441) + Thanks for the patch by David Härdeman . + + * update.conf: Allow to make "update-initramfs -u" an noop. Useful for + conservative settings of a remote server. (closes: 362064) urgency high. + Thanks Manoj Srivastava for the tough testing. + + * update-initramfs.conf.5: Document the new update_initramfs variable. + + * update-initramfs: Kope with stupid mv of grub to /usr/sbin. + + * manpages: Get a banana and mark myself as author. + + -- maximilian attems Fri, 13 Oct 2006 08:12:40 +0200 + initramfs-tools (0.82) unstable; urgency=high * Merge 0.69ubuntu15, plus 0.69ubuntu14 and 0.69ubuntu11 changelog entries diff --git a/debian/initramfs-tools.install b/debian/initramfs-tools.install index 5514c2e..5b3d8a6 100644 --- a/debian/initramfs-tools.install +++ b/debian/initramfs-tools.install @@ -3,6 +3,7 @@ mkinitramfs-kpkg usr/sbin init usr/share/initramfs-tools scripts usr/share/initramfs-tools conf/initramfs.conf etc/initramfs-tools +conf/update-initramfs.conf etc/initramfs-tools hooks usr/share/initramfs-tools hook-functions usr/share/initramfs-tools conf/modules usr/share/initramfs-tools diff --git a/debian/initramfs-tools.manpages b/debian/initramfs-tools.manpages index f127e99..0c88045 100644 --- a/debian/initramfs-tools.manpages +++ b/debian/initramfs-tools.manpages @@ -3,3 +3,4 @@ mkinitramfs-kpkg.8 initramfs.conf.5 initramfs-tools.8 update-initramfs.8 +update-initramfs.conf.5 diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst index 7b02612..fc1fd06 100644 --- a/debian/initramfs-tools.preinst +++ b/debian/initramfs-tools.preinst @@ -3,7 +3,7 @@ set -e case "$1" in - configure) + install) if [ -n "$2" ]; then mkdir -p /etc/initramfs-tools/conf.d diff --git a/hooks/kernelextras b/hooks/kernelextras index 6bbd6b9..714e9a9 100755 --- a/hooks/kernelextras +++ b/hooks/kernelextras @@ -42,4 +42,3 @@ manual_add_modules vga16fb if [ ${fbcon} = "y" ]; then force_load fbcon fi - diff --git a/init b/init index 85f6291..fbe32be 100755 --- a/init +++ b/init @@ -110,6 +110,10 @@ for x in $(cat /proc/cmdline); do exec >/tmp/initramfs.debug 2>&1 set -x ;; + debug=*) + debug=y + set -x + ;; break=*) break=${x#break=} ;; diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 7af09e1..4ce53d3 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -1,4 +1,4 @@ -.TH INITRAMFS-TOOLS 8 "Date: 2006/08/19" "" "mkinitramfs script overview" +.TH INITRAMFS-TOOLS 8 "Date: 2006/10/11" "" "mkinitramfs script overview" .SH NAME initramfs-tools \- an introduction to writing scripts for mkinitramfs @@ -96,7 +96,9 @@ sets an timeout on panic. Currently only zero value supported. .TP \fB \fI debug -generates lots of output to /tmp/initramfs.debug. +generates lots of output. It writes a log to /tmp/initramfs.debug. +Instead when invoked with an arbitrary argument output is written to console. +Use for example "debug=vc". .TP \fB \fI break @@ -443,7 +445,8 @@ cpio -i -d -H newc --no-absolute-filenames .SH AUTHOR -The initramfs-tools are written by Jeff Bailey . +The initramfs-tools are written by Maximilian Attems , +Jeff Bailey and numerous others. .PP This manual was written by David H\[:a]rdeman , updated by Maximilian Attems . diff --git a/initramfs.conf.5 b/initramfs.conf.5 index 89e9f4b..ca47a02 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -1,4 +1,4 @@ -.TH INITRAMFS.CONF 5 "$Date: 2006/09/02 $" "" "initramfs.conf manual" +.TH INITRAMFS.CONF 5 "$Date: 2006/10/12 $" "" "initramfs.conf manual" .SH NAME initramfs.conf \- configuration file for mkinitramfs @@ -58,8 +58,8 @@ Otherwise you need to specify \fIHOST:MOUNT\fP. .SH AUTHOR -The initramfs-tools are written by Jeff Bailey . -This manual is maintained by Maximilian Attems . +The initramfs-tools are written by Maximilian Attems , +Jeff Bailey and numerous others. Loosely based on mkinitrd.conf by Herbert Xu. .SH SEE ALSO diff --git a/mkinitramfs.8 b/mkinitramfs.8 index 9041ba6..23e719f 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -1,4 +1,4 @@ -.TH MKINITRAMFS 8 "$Date: 2006/08/12 $" "" "mkinitramfs manual" +.TH MKINITRAMFS 8 "$Date: 2006/10/12 $" "" "mkinitramfs manual" .SH NAME mkinitramfs \- generate an initramfs image @@ -95,8 +95,8 @@ it to be loaded by ACPI. .SH AUTHOR -The initramfs-tools are written by Jeff Bailey . -This manual is maintained by Maximilian Attems . +The initramfs-tools are written by Maximilian Attems , +Jeff Bailey and numerous others. .SH SEE ALSO .BR diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 4f0ab62..bafbe19 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -13,27 +13,78 @@ prereqs) ;; esac + +# The options part of the kernel "video=" argument (i.e. everyting +# after "video=:") has very inconsistent rules. +# +# Generally the following applies: +# 1) options are comma-separated +# 2) options can be in either of these three forms: +# =, :, . +# 3) the "mode" option has the form x[M][R][-][@][i][m] +# and may or may not start with "mode=" +# +# When the options are used with modules, they need to be space-separated +# and the following conversions are needed: +# : -> = +# -> =1 +# -> mode= +parse_video_opts() +{ + local OPTS="$1" + local IFS="," + + # Must be a line like video=:,[opt2]... + if [ "$OPTS" = "${OPTS%%:*}" ]; then + return + fi + OPTS="${OPTS#*:}" + for opt in $OPTS; do + # Already in the "=" form + if [ "$opt" != "${opt#*=}" ]; then + echo -n "$opt " + # Presumably a modevalue without the "mode=" prefix + elif [ "$opt" != "${opt#[[:digit:]]*x[[:digit:]]}"; then + echo -n "mode=$opt " + # Presumably a boolean + else + echo -n "$opt=1 " + fi + done +} + +FB="" +OPTS="" + SPLASH=false; VESA=false; for x in $(cat /proc/cmdline); do case $x in splash*) - SPLASH=true; + FB="vga16fb"; + OPTS=""; ;; vga=*) - VESA=true; + FB="vesafb"; + OPTS=""; ;; + video=*) + FB=${x#*=} + FB="${FB%%:*}" + OPTS="$(parse_video_opts "$TMP")" esac done -if [ $SPLASH = "true" -o $VESA = "true" ]; then - modprobe -q fbcon - if [ $VESA = "true" ]; then - modprobe -q vesafb - else - modprobe -q vga16fb - fi +if [ -n "$FB" ]; then + modprobe -q $FB $OPTS +fi + +if [ -e /proc/fb ]; then + while read fbno desc; do + mknod /dev/fb$fbno 29 $fbno + done < /proc/fb + mknod /dev/fb0 c 29 0 for i in 0 1 2 3 4 5 6 7 8; do mknod /dev/tty$i c 4 $i diff --git a/update-initramfs b/update-initramfs index 45d4631..4995553 100755 --- a/update-initramfs +++ b/update-initramfs @@ -2,10 +2,13 @@ STATEDIR=/var/lib/initramfs-tools BOOTDIR=/boot +CONF=/etc/initramfs-tools/update-initramfs.conf KPKGCONF=/etc/kernel-img.conf set -e +[ -r ${CONF} ] && . ${CONF} + usage() { if [ -n "${1}" ]; then @@ -62,6 +65,46 @@ set_initramfs() initramfs="${BOOTDIR}/initrd.img-${version}" } + +# backup initramfs while running +backup_initramfs() +{ + [ ! -r "${initramfs}" ] && return 0 + initramfs_bak="${initramfs}.dpkg-bak" + [ -r "${initramfs_bak}" ] && rm -f "${initramfs_bak}" + mv -f "${initramfs}" "${initramfs_bak}" + verbose "Keeping ${initramfs_bak}" +} + +# keep booted initramfs +backup_booted_initramfs() +{ + # chroot + [ ! -r /proc/uptime ] && rm -f "${initramfs_bak}" && return 0 + + # no backup yet + initramfs_bak="${initramfs}.dpkg-bak" + if [ ! -r "${initramfs}.bak" ]; then + mv -f ${initramfs_bak} "${initramfs}.bak" + verbose "Backup ${initramfs}.bak" + return 0 + fi + + + # keep booted initramfs + uptime_days=$(awk '{printf "%d", $1 / 3600 / 24}' /proc/uptime) + if [ -n "$uptime_days" ]; then + boot_initramfs=$(find "${initramfs_bak}" -mtime +${uptime_days}) + fi + if [ -n "${boot_initramfs}" ]; then + mv -f "${initramfs_bak}" "${initramfs}.bak" + verbose "Backup ${initramfs}.bak" + return 0 + fi + verbose "Removing current backup ${initramfs_bak}" + rm -f ${initramfs_bak} +} + generate_initramfs() { echo "update-initramfs: Generating ${initramfs}" @@ -91,11 +134,27 @@ run_lilo() fi } +# check if lilo is on mbr +mbr_check() +{ + boot=$(awk -F = '/^boot=/{ print $2}' /etc/lilo.conf) + [ -z "${boot}" ] && return 0 + [ ! -r "${boot}" ] && return 0 + dd if="${boot}" bs=512 skip=0 count=1 2> /dev/null | grep -q LILO + [ $? -eq 0 ] && run_lilo && return 0 + echo + echo "WARNING: grub and lilo installed." + echo "If you use grub as bootloader everything is fine." + echo "If you use lilo as bootloader you must run lilo!" + echo +} + # only run lilo if no grub is around # or if "do_bootloader = yes" is set run_bootloader() { - if [ -x /sbin/grub ] || [ -e /boot/grub/menu.lst ]; then + if [ -x /sbin/grub ] || [ -e /boot/grub/menu.lst ] \ + || [ -x /usr/sbin/grub ]; then if [ -e /etc/lilo.conf ] && [ -x /sbin/lilo ]; then [ -r "${KPKGCONF}" ] && \ do_b=$(awk '/bootloader/{print $3}' "${KPKGCONF}") @@ -103,13 +162,10 @@ run_bootloader() || [ "${do_b}" = "YES" ]; then run_lilo return 0 + else + mbr_check + return 0 fi - - echo - echo "WARNING: grub and lilo installed." - echo "If you use grub as bootloader everything is fine." - echo "If you use lilo as bootloader you must run lilo!" - echo fi return 0 fi @@ -228,6 +284,11 @@ create() update() { + if [ "${update_initramfs}" = "no" ]; then + echo "update-initramfs: Not updating initramfs." + exit 0 + fi + if [ -z "${version}" ]; then set_linked_version fi @@ -251,10 +312,13 @@ update() altered_check + backup_initramfs + generate_initramfs run_bootloader + backup_booted_initramfs } delete() diff --git a/update-initramfs.8 b/update-initramfs.8 index 871e9a5..a562349 100644 --- a/update-initramfs.8 +++ b/update-initramfs.8 @@ -1,4 +1,4 @@ -.TH UPDATE-INITRAMFS 8 "$Date: 2006/09/06" $" "" "update\-initramfs manual" +.TH UPDATE-INITRAMFS 8 "$Date: 2006/10/12" $" "" "update\-initramfs manual" .SH NAME update\-initramfs \- generate an initramfs image @@ -85,8 +85,8 @@ Create the initramfs for a specific kernel: .B update\-initramfs -c -k 2.6.18-1-686 .SH AUTHOR -The initramfs-tools are written by Jeff Bailey . -This manual is maintained by Maximilian Attems . +The initramfs-tools are written by Maximilian Attems , +Jeff Bailey and numerous others. .SH SEE ALSO .BR diff --git a/update-initramfs.conf.5 b/update-initramfs.conf.5 new file mode 100644 index 0000000..551f6c9 --- /dev/null +++ b/update-initramfs.conf.5 @@ -0,0 +1,26 @@ +.TH UPDATE-INITRAMFS.CONF 5 "$Date: 2006/10/12 $" "" "update-initramfs.conf manual" + +.SH NAME +update-initramfs.conf \- configuration file for update-initramfs + +.SH DESCRIPTION +The configuration file allows to disable the update action from +.B update-initramfs. + +.SH GENERAL VARIABLES +.TP +\fB update_initramfs +Default is \fIyes\fP for running the latest initramfs-tools hooks in the +newest Linux image. +It is possible to set it to \fIno\fP for remote servers or boxes where +conservative manners needs to be applied. This disables +the \fBupdate_initramfs -u\fP call. + +.SH AUTHOR +The initramfs-tools are written by Maximilian Attems , +Jeff Bailey and numerous others. +.SH SEE ALSO +.BR +.IR initramfs-tools (8), +.IR mkinitramfs (8), +.IR update-initramfs (8). -- cgit v1.2.3 From dc67493c8b72ebb4a360194a13c74a13d06def52 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 18 Oct 2006 13:16:03 +0200 Subject: - improve run_bootloader (elilo, zipl) - fix preinst sed command - bunch of minor fixes --- debian/changelog | 40 ++++++++++++++++++++++++++++++++++++++++ debian/initramfs-tools.preinst | 4 +--- hook-functions | 3 ++- hooks/thermal | 11 +++++++++++ initramfs-tools.8 | 4 ++-- mkinitramfs | 2 +- scripts/init-top/framebuffer | 2 +- scripts/local | 4 ++++ update-initramfs | 15 ++++++++++++--- 9 files changed, 74 insertions(+), 11 deletions(-) (limited to 'scripts/init-top') diff --git a/debian/changelog b/debian/changelog index 49d07a9..022e167 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,31 @@ +initramfs-tools (0.84) unstable; urgency=high + + Release "A-t-on pris à Saint-Périne, Tous ces dictateurs impotents ?" + + * hook-functions: Use modprobe --ignore-install arg to put all listed + modules on initramfs. Thanks Mario Izquierdo + for report. (closes: 384043) + + * update-initramfs: If elilo is around run it on initramfs update, add + zipl run. + + * scripts/local: Use vol_id too if around to set FSTYPE. Thanks for the + patch to "Alex Owen" (closes: 380004) + + * hooks/thermal: Add many of the windfarm modules for powerpc boxes. + + * initramfs-tools.preinst: merge bits of 0.69ubuntu16. (closes: 393773) + urgency high as fixes upgrade from sarge - thanks Federico Grau + . + + * scripts/init-top/framebuffer: Fix mknod call. (closes: 393543) + Thanks for the patch Kiro Zimmer . + + * mkinitramfs: Create modulesdir even on monolithic linux. (closes: 393688) + Thanks for the patch Ian Campbell . + + -- maximilian attems Wed, 18 Oct 2006 11:04:50 +0200 + initramfs-tools (0.83) unstable; urgency=high Release "Ois was du verzapfst is a koida Kaffee" @@ -438,6 +466,18 @@ initramfs-tools (0.69b) unstable; urgency=high -- maximilian attems Fri, 14 Jul 2006 00:31:30 +0200 +initramfs-tools (0.69ubuntu16) edgy; urgency=low + + * Bring in preinst fixes from Debian, including s/configure/install/ in + preinst, since preinst is never called with "configure", and checking + for /proc/swaps before we blindly try to read it to determine RESUME. + * Do away with the bogus '-n "$2"' test in preinst, since "install" can + be called without any arguments at all (and often is, on a clean setup) + * On upgrades, revert the RESUME mangling that dapper's d-i did to our + config file, avoiding spurious conffile prompts (launchpad.net/63693) + + -- Adam Conrad Mon, 16 Oct 2006 17:23:41 +1000 + initramfs-tools (0.69ubuntu15) edgy; urgency=low * Add jmicron module to ide list. diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst index fc1fd06..aa8c8ca 100644 --- a/debian/initramfs-tools.preinst +++ b/debian/initramfs-tools.preinst @@ -4,7 +4,6 @@ set -e case "$1" in install) - if [ -n "$2" ]; then mkdir -p /etc/initramfs-tools/conf.d # First time install. Can we autodetect the RESUME partition? @@ -29,7 +28,7 @@ case "$1" in -e '/# This file should/,/one per line\./d' \ -e 's/Comments begin with.*/Syntax: module_name [args ...]/' \ -e 's/^# ext2$/# raid1/' \ - -e 's/^# wd io=0x300$/# sd_mod/' + -e 's/^# wd io=0x300$/# sd_mod/' \ -e '/^ide-generic/d' \ -e '/^ide-disk/d' \ -e '/^ext2/d' \ @@ -40,7 +39,6 @@ case "$1" in if [ -e /etc/mkinitrd/DSDT ]; then cp /etc/mkinitrd/DSDT /etc/initramfs-tools/DSDT.aml fi - fi ;; upgrade) if [ -n "$2" ] && dpkg --compare-versions "$2" lt "0.61"; then diff --git a/hook-functions b/hook-functions index 98c88a2..8df30f2 100644 --- a/hook-functions +++ b/hook-functions @@ -40,7 +40,8 @@ add_modules_from_file() manual_add_modules() { - for mam_x in $(modprobe --set-version="${version}" --show-depends "${1}" 2>/dev/null | awk '/^insmod/ { print $2 }'); do + for mam_x in $(modprobe --set-version="${version}" --ignore-install \ + --show-depends "${1}" 2>/dev/null | awk '/^insmod/ { print $2 }'); do # Prune duplicates if [ -e "${DESTDIR}/${mam_x}" ]; then continue diff --git a/hooks/thermal b/hooks/thermal index 9bfd323..ece7243 100755 --- a/hooks/thermal +++ b/hooks/thermal @@ -23,6 +23,17 @@ case "$DPKG_ARCH" in # copy the right modules powerpc|ppc64) manual_add_modules therm_pm72 + manual_add_modules windfarm_core + manual_add_modules windfarm_cpufreq_clamp + manual_add_modules windfarm_lm75_sensor + manual_add_modules windfarm_max6690_sensor + manual_add_modules windfarm_pid + manual_add_modules windfarm_pm112 + manual_add_modules windfarm_pm81 + manual_add_modules windfarm_pm91 + manual_add_modules windfarm_smu_controls + manual_add_modules windfarm_smu_sat + manual_add_modules windfarm_smu_sensors manual_add_modules i2c-powermac ;; i386|amd64|ia64) diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 4ce53d3..690505f 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -1,4 +1,4 @@ -.TH INITRAMFS-TOOLS 8 "Date: 2006/10/11" "" "mkinitramfs script overview" +.TH INITRAMFS-TOOLS 8 "Date: 2006/10/14" "" "mkinitramfs script overview" .SH NAME initramfs-tools \- an introduction to writing scripts for mkinitramfs @@ -438,7 +438,7 @@ to double-check if it contains the relevant binaries, libs or modules: .nf mkdir tmp/initramfs cd tmp/initramfs -gunzip -c -9 /boot/initrd.img-2.6.17-2-686 | \\ +gunzip -c -9 /boot/initrd.img-2.6.18-1-686 | \\ cpio -i -d -H newc --no-absolute-filenames .fi .RE diff --git a/mkinitramfs b/mkinitramfs index f667c53..2fd0cc8 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -166,7 +166,7 @@ export verbose # Private, used by 'catenate_cpiogz'. export __TMPCPIOGZ -for d in bin conf/conf.d etc lib modules sbin scripts; do +for d in bin conf/conf.d etc lib modules sbin scripts ${MODULESDIR}; do mkdir -p "${DESTDIR}/${d}" done diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index bafbe19..8382b20 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -82,7 +82,7 @@ fi if [ -e /proc/fb ]; then while read fbno desc; do - mknod /dev/fb$fbno 29 $fbno + mknod /dev/fb$fbno c 29 $fbno done < /proc/fb mknod /dev/fb0 c 29 0 diff --git a/scripts/local b/scripts/local index 299fc65..f4079d5 100644 --- a/scripts/local +++ b/scripts/local @@ -51,6 +51,10 @@ mountroot () else FSTYPE=${ROOTFSTYPE} fi + if [ "$FSTYPE" = "unknown" ] && [ -x /lib/udev/vol_id ]; then + FSTYPE=$(/lib/udev/vol_id -t ${ROOT}) + [ -z "$FSTYPE" ] && FSTYPE="unknown" + fi [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-premount" run_scripts /scripts/local-premount diff --git a/update-initramfs b/update-initramfs index 151e47a..c112211 100755 --- a/update-initramfs +++ b/update-initramfs @@ -148,10 +148,11 @@ mbr_check() echo } -# only run lilo if no grub is around -# or if "do_bootloader = yes" is set +# Invoke bootloader run_bootloader() { + # only run lilo if no grub is around + # or if "do_bootloader = yes" is set if [ -x /sbin/grub ] || [ -e /boot/grub/menu.lst ] \ || [ -x /usr/sbin/grub ]; then if [ -e /etc/lilo.conf ] && [ -x /sbin/lilo ]; then @@ -168,8 +169,16 @@ run_bootloader() fi return 0 fi - if [ -e /etc/lilo.conf ] && [ -x /sbin/lilo ]; then + if [ -r /etc/lilo.conf ] && [ -x /sbin/lilo ]; then run_lilo + return 0 + fi + if [ -x /sbin/elilo ]; then + elilo + return 0 + fi + if [ -r /etc/zipl.conf ]; then + zipl fi } -- cgit v1.2.3 From efa60794a8a0290ec3972aca23b3ab5f92c3175a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 2 Nov 2006 09:30:03 +0100 Subject: - enhance mbr_check() - fix /boot ro check - create fb devices unconditionaly --- debian/changelog | 32 ++++++++++++++++++++++++++++++++ hook-functions | 2 +- scripts/init-top/framebuffer | 17 +++++++++-------- update-initramfs | 40 +++++++++++++++++++++++++++++++++------- 4 files changed, 75 insertions(+), 16 deletions(-) (limited to 'scripts/init-top') diff --git a/debian/changelog b/debian/changelog index 022e167..991ff6f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,29 @@ +initramfs-tools (0.85) unstable; urgency=high + + Release "Nichts ist getan, wenn noch etwas zu tun übrig ist." + + * update-initramfs: Fix ro /boot check to not trigger on other mounts + having a /boot string. (closes: 393906) Thanks for the patch + Olli Helenius + + * init-top/framebuffer: Fix duplicate fbno0 device creation. Merge the + 0.69ubuntu10 solution. Thanks Benjamin Leipold + for the report. (closes: 393890) + + * update-initramfs: Fix mbr_check() for installed lilo and used grub. Thanks + for the patch by Michel Casabona . Also be + stricter about do_bootloader match, use negative info and add check for + grub on mbr before throwing error. (closes: 394559) urgency high. + + * hook-functions: Add sata_sil24 to scsi modules. (closes: 395907) + Thanks Vadim S. Solomi" for the patch. + + * update-initramfs: Fix lilo detection in mbr_check() for rootraid. + Based on a patch by Michael Prokop . Suppress lilo warning + messages on test run. + + -- maximilian attems Mon, 30 Oct 2006 10:12:58 +0100 + initramfs-tools (0.84) unstable; urgency=high Release "A-t-on pris à Saint-Périne, Tous ces dictateurs impotents ?" @@ -499,6 +525,12 @@ initramfs-tools (0.69ubuntu11) edgy; urgency=low -- Oliver Grawert Sun, 10 Sep 2006 11:50:14 +0200 +initramfs-tools (0.69ubuntu10) edgy; urgency=low + + * Create framebuffer device nodes unconditionally + + -- Matthew Garrett Tue, 5 Sep 2006 17:50:53 +0100 + initramfs-tools (0.69ubuntu4) edgy; urgency=low * scripts/local-premount/suspend: Check for UUID= or LABEL= on the diff --git a/hook-functions b/hook-functions index 8df30f2..c6a42a6 100644 --- a/hook-functions +++ b/hook-functions @@ -179,7 +179,7 @@ auto_add_modules() mesh mptfc mptscsih mptsas mptspi nsp32 \ osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx \ qla4xxx qla6312 qlogicfas408 qlogicfc sata_mv sata_nv \ - sata_promise sata_qstor sata_sil sata_sis sata_svw \ + sata_promise sata_qstor sata_sil sata_sil24 sata_sis sata_svw \ sata_sx4 sata_uli sata_via sata_vsc scsi_mod \ scsi_transport_fc scsi_transport_iscsi scsi_transport_spi \ sd_mod stex sym53c8xx tmscsim zfcp; do diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 8382b20..1d5e375 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -76,17 +76,18 @@ for x in $(cat /proc/cmdline); do esac done -if [ -n "$FB" ]; then - modprobe -q $FB $OPTS -fi - if [ -e /proc/fb ]; then while read fbno desc; do mknod /dev/fb$fbno c 29 $fbno done < /proc/fb - +else mknod /dev/fb0 c 29 0 - for i in 0 1 2 3 4 5 6 7 8; do - mknod /dev/tty$i c 4 $i - done +fi +for i in 0 1 2 3 4 5 6 7 8; do + mknod /dev/tty$i c 4 $i +done + +if [ -n "$FB" ]; then + modprobe -q fbcon + modprobe -q $FB $OPTS fi diff --git a/update-initramfs b/update-initramfs index c112211..0fea63c 100755 --- a/update-initramfs +++ b/update-initramfs @@ -127,7 +127,8 @@ generate_initramfs() # lilo call run_lilo() { - lilo -t > /dev/null + # suppress errors on test run + lilo -t > /dev/null 2>&1 if [ $? -eq 0 ]; then lilo fi @@ -136,11 +137,33 @@ run_lilo() # check if lilo is on mbr mbr_check() { + # check out lilo.conf for validity boot=$(awk -F = '/^boot=/{ print $2}' /etc/lilo.conf) [ -z "${boot}" ] && return 0 + case ${boot} in + /dev/md*) + if [ -r /proc/mdstat ]; then + MD=${boot#/dev/} + boot="/dev/$(awk "/^${MD}/{print substr(\$5, 1, 3)}" \ + /proc/mdstat)" + fi + ;; + esac [ ! -r "${boot}" ] && return 0 - dd if="${boot}" bs=512 skip=0 count=1 2> /dev/null | grep -q LILO - [ $? -eq 0 ] && run_lilo && return 0 + dd if="${boot}" bs=512 skip=0 count=1 2> /dev/null | grep -q LILO \ + && run_lilo && return 0 + + # try to discover grub and be happy + [ -r /boot/grub/menu.lst ] \ + && groot=$(awk '/^root/{print substr($2, 2, 3); exit}' \ + /boot/grub/menu.lst) + [ -e /boot/grub/device.map ] && [ -n "${groot}" ] \ + && dev=$(awk "/${groot}/{ print \$NF}" /boot/grub/device.map) + [ -n "${dev}" ] && [ -r ${dev} ] \ + && dd if="${dev}" bs=512 skip=0 count=1 2> /dev/null \ + | grep -q GRUB && return 0 + + # no idea which bootloader is used echo echo "WARNING: grub and lilo installed." echo "If you use grub as bootloader everything is fine." @@ -151,17 +174,19 @@ mbr_check() # Invoke bootloader run_bootloader() { - # only run lilo if no grub is around - # or if "do_bootloader = yes" is set + # if both lilo and grub around, figure out if lilo needs to be run if [ -x /sbin/grub ] || [ -e /boot/grub/menu.lst ] \ || [ -x /usr/sbin/grub ]; then if [ -e /etc/lilo.conf ] && [ -x /sbin/lilo ]; then [ -r "${KPKGCONF}" ] && \ - do_b=$(awk '/bootloader/{print $3}' "${KPKGCONF}") + do_b=$(awk '/^do_bootloader/{print $3}' "${KPKGCONF}") if [ "${do_b}" = "yes" ] || [ "${do_b}" = "Yes" ] \ || [ "${do_b}" = "YES" ]; then run_lilo return 0 + elif [ "${do_b}" = "no" ] || [ "${do_b}" = "No" ] \ + || [ "${do_b}" = "NO" ]; then + return 0 else mbr_check return 0 @@ -203,7 +228,8 @@ delete_sha1() ro_boot_check() { [ -r /proc/mounts ] || return 0 - boot_opts=$(awk '/boot/{if (match($4, /ro/)) print "ro"}' /proc/mounts) + boot_opts=$(awk '/boot/{if (match($4, /ro/) && $2 == "/boot") + print "ro"}' /proc/mounts) if [ -n "${boot_opts}" ]; then echo "WARNING: /boot is ro mounted." echo "update-initramfs: Not updating ${initramfs}" -- cgit v1.2.3 From 78fe68bcad9d0850e6b9877903719cab7c73b475 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 2 Dec 2006 18:51:54 +0100 Subject: - allow to disable backup - new bzr location - functional copy_dir_modules() - modprobe a bunch of ppc windfarm modules in thermal - provide output on error --- conf/update-initramfs.conf | 8 ++++++++ debian/changelog | 42 ++++++++++++++++++++++++++++++++++++++++++ debian/copyright | 2 +- hook-functions | 18 +++++++++++++++--- mkinitramfs | 6 +++--- scripts/init-premount/thermal | 9 +++++++++ scripts/init-top/framebuffer | 10 +++++----- update-initramfs | 12 ++++++++---- 8 files changed, 91 insertions(+), 16 deletions(-) (limited to 'scripts/init-top') diff --git a/conf/update-initramfs.conf b/conf/update-initramfs.conf index 36c3dde..278c51c 100644 --- a/conf/update-initramfs.conf +++ b/conf/update-initramfs.conf @@ -9,3 +9,11 @@ # If set to no disables any update to initramfs beside kernel upgrade update_initramfs=yes + +# +# backup_initramfs [ yes | no ] +# +# Default is yes +# If set to no leaves no .bak backup files. + +backup_initramfs=yes diff --git a/debian/changelog b/debian/changelog index f6ef12c..acfa6f0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,38 @@ +initramfs-tools (0.85c) unstable; urgency=medium + + Release "Pour être heureux vraiment Faut plus d'gouvernement" + + * hook-funcions: Show on verbose mode the added binaries and libraries. + + * update-initramfs: Don't silently fail, user won't be able to reboot. + Thanks Mario Aeby for his blog entry. + + * debian/copyright: Moved to bzr.d.o repo location. + + * hook-functions: Merge 0.69ubuntu22 copy_module_dir fixes, we'll use it + too postetch. Fix the bashism. Thanks to Jurij Smakov + + * scripts/init-premount/thermal: Load blindly a bunch of thermal modules + on powerpc as they are not hotpluggable. Might be ugly, but is a safe bet. + Kernel plattform fix is scheduled for 2.6.20. Push with medium urgency. + (closes: 401269) + + -- maximilian attems Sat, 2 Dec 2006 18:06:34 +0100 + +initramfs-tools (0.85b) unstable; urgency=medium + + * mkinitramfs: Test for ${outfile} before touching anything. (closes: 381677) + + * update-initramfs.conf, update-initramfs: Allow to disable backup strategy. + While we are it fix logic of backup_booted_initramfs(). (closes: 397787) + urgency medium. + + * scripts/init-top/framebuffer: Fix regression of /dev/fb0 creation, + modprobe fb before creating device. Thanks to Otavio Salvador + for patch. + + -- maximilian attems Tue, 14 Nov 2006 08:06:40 +0100 + initramfs-tools (0.85a) unstable; urgency=high * On first time run backup_booted_initramfs() has nothing to back up. @@ -498,6 +533,13 @@ initramfs-tools (0.69b) unstable; urgency=high -- maximilian attems Fri, 14 Jul 2006 00:31:30 +0200 +initramfs-tools (0.69ubuntu22) feisty; urgency=low + + * For copy_module_dir, actually call manual_module for each one, so deps are + taken care of. + + -- Ben Collins Thu, 23 Nov 2006 02:10:29 -0500 + initramfs-tools (0.69ubuntu16) edgy; urgency=low * Bring in preinst fixes from Debian, including s/configure/install/ in diff --git a/debian/copyright b/debian/copyright index 2c681c2..396499f 100644 --- a/debian/copyright +++ b/debian/copyright @@ -10,7 +10,7 @@ The current ubuntu release can be found at: http://archive.ubuntu.com/ubuntu/pool/main/i/initramfs-tools/ The Debian tree is maintained with "bzr" at: -http://debian.stro.at/bzr-test/initramfs-tools/ +http://bzr.debian.org/kernel/initramfs-tools/ Authors: Jeff Bailey , Adam Conrad , Scott James Remnant , diff --git a/hook-functions b/hook-functions index c6a42a6..b4cd58d 100644 --- a/hook-functions +++ b/hook-functions @@ -66,6 +66,9 @@ copy_exec() { fi else ln -s ${1} ${DESTDIR}/${2} + if [ -n "${verbose}" ] && [ "${verbose}" = "y" ]; then + echo "Adding binary ${1}" + fi fi # Copy the dependant libraries @@ -89,6 +92,9 @@ copy_exec() { mkdir -p ${DESTDIR}/${dirname} if [ ! -e ${DESTDIR}/${dirname}/${libname} ]; then ln -s ${x} ${DESTDIR}/${dirname} + if [ -n "${verbose}" ] && [ "${verbose}" = "y" ]; then + echo "Adding library ${x}" + fi fi done } @@ -96,9 +102,15 @@ copy_exec() { # Copy entire subtrees to the initramfs copy_modules_dir() { - tmpdir_modbase="${DESTDIR}/lib/modules/${version}" - mkdir -p "$(dirname "${tmpdir_modbase}/${1}")" - cp -a "${MODULESDIR}/${1}" "${tmpdir_modbase}/${1}" + if ! [ -d "${MODULESDIR}/${1}" ]; then + return; + fi + if [ -n "${verbose}" ] && [ "${verbose}" = "y" ]; then + echo "Copying module directory ${1}" + fi + for x_mod in $(find "${MODULESDIR}/${1}" -name '*.ko' -print); do + manual_add_modules `basename ${x_mod} .ko` + done } dep_add_modules() diff --git a/mkinitramfs b/mkinitramfs index 2fd0cc8..694f423 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -97,13 +97,13 @@ if [ -n "${UMASK}" ]; then umask "${UMASK}" fi -touch $outfile -outfile="$(readlink -f "$outfile")" - if [ -z "${outfile}" ]; then usage fi +touch "$outfile" +outfile="$(readlink -f "$outfile")" + # And by "version" we really mean path to kernel modules # This is braindead, and exists to preserve the interface with mkinitrd if [ ${#} -ne 1 ]; then diff --git a/scripts/init-premount/thermal b/scripts/init-premount/thermal index 3518e7c..bfea1fc 100755 --- a/scripts/init-premount/thermal +++ b/scripts/init-premount/thermal @@ -20,6 +20,15 @@ case "$DPKG_ARCH" in powerpc|ppc64) modprobe -q i2c-powermac modprobe -q therm_pm72 + modprobe -q windfarm_cpufreq_clamp + modprobe -q windfarm_lm75_sensor + modprobe -q windfarm_max6690_sensor + modprobe -q windfarm_pm112 + modprobe -q windfarm_pm81 + modprobe -q windfarm_pm91 + modprobe -q windfarm_smu_controls + modprobe -q windfarm_smu_sat + modprobe -q windfarm_smu_sensors ;; i386|amd64|ia64) modprobe -q fan diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 1d5e375..044b247 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -76,6 +76,11 @@ for x in $(cat /proc/cmdline); do esac done +if [ -n "$FB" ]; then + modprobe -q fbcon + modprobe -q $FB $OPTS +fi + if [ -e /proc/fb ]; then while read fbno desc; do mknod /dev/fb$fbno c 29 $fbno @@ -86,8 +91,3 @@ fi for i in 0 1 2 3 4 5 6 7 8; do mknod /dev/tty$i c 4 $i done - -if [ -n "$FB" ]; then - modprobe -q fbcon - modprobe -q $FB $OPTS -fi diff --git a/update-initramfs b/update-initramfs index e694093..4b230d0 100755 --- a/update-initramfs +++ b/update-initramfs @@ -79,12 +79,16 @@ backup_initramfs() # keep booted initramfs backup_booted_initramfs() { + initramfs_bak="${initramfs}.dpkg-bak" + + # first time run thus no backup + [ ! -r "${initramfs_bak}" ] && return 0 + # chroot [ ! -r /proc/uptime ] && rm -f "${initramfs_bak}" && return 0 - # first time run - initramfs_bak="${initramfs}.dpkg-bak" - [ ! -r "${initramfs_bak}" ] && return 0 + # no kept backup wanted + [ "${backup_initramfs}" = "no" ] && rm -f "${initramfs_bak}" && return 0 # no backup yet if [ ! -r "${initramfs}.bak" ]; then @@ -122,7 +126,7 @@ generate_initramfs() # minversion wasn't met, exit 0 exit 0 fi - verbose "mkinitramfs failed for ${initramfs}" + echo "update-initramfs: failed for ${initramfs}" exit $mkinitramfs_return fi } -- cgit v1.2.3 From d21a00a23405d1db81ab05a12342145276ef2af0 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 21 Dec 2006 10:18:28 +0100 Subject: - revert busybox hardlinking it's utitilites - add drivers/ata - rework the framebuffer boot script - small docs changes --- debian/changelog | 24 ++++++++++++++++++++++++ hook-functions | 4 ++++ initramfs-tools.8 | 4 ++-- mkinitramfs | 8 ++------ scripts/init-top/framebuffer | 34 +++++++++++++++++++++++----------- 5 files changed, 55 insertions(+), 19 deletions(-) (limited to 'scripts/init-top') diff --git a/debian/changelog b/debian/changelog index 394179a..c292a82 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,27 @@ +initramfs-tools (0.85e) unstable; urgency=high + + Release "Qu'ils soient rouges, bleus ou blancs Il faudrait mieux les pendre" + + * initramfs-tools.8: Correct copy_exec() example. (closes: 403122) + Add a better dir to copy_modules_dir() example. + + * mkinitramfs: Revert the sed magic busybox hardlinking for size reduction. + Go for functionality. The klibc binaries are better tested and superior + in some cases like sleep. Fixes several boot troubles. Thanks + Benjamí Villoslada for the report. (closes: 403224) + Thanks Jurij Smakov for pinpointing the trouble. + + * hook-functions: Add all drivers/ata drivers to initramfs that exist for + uname >= 2.6.19 (closes: 403309) urgency high. + + * scripts/init-top/framebuffer: Fix syntax by closing the brackets. Handle + options of the form key:value, map kernel bootarg to module name for + matroxfb. Thanks Rob Walker for the patches + (closes: 403667, 403669). Use posix regexes according to review by + Jurij Smakov . Also protect all variables. + + -- maximilian attems Wed, 20 Dec 2006 22:29:51 +0100 + initramfs-tools (0.85d) unstable; urgency=high Release "Le gros ventre qu'engraisse L'suffrage universel" diff --git a/hook-functions b/hook-functions index 67f5931..fe5d31e 100644 --- a/hook-functions +++ b/hook-functions @@ -198,6 +198,9 @@ auto_add_modules() manual_add_modules "${x}" done ;; + ata) + copy_modules_dir kernel/drivers/ata + ;; ieee1394) for x in ohci1394 sbp2; do manual_add_modules "${x}" @@ -218,6 +221,7 @@ auto_add_modules() auto_add_modules net auto_add_modules ide auto_add_modules scsi + auto_add_modules ata auto_add_modules i2o auto_add_modules dasd auto_add_modules ieee1394 diff --git a/initramfs-tools.8 b/initramfs-tools.8 index 690505f..e280ba4 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -189,7 +189,7 @@ initramfs image. .RS .PP .B Example: -copy_modules_dir kernel/drivers/pci/foobar +copy_modules_dir kernel/drivers/ata .RE .SS Including binaries @@ -197,7 +197,7 @@ If you need to copy binaries to the initramfs module, a command like this should be used: .PP .RS -copy_exec /sbin/mdadm "${DESTDIR}/sbin" +copy_exec /sbin/mdadm /sbin .RE mkinitramfs will automatically detect which libraries the executable depends on diff --git a/mkinitramfs b/mkinitramfs index d187de0..0c278d5 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -227,13 +227,9 @@ if [ "x${BUSYBOX}" = "xn" ]; then echo "Warning: Busybox is required for successful boot!" else rm -f ${DESTDIR}/bin/sh - copy_exec ${BUSYBOXDIR}/busybox /bin/busybox rm -f ${DESTDIR}/bin/busybox - cp ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/busybox - for cmd in `busybox | sed -n '/functions:$/,$p' \ - | sed -e 's/[[:space:]]*//g; s/,$//; s/,/\n/g; /busybox/d'`; do - ln -f ${DESTDIR}/bin/busybox ${DESTDIR}/bin/${cmd} - done + copy_exec ${BUSYBOXDIR}/busybox /bin/busybox + ln -s ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/sh fi # Modutils diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 044b247..7c080f9 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -35,20 +35,23 @@ parse_video_opts() local IFS="," # Must be a line like video=:,[opt2]... - if [ "$OPTS" = "${OPTS%%:*}" ]; then + if [ "${OPTS}" = "${OPTS%%:*}" ]; then return fi OPTS="${OPTS#*:}" - for opt in $OPTS; do + for opt in ${OPTS}; do # Already in the "=" form - if [ "$opt" != "${opt#*=}" ]; then + if [ "${opt}" != "${opt#*=}" ]; then echo -n "$opt " + # In the ":" form + elif [ "${opt}" != "${opt#*:}" ]; then + echo -n "${opt%:*}=${opt#*:} " # Presumably a modevalue without the "mode=" prefix - elif [ "$opt" != "${opt#[[:digit:]]*x[[:digit:]]}"; then + elif [ "${opt}" != "${opt#[0-9]*x[0-9]}" ]; then echo -n "mode=$opt " # Presumably a boolean else - echo -n "$opt=1 " + echo -n "${opt}=1 " fi done } @@ -60,7 +63,7 @@ SPLASH=false; VESA=false; for x in $(cat /proc/cmdline); do - case $x in + case ${x} in splash*) FB="vga16fb"; OPTS=""; @@ -72,22 +75,31 @@ for x in $(cat /proc/cmdline); do video=*) FB=${x#*=} FB="${FB%%:*}" - OPTS="$(parse_video_opts "$TMP")" + OPTS="$(parse_video_opts "${x}")" esac done -if [ -n "$FB" ]; then +# Map command line name to module name +case ${FB} in +matroxfb) + FB=matroxfb_base + ;; +*) + ;; +esac + +if [ -n "${FB}" ]; then modprobe -q fbcon - modprobe -q $FB $OPTS + modprobe -q ${FB} ${OPTS} fi if [ -e /proc/fb ]; then while read fbno desc; do - mknod /dev/fb$fbno c 29 $fbno + mknod /dev/fb${fbno} c 29 ${fbno} done < /proc/fb else mknod /dev/fb0 c 29 0 fi for i in 0 1 2 3 4 5 6 7 8; do - mknod /dev/tty$i c 4 $i + mknod /dev/tty${i} c 4 ${i} done -- cgit v1.2.3 From c4343742b3bf028e467ac8a58ead95c9bfefc628 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 2 Apr 2007 13:29:25 +0200 Subject: first prerelease 0.86 + merge 0.85f * kick mdrun script * update control for lenny + ubuntu * add _all_ ide, block and drivers * use MODPROBE_OPTIONS and kill any modprobed arg * small doc + whitespace fixes --- debian/changelog | 60 +++++++++++++++++++++++++++++++++++++++++-- debian/control | 4 +-- debian/script | 2 +- hook-functions | 28 +++++--------------- init | 13 +++++++--- initramfs.conf.5 | 6 ++--- mkinitramfs.8 | 7 ++++- scripts/functions | 8 +++--- scripts/init-premount/thermal | 26 +++++++++---------- scripts/init-top/framebuffer | 7 ++--- scripts/local | 8 +++--- scripts/local-top/lvm | 6 ++--- scripts/local-top/mdrun | 46 --------------------------------- scripts/local-top/udev_helper | 2 +- scripts/nfs | 4 +-- update-initramfs | 24 +++++++++-------- update-initramfs.conf.5 | 4 +-- 17 files changed, 130 insertions(+), 125 deletions(-) delete mode 100755 scripts/local-top/mdrun (limited to 'scripts/init-top') diff --git a/debian/changelog b/debian/changelog index c292a82..07d28d0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,59 @@ +initramfs-tools (0.86) experimental; urgency=low + + * update-initramfs: Bound the mode and version variable. (closes: 403905) + Thanks "Nikita V. Youshchenko" 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. + Thus remove everywhere the -q modprobe switch. + Thanks Ben Collins for the suggestion. + + * small trailing whitespace cleanup, display full path of kernel-img.conf + in bug script. + + * debian/control: change maintainer entry to new DD mail. :) + Add busybox-initramfs as Ubuntu busybox alternative to depends. + Dropp the sarge busybox-cvs-static entry. + + * scripts/local-top/mdrun: Drop, existed for partial upgrades from sarge. + + * 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) + Thanks martin f krafft 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. + As bonus syncs with Ubuntu. + + * init: Mount /sys and /proc nodev, noexec, nosuid - Ubuntu sync. + + -- maximilian attems Sat, 17 Mar 2007 21:39:13 +0100 + +initramfs-tools (0.85f) unstable; urgency=high + + Release "Au lieu d'aller voter Casse leur la margoulette" + + * update-initramfs: Grub _doesn't_ clear LILO string in mbr, but the inverse + is done. Fix mbr_check() to first check for GRUB. Fixes accidental lilo + call in the case that Grub is the used bootloader. (closes: 409820) + Thanks Michael Prokop for bringing up the case. + + * initramfs.conf.5, mkinitramfs.5: Fix typos. Document version. + (closes: 405157, 405190, 405194) + + * update-initramfs: Be more screamy about lilo error, people seem to + overlook recent lilo failures. + + * scripts/init-top/framebuffer: Remove unused variables. + + * init: Export ROOTDELAY to let udev boot script handle eventual rootdelay. + downgrades 401916 + + -- maximilian attems Wed, 7 Mar 2007 23:34:17 +0100 + initramfs-tools (0.85e) unstable; urgency=high Release "Qu'ils soient rouges, bleus ou blancs Il faudrait mieux les pendre" @@ -74,7 +130,7 @@ initramfs-tools (0.85b) unstable; urgency=medium urgency medium. * scripts/init-top/framebuffer: Fix regression of /dev/fb0 creation, - modprobe fb before creating device. Thanks to Otavio Salvador + modprobe fb before creating device. Thanks to Otavio Salvador for patch. -- maximilian attems Tue, 14 Nov 2006 08:06:40 +0100 @@ -93,7 +149,7 @@ initramfs-tools (0.85) unstable; urgency=high having a /boot string. (closes: 393906) Thanks for the patch Olli Helenius - * init-top/framebuffer: Fix duplicate fbno0 device creation. Merge the + * init-top/framebuffer: Fix duplicate fbno0 device creation. Merge the 0.69ubuntu10 solution. Thanks Benjamin Leipold for the report. (closes: 393890) diff --git a/debian/control b/debian/control index dd4c3b3..9294ee7 100644 --- a/debian/control +++ b/debian/control @@ -1,14 +1,14 @@ Source: initramfs-tools Section: utils Priority: optional -Uploaders: Jeff Bailey , maximilian attems +Uploaders: Jeff Bailey , maximilian attems Maintainer: Debian kernel team Build-Depends: debhelper (>= 4.1.0), cdbs Standards-Version: 3.7.2.0 Package: initramfs-tools Architecture: all -Depends: klibc-utils (>= 1.4.19-2), busybox (>= 1:1.01-3) | busybox-cvs-static (>= 20040623-1), cpio, module-init-tools, udev (>= 0.086-1) +Depends: klibc-utils (>= 1.4.19-2), busybox (>= 1:1.01-3) | busybox-initramfs, cpio, module-init-tools, udev (>= 0.086-1) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for packaged 2.6 diff --git a/debian/script b/debian/script index a8e3dd9..7cfac12 100755 --- a/debian/script +++ b/debian/script @@ -15,7 +15,7 @@ lsmod echo if [ -r /etc/kernel-img.conf ]; then - echo "-- kernel-img.conf" + echo "-- /etc/kernel-img.conf" cat /etc/kernel-img.conf echo fi diff --git a/hook-functions b/hook-functions index fe5d31e..f506b49 100644 --- a/hook-functions +++ b/hook-functions @@ -172,35 +172,20 @@ auto_add_modules() done ;; ide) - for x in ide-cd ide-disk ide-generic aec62xx alim15x3 \ - amd74xx atiixp atuuxo cmd64x cs5520 cs5530 cy82c693 \ - generic hpt34x hpt366 it821x jmicron ns87415 opti621 \ - pdc202xx_new pdc202xx_old piix rz1000 sc1200 serverworks \ - siimage sis5513 slc82c105 slc90e66 triflex trm290 \ - via82cxxx; do - manual_add_modules "${x}" - done + copy_modules_dir kernel/drivers/ide ;; scsi) - for x in 3w-9xxx 3w-xxxx a100u2x aacraid advansys ahci \ - aic79xx aic7xxx aic94xx arcmsr ata_piix atari_scsi \ - atp870u BusLogic cciss ch cpqarray DAC960 dc395x \ - dmx3191d dpt_i2o eata fdomain gdth hptiop ibmvscsic \ - initio ipr ips isp1020 lasi700 lpfc max_scsi mac53c94 \ - megaraid megaraid_mbox megaraid_mm megaraid_sas \ - mesh mptfc mptscsih mptsas mptspi nsp32 \ - osst qla1280 qla2100 qla2200 qla2300 qla2322 qla2xxx \ - qla4xxx qla6312 qlogicfas408 qlogicfc sata_mv sata_nv \ - sata_promise sata_qstor sata_sil sata_sil24 sata_sis sata_svw \ - sata_sx4 sata_uli sata_via sata_vsc scsi_mod \ - scsi_transport_fc scsi_transport_iscsi scsi_transport_spi \ - sd_mod stex sym53c8xx tmscsim zalon zfcp; do + copy_modules_dir kernel/drivers/scsi + for x in mptfc mptsas mptscsih mptspi; do manual_add_modules "${x}" done ;; ata) copy_modules_dir kernel/drivers/ata ;; + block) + copy_modules_dir kernel/drivers/block + ;; ieee1394) for x in ohci1394 sbp2; do manual_add_modules "${x}" @@ -221,6 +206,7 @@ auto_add_modules() auto_add_modules net auto_add_modules ide auto_add_modules scsi + auto_add_modules block auto_add_modules ata auto_add_modules i2o auto_add_modules dasd diff --git a/init b/init index fbe32be..4c09fd7 100755 --- a/init +++ b/init @@ -8,8 +8,8 @@ echo "Loading, please wait..." [ -d /proc ] || mkdir /proc [ -d /tmp ] || mkdir /tmp mkdir -p /var/lock -mount -t sysfs none /sys -mount -t proc none /proc +mount -t sysfs none /sys -o nodev, noexec, nosuid +mount -t proc none /proc -o nodev, noexec, nosuid # Note that this only becomes /dev on the real filesystem if udev's scripts # are used; which they will be, but it's worth pointing out @@ -37,7 +37,10 @@ for i in conf/conf.d/*; do done . /scripts/functions -# Parse command line options +# Set modprobe env +export MODPROBE_OPTIONS="-qb" + +# Export relevant variables export break= export init=/sbin/init export quiet=n @@ -45,8 +48,10 @@ export readonly=y export rootmnt=/root export debug= export cryptopts=${CRYPTOPTS} -export panic +export ROOTDELAY= +export panic= +# Parse command line options for x in $(cat /proc/cmdline); do case $x in init=*) diff --git a/initramfs.conf.5 b/initramfs.conf.5 index ca47a02..e685298 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -1,4 +1,4 @@ -.TH INITRAMFS.CONF 5 "$Date: 2006/10/12 $" "" "initramfs.conf manual" +.TH INITRAMFS.CONF 5 "$Date: 2007/01/01 $" "" "initramfs.conf manual" .SH NAME initramfs.conf \- configuration file for mkinitramfs @@ -37,14 +37,14 @@ The default setting is \fImost\fP. Include busybox utilities for the boot scripts. If set to 'n' .B mkinitramfs -will build an initramfs whithout busybox. +will build an initramfs without busybox. Beware that many boot scripts need busybox utilities. .SH NFS VARIABLES .TP \fB BOOT Allows to use an nfs drive as the root of the drive. -The default is to boot of an \fIlocal\fP media (harddrive, USB stick). +The default is to boot from \fIlocal\fP media (harddrive, USB stick). Set to \fInfs\fP for an NFS root share. .TP diff --git a/mkinitramfs.8 b/mkinitramfs.8 index 23e719f..6d81233 100644 --- a/mkinitramfs.8 +++ b/mkinitramfs.8 @@ -1,4 +1,4 @@ -.TH MKINITRAMFS 8 "$Date: 2006/10/12 $" "" "mkinitramfs manual" +.TH MKINITRAMFS 8 "$Date: 2007/01/02 $" "" "mkinitramfs manual" .SH NAME mkinitramfs \- generate an initramfs image @@ -58,6 +58,11 @@ Override the setting in .IR initramfs.conf . +.TP +\fI version +Set the kernel version of the initramfs image +(defaults to the running kernel). + .TP \fB\-\-supported-host-version=\fIhversion This option queries if mkinitramfs can create ramdisks on a running kernel of version diff --git a/scripts/functions b/scripts/functions index 7e67771..7ae9c78 100644 --- a/scripts/functions +++ b/scripts/functions @@ -60,11 +60,11 @@ panic() /sbin/usplash_write "QUIT" fi # Disallow console access - if [ "${panic}" = 0 ]; then + if [ -n "${panic}" ] && [ "${panic}" = 0 ]; then reboot fi - modprobe -q i8042 - modprobe -q atkbd + modprobe i8042 + modprobe atkbd echo $@ PS1='(initramfs) ' /bin/sh -i /dev/console 2>&1 } @@ -206,7 +206,7 @@ load_modules() if [ "$com" = "#" ]; then continue fi - modprobe -q $m + modprobe $m done fi } diff --git a/scripts/init-premount/thermal b/scripts/init-premount/thermal index bfea1fc..aa146ec 100755 --- a/scripts/init-premount/thermal +++ b/scripts/init-premount/thermal @@ -18,20 +18,20 @@ esac case "$DPKG_ARCH" in # load the right modules powerpc|ppc64) - modprobe -q i2c-powermac - modprobe -q therm_pm72 - modprobe -q windfarm_cpufreq_clamp - modprobe -q windfarm_lm75_sensor - modprobe -q windfarm_max6690_sensor - modprobe -q windfarm_pm112 - modprobe -q windfarm_pm81 - modprobe -q windfarm_pm91 - modprobe -q windfarm_smu_controls - modprobe -q windfarm_smu_sat - modprobe -q windfarm_smu_sensors + modprobe i2c-powermac + modprobe therm_pm72 + modprobe windfarm_cpufreq_clamp + modprobe windfarm_lm75_sensor + modprobe windfarm_max6690_sensor + modprobe windfarm_pm112 + modprobe windfarm_pm81 + modprobe windfarm_pm91 + modprobe windfarm_smu_controls + modprobe windfarm_smu_sat + modprobe windfarm_smu_sensors ;; i386|amd64|ia64) - modprobe -q fan - modprobe -q thermal + modprobe fan + modprobe thermal ;; esac diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 7c080f9..c680409 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -59,9 +59,6 @@ parse_video_opts() FB="" OPTS="" -SPLASH=false; -VESA=false; - for x in $(cat /proc/cmdline); do case ${x} in splash*) @@ -89,8 +86,8 @@ matroxfb) esac if [ -n "${FB}" ]; then - modprobe -q fbcon - modprobe -q ${FB} ${OPTS} + modprobe fbcon + modprobe ${FB} ${OPTS} fi if [ -e /proc/fb ]; then diff --git a/scripts/local b/scripts/local index f4079d5..4e01472 100644 --- a/scripts/local +++ b/scripts/local @@ -40,9 +40,9 @@ mountroot () # We've given up, but we'll let the user fix matters if they can while [ ! -e "${ROOT}" ]; do - echo " Check root= bootarg cat /proc/cmdline" - echo " or missing modules, devices: cat /proc/modules ls /dev" - panic "ALERT! ${ROOT} does not exist. Dropping to a shell!" + echo "ALERT! ${ROOT} does not exist. Dropping to a shell!" + echo " Check your root= boot argument (cat /proc/cmdline)" + panic " Check for missing modules (cat /proc/modules), or device files (ls /dev)" done # Get the root filesystem type if not set @@ -67,7 +67,7 @@ mountroot () fi # FIXME This has no error checking - modprobe -q ${FSTYPE} + modprobe ${FSTYPE} # FIXME This has no error checking # Mount root diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm index 27053de..4cf48ad 100755 --- a/scripts/local-top/lvm +++ b/scripts/local-top/lvm @@ -64,9 +64,9 @@ if [ ! -e /sbin/vgchange ]; then exit 0 fi -modprobe -q dm-mod -modprobe -q dm-snapshot -modprobe -q dm-mirror +modprobe dm-mod +modprobe dm-snapshot +modprobe dm-mirror activate_vg "$ROOT" activate_vg "$resume" diff --git a/scripts/local-top/mdrun b/scripts/local-top/mdrun deleted file mode 100755 index f733656..0000000 --- a/scripts/local-top/mdrun +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh - -PREREQ="udev_helper" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -if [ -e /scripts/local-top/mdadm ]; then - exit 0 -fi - -unset raidlvl -gotraid=n - -# Detect raid level -for x in /dev/hd[a-z][0-9]* /dev/sd[a-z][0-9]*; do - if [ ! -e ${x} ]; then - continue - fi - raidlvl=$(mdadm --examine ${x} 2>/dev/null | grep "Level" | sed -e 's/.*Raid Level : \(.*\)/\1/') - if [ "$raidlvl" ]; then - modprobe -q ${raidlvl} 2>/dev/null - gotraid=y - fi -done - -[ "${gotraid}" = y ] || exit - -# source the presumed root md and it's info -. ./conf/mdrun.conf - -# assemble root raid first due to initrd-tools compatibility -mdadm -A ${rootraiddev} -R -u $uuid $devices - -# assemble all raid devices -/sbin/mdrun /dev diff --git a/scripts/local-top/udev_helper b/scripts/local-top/udev_helper index 2d4c209..c1694b7 100755 --- a/scripts/local-top/udev_helper +++ b/scripts/local-top/udev_helper @@ -19,5 +19,5 @@ esac # but might be an old fashioned ISA controller; in which case # we need to load ide-generic. if [ ! -e "${ROOT}" -o "${ROOT}" = "/dev/root" ]; then - modprobe -q ide-generic + modprobe ide-generic fi diff --git a/scripts/nfs b/scripts/nfs index fc869cc..5eb17bf 100644 --- a/scripts/nfs +++ b/scripts/nfs @@ -78,9 +78,9 @@ mountroot() run_scripts /scripts/nfs-top [ "$quiet" != "y" ] && log_end_msg - modprobe -q nfs + modprobe nfs # For DHCP - modprobe -q af_packet + modprobe af_packet # Default delay is around 180s # FIXME: add usplash_write info diff --git a/update-initramfs b/update-initramfs index 52e603b..a676fe9 100755 --- a/update-initramfs +++ b/update-initramfs @@ -4,6 +4,8 @@ STATEDIR=/var/lib/initramfs-tools BOOTDIR=/boot CONF=/etc/initramfs-tools/update-initramfs.conf KPKGCONF=/etc/kernel-img.conf +mode="" +version="" set -e @@ -136,7 +138,7 @@ run_lilo() { # show lilo errors on failure if ! lilo -t > /dev/null 2>&1 ; then - echo "update-initramfs: lilo run failed for ${initramfs}:" + echo "Error lilo fails for new ${initramfs}:" echo lilo -t fi @@ -146,6 +148,16 @@ run_lilo() # check if lilo is on mbr mbr_check() { + # try to discover grub and be happy + [ -r /boot/grub/menu.lst ] \ + && groot=$(awk '/^root/{print substr($2, 2, 3); exit}' \ + /boot/grub/menu.lst) + [ -e /boot/grub/device.map ] && [ -n "${groot}" ] \ + && dev=$(awk "/${groot}/{ print \$NF}" /boot/grub/device.map) + [ -n "${dev}" ] && [ -r ${dev} ] \ + && dd if="${dev}" bs=512 skip=0 count=1 2> /dev/null \ + | grep -q GRUB && return 0 + # check out lilo.conf for validity boot=$(awk -F = '/^boot=/{ print $2}' /etc/lilo.conf) [ -z "${boot}" ] && return 0 @@ -162,16 +174,6 @@ mbr_check() dd if="${boot}" bs=512 skip=0 count=1 2> /dev/null | grep -q LILO \ && run_lilo && return 0 - # try to discover grub and be happy - [ -r /boot/grub/menu.lst ] \ - && groot=$(awk '/^root/{print substr($2, 2, 3); exit}' \ - /boot/grub/menu.lst) - [ -e /boot/grub/device.map ] && [ -n "${groot}" ] \ - && dev=$(awk "/${groot}/{ print \$NF}" /boot/grub/device.map) - [ -n "${dev}" ] && [ -r ${dev} ] \ - && dd if="${dev}" bs=512 skip=0 count=1 2> /dev/null \ - | grep -q GRUB && return 0 - # no idea which bootloader is used echo echo "WARNING: grub and lilo installed." diff --git a/update-initramfs.conf.5 b/update-initramfs.conf.5 index 30ef6d0..50e1f95 100644 --- a/update-initramfs.conf.5 +++ b/update-initramfs.conf.5 @@ -1,4 +1,4 @@ -.TH UPDATE-INITRAMFS.CONF 5 "$Date: 2006/10/12 $" "" "update-initramfs.conf manual" +.TH UPDATE-INITRAMFS.CONF 5 "$Date: 2006/12/22 $" "" "update-initramfs.conf manual" .SH NAME update-initramfs.conf \- configuration file for update-initramfs @@ -13,7 +13,7 @@ The configuration file allows to disable the update action from Default is \fIyes\fP for running the latest initramfs-tools hooks in the newest Linux image. It is possible to set it to \fIno\fP for remote servers or boxes where -conservative manners needs to be applied. This disables +conservative manners needs to be applied. This disables the \fBupdate_initramfs -u\fP call. .SH AUTHOR -- cgit v1.2.3 From 1541218fe148cfae9c3a4ce84e7fd6692f3d2028 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Thu, 12 Apr 2007 21:56:32 +0200 Subject: Add support for loading keymaps. (closes: 337663) --- conf/initramfs.conf | 9 ++++++++ debian/changelog | 6 +++++- hooks/keymap | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ initramfs.conf.5 | 7 +++++++ mkinitramfs | 1 + scripts/init-top/keymap | 27 ++++++++++++++++++++++++ 6 files changed, 104 insertions(+), 1 deletion(-) create mode 100755 hooks/keymap create mode 100755 scripts/init-top/keymap (limited to 'scripts/init-top') diff --git a/conf/initramfs.conf b/conf/initramfs.conf index b0d1dc0..0620d26 100644 --- a/conf/initramfs.conf +++ b/conf/initramfs.conf @@ -17,6 +17,7 @@ MODULES=most +# # BUSYBOX: [ y | n ] # # Use busybox if available. @@ -24,6 +25,14 @@ MODULES=most BUSYBOX=y +# +# KEYMAP: [ y | n ] +# +# Load a keymap during the initramfs stage. +# + +KEYMAP=n + # # NFS Section of the config. # diff --git a/debian/changelog b/debian/changelog index 0da1fed..f224405 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,14 @@ initramfs-tools (0.87) UNRELEASED; urgency=low + [ maximilian attems ] * scripts/functions: reduce_satisfied() needs to ignore the same set as set_initlist() otherwise an script having a prereqs on a non-executable boot script may cause circular panic. (closes: 418509) - -- maximilian attems Wed, 11 Apr 2007 00:07:18 +0200 + [ David Härdeman ] + * Add support for loading keymaps. (closes: 337663) + + -- David Härdeman Thu, 12 Apr 2007 21:28:45 +0200 initramfs-tools (0.86) unstable; urgency=low diff --git a/hooks/keymap b/hooks/keymap new file mode 100755 index 0000000..749f24c --- /dev/null +++ b/hooks/keymap @@ -0,0 +1,55 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# Hook to load keymaps into the initramfs if requested by KEYMAP="y" +if [ "$KEYMAP" != "y" ] && [ "$KEYMAP" != "Y" ]; then + exit 0 +fi + +# Step 1 - Basic tools +if [ ! -x /bin/loadkeys ] || [ ! -r /etc/console/boottime.kmap.gz ]; then + exit 0 +fi + +. /usr/share/initramfs-tools/hook-functions +copy_exec /bin/loadkeys /bin +cp /etc/console/boottime.kmap.gz ${DESTDIR}/etc + +# Step 2 - Check for UTF8 console +if [ ! -x /usr/bin/kbd_mode ]; then + exit 0 +fi + +if [ -r /etc/environment ]; then + env="/etc/environment" +elif [ -r /etc/default/locale ]; then + env="/etc/default/locale" +else + exit 0 +fi + +for var in LANG LC_ALL LC_CTYPE; do + value=$(egrep "^[^#]*${var}=" $env | tail -n1 | cut -d= -f2) + eval $var=$value +done + +charmap=$(LANG=$LANG LC_ALL=$LC_ALL LC_CTYPE=$LC_CTYPE locale charmap) +if [ "$charmap" = "UTF-8" ]; then + copy_exec /usr/bin/kbd_mode /bin +fi +exit 0 + diff --git a/initramfs.conf.5 b/initramfs.conf.5 index e685298..55d6629 100644 --- a/initramfs.conf.5 +++ b/initramfs.conf.5 @@ -40,6 +40,13 @@ If set to 'n' will build an initramfs without busybox. Beware that many boot scripts need busybox utilities. +.TP +\fB KEYMAP +If set to 'y', the console keymap will be loaded during the initramfs stage. +The keymap will anyway be loaded by the initscripts later, and the packages +that might need input will normally set this variable automatically, so there +should normally be no need to set this. + .SH NFS VARIABLES .TP \fB BOOT diff --git a/mkinitramfs b/mkinitramfs index 17e1846..7d73ba1 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -163,6 +163,7 @@ export CONFDIR export DESTDIR export DPKG_ARCH export verbose +export KEYMAP # Private, used by 'catenate_cpiogz'. export __TMPCPIOGZ diff --git a/scripts/init-top/keymap b/scripts/init-top/keymap new file mode 100755 index 0000000..f011abf --- /dev/null +++ b/scripts/init-top/keymap @@ -0,0 +1,27 @@ +#!/bin/sh + +PREREQ="" +prereqs() +{ + echo "$PREREQ" +} +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +OPTS="-q" + +# Should terminal be in UTF8 mode? +if [ -x /bin/kbd_mode ]; then + /bin/kbd_mode -u + OPTS="${OPTS} -u" +fi + +# Load custom keymap +if [ -x /bin/loadkeys -a -r /etc/boottime.kmap.gz ]; then + loadkeys ${OPTS} /etc/boottime.kmap.gz +fi -- cgit v1.2.3 From 7e0470e3fe7ede0f846ff2e459aeec1650742e9b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 16 Apr 2007 22:07:01 +0200 Subject: nice usplash experience tested both on my laptop as on qemu ubuntu merge --- debian/changelog | 7 +++++++ scripts/init-top/framebuffer | 4 ---- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'scripts/init-top') diff --git a/debian/changelog b/debian/changelog index 0d77ff9..62fef53 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +initramfs-tools (0.88) UNRELEASED; urgency=low + + * scripts/init-top/framebuffer: Remove vga16fb loading on splash bootarg. + Newer usplash > 0.4 no longer needs that. + + -- maximilian attems Mon, 16 Apr 2007 22:05:18 +0200 + initramfs-tools (0.87) unstable; urgency=low [ maximilian attems ] diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index c680409..08e36d2 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -61,10 +61,6 @@ OPTS="" for x in $(cat /proc/cmdline); do case ${x} in - splash*) - FB="vga16fb"; - OPTS=""; - ;; vga=*) FB="vesafb"; OPTS=""; -- cgit v1.2.3 From 971f6f778035b49afaea9be8408f90cccb6b548b Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 1 Sep 2007 10:56:59 +0200 Subject: init-top/framebuffer: Check that fb minor is below 32. you can only have up to 32 fb devices going from fb0 to fb31. --- debian/changelog | 3 ++- scripts/init-top/framebuffer | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'scripts/init-top') diff --git a/debian/changelog b/debian/changelog index 36a3b81..6a1d1f3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,8 +9,9 @@ initramfs-tools (0.91) UNRELEASED; urgency=low * scripts/local: Quote readonly variable. (LP: #115807) * mkinitramfs, scripts/keymap: Add trailing slash on cp destination for dir. * init: Call panic for debug sh if run-init fails. + * init-top/framebuffer: Check that fb minor is below 32. - -- maximilian attems Sat, 01 Sep 2007 10:45:04 +0200 + -- maximilian attems Sat, 01 Sep 2007 10:55:33 +0200 initramfs-tools (0.90a) unstable; urgency=high diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 08e36d2..9292024 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -88,7 +88,9 @@ fi if [ -e /proc/fb ]; then while read fbno desc; do - mknod /dev/fb${fbno} c 29 ${fbno} + if [ $(($fbnum < 32)) ]; then + mknod /dev/fb${fbno} c 29 ${fbno} + fi done < /proc/fb else mknod /dev/fb0 c 29 0 -- cgit v1.2.3 From fd0b67f392bc351dacf6b29532fc478d1ff9f118 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 5 Sep 2007 22:22:20 +0200 Subject: scripts/init-top/framebuffer: fix variable name s/fbnum/fbno/ --- scripts/init-top/framebuffer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/init-top') diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 9292024..2427b47 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -88,7 +88,7 @@ fi if [ -e /proc/fb ]; then while read fbno desc; do - if [ $(($fbnum < 32)) ]; then + if [ $(($fbno < 32)) ]; then mknod /dev/fb${fbno} c 29 ${fbno} fi done < /proc/fb -- cgit v1.2.3 From 0aec8b0c22b7622841c4ab7a3b492b4d2657456f Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 25 Mar 2008 14:40:45 +0100 Subject: framebuffer: Let udev create fb devices. nuke fb device mknod creation as udev creates the fb device nodes. suggested by waldi. positive test on qemu with usplash. let's see if we get a bad interaction with usplash and vga=XXX boots. --- scripts/init-top/framebuffer | 9 --------- 1 file changed, 9 deletions(-) (limited to 'scripts/init-top') diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 2427b47..cb1ea2c 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -86,15 +86,6 @@ if [ -n "${FB}" ]; then modprobe ${FB} ${OPTS} fi -if [ -e /proc/fb ]; then - while read fbno desc; do - if [ $(($fbno < 32)) ]; then - mknod /dev/fb${fbno} c 29 ${fbno} - fi - done < /proc/fb -else - mknod /dev/fb0 c 29 0 -fi for i in 0 1 2 3 4 5 6 7 8; do mknod /dev/tty${i} c 4 ${i} done -- cgit v1.2.3 From d377e38823d06d8e79341fba44ce8ea9c42daff6 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 25 Mar 2008 14:47:17 +0100 Subject: framebuffer: Leave tty devices for udev too. udev creates tty devices too, in the case of not using udev, we need to ship more anyway, so no need to worry about that right now. --- scripts/init-top/framebuffer | 4 ---- 1 file changed, 4 deletions(-) (limited to 'scripts/init-top') diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index cb1ea2c..21a6b19 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -85,7 +85,3 @@ if [ -n "${FB}" ]; then modprobe fbcon modprobe ${FB} ${OPTS} fi - -for i in 0 1 2 3 4 5 6 7 8; do - mknod /dev/tty${i} c 4 ${i} -done -- cgit v1.2.3 From 72a013043b785642d125bcba6698b460f82e97f2 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 5 Jul 2008 02:03:23 +0200 Subject: add boot script loading ide-generic on all_generic_ide cmdline thanks to Frans Pop for report, idea stolen from Ubuntu, adapted their boot script same boot param. closes: #485786 Signed-off-by: maximilian attems --- scripts/init-top/all_generic_ide | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 scripts/init-top/all_generic_ide (limited to 'scripts/init-top') diff --git a/scripts/init-top/all_generic_ide b/scripts/init-top/all_generic_ide new file mode 100644 index 0000000..28b519a --- /dev/null +++ b/scripts/init-top/all_generic_ide @@ -0,0 +1,22 @@ +#!/bin/sh + +PREREQ="" +prereqs() +{ + echo "$PREREQ" +} +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +for x in $(cat /proc/cmdline); do + case ${x} in + all_generic_ide) + modprobe ide-generic + ;; + esac +done -- cgit v1.2.3 From 6244406a9cd195d2867c72662ce632c2a2d2f653 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 5 Jul 2008 02:46:04 +0200 Subject: release 0.92d --- debian/changelog | 17 +++++++++++++++++ scripts/init-top/all_generic_ide | 0 2 files changed, 17 insertions(+) mode change 100644 => 100755 scripts/init-top/all_generic_ide (limited to 'scripts/init-top') diff --git a/debian/changelog b/debian/changelog index 90e50a6..2d8029b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,20 @@ +initramfs-tools (0.92d) unstable; urgency=low + + * Ubuntu merge + - More meaningful text for no root device panic from Ubuntu. + - Add virtio_pci, udf for MODULES=most root device support. + - usplash pulsates: drop code to increment a progress bar after + each message. + - initramfs-tools.preinst: Try to use UUID for resume device. + - add boot script loading ide-generic on all_generic_ide cmdline. + Thanks Frans Pop for report. (closes: #485786) + * init: add possible mountroot break (closes: #488963) + * initramfs-tools.8: document UUID usage for root and all_generic_ide. + (closes: #489186) + * debian/initramfs-tools.preinst: try with different vol_id pathes. + + -- maximilian attems Sat, 05 Jul 2008 02:36:10 +0200 + initramfs-tools (0.92c) unstable; urgency=low [ maximilian attems ] diff --git a/scripts/init-top/all_generic_ide b/scripts/init-top/all_generic_ide old mode 100644 new mode 100755 -- cgit v1.2.3 From 87461ea463b943a9ccff96b2b36fcfbd66691a1a Mon Sep 17 00:00:00 2001 From: Michal Pokrywka Date: Mon, 13 Oct 2008 02:08:52 +0200 Subject: framebuffer: Add support for uvesafb Uvesafb framebuffer driver needs v86d userspace program but when fb driver is modprobed at init-top stage of initrd, /dev/zero and /dev/mem are missing because udev have not been run yet. --- scripts/init-top/framebuffer | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts/init-top') diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 21a6b19..4375dca 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -72,11 +72,16 @@ for x in $(cat /proc/cmdline); do esac done -# Map command line name to module name +# Map command line name to module name and other tweaks case ${FB} in matroxfb) FB=matroxfb_base ;; +uvesafb) + # v86d requires /dev/zero and dev/mem, but udev haven't been started yet + [ -e /dev/zero ] || mknod -m 0666 /dev/zero c 1 5 + [ -e /dev/mem ] || mknod -m 0640 /dev/mem c 1 1 + ;; *) ;; esac -- cgit v1.2.3 From 7e82cbb4ff425ef0201e215566f17826311197c1 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 15 Dec 2008 11:31:15 +0100 Subject: Revert "framebuffer: Let udev create fb devices." udev isn't started at this point and therefore can't create framebuffer devices. This causes usplash not to run on PS3. set sane permissions will making the char files. This reverts commit 0aec8b0c22b7622841c4ab7a3b492b4d2657456f. --- scripts/init-top/framebuffer | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'scripts/init-top') diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 4375dca..0ed798e 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -90,3 +90,13 @@ if [ -n "${FB}" ]; then modprobe fbcon modprobe ${FB} ${OPTS} fi + +if [ -e /proc/fb ]; then + while read fbno desc; do + if [ $(($fbno < 32)) ]; then + mknod -m 0640 /dev/fb${fbno} c 29 ${fbno} + fi + done < /proc/fb +else + mknod -m 0640 /dev/fb0 c 29 0 +fi -- cgit v1.2.3 From b11f308d10ff9de4bb2a8fef44e1ec98d5e950e7 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 18 Dec 2008 00:40:36 +0100 Subject: all_generic_ide: Also parse boolean bootoption d-i uses to pass it with the value 1 Reported-by: Frans Pop --- scripts/init-top/all_generic_ide | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scripts/init-top') diff --git a/scripts/init-top/all_generic_ide b/scripts/init-top/all_generic_ide index 28b519a..3274ee8 100755 --- a/scripts/init-top/all_generic_ide +++ b/scripts/init-top/all_generic_ide @@ -18,5 +18,10 @@ for x in $(cat /proc/cmdline); do all_generic_ide) modprobe ide-generic ;; + all_generic_ide=*) + if [ ${x#all_generic_ide=} ]; then + modprobe ide-generic + fi + ;; esac done -- cgit v1.2.3 From 7e3f1f2ef6477cf9ab93793d12168ee9ae8c5571 Mon Sep 17 00:00:00 2001 From: Ben Collins Date: Tue, 18 Mar 2008 11:46:44 -0400 Subject: init-top/framebuffer: ignore blacklist for forced vga= usage. DO NOT USE -Qb for framebuffer. Blank ttys when using vesafb (vga=xxx) LP: #129910 [ s/-Q/-q/ for modprobe options -maks ] --- scripts/init-top/framebuffer | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts/init-top') diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 0ed798e..c5c18b9 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -87,8 +87,9 @@ uvesafb) esac if [ -n "${FB}" ]; then - modprobe fbcon - modprobe ${FB} ${OPTS} + unset MODPROBE_OPTIONS + modprobe -q fbcon + modprobe -q ${FB} ${OPTS} fi if [ -e /proc/fb ]; then -- cgit v1.2.3 From e184c8c2a9ad4520cf0cf4536301c6ae6206e911 Mon Sep 17 00:00:00 2001 From: Maik Zumstrull Date: Sat, 24 Mar 2007 23:48:16 +0100 Subject: init-top/framebuffer: Load intel-agp for intelfb After further experimentation, I discovered additional problems that my first patch did not address, namely that 1) Some FB drivers need the AGP subsystem up and running before they are loaded and 2) intelfb needs intel-agp.ko, but does not have a dependency on it. intelfb does not actually *work* on my testsystem after this (it crashes), but unlike with plain initramfs-tools, it loads (and prints something useful if loaded with the probeonly option). I'll try to find out why it fails to work tomorrow; it's probably an unrelated issue. [ make the patch applyable, probably whitespace damaged, fix comments, no need to pass -q to modprobe that is set globaly -maks ] (closes: #416063, #455876) Signed-off-by: maximilian attems --- scripts/init-top/framebuffer | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts/init-top') diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index c5c18b9..37456ae 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -72,11 +72,15 @@ for x in $(cat /proc/cmdline); do esac done -# Map command line name to module name and other tweaks +# Module-specific workarounds case ${FB} in matroxfb) + # Map command line name to module name FB=matroxfb_base ;; +intelfb|i810fb) + # Needs AGP driver loaded + modprobe intel-agp uvesafb) # v86d requires /dev/zero and dev/mem, but udev haven't been started yet [ -e /dev/zero ] || mknod -m 0666 /dev/zero c 1 5 -- cgit v1.2.3 From f3049298fec182252dc76c75202454bb324bc682 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Thu, 2 Apr 2009 01:54:46 +0200 Subject: init-top/framebuffer: syntax fix. fix wrong merge of e184c8c2a9ad4520cf0cf4536301c6ae6206e911 scripts/init-top/framebuffer: 84: Syntax error: ")" unexpected (expecting ";;") --- scripts/init-top/framebuffer | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts/init-top') diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index 37456ae..e0028f7 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -81,6 +81,7 @@ matroxfb) intelfb|i810fb) # Needs AGP driver loaded modprobe intel-agp + ;; uvesafb) # v86d requires /dev/zero and dev/mem, but udev haven't been started yet [ -e /dev/zero ] || mknod -m 0666 /dev/zero c 1 5 -- cgit v1.2.3 From 4a4dda7aff43b9fdb52633c1af877fa69884fc33 Mon Sep 17 00:00:00 2001 From: "Aaron M. Ucko" Date: Mon, 15 Jun 2009 19:14:00 -0400 Subject: scripts/init-top/framebuffer: i915 needs intel-agp too The i915 DRM module doubles as a framebuffer of sorts, at least in kernel mode-setting setups; like its cousins intelfb and i810fb, it effectively requires intel-agp despite not actually using any of its symbols. As such, could you please arrange for scripts/init-top/framebuffer to give it the same treatment, per the following patch?: (closes: #533258) Signed-off-by: maximilian attems --- scripts/init-top/framebuffer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/init-top') diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer index e0028f7..678ffdf 100755 --- a/scripts/init-top/framebuffer +++ b/scripts/init-top/framebuffer @@ -78,7 +78,7 @@ matroxfb) # Map command line name to module name FB=matroxfb_base ;; -intelfb|i810fb) +intelfb|i810fb|i915) # Needs AGP driver loaded modprobe intel-agp ;; -- cgit v1.2.3 From db24ed6ec7887631c05ce0d51c53c8c2cb9c507a Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 29 Jul 2009 15:46:48 +0200 Subject: nuke framebuffer boot script fb should be loaded after initramfs by init to have a beautiful userland. allows faster boot not to try parsing crazy things with only posix sh at our hands. this will need a README.DEBIAN section as noone is now currently loading fbcon. Signed-off-by: maximilian attems --- scripts/init-top/framebuffer | 108 ------------------------------------------- 1 file changed, 108 deletions(-) delete mode 100755 scripts/init-top/framebuffer (limited to 'scripts/init-top') diff --git a/scripts/init-top/framebuffer b/scripts/init-top/framebuffer deleted file mode 100755 index 678ffdf..0000000 --- a/scripts/init-top/framebuffer +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/sh - -PREREQ="" -prereqs() -{ - echo "$PREREQ" -} -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - - -# The options part of the kernel "video=" argument (i.e. everyting -# after "video=:") has very inconsistent rules. -# -# Generally the following applies: -# 1) options are comma-separated -# 2) options can be in either of these three forms: -# =, :, . -# 3) the "mode" option has the form x[M][R][-][@][i][m] -# and may or may not start with "mode=" -# -# When the options are used with modules, they need to be space-separated -# and the following conversions are needed: -# : -> = -# -> =1 -# -> mode= -parse_video_opts() -{ - local OPTS="$1" - local IFS="," - - # Must be a line like video=:,[opt2]... - if [ "${OPTS}" = "${OPTS%%:*}" ]; then - return - fi - OPTS="${OPTS#*:}" - for opt in ${OPTS}; do - # Already in the "=" form - if [ "${opt}" != "${opt#*=}" ]; then - echo -n "$opt " - # In the ":" form - elif [ "${opt}" != "${opt#*:}" ]; then - echo -n "${opt%:*}=${opt#*:} " - # Presumably a modevalue without the "mode=" prefix - elif [ "${opt}" != "${opt#[0-9]*x[0-9]}" ]; then - echo -n "mode=$opt " - # Presumably a boolean - else - echo -n "${opt}=1 " - fi - done -} - -FB="" -OPTS="" - -for x in $(cat /proc/cmdline); do - case ${x} in - vga=*) - FB="vesafb"; - OPTS=""; - ;; - video=*) - FB=${x#*=} - FB="${FB%%:*}" - OPTS="$(parse_video_opts "${x}")" - esac -done - -# Module-specific workarounds -case ${FB} in -matroxfb) - # Map command line name to module name - FB=matroxfb_base - ;; -intelfb|i810fb|i915) - # Needs AGP driver loaded - modprobe intel-agp - ;; -uvesafb) - # v86d requires /dev/zero and dev/mem, but udev haven't been started yet - [ -e /dev/zero ] || mknod -m 0666 /dev/zero c 1 5 - [ -e /dev/mem ] || mknod -m 0640 /dev/mem c 1 1 - ;; -*) - ;; -esac - -if [ -n "${FB}" ]; then - unset MODPROBE_OPTIONS - modprobe -q fbcon - modprobe -q ${FB} ${OPTS} -fi - -if [ -e /proc/fb ]; then - while read fbno desc; do - if [ $(($fbno < 32)) ]; then - mknod -m 0640 /dev/fb${fbno} c 29 ${fbno} - fi - done < /proc/fb -else - mknod -m 0640 /dev/fb0 c 29 0 -fi -- cgit v1.2.3 From 1bf31aaa5bc8bf53bf123d8d75a927c1a358171c Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Mon, 22 Feb 2010 23:36:53 +0100 Subject: blacklist earlier at init-top stage as udev will start earlier, care to blacklist before it loads. Signed-off-by: maximilian attems --- scripts/init-premount/blacklist | 25 ------------------------- scripts/init-top/blacklist | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 25 deletions(-) delete mode 100755 scripts/init-premount/blacklist create mode 100755 scripts/init-top/blacklist (limited to 'scripts/init-top') diff --git a/scripts/init-premount/blacklist b/scripts/init-premount/blacklist deleted file mode 100755 index 2164906..0000000 --- a/scripts/init-premount/blacklist +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -# get pre-requisites -prereqs) - prereqs - exit 0 - ;; -esac - -# sanity check -[ -z "${blacklist}" ] && exit 0 - -# write blacklist to modprobe.d -IFS=',' -for b in ${blacklist}; do - echo "blacklist $b" >> /etc/modprobe.d/initramfs.conf -done diff --git a/scripts/init-top/blacklist b/scripts/init-top/blacklist new file mode 100755 index 0000000..2164906 --- /dev/null +++ b/scripts/init-top/blacklist @@ -0,0 +1,25 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# sanity check +[ -z "${blacklist}" ] && exit 0 + +# write blacklist to modprobe.d +IFS=',' +for b in ${blacklist}; do + echo "blacklist $b" >> /etc/modprobe.d/initramfs.conf +done -- cgit v1.2.3 From 7ea605d62c6fca441a40820a573a2e0ef704f183 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 4 Apr 2010 02:15:17 +0200 Subject: Use ata_generic driver on all_generic_ide bootarg [ merge from 0.92bubuntu1 ] Reported-by: Ben Hutchings Signed-off-by: maximilian attems --- scripts/init-top/all_generic_ide | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/init-top') diff --git a/scripts/init-top/all_generic_ide b/scripts/init-top/all_generic_ide index 3274ee8..e9539d8 100755 --- a/scripts/init-top/all_generic_ide +++ b/scripts/init-top/all_generic_ide @@ -16,11 +16,11 @@ esac for x in $(cat /proc/cmdline); do case ${x} in all_generic_ide) - modprobe ide-generic + modprobe ata_generic all_generic_ide=1 ;; all_generic_ide=*) if [ ${x#all_generic_ide=} ]; then - modprobe ide-generic + modprobe ata_generic all_generic_ide=1 fi ;; esac -- cgit v1.2.3