4 merge_debconf_into_conf
()
6 local tmpfile
; tmpfile
="$1"
7 local setting
; setting
="$2"
8 local template
; template
="$3"
11 local value
; value
="$(echo "$RET" | sed -e 's,[$`"\
],\\&,g
')"
12 if grep -q "^${setting}=" "$tmpfile"; then
13 value="$(echo "$value" | sed -e 's
,[\@
],\\&,g
')"
14 sed -i -re "s@^(${setting}=).*@\1\"${value}\"@" "$tmpfile"
17 echo "${setting}=\"${value}\"" >> "$tmpfile"
23 if [ ! -x /usr/share/lupin-support/grub-mkimage ] || \
24 ! /usr/share/lupin-support/grub-mkimage --test; then
28 local bootdev="$(grub-probe --target=device /boot)" || true
31 /dev/loop/*|/dev/loop[0-9])
32 loop_file="$(losetup "$bootdev" | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/")"
33 # If it's loop-mounted from another device
, it isn
't Wubi.
44 # This only works on a Linux system with udev running. This is probably the
45 # vast majority of systems where we need any of this, though, and we fall
46 # back reasonably gracefully if we don't have it.
52 if [ "$cached_available_ids" ]; then
53 echo "$cached_available_ids"
57 [ -d /dev
/disk
/by-id
] ||
return
58 cached_available_ids
="$(
59 for path in /dev/disk/by-id/*; do
60 [ -e "$path" ] || continue
61 printf '%s %s\n' "$path" "$
(readlink
-f "$path")"
62 done | sort -k2 -s -u | cut -d' ' -f1
64 echo "$cached_available_ids"
67 # Returns non-zero and no output if no mapping can be found.
71 for id
in $
(available_ids
); do
72 if [ "$(readlink -f "$id")" = "$(readlink -f "$1")" ]; then
77 # Fall back to the plain device name if there's no by-id link for it.
90 id
="$(device_to_id "$device" || true)"
92 ids
="${ids:+$ids, }$id"
101 for id
in $
(available_ids
); do
113 for id
in $
(available_ids
); do
114 if [ "$id" != "$1" ] && [ "${id%-part*}" = "$1" ]; then
115 ids
="${ids:+$ids }$id"
121 # In order to determine whether we accidentally ran grub-install without
122 # upgrade-from-grub-legacy on versions older than 1.98+20100617-1, we need
123 # to be able to scan a disk to determine whether GRUB 2 was installed in its
124 # boot sector. This is specific to i386-pc (but that's the only platform
128 if ! dd if="$1" bs
=512 count
=1 2>/dev
/null |
grep -aq GRUB
; then
129 # No version of GRUB is installed.
133 # The GRUB boot sector always starts with a JMP instruction.
134 initial_jmp
="$(dd if="$1" bs=2 count=1 2>/dev/null | od -Ax -tx1 | \
135 head -n1 | cut -d' ' -f2,3)"
136 [ "$initial_jmp" ] ||
return 1
137 initial_jmp_opcode
="${initial_jmp%% *}"
138 [ "$initial_jmp_opcode" = eb
] ||
return 1
139 initial_jmp_operand
="${initial_jmp#* }"
140 case $initial_jmp_operand in
142 # I believe this covers all versions of GRUB 2 up to the package
143 # version where we gained a more explicit mechanism. GRUB Legacy
144 # always had 48 here.
155 local num_sectors sector_size size
156 # Try to find out the size without relying on a partitioning tool being
157 # installed. This isn't too hard on Linux 2.6 with sysfs, but we have to
158 # try a couple of variants on detection of the sector size.
159 if [ -e "$1/size" ]; then
160 num_sectors
="$(cat "$1/size
")"
162 if [ -e "$1/queue/logical_block_size" ]; then
163 sector_size
="$(cat "$1/queue
/logical_block_size
")"
164 elif [ -e "$1/queue/hw_sector_size" ]; then
165 sector_size
="$(cat "$1/queue
/hw_sector_size
")"
167 size
="$(expr "$num_sectors" \* "$sector_size" / 1000 / 1000)"
169 [ "$size" ] || size
='???'
176 local num_sectors sector_size size
=
178 if num_sectors
="$(camcontrol readcap "$1" -q -s -N)"; then
179 sector_size
="$(camcontrol readcap "$1" -q -b)"
180 size
="$(expr "$num_sectors" \* "$sector_size" / 1000 / 1000)"
183 [ "$size" ] || size
='???'
189 if which udevadm
>/dev
/null
2>&1; then
194 # Returns value in $RET, like a debconf command.
197 local disk id sysfs_path disk_basename size model
204 sysfs_path
="$(maybe_udevadm info -n "$disk" -q path)"
205 if [ -z "$sysfs_path" ]; then
206 sysfs_path
="/block/$(printf %s "${disk#/dev/}" | sed 's,/,!,g')"
208 size
="$(sysfs_size "/sys
$sysfs_path")"
210 model
="$(maybe_udevadm info -n "$disk" -q property | sed -n 's/^ID_MODEL=//p')"
211 if [ -z "$model" ]; then
212 model
="$(maybe_udevadm info -n "$disk" -q property | sed -n 's/^DM_NAME=//p')"
213 if [ -z "$model" ]; then
214 model
="$(maybe_udevadm info -n "$disk" -q property | sed -n 's/^MD_NAME=//p')"
215 if [ -z "$model" ] && which dmsetup
>/dev
/null
2>&1; then
216 model
="$(dmsetup info -c --noheadings -o name "$disk" 2>/dev/null || true)"
222 disk_basename
=$
(basename "$disk")
223 size
="$(camcontrol_size "$disk_basename")"
224 model
="$(camcontrol inquiry "$disk_basename" | sed -ne "s
/^pass0
: <\
([^
>]*\
)>.
*/\
1/p
")"
228 [ "$model" ] || model
='???'
230 db_subst grub-pc
/disk_description DEVICE
"$disk"
231 db_subst grub-pc
/disk_description SIZE
"$size"
232 db_subst grub-pc
/disk_description MODEL
"$model"
233 db_metaget grub-pc
/disk_description description
236 # Returns value in $RET, like a debconf command.
239 local disk part id path sysfs_path diskbase partbase size
245 sysfs_path
="$(maybe_udevadm info -n "$part" -q path)"
246 if [ -z "$sysfs_path" ]; then
247 diskbase
="${disk#/dev/}"
248 diskbase
="$(printf %s "$diskbase" | sed 's,/,!,g')"
249 partbase
="${part#/dev/}"
250 partbase
="$(printf %s "$partbase" | sed 's,/,!,g')"
251 sysfs_path
="/block/$diskbase/$partbase"
253 size
="$(sysfs_size "/sys
$sysfs_path")"
255 db_subst grub-pc
/partition_description DEVICE
"$part"
256 db_subst grub-pc
/partition_description SIZE
"$size"
257 db_subst grub-pc
/partition_description PATH
"$path"
258 db_metaget grub-pc
/partition_description description
263 local last_partition path partition partition_id
266 for path
in / /boot
/boot
/grub
; do
267 partition
="$(grub-probe -t device "$path" || true)"
268 if [ -z "$partition" ] ||
[ "$partition" = "$last_partition" ]; then
271 partition_id
="$(device_to_id "$partition" || true)"
272 echo "$path:$partition_id"
273 last_partition
="$partition"
279 local relpath boot_mountpoint
281 relpath
="$(grub-mkrelpath "$1")"
282 boot_mountpoint
="${1#$relpath}"
283 echo "${boot_mountpoint:-/}"
288 for x
in /etc
/default
/grub
/etc
/default
/grub.d
/*.cfg
; do
293 if [ "$(eval echo "\
${$1+set}")" = set ]; then
300 running_in_container
()
302 type systemd-detect-virt
>/dev
/null
2>&1 && systemd-detect-virt
--quiet --container
306 db_get grub
2/update_nvram
307 if [ "$RET" = false
]; then
314 if ! grub-install $@
; then
315 echo "Failed: grub-install $@" >&2
316 echo "WARNING: Bootloader is not properly installed, system may not be bootable" >&2
322 .
/usr
/share
/debconf
/confmodule
324 devicemap_regenerated
=
326 if egrep -q '^[[:space:]]*post(inst|rm)_hook[[:space:]]*=[[:space:]]*(/sbin/|/usr/sbin/)?update-grub' /etc
/kernel-img.conf
2>/dev
/null
; then
327 echo 'Removing update-grub hooks from /etc/kernel-img.conf in favour of' >&2
328 echo '/etc/kernel/ hooks.' >&2
329 sed -ri /etc
/kernel-img.conf
-e '\%^[[:space:]]*post(inst|rm)_hook[[:space:]]*=[[:space:]]*(/sbin/|/usr/sbin/)?update-grub%d'
336 if test -e /boot
/grub
/device.map
&& ! test -e /boot
/grub
/core.img
&& \
337 ! test -e /boot
/grub
/@FIRST_CPU_PLATFORM@
/core.img
; then
338 # Looks like your device.map was generated by GRUB Legacy, which
339 # used to generate broken device.map (see #422851). Avoid the risk
340 # by regenerating it.
341 grub-mkdevicemap
--no-floppy
342 devicemap_regenerated
=1
347 if test -z "$devicemap_regenerated" && test -s /boot
/grub
/device.map
&& \
348 dpkg
--compare-versions "$2" lt-nl
1.98+20100702-1 && \
349 test "$(uname -s)" = Linux
; then
350 # Earlier versions of GRUB used unstable device names in device.map,
351 # which caused a variety of problems. There is some risk associated with
352 # regenerating it (so we prompt the user if it's non-trivial), but on the
353 # whole it's less risky to move to /dev/disk/by-id/.
354 devicemap_lines
="$(egrep -v '^[[:space:]]+#' /boot/grub/device.map | wc -l)"
355 grub-mkdevicemap
--no-floppy
356 devicemap_regenerated
=1
357 if test "$devicemap_lines" != 1; then
358 db_input critical grub
2/device_map_regenerated || true
363 if test -z "$devicemap_regenerated" && \
364 dpkg
--compare-versions "$2" lt-nl
1.99~
20101210-2 && \
365 grep -qs /md-uuid-
/boot
/grub
/device.map
; then
366 echo "Removing MD devices from device.map, since the BIOS cannot read from these." >&2
367 sed -i '/\/md-uuid-/d' /boot
/grub
/device.map
370 tmp_default_grub
="$(mktemp -t grub.XXXXXXXXXX)"
371 trap "rm -f ${tmp_default_grub}" EXIT
372 cp -p /usr
/share
/grub
/default
/grub
${tmp_default_grub}
374 merge_debconf_into_conf
"$tmp_default_grub" GRUB_CMDLINE_LINUX grub
2/linux_cmdline
375 merge_debconf_into_conf
"$tmp_default_grub" GRUB_CMDLINE_LINUX_DEFAULT grub
2/linux_cmdline_default
379 merge_debconf_into_conf
"$tmp_default_grub" GRUB_TIMEOUT grub-pc
/timeout
380 sed -i -e 's/^\(GRUB_TIMEOUT=\)"\([0-9][0-9]*\)"/\1\2/' "$tmp_default_grub"
381 db_get grub-pc
/hidden_timeout
382 if [ "$RET" = false
]; then
383 sed -i -e 's/^GRUB_HIDDEN_TIMEOUT=/#&/' "$tmp_default_grub"
388 ucf
--three-way --debconf-ok --sum-file=/usr
/share
/grub
/default
/grub.
md5sum ${tmp_default_grub} /etc
/default
/grub
389 package
="$(ucfq --with-colons /etc/default/grub | cut -d : -f 2)"
390 if echo $package |
grep -q "^grub-" ; then
391 ucfr
--force @PACKAGE@
/etc
/default
/grub
393 ucfr @PACKAGE@
/etc
/default
/grub
400 if test -e /boot
/grub
/stage2
&& test -e /boot
/grub
/menu.lst
&& \
401 ! test -e /boot
/grub
/grub2-installed
&& \
402 test -z "$UPGRADE_FROM_GRUB_LEGACY"; then
403 # Unfortunately, it's still possible that the user upgraded fully
404 # to GRUB 2 in some way other than running
405 # upgrade-from-grub-legacy; perhaps they ran grub-install by hand
406 # for some reason. It's really quite difficult to detect this
407 # situation, because the only difference between this and a
408 # working chainloaded setup is that in this case grub-setup has
409 # been run. So, to try to tell the difference, we scan the boot
410 # sectors of all disks for a GRUB 2 boot sector. Hopefully this
411 # won't cause too much to explode, since I can't think of a better
414 for disk
in $
(all_disks
); do
415 if scan_grub2
"$disk"; then
416 grub2_disks
="${grub2_disks:+$grub2_disks }$(readlink -f "$disk")"
419 if [ "$grub2_disks" ]; then
420 # No || true here; it's vital that the user sees this, and it's
421 # better to throw an error than to do the wrong thing.
422 db_subst grub-pc
/mixed_legacy_and_grub2 DISKS
"$grub2_disks"
423 db_fset grub-pc
/mixed_legacy_and_grub2 seen false
424 db_input critical grub-pc
/mixed_legacy_and_grub2
426 db_get grub-pc
/mixed_legacy_and_grub2
427 if [ "$RET" = true
]; then
428 db_reset grub-pc
/install_devices
429 UPGRADE_FROM_GRUB_LEGACY
=1
431 # Fall through to normal installation logic.
436 # Make sure that Wubi users never see confusing device prompts.
437 # Wubi is a very specialised hack that does complicated things with
438 # grub-install diversions to create an image that's chained from the
439 # Windows boot loader to boot an operating system from a file on a
440 # Windows file system. In these circumstances, prompting for where
441 # to install GRUB is not going to help anyone.
442 wubi_device
="$(get_wubi_device)" || true
443 if [ "$wubi_device" ]; then
444 db_set grub-pc
/install_devices
"$wubi_device"
445 db_fset grub-pc
/install_devices seen true
448 if test -e /boot
/grub
/stage2
&& test -e /boot
/grub
/menu.lst
&& \
449 ! test -e /boot
/grub
/grub2-installed
&& \
450 test -z "$UPGRADE_FROM_GRUB_LEGACY"; then
451 db_get grub-pc
/chainload_from_menu.lst
453 # Create core.img (but do not risk writing to MBR).
454 # Using grub-probe instead of "(hd0)" avoids (UUID=) hack slowness
455 # in case /boot/grub is not on (hd0) in device.map.
456 echo "Generating core.img" >&2
457 grub-install
--target=i386-pc
--no-floppy --grub-setup=/bin
/true
"$(grub-probe -t drive /boot/grub)" > /dev
/null
459 # Update menu.lst to reflect that:
460 # - core.img is present now
461 # - core.img has to be the first option
462 echo "Saving menu.lst backup in /boot/grub/menu.lst_backup_by_grub2_postinst" >&2
463 cp /boot
/grub
/menu.lst
{,_backup_by_grub2_postinst
}
464 echo "Running update-grub Legacy to hook our core.img in it" >&2
465 LET_US_TRY_GRUB_2
=true
/usr
/lib
/grub-legacy
/update-grub
2>&1 |
sed -e "s/^/ /g" >&2
466 # We just hooked GRUB 2 in menu.lst; then also generate grub.cfg.
467 touch /boot
/grub
/grub.cfg
469 elif running_in_container
; then
470 # Skip grub-install in containers.
472 elif test -z "$2" ||
test -e /boot
/grub
/core.img || \
473 test -e /boot
/grub
/@FIRST_CPU_PLATFORM@
/core.img || \
474 test "$UPGRADE_FROM_GRUB_LEGACY" ||
test "$wubi_device"; then
475 question
=grub-pc
/install_devices
477 device_map
="$(grub-mkdevicemap -m - | grep -v '^(fd[0-9]\+)' || true)"
478 devices
="$(echo "$device_map" | cut -f2)"
479 if dpkg
--compare-versions "$2" lt
1.98+20100702-1 && \
480 test "$(uname -s)" = Linux
&& [ -z "$wubi_device" ]; then
481 # Migrate to new by-id naming scheme.
482 db_get grub-pc
/install_devices
483 old_devices
="$(echo "$RET" | sed 's/, / /g')"
485 # Common-case optimisation: if the list of devices is
486 # identical to the LHS of grub-mkdevicemap's output, then
487 # there's no point asking again; just install to all disks.
488 # (This handles e.g. "(hd0)" with one disk.)
489 if [ "$(echo "$device_map" | cut -f1 | sort)" = \
490 "$(echo "$old_devices" | xargs -n1 | sort)" ]; then
491 new_devices
="$(devices_to_ids $devices)"
492 db_set grub-pc
/install_devices
"$new_devices"
493 # Alternatively, we might be installing to a single partition
494 # on a single disk, and we can deal with that too if there's
495 # only one available disk and it has an appropriate partition.
496 # This doesn't necessarily work for multiple disks because now
498 elif [ "$(echo "$device_map" | wc -l)" = 1 ] && \
499 [ "$(echo "$old_devices" | wc -w)" = 1 ] && \
500 echo "$old_devices" |
grep -q ,; then
501 old_device
="${old_devices#(}"
502 old_device
="${old_device%)}"
503 old_disk
="${old_device%,*}"
504 old_partition
="${old_device##*,}"
505 new_device
="$(echo "$device_map" | grep "^
($old_disk)" | \
507 new_device
="$(device_to_id $new_device)"
508 if [ "$new_device" ]; then
509 new_device
="$new_device-part$old_partition"
510 # Run through device_to_id again to check for existence.
511 new_device
="$(device_to_id $new_device)"
513 if [ "$new_device" ]; then
514 new_devices
="$new_device"
515 db_set grub-pc
/install_devices
"$new_device"
518 if [ -z "$new_devices" ]; then
519 new_devices
="$(devices_to_ids $old_devices)"
520 db_set grub-pc
/install_devices
"$new_devices"
521 # Common-case optimisation: if all devices are translatable
522 # to by-id and the number of devices there is the same as
523 # the number of devices GRUB can see, then there's no point
524 # asking again. (This handles e.g. "/dev/sda" with one
526 old_devices_count
="$(echo "$old_devices" | wc -w)"
527 new_devices_count
="$(echo "$new_devices" | wc -w)"
528 devices_count
="$(echo "$devices" | wc -w)"
529 if [ "$old_devices_count" != "$new_devices_count" ] || \
530 [ "$new_devices_count" != "$devices_count" ]; then
531 db_fset grub-pc
/install_devices seen false
532 db_fset grub-pc
/install_devices_empty seen false
536 db_get grub-pc
/install_devices
538 for device
in $RET; do
539 if [ ! -e "${device%,}" ]; then
544 if [ "$valid" = 0 ]; then
545 question
=grub-pc
/install_devices_disks_changed
547 db_set
"$question" "$RET"
548 db_fset
"$question" seen false
549 db_fset grub-pc
/install_devices_empty seen false
556 partitions
="$(usable_partitions)"
557 for device
in $devices; do
558 disk_id
="$(device_to_id "$device" || true)"
559 if [ "$disk_id" ]; then
560 ids
="${ids:+$ids, }$disk_id"
561 describe_disk
"$(readlink -f "$device")" "$disk_id"
562 RET
="$(printf %s "$RET" | sed 's/,/\\,/g')"
563 descriptions
="${descriptions:+$descriptions, }$RET"
564 for partition_pair
in $partitions; do
565 partition_id
="${partition_pair#*:}"
566 if [ "${partition_id#$disk_id-part}" != "$partition_id" ]; then
567 ids
="${ids:+$ids, }$partition_id"
568 describe_partition
"$(readlink -f "$device")" "$(readlink -f "$partition_id")" "$partition_id" "$(get_mountpoint "${partition_pair%%:*}")"
569 RET
="$(printf %s "$RET" | sed 's/,/\\,/g')"
570 descriptions
="${descriptions:+$descriptions, }$RET"
575 # Some "partitions" may in fact be at the disk level, e.g. RAID.
576 # List these as well if they haven't already been listed.
577 for partition_pair
in $partitions; do
578 partition_id
="${partition_pair#*:}"
579 if [ "${partition_id#*-part}" = "$partition_id" ]; then
581 ", $partition_id, ") ;;
583 ids
="${ids:+$ids, }$partition_id"
584 describe_disk
"$(readlink -f "$partition_id")" "$partition_id"
585 RET
="$(printf %s "$RET" | sed 's/,/\\,/g')"
586 descriptions
="${descriptions:+$descriptions, }$RET"
591 db_subst
"$question" RAW_CHOICES
"$ids"
592 db_subst
"$question" CHOICES
"$descriptions"
593 db_input
"$priority" "$question" || true
597 for i
in `echo $RET | sed -e 's/, / /g'` ; do
598 real_device
="$(readlink -f "$i")"
599 if grub-install
--target=i386-pc
--force --no-floppy $real_device ; then
600 # We just installed GRUB 2; then also generate grub.cfg.
601 touch /boot
/grub
/grub.cfg
603 failed_devices
="$failed_devices $real_device"
607 if [ "$question" != grub-pc
/install_devices
]; then
608 db_set grub-pc
/install_devices
"$RET"
609 db_fset grub-pc
/install_devices seen true
612 if [ "$failed_devices" ]; then
613 if [ "$UPGRADE_FROM_GRUB_LEGACY" ]; then
614 db_subst grub-pc
/install_devices_failed_upgrade FAILED_DEVICES
"$failed_devices"
615 db_fset grub-pc
/install_devices_failed_upgrade seen false
616 if db_input critical grub-pc
/install_devices_failed_upgrade
; then
618 db_get grub-pc
/install_devices_failed_upgrade
619 if [ "$RET" = true
]; then
620 db_fset
"$question" seen false
621 db_fset grub-pc
/install_devices_failed_upgrade seen false
627 exit 1 # noninteractive
630 db_subst grub-pc
/install_devices_failed FAILED_DEVICES
"$failed_devices"
631 db_fset grub-pc
/install_devices_failed seen false
632 if db_input critical grub-pc
/install_devices_failed
; then
634 db_get grub-pc
/install_devices_failed
635 if [ "$RET" = true
]; then
638 db_fset
"$question" seen false
639 db_fset grub-pc
/install_devices_failed seen false
643 break # noninteractive
648 db_get grub-pc
/install_devices
649 if [ -z "$RET" ]; then
650 # Reset the seen flag if the current answer is false, since
651 # otherwise we'll loop with no indication of why.
652 db_get grub-pc
/install_devices_empty
653 if [ "$RET" = false
]; then
654 db_fset grub-pc
/install_devices_empty seen false
656 if db_input critical grub-pc
/install_devices_empty
; then
658 db_get grub-pc
/install_devices_empty
659 if [ "$RET" = true
]; then
662 db_fset
"$question" seen false
663 db_fset grub-pc
/install_devices_empty seen false
666 break # noninteractive
674 # /boot/grub/ has more chances of being accessible by GRUB
675 for i
in /usr
/share
/grub
/unicode.pf2
; do
681 if [ "$fix_mixed_system" ]; then
682 # These never contain any valuable information, and they aren't
683 # useful for boot any more, since we just overwrote MBR/PBR.
684 rm -f /boot
/grub
/{{xfs
,reiserfs
,e2fs
,fat
,jfs
,minix
}_stage1_5
,stage
{1,2}}
685 # Remove marker file used to indicate that grub-install was run
686 # rather than upgrade-from-grub-legacy. Since stage2 has been
687 # removed, we don't need this any more.
688 rm -f /boot
/grub
/grub2-installed
692 grub-efi-ia32|grub-efi-amd64|grub-efi-ia64|grub-efi-arm|grub-efi-arm64
)
693 bootloader_id
="$(config_item GRUB_DISTRIBUTOR | tr A-Z a-z | \
695 case $bootloader_id in
696 kubuntu
) bootloader_id
=ubuntu
;;
698 if [ "$bootloader_id" ] && [ -d "/boot/efi/EFI/$bootloader_id" ]; then
700 grub-efi-ia32
) target
=i386-efi
;;
701 grub-efi-amd64
) target
=x86_64-efi
;;
702 grub-efi-ia64
) target
=ia64-efi
;;
703 grub-efi-arm
) target
=arm-efi
;;
704 grub-efi-arm64
) target
=arm64-efi
;;
706 db_get grub
2/force_efi_extra_removable
707 if [ "$RET" = true
]; then
708 FORCE_EXTRA_REMOVABLE
="--force-extra-removable"
710 NO_NVRAM
="$(no_nvram_arg)"
711 run_grub_install
--target="$target" "$FORCE_EXTRA_REMOVABLE" "$NO_NVRAM"
714 # /boot/grub/ has more chances of being accessible by GRUB
715 for i
in /usr
/share
/grub
/unicode.pf2
; do
721 if type update-secureboot-policy
>/dev
/null
2>&1; then
722 update-secureboot-policy || true
727 case $
(dpkg
--print-architecture) in
728 powerpc|ppc64|ppc64el
)
729 # Output may be empty; if so, just update the core image but
730 # don't install it to any PReP partition.
731 prep_bootdev
="$(/usr/lib/grub/powerpc-ieee1275/prep-bootdev)"
732 NO_NVRAM
="$(no_nvram_arg)"
733 run_grub_install
--target=powerpc-ieee1275
$prep_bootdev "$NO_NVRAM"
739 run_grub_install
--target=mipsel-loongson
743 # Install for x86_64 regardless of arch, since a 32-bit userspace can still boot with a 64-bit kernel.
745 run_grub_install
--target=x86_64-xen
746 case $
(dpkg
--print-architecture) in
748 run_grub_install
--target=i386-xen
754 # If grub.cfg has been generated, update it.
755 if test -e /boot
/grub
/grub.cfg
&& ! running_in_container
; then
759 abort-upgrade|abort-remove|abort-deconfigure
)
762 echo "postinst called with unknown argument \`$1'" >&2
767 # dh_installdeb will replace this with shell code automatically
768 # generated by other debhelper scripts.