Skip to content

Commit d792fc9

Browse files
committed
Do not update kernel in install cuttlefish packages tool.
1 parent 8238bbf commit d792fc9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tools/baseimage/pkg/gce/scripts/scripts.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ fi
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+
196200
sudo chroot /mnt/image /usr/bin/apt update
197201
sudo 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}"
214218
done
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
`

0 commit comments

Comments
 (0)