122 Commits

Author SHA1 Message Date
Michael Prokop
ab28c77261 code cleanup: consequently replace spaces in indentions with tabs to unify coding stile
Signed-off-by: Michael Prokop <mika@debian.org>
2010-06-14 12:15:07 +02:00
Michael Prokop
2a8c9907b1 hook-functions/mkinitramfs/update-initramfs: consequently output error messages to stderr
Signed-off-by: Michael Prokop <mika@debian.org>
2010-06-14 11:11:42 +02:00
maximilian attems
cc6077aa62 update-initramfs: Fix another unbound variable
still uncovering things..

Closes: #583695

Signed-off-by: maximilian attems <maks@debian.org>
2010-06-13 20:46:37 +02:00
Jonathan Nieder
06d05e4d9d update-initramfs: use $* instead of $@
Use "$*" where it makes the quoting behavior easier to understand.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Reviewed-by: Michael Prokop <mika@debian.org>
2010-06-02 23:45:29 +02:00
Michael Prokop
8db2ddbaaf update-initramfs: fix unbound variables. [Closes: #583695]
Signed-off-by: Michael Prokop <mika@debian.org>
2010-06-02 23:44:25 +02:00
maximilian attems
17b4d50016 update-initramfs: Use nounset
better catch errors early..

Signed-off-by: maximilian attems <maks@debian.org>
2010-04-07 07:01:35 +02:00
maximilian attems
110a03b4fa update-initramfs: fix previous elilo commit
sloppy coding without coffee
2010-03-25 17:27:51 +01:00
maximilian attems
83e83675cc update-initramfs: only run elilo if configured
check for /etc/elilo.conf

(closes: #534201)

Signed-off-by: maximilian attems <maks@debian.org>
2010-03-25 17:00:44 +01:00
maximilian attems
cc33aa5bfb update-initramfs: Stop second guessing lilo usage.
If people have both lilo and grub installed they need
to figured out on their own, what they want.

The mbr detection is error prone and a nice hack,
but has survived it's time now that grub.cfg would need
to be parsed in a different way.

warn people that they should act.

(closes: #574553)

Signed-off-by: maximilian attems <maks@debian.org>
2010-03-25 01:25:05 +01:00
maximilian attems
d50ca3a902 update-initramfs: -d delete .bak file
as bonus rename confusing function.
(closes: #559535)

Signed-off-by: maximilian attems <maks@debian.org>
2010-03-24 00:04:22 +01:00
maximilian attems
c1fa297a93 update-initramfs: allow -t takeover on delete
needed to have idempotent delete
2009-09-25 19:46:29 +02:00
maximilian attems
ceb549235d update-initramfs: Don't hardcode path for lilo or elilo.
elilo seems to be installed in /usr/sbin/ and thus wasn't run.
(closes: #524928)

Reported-by: dann frazier <dannf@hp.com>
Signed-off-by: maximilian attems <maks@debian.org>
2009-04-21 14:51:55 +02:00
maximilian attems
409aa55645 update-initramfs: Pass version to flash-kernel
allows handling of different subarches.

(closes: #523711)

Reported-by: Martin Michlmayr <tbm@cyrius.com>
Signed-off-by: maximilian attems <maks@debian.org>
2009-04-18 17:58:55 +02:00
maximilian attems
41562f3293 update-initramfs: Text exit code of command -v too.
same simplification.

Signed-off-by: maximilian attems <maks@debian.org>
2009-04-03 15:00:30 +02:00
maximilian attems
0cdf39d601 update-initramfs: Fix error message on wrong -k version argument
update-initramfs  -k $(uname -a) -t -u
You must specify at least one of -c, -u, or -d.
[..]

which is wrong as -u was reported.

Reported-by: Michael Prokop <mika@grml.org>
2009-03-30 18:31:49 +02:00
maximilian attems
ac6626f75f update-initramfs: Run update on highest version instead of /initrd.img link
"Ah.  there were symlinks in / - tho they were never ever used on this
system.

Seems pretty broken to rely on symlinks that might (and are) years out
of date."

Reported-by: Peter Palfrader <weasel@debian.org>

so no longer rely on this links like since 0.65,
but use the "latest" according the dpkg higher heuristic check.
that should make people more happy!
also the symlinks should be phased out, only fallback to them
if set_highest_version() finds nothing.

(closes: #493863)
2009-03-30 01:01:48 +02:00
maximilian attems
89257a84d0 update-initramfs: mbr_check() use /boot/grub/grub.cfg for grub2 search.
only comes into play if lilo is installed too and usage is not
configured by do_bootloader in /etc/kernel-img.conf.

(closes: #427509)
2009-03-30 00:23:54 +02:00
maximilian attems
ff34476ecd update-initramfs: Cleanup run_bootloader()
rework it's logic, instead of 2 nested top ifs use one if
with 2 "&&" connected checks. gets us rid of one nested level.

simplify codeflow inside too as bonus.

make clear why mbr_check() is run.
2009-03-30 00:13:39 +02:00
Michael Vogt
b61ca06a84 update-initramfs: set_linked_version() check if the links point to an existing initrd.img
[ first test existence before link and don't use bashism -maks ]
Ubuntu merge 0.92bubuntu24
2009-03-19 16:57:33 +01:00
maximilian attems
254a54d61d update-initramfs: Fix run_bootloader() to check for grub2
makes it respect "do_bootloader = no" if both lilo and grub2 are
installed.

simplify grub check as both grub2 and grub have an update-grub script.

based on patch and report by Clint Adams <schizo@debian.org>

(closes: #511514)
2009-01-12 00:00:07 +01:00
Martin Michlmayr
aac6f31e93 update-initramfs: don't run glantank-update-kernel
glantank-update-kernel has been merged into flash-kernel and
glantank-update-kernel will now call flash-kernel for compatibility.
So there's no need to run glantank-update-kernel anymore.

In case you do another upload for lenny, please include this patch.
But there's no reason just to upload for this since nothing will break
with the current initramfs-tools (although flash-kernel will be ran
twice).
2008-09-15 11:48:38 +02:00
maximilian attems
e45c4b2406 update-initramfs: run_bootloader() invoke flash-kernel and glantank-update-kernel
in case of triggered update-initramfs the latest initramfs should get
flashed.

thanks to Joey Hess <joeyh@debian.org>
2008-08-12 11:03:22 +02:00
maximilian attems
a1ba5db6ee update-initramfs: mbr_check() fix for /dev/md/X naming (closes: #469312)
update-initramfs: Generating /boot/initrd.img-2.6.22-3-k7
awk: /^md/2/{print substr($5, 1, 3)}

thuse the initramfs will not be generated properly
2008-05-30 14:05:22 +02:00
maximilian attems
a8584be941 update-initramfs: Rename function according to reliability fix.
purpose of function changed, now we keep the old initramfs
on the real path until mkinitramfs run finished.
2008-04-08 11:02:17 +02:00
Luke Yelavich
cf1cb624d7 update-initramfs: Initramfs generation reliability fixes.
Attached is a patch to improve the way update-initramfs handles the
generating of new or updated initramfs images for kernels. It puts in
place a few measures to ensure that if there is not enough disk space on
/boot, a previous initramfs is still in tact, to allow the booting of
that kernel. The patch applies against current git head. See the Ubuntu
specification found at the following URL for more information:
https://wiki.ubuntu.com/HardyInitramfsErrorHandling

This patch does the following:
* When generating a new initramfs, instead of copying the old initramfs to a
  backup file, it hard links it instead, so no more space is used than
  necessary. it only copies to the backup file in the event that the filesystem
  on /boot doesn't support hard links, eg FAT32 partitions.

* A new file is used to generate the initramfs. If the generation succeeds, it
  is moved to the original initramfs's location, ready to use. If it fails, the
  original initramfs is not affected, allowing it to be used at boot.

[ wrap on long line -maks ]
2008-04-08 10:47:20 +02:00
Joey Hess
5dfdae9ae2 update-initramfs: use dpkg-trigger
This is a lightly modified version of Ian Jackson's original patch,
incorporating maximilian attems's comments.

dh_installdeb automatically installs the triggers file, so the rules file
does not need to be changed.
2008-04-02 21:52:03 +02:00
Daniel Reichelt
894c4c19e0 update-initramfs: fix ro-mounted /boot check (closes: #458772)
Hi Kernel-Team,

i stumbled over this bug when I wanted to update my initrd while I had
some isos loop-mounted like this:

$ cat /proc/mounts |grep boot
/dev/hda1 /boot ext2 rw 0 0
/dev/loop57 /srv/pub/iso_loop/sys/bootrescue-cd-20071129-59 iso9660 ro 0
0
/dev/loop58 /srv/pub/iso_loop/sys/bootrescue-cd-dev iso9660 ro 0 0
/dev/loop59 /srv/pub/iso_loop/sys/bootrescue-dvd-20071129-59 iso9660 ro
0 0
/dev/loop60 /srv/pub/iso_loop/sys/bootrescue-dvd-dev iso9660 ro 0 0

The check for a ro-mounted /boot partition was falsly triggered by the
mount targets of the iso-images. As you can see in the patch attached,
for the conditional awk output to work as desired, another pair of hyphen
enclosing the awk match calls is required.

HTH,

Daniel Reichelt
2008-01-05 16:57:52 +01:00
maximilian attems
3e65988cf9 update-initramfs: Fix ro /boot partition check (closes: #451151)
Newer kernel in the effort of killing /etc/mtab show mount options,
like errors=remount-ro, that is matched for read only.
Thanks Jan Niehusmann <jan@gondor.com> for report.
2007-11-28 19:43:15 +01:00
maximilian attems
803cf67dab update-initramfs: Don't check for ro /boot inside of a chroot.
debian-live may as well be build on a host with ro /boot
2007-09-04 11:35:32 +02:00
maximilian attems
aad955549a update_initramfs tristate variable "all"
allow admin to set that an update-initramfs postinst call
should update any known initramfs.
2007-08-09 21:22:10 +02:00
maximilian attems
b6c5123351 update-initramfs: enhance altered error message. 2007-08-09 20:45:31 +02:00
maximilian attems
60ee14df53 scripts/functions, mkinitramfs: better backup file handling
* don't panick on backup files on boot, just ignore them
* don't include backup file in initramfs
* cleanup changelog

this is quite a fundamental change need to double check
that it works on nfs root too.. :)
2007-04-05 21:48:20 +02:00
maximilian attems
1eaf8424e5 bootfixes: mount args don't like spaces
restore_initramfs(): verbose output before action
2007-04-02 20:21:34 +02:00
maximilian attems
5dfd85f416 update-initramfs: restore_initramfs
restore initramfs on failure path
2007-04-02 15:04:41 +02:00
maximilian attems
c4343742b3 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
2007-04-02 13:29:25 +02:00
maximilian attems
c03e703126 - show lilo error on lilo failure
- add hppa zalon module
- reduce size due to keeping only 1 busybox copy
- warn on update mode when no initramfs exist and takeover not specified
2006-12-14 23:16:15 +01:00
maximilian attems
78fe68bcad - allow to disable backup
- new bzr location
- functional copy_dir_modules()
- modprobe a bunch of ppc windfarm modules in thermal
- provide output on error
2006-12-02 18:51:54 +01:00
maximilian attems
3c1412b131 - check that an initrd is around before trying to backup 2006-11-04 12:20:05 +01:00
maximilian attems
efa60794a8 - enhance mbr_check()
- fix /boot ro check
- create fb devices unconditionaly
2006-11-02 09:30:03 +01:00
maximilian attems
dc67493c8b - improve run_bootloader (elilo, zipl)
- fix preinst sed command
- bunch of minor fixes
2006-10-18 13:16:03 +02:00
maximilian attems
63f337b6a8 last minute fixes update-initramfs:
- find against the correct backup
- check if initramfs _really_ exists
2006-10-13 09:44:20 +02:00
maximilian attems
abb7b4e13f whitespace policy 2006-10-13 09:11:54 +02:00
maximilian attems
849c7c5f29 - add backup handling to initramfs-tools
- allow conservative settings for skipping updated initramfs.
- debug output to screen
- parse mbr for lilo
+ small fixes
2006-10-13 08:52:12 +02:00
maximilian attems
b8c8f676a5 - mkinitramfs: allow umask setting paranoid
- revert an nfs changes
small fixes over the place
2006-09-27 16:03:30 +02:00
maximilian attems
681dc7a756 - more nfs work (timeout, parsing, typo)
- lilo codeflow
- add lasi700 scsi module
2006-09-19 23:56:24 +02:00
maximilian attems
d4105f86b3 - another run_lilo improvement 2006-09-12 16:54:36 +02:00
maximilian attems
773f7f37a7 - check for ro /boot
- allow -k all for all modes and more feedback on deleting
- small whitespace cleanup
2006-09-12 09:29:44 +02:00
maximilian attems
8ae9783215 - fix destination of the mdrun.conf for partial sarge upgrades
- checkout if /sbin/lilo is really there
- guard more dirs against creation
- add /etc/kernel-img.conf to reportbug output
2006-09-01 16:18:29 +02:00
maximilian attems
45989c9f37 - fix bashism
- rename mdadm.conf in mdrun.conf
- retry nfsmount
- harden init
- fix lvm boot script prereqs
2006-08-25 17:04:33 +02:00
maximilian attems
fabe918dee - improved nfsroo parsing
- added rootdelay and rootfstype bootargs
- document this changes
- initrd-tools backward compatible mdadm assembe and then run mdrun
- update-initramfs really checkout use_bootloader from /etc/kernel-img.conf
- tighter klibc deps
2006-08-23 09:22:54 +02:00