Merge 24Q3 (ab/11976889) to aosp-main-future

Bug: 347831320
Merged-In: I002afe0ac6ad47701ae9857fd344a350446aeada
Change-Id: Icf41fe20cf36c26f42bcb2f13c068a4380d37142
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