Skip to content
This repository
Browse code

Update the kernel and initrd during an upgrade

  • Loading branch information...
commit c53de1d901eb15c4728a1009be559d3184c9776a 1 parent ad9c65e
Matthijs Kooijman authored September 26, 2012

Showing 1 changed file with 10 additions and 2 deletions. Show diff stats Hide diff stats

  1. 12  etc/webc/live-config.sh
12  etc/webc/live-config.sh
@@ -245,7 +245,15 @@ update_cmdline() {
245 245
 			for _FLAVOUR in ${flavours}; do
246 246
 				_NUMBER="$((${_NUMBER} + 1))"
247 247
 
248  
-				# TODO: Actually update the kernel and initrd
  248
+				# Find out the filenames for the kernel and
  249
+				# initrd for this flavour inside the new
  250
+				# rootfs
  251
+				kernel=$(git --git-dir "${git_repo}" show "${git_revision}:boot" | grep ^vmlinuz-.*-${_FLAVOUR}$ | head -n 1)
  252
+				initrd=$(git --git-dir "${git_repo}" show "${git_revision}:boot" | grep ^initrd.img-.*-${_FLAVOUR}$ | head -n 1)
  253
+
  254
+				# Fetch the actual files
  255
+				git --git-dir "${git_repo}" show "${git_revision}:boot/${kernel}" > /live/image/live/vmlinuz${_NUMBER}
  256
+				git --git-dir "${git_repo}" show "${git_revision}:boot/${initrd}" > /live/image/live/initrd${_NUMBER}.img
249 257
 
250 258
 				sed -e "s|@FLAVOUR@|${_FLAVOUR}|g" \
251 259
 				    -e "s|@KERNEL@|/live/vmlinuz${_NUMBER}|g" \
@@ -253,7 +261,7 @@ update_cmdline() {
253 261
 				    -e "s|@LB_BOOTAPPEND_LIVE@|${bootparams}|g" \
254 262
 				"/live/image/boot/live.cfg.in" >> "/live/image/boot/live.cfg"
255 263
 			done
256  
-			logs "Updated bootloader to boot from ${git_revision})"
  264
+			logs "Updated bootloader to boot from ${git_revision}"
257 265
 		else
258 266
 			logs "Already running ${current_git_revision}, no upgrade needed"
259 267
 		fi

0 notes on commit c53de1d

Please sign in to comment.
Something went wrong with that request. Please try again.