Change-Id: I34cd927358b571444893b8991dd9c30755efb571
| ... | ... |
@@ -45,7 +45,6 @@ fi |
| 45 | 45 |
PASSWORD=`date | md5sum | cut -f 1 -d ' '` |
| 46 | 46 |
sed -i "s/PASSWORD/$PASSWORD/" $VMDK_CONFIG_SAFE_FILE |
| 47 | 47 |
|
| 48 |
-echo $ADDITIONAL_RPMS_PATH |
|
| 49 | 48 |
if [ -n "$ADDITIONAL_RPMS_PATH" ] |
| 50 | 49 |
then |
| 51 | 50 |
mkdir $PHOTON_STAGE_PATH/RPMS/additonal |
| ... | ... |
@@ -77,12 +76,22 @@ cp $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/etc/shadow $PHOTON_IMG_OUTPUT_PATH
|
| 77 | 77 |
sed -e "s/^\(root:\)[^:]*:/\1*:/" $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/etc/shadow.bak > $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/etc/shadow
|
| 78 | 78 |
rm -f $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/etc/shadow.bak
|
| 79 | 79 |
rm -f $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/etc/shadow-
|
| 80 |
+ |
|
| 81 |
+mount -o bind /proc $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/proc
|
|
| 82 |
+mount -o bind /dev $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/dev
|
|
| 83 |
+mount -o bind /dev/pts $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/dev/pts
|
|
| 84 |
+mount -o bind /sys $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/sys
|
|
| 85 |
+if [ -n "$ADDITIONAL_RPMS_PATH" ] |
|
| 86 |
+ then |
|
| 87 |
+ mkdir $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/additional_rpms
|
|
| 88 |
+ mkdir $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/var/run
|
|
| 89 |
+ cp -f $PHOTON_STAGE_PATH/RPMS/additonal/* $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/additional_rpms/
|
|
| 90 |
+ chroot $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME} /bin/bash -c "rpm -i /additional_rpms/*"
|
|
| 91 |
+fi |
|
| 92 |
+ |
|
| 80 | 93 |
if [ $IMG_NAME != "ova" ] && [ $IMG_NAME != "ova_uefi" ] |
| 81 | 94 |
then |
| 82 |
- mount -o bind /proc $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/proc
|
|
| 83 |
- mount -o bind /dev $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/dev
|
|
| 84 |
- mount -o bind /dev/pts $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/dev/pts
|
|
| 85 |
- mount -o bind /sys $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/sys
|
|
| 95 |
+ |
|
| 86 | 96 |
if [ $IMG_NAME = "gce" ] |
| 87 | 97 |
then |
| 88 | 98 |
cp ntpd.service $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/lib/systemd/system/
|
| ... | ... |
@@ -104,11 +113,11 @@ if [ $IMG_NAME != "ova" ] && [ $IMG_NAME != "ova_uefi" ] |
| 104 | 104 |
chroot $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME} /bin/bash -c "/$IMG_NAME-patch.sh"
|
| 105 | 105 |
rm -f $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/$IMG_NAME-patch.sh
|
| 106 | 106 |
|
| 107 |
- umount $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/sys
|
|
| 108 |
- umount $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/dev/pts
|
|
| 109 |
- umount $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/dev
|
|
| 110 |
- umount $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/proc
|
|
| 111 | 107 |
fi |
| 108 |
+umount $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/sys
|
|
| 109 |
+umount $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/dev/pts
|
|
| 110 |
+umount $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/dev
|
|
| 111 |
+umount $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/proc
|
|
| 112 | 112 |
umount $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}
|
| 113 | 113 |
|
| 114 | 114 |
echo "Deleting device map partition" |