@@ -10,13 +10,6 @@ OEM_MNT="/usr/share/oem"
10
10
11
11
INSTALL_MNT=$( dirname " $0 " )
12
12
INSTALL_DEV=" $1 "
13
- INSTALL_KERNEL=" "
14
-
15
- for arg in " $@ " ; do
16
- case " ${arg} " in
17
- KERNEL=* ) INSTALL_KERNEL=" ${arg# KERNEL=} " ;;
18
- esac
19
- done
20
13
21
14
# Figure out if the slot id is A or B
22
15
INSTALL_LABEL=$( blkid -o value -s PARTLABEL " ${INSTALL_DEV} " )
@@ -30,71 +23,6 @@ case "${INSTALL_LABEL}" in
30
23
exit 1
31
24
esac
32
25
33
- # Find the ESP partition and mount it if needed
34
- ESP_PARTTYPE=" c12a7328-f81f-11d2-ba4b-00a0c93ec93b"
35
- ESP_MNT=
36
-
37
- declare -a DEV_LIST
38
- mapfile DEV_LIST < <( lsblk -P -o NAME,PARTTYPE,MOUNTPOINT)
39
-
40
- for dev_info in " ${DEV_LIST[@]} " ; do
41
- eval " $dev_info "
42
-
43
- if [[ " ${PARTTYPE} " != " ${ESP_PARTTYPE} " ]]; then
44
- continue
45
- fi
46
-
47
- if [[ -n " ${MOUNTPOINT} " ]]; then
48
- ESP_MNT=" ${MOUNTPOINT} "
49
- else
50
- ESP_MNT=" $( mktemp -d /tmp/postinst_esp.XXXXXXXXXX) "
51
- mount " /dev/${NAME} " " ${ESP_MNT} "
52
- trap " umount '${ESP_MNT} ' && rmdir '${ESP_MNT} '" EXIT
53
- fi
54
-
55
- break
56
- done
57
-
58
- if [[ -z " ${ESP_MNT} " ]]; then
59
- echo " Failed to find ESP partition!" >&2
60
- exit 1
61
- fi
62
-
63
- if [[ ! -d " ${ESP_MNT} " ]]; then
64
- echo " ESP partition mount point (${ESP_MNT} ) is not a directory!" >&2
65
- exit 1
66
- fi
67
-
68
- # Update bootloaders from CoreOS <= 522.x.x
69
- if grep -q cros_legacy /proc/cmdline; then
70
- # Update kernel and bootloader configs
71
- mkdir -p " ${ESP_MNT} " {/syslinux,/boot/grub}
72
- cp -v " ${INSTALL_MNT} /boot/vmlinuz" \
73
- " ${ESP_MNT} /syslinux/vmlinuz.${SLOT} "
74
- cp -v " ${INSTALL_MNT} /boot/syslinux/root.${SLOT} .cfg" \
75
- " ${ESP_MNT} /syslinux/root.${SLOT} .cfg"
76
-
77
- # For Xen's pvgrub
78
- cp -v " ${INSTALL_MNT} /boot/grub/menu.lst.${SLOT} " \
79
- " ${ESP_MNT} /boot/grub/menu.lst"
80
-
81
- # For systems that have disabled boot_kernel and kexec
82
- if ! grep -q boot_kernel " ${ESP_MNT} /syslinux/default.cfg" ; then
83
- cp -v " ${INSTALL_MNT} /boot/syslinux/default.cfg.${SLOT} " \
84
- " ${ESP_MNT} /syslinux/default.cfg"
85
- fi
86
- elif [[ -z " ${INSTALL_KERNEL} " ]]; then
87
- # not a legacy system but update_engine didn't handle the kernel.
88
- # kernel names are in lower case, ${SLOT,,} converts the slot name
89
- if [ -e " ${ESP_MNT} /coreos/vmlinuz-a" ] || [ -e " ${ESP_MNT} /coreos/vmlinuz-b" ]; then
90
- cp -v " ${INSTALL_MNT} /boot/vmlinuz" \
91
- " ${ESP_MNT} /coreos/vmlinuz-${SLOT,,} "
92
- else
93
- cp -v " ${INSTALL_MNT} /boot/vmlinuz" \
94
- " ${ESP_MNT} /flatcar/vmlinuz-${SLOT,,} "
95
- fi
96
- fi
97
-
98
26
# If the OEM provides a hook, call it
99
27
if [[ -x " ${OEM_MNT} /bin/oem-postinst" ]]; then
100
28
" ${OEM_MNT} /bin/oem-postinst" " ${SLOT} " " ${INSTALL_MNT} "
0 commit comments