Merge 24Q3 to AOSP main

Bug: 357762254
Merged-In: I002afe0ac6ad47701ae9857fd344a350446aeada
Change-Id: Ia00ae9e536318a5f5164debb0339f910febd49fe
diff --git a/generate-factory-images-common.sh b/generate-factory-images-common.sh
index 9a6f5ad..6853543 100644
--- a/generate-factory-images-common.sh
+++ b/generate-factory-images-common.sh
@@ -25,6 +25,10 @@
 then
   RADIOSRC=radio.img
 fi
+if test "$GSCFIRMWARESRC" = ""
+then
+  GSCFIRMWARESRC=dauntless
+fi
 if test "$SLEEPDURATION" = ""
 then
   SLEEPDURATION=5
@@ -52,6 +56,9 @@
   unzip -d tmp ${SRCPREFIX}$PRODUCT-target_files-$BUILD.zip RADIO/radio-cdma.img
 fi
 
+# Extract the GSC firmware
+unzip -d tmp ${SRCPREFIX}$PRODUCT-target_files-$BUILD.zip VENDOR/firmware/$GSCFIRMWARESRC/*
+
 # Copy the various images in their staging location
 cp ${SRCPREFIX}$PRODUCT-img-$BUILD.zip tmp/$PRODUCT-$VERSION/image-$PRODUCT-$VERSION.zip
 if test "$XLOADER" != ""
@@ -82,6 +89,7 @@
     cp $CDMARADIOFILE tmp/$PRODUCT-$VERSION/radio-cdma-$DEVICE-$CDMARADIO.img
   fi
 fi
+cp -r tmp/VENDOR/firmware/$GSCFIRMWARESRC/* tmp/$PRODUCT-$VERSION
 
 # Write flash-all.sh
 cat > tmp/$PRODUCT-$VERSION/flash-all.sh << EOF