Changeset 68087 in vbox
- Timestamp:
- Jul 21, 2017 6:19:28 PM (7 years ago)
- Location:
- trunk/src/VBox/Main/UnattendedTemplates
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/UnattendedTemplates/debian_postinstall.sh
r68084 r68087 3 3 # Post installation script template for debian-like distros. 4 4 # 5 # This script expects to be running w/o chroot. 5 # Note! This script expects to be running w/o chroot. 6 # Note! When using ubiquity, this is run after installation logs have 7 # been copied to /var/log/installation. 6 8 # 7 9 … … 18 20 # 19 21 20 #MY_DEBUG="yes" 21 MY_DEBUG="" 22 23 # 24 # Globals. 25 # 22 26 MY_TARGET="/target" 23 27 MY_LOGFILE="${MY_TARGET}/var/log/vboxpostinstall.log" 24 28 MY_EXITCODE=0 29 MY_DEBUG="" # "yes" 30 31 32 # 33 # Do we need to exec using target bash? If so, we must do that early 34 # or ash will bark 'bad substitution' and fail. 35 # 36 if [ "$1" = "--need-target-bash" ]; then 37 # Try figure out which directories we might need in the library path. 38 if [ -z "${LD_LIBRARY_PATH}" ]; then 39 LD_LIBRARY_PATH="${MY_TARGET}/lib" 40 fi 41 for x in \ 42 ${MY_TARGET}/lib \ 43 ${MY_TARGET}/usr/lib \ 44 ${MY_TARGET}/lib/*linux-gnu/ \ 45 ${MY_TARGET}/lib32/ \ 46 ${MY_TARGET}/lib64/ \ 47 ${MY_TARGET}/usr/lib/*linux-gnu/ \ 48 ${MY_TARGET}/usr/lib32/ \ 49 ${MY_TARGET}/usr/lib64/ \ 50 ; 51 do 52 if [ -e "$x" ]; then LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${x}"; fi; 53 done 54 export LD_LIBRARY_PATH 55 56 # Append target bin directories to the PATH as busybox may not have tee. 57 PATH="${PATH}:${MY_TARGET}/bin:${MY_TARGET}/usr/bin:${MY_TARGET}/sbin:${MY_TARGET}/usr/sbin" 58 export PATH 59 60 # Drop the --need-target-bash argument and re-exec. 61 shift 62 echo "******************************************************************************" >> "${MY_LOGFILE}" 63 echo "** Relaunching using ${MY_TARGET}/bin/bash $0 $*" >> "${MY_LOGFILE}" 64 echo "** LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> "${MY_LOGFILE}" 65 echo "** PATH=${PATH}" >> "${MY_LOGFILE}" 66 exec "${MY_TARGET}/bin/bash" "$0" "$@" 67 fi 68 69 70 # 71 # Commands. 72 # 25 73 26 74 # Logs execution of a command. … … 42 90 } 43 91 92 # Logs execution of a command inside the target. 44 93 log_command_in_target() 45 94 { … … 58 107 59 108 # 60 # Header.109 # Log header. 61 110 # 62 111 echo "******************************************************************************" >> "${MY_LOGFILE}" … … 64 113 echo "** Date: `date -R`" >> "${MY_LOGFILE}" 65 114 echo "** Started: $0 $*" >> "${MY_LOGFILE}" 115 66 116 67 117 # … … 80 130 fi 81 131 132 82 133 # 83 134 # We want the ISO available inside the target jail. 84 135 # 136 if [ -d "${MY_TARGET}/cdrom" ]; then 137 MY_RMDIR_TARGET_CDROM= 138 else 139 MY_RMDIR_TARGET_CDROM="yes" 140 log_command mkdir -p ${MY_TARGET}/cdrom 141 fi 142 85 143 if [ -f "${MY_TARGET}/cdrom/vboxpostinstall.sh" ]; then 86 144 MY_UNMOUNT_TARGET_CDROM= … … 99 157 fi 100 158 159 101 160 # 102 161 # Debug … … 104 163 if [ "${MY_DEBUG}" = "yes" ]; then 105 164 log_command id 165 log_command ps 166 log_command ps auxwwwf 167 log_command env 106 168 log_command df 107 169 log_command mount 108 170 log_command_in_target df 109 171 log_command_in_target mount 110 log_command find /172 #log_command find / 111 173 MY_EXITCODE=0 112 174 fi 113 175 176 114 177 # 115 178 # Packages needed for GAs. 116 179 # 180 echo "--------------------------------------------------" >> "${MY_LOGFILE}" 117 181 echo '** Installing packages for building kernel modules...' | tee -a "${MY_LOGFILE}" 118 182 log_command_in_target apt-get -y install build-essential 119 183 log_command_in_target apt-get -y install linux-headers-$(uname -r) 120 184 185 121 186 # 122 187 # GAs 123 188 # 124 189 @@VBOX_COND_IS_INSTALLING_ADDITIONS@@ 190 echo "--------------------------------------------------" >> "${MY_LOGFILE}" 125 191 echo '** Installing VirtualBox Guest Additions...' | tee -a "${MY_LOGFILE}" 126 192 MY_IGNORE_EXITCODE=2 # returned if modules already loaded and reboot required. … … 130 196 @@VBOX_COND_END@@ 131 197 198 132 199 # 133 200 # Test Execution Service. 134 201 # 135 202 @@VBOX_COND_IS_INSTALLING_TEST_EXEC_SERVICE@@ 203 echo "--------------------------------------------------" >> "${MY_LOGFILE}" 136 204 echo '** Installing Test Execution Service...' | tee -a "${MY_LOGFILE}" 137 205 log_command_in_target test "/cdrom/vboxvalidationkit/linux/@@VBOX_INSERT_OS_ARCH@@/TestExecService" … … 167 235 EOF 168 236 fi 169 log_command chmod 755"${MY_UNIT_PATH}/vboxtxs.service"237 log_command chmod 644 "${MY_UNIT_PATH}/vboxtxs.service" 170 238 log_command_in_target systemctl -q enable vboxtxs 171 239 … … 176 244 177 245 @@VBOX_COND_END@@ 246 178 247 179 248 # … … 185 254 @@VBOX_COND_END@@ 186 255 256 187 257 # 188 258 # Unmount the cdrom if we bound it and clean up the chroot if we set it up. … … 192 262 log_command umount "${MY_TARGET}/cdrom" 193 263 fi 264 265 if [ -n "${MY_RMDIR_TARGET_CDROM}" ]; then 266 log_command rmdir "${MY_TARGET}/cdrom" 267 fi 268 194 269 if [ -n "${MY_HAVE_CHROOT_SETUP}" ]; then 195 270 if chroot_cleanup; then … … 201 276 202 277 # 203 # Footer.278 # Log footer. 204 279 # 205 280 echo "******************************************************************************" >> "${MY_LOGFILE}" -
trunk/src/VBox/Main/UnattendedTemplates/debian_preseed.cfg
r68075 r68087 26 26 d-i clock-setup/utc-auto boolean true 27 27 d-i clock-setup/utc boolean true 28 ## @todo set this 28 29 d-i time/zone string US/Pacific 30 ## @todo do we want ntp? probably not if GAs are installed. 29 31 d-i clock-setup/ntp boolean true 30 32 … … 32 34 d-i base-installer/kernel/override-image string linux-server 33 35 d-i base-installer/kernel/override-image string linux-image-amd64 36 ## @todo use nearest mirror somehow... 37 # debug tip: Replace US with DE. 34 38 d-i mirror/country string US 35 39 d-i mirror/http/proxy string 40 d-i pkgsel/install-language-support boolean false 41 # debug tip: disable the following for minimal install 36 42 d-i apt-setup/restricted boolean true 37 43 d-i apt-setup/universe boolean true 38 d-i pkgsel/install-language-support boolean false 44 # debug tip: enable the following for minimal install 45 # tasksel tasksel/first multiselect minimal 46 # d-i pkgsel/include string openssh-server 47 # d-i pkgsel/upgrade select none 39 48 40 49 # Users … … 61 70 d-i finish-install/reboot_in_progress note 62 71 63 # Custom Commands 72 # Custom Commands. 73 # Note! Debian netboot images use busybox, so no bash. 74 # Tell script to use target bash. 64 75 d-i preseed/late_command string cp /cdrom/vboxpostinstall.sh /target/root/vboxpostinstall.sh \ 65 76 && chmod +x /target/root/vboxpostinstall.sh \ 66 && /bin/ bash /root/vboxpostinstall.sh77 && /bin/sh /target/root/vboxpostinstall.sh --need-target-bash --preseed-late-command 67 78 -
trunk/src/VBox/Main/UnattendedTemplates/ubuntu_preseed.cfg
r68075 r68087 64 64 d-i preseed/late_command string cp /cdrom/vboxpostinstall.sh /target/root/vboxpostinstall.sh \ 65 65 && chmod +x /target/root/vboxpostinstall.sh \ 66 && /bin/bash /root/vboxpostinstall.sh 66 && /bin/bash /root/vboxpostinstall.sh --preseed-late-command 67 67 68 68 # Same as above, but for ubiquity. 69 ubiquity ubiquity/success_command string vboxpostinstall.sh 69 70 ubiquity ubiquity/success_command string cp /cdrom/vboxpostinstall.sh /target/root/vboxpostinstall.sh \ 70 71 && chmod +x /target/root/vboxpostinstall.sh \ 71 && /bin/bash /target/root/vboxpostinstall.sh 72 && /bin/bash /target/root/vboxpostinstall.sh --ubiquity-success-command 72 73 74 # automatically reboot after installation. 75 ubiquity ubiquity/reboot boolean true 76
Note:
See TracChangeset
for help on using the changeset viewer.