- Timestamp:
- Jul 21, 2017 12:44:53 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/UnattendedTemplates/debian_postinstall.sh
r68075 r68084 31 31 echo "** Executing: $*" >> "${MY_LOGFILE}" 32 32 "$@" 2>&1 | tee -a "${MY_LOGFILE}" 33 if [ "${PIPESTATUS[0]}" != "0" ]; then 34 echo "exit code: ${PIPESTATUS[0]}" 35 MY_EXITCODE=1; 33 MY_TMP_EXITCODE="${PIPESTATUS[0]}" 34 if [ "${MY_TMP_EXITCODE}" != "0" ]; then 35 if [ "${MY_TMP_EXITCODE}" != "${MY_IGNORE_EXITCODE}" ]; then 36 echo "** exit code: ${MY_TMP_EXITCODE}" | tee -a "${MY_LOGFILE}" 37 MY_EXITCODE=1; 38 else 39 echo "** exit code: ${MY_TMP_EXITCODE} (ignored)" | tee -a "${MY_LOGFILE}" 40 fi 36 41 fi 37 42 } … … 47 52 # script (see below) and just use chroot here. 48 53 # 49 # Also, GA installer and in-root/log-output doesn't seem to get along.50 #51 54 log_command chroot "${MY_TARGET}" "$@" 52 55 # log_command in-target --pass-stdout "$@" # No stderr output... :-( … … 78 81 79 82 # 80 # Debug81 #82 if [ "${MY_DEBUG}" = "yes" ]; then83 log_command id84 log_command df85 log_command mount86 log_command_in_target df87 log_command_in_target mount88 log_command_in_target ls -Rla /cdrom89 log_command_in_target ls -Rla /media90 log_command find /91 MY_EXITCODE=092 fi93 94 83 # We want the ISO available inside the target jail. 84 # 95 85 if [ -f "${MY_TARGET}/cdrom/vboxpostinstall.sh" ]; then 96 86 MY_UNMOUNT_TARGET_CDROM= … … 110 100 111 101 # 102 # Debug 103 # 104 if [ "${MY_DEBUG}" = "yes" ]; then 105 log_command id 106 log_command df 107 log_command mount 108 log_command_in_target df 109 log_command_in_target mount 110 log_command find / 111 MY_EXITCODE=0 112 fi 113 114 # 112 115 # Packages needed for GAs. 113 116 # … … 121 124 @@VBOX_COND_IS_INSTALLING_ADDITIONS@@ 122 125 echo '** Installing VirtualBox Guest Additions...' | tee -a "${MY_LOGFILE}" 126 MY_IGNORE_EXITCODE=2 # returned if modules already loaded and reboot required. 123 127 log_command_in_target /bin/bash /cdrom/vboxadditions/VBoxLinuxAdditions.run --nox11 128 MY_IGNORE_EXITCODE= 124 129 log_command_in_target usermod -a -G vboxsf "@@VBOX_INSERT_USER_LOGIN@@" 125 130 @@VBOX_COND_END@@ 126 131 127 132 # 128 # Test ing.133 # Test Execution Service. 129 134 # 130 135 @@VBOX_COND_IS_INSTALLING_TEST_EXEC_SERVICE@@ 131 136 echo '** Installing Test Execution Service...' | tee -a "${MY_LOGFILE}" 132 log_command_in_target test "/cdrom/linux/@@VBOX_INSERT_OS_ARCH@@/TestExecService" 133 ## @todo fix this 137 log_command_in_target test "/cdrom/vboxvalidationkit/linux/@@VBOX_INSERT_OS_ARCH@@/TestExecService" 138 log_command mkdir -p "${MY_TARGET}/root/validationkit" "${MY_TARGET}/target/cdrom" 139 log_command cp -R /cdrom/vboxvalidationkit/* "${MY_TARGET}/root/validationkit/" 140 log_command chmod -R u+rw,a+xr "${MY_TARGET}/root/validationkit/" 141 142 # systemd service config: 143 MY_UNIT_PATH="${MY_TARGET}/lib/systemd/system" 144 test -d "${MY_TARGET}/usr/lib/systemd/system" && MY_UNIT_PATH="${MY_TARGET}/usr/lib/systemd/system" 145 if [ -d "${MY_UNIT_PATH}" ]; then 146 if [ -f "${MY_TARGET}/linux/vboxtxs.service" ]; then ## REMOVE AS SOON AS r117117 IS READY 147 log_command cp "${MY_TARGET}/linux/vboxtxs.service" "${MY_UNIT_PATH}/vboxtxs.service" 148 else ## REMOVE AS SOON AS r117117 IS READY 149 cat > "${MY_UNIT_PATH}/vboxtxs.service" <<EOF 150 [Unit] 151 Description=VirtualBox Test Execution Service 152 SourcePath=/root/validationkit/linux/vboxtxs 153 154 [Service] 155 Type=forking 156 Restart=no 157 TimeoutSec=5min 158 IgnoreSIGPIPE=no 159 KillMode=process 160 GuessMainPID=no 161 RemainAfterExit=yes 162 ExecStart=/root/validationkit/linux/vboxtxs start 163 ExecStop=/root/validationkit/linux/vboxtxs stop 164 165 [Install] 166 WantedBy=multi-user.target 167 EOF 168 fi 169 log_command chmod 755 "${MY_UNIT_PATH}/vboxtxs.service" 170 log_command_in_target systemctl -q enable vboxtxs 171 172 # Not systemd. Add support for upstart later... 173 else 174 echo "** error: No systemd unit dir found. Using upstart or something?" | tee -a "${MY_LOGFILE}" 175 fi 176 134 177 @@VBOX_COND_END@@ 135 178
Note:
See TracChangeset
for help on using the changeset viewer.