File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
tools/baseimage/pkg/gce/scripts Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 193193
194194./mount_attached_disk.sh
195195
196+ kmodver_begin=$(sudo chroot /mnt/image/ /usr/bin/dpkg -s linux-image-cloud-amd64 | grep ^Depends: | \
197+ cut -d: -f2 | cut -d" " -f2 | sed 's/linux-image-//')
198+ echo "IMAGE STARTS WITH KERNEL: ${kmodver_begin}"
199+
196200sudo chroot /mnt/image /usr/bin/apt update
197201sudo chroot /mnt/image /usr/bin/apt upgrade -y
198202
@@ -212,4 +216,18 @@ for name in "${PKG_NAMES[@]}"; do
212216
213217 sudo chroot /mnt/image /usr/bin/apt install -y "/tmp/install/${name}"
214218done
219+
220+ kmodver_end=$(sudo chroot /mnt/image/ /usr/bin/dpkg -s linux-image-cloud-amd64 | grep ^Depends: | \
221+ cut -d: -f2 | cut -d" " -f2 | sed 's/linux-image-//')
222+ echo "IMAGE ENDS WITH KERNEL: ${kmodver_end}"
223+
224+ if [ "${kmodver_begin}" != "${kmodver_end}" ]; then
225+ echo "KERNEL UPDATE DETECTED!!! ${kmodver_begin} -> ${kmodver_end}"
226+ echo "Use source image with kernel ${kmodver_end} installed."
227+ exit 1
228+ fi
229+
230+ # Skip unmounting:
231+ # Sometimes systemd starts, making it hard to unmount
232+ # In any case we'll unmount cleanly when the instance shuts down
215233`
You can’t perform that action at this time.
0 commit comments