- Timestamp:
- Jul 31, 2017 1:00:32 PM (7 years ago)
- Location:
- trunk/src/VBox/Main/UnattendedTemplates
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/UnattendedTemplates/debian_postinstall.sh
r68189 r68201 107 107 } 108 108 109 # Checks if $1 is a command on the PATH inside the target jail. 110 chroot_which() 111 { 112 for dir in /bin /usr/bin /sbin /usr/sbin; 113 do 114 if [ -x "${MY_TARGET}${dir}/$1" ]; then 115 return 0; 116 fi 117 done 118 return 1; 119 } 109 120 110 121 # … … 223 234 log_command_in_target systemctl -q enable vboxtxs 224 235 225 # Not systemd: Add support for upstart later... 236 # System V like: 237 elif [ -e /etc/init.d/ ]; then 238 239 # Install the script. On rhel6 scripts are under /etc/rc.d/ with /etc/init.d and /etc/rc?.d being symlinks. 240 if [ -d /etc/rc.d/init.d/ ]; then 241 MY_INIT_D_PATH="${MY_TARGET}/etc/rc.d" 242 log_command ln -s "../../../opt/validationkit/linux/vboxtxs" "${MY_INIT_D_PATH}/init.d/" 243 else 244 MY_INIT_D_PATH="${MY_TARGET}/etc" 245 log_command ln -s "../../opt/validationkit/linux/vboxtxs" "${MY_INIT_D_PATH}/init.d/" 246 fi 247 248 # Use runlevel management script if found. 249 if chroot_which chkconfig; then # Redhat based sysvinit systems 250 log_command_in_target chkconfig --add vboxtxs 251 elif chroot_which insserv; then # SUSE-based sysvinit systems 252 log_command_in_target insserv vboxtxs 253 elif chroot_which update-rc.d; then # Debian/Ubuntu-based systems 254 log_command_in_target update-rc.d vboxtxs defaults 255 elif chroot_which rc-update; then # Gentoo Linux 256 log_command_in_target rc-update add vboxtxs default 257 # Fall back on hardcoded symlinking. 258 else 259 log_command ln -s "../init.d/vboxtxs" "${MY_INIT_D_PATH}/rc0.d/K65vboxtxs" 260 log_command ln -s "../init.d/vboxtxs" "${MY_INIT_D_PATH}/rc1.d/K65vboxtxs" 261 log_command ln -s "../init.d/vboxtxs" "${MY_INIT_D_PATH}/rc6.d/K65vboxtxs" 262 log_command ln -s "../init.d/vboxtxs" "${MY_INIT_D_PATH}/rc2.d/S35vboxtxs" 263 log_command ln -s "../init.d/vboxtxs" "${MY_INIT_D_PATH}/rc3.d/S35vboxtxs" 264 log_command ln -s "../init.d/vboxtxs" "${MY_INIT_D_PATH}/rc4.d/S35vboxtxs" 265 log_command ln -s "../init.d/vboxtxs" "${MY_INIT_D_PATH}/rc5.d/S35vboxtxs" 266 fi 226 267 else 227 echo "** error: No systemd unit dir found. Using upstart or something?" | tee -a "${MY_LOGFILE}"268 echo "** error: Unknown init script system." | tee -a "${MY_LOGFILE}" 228 269 fi 229 270 -
trunk/src/VBox/Main/UnattendedTemplates/fedora_ks.cfg
r68164 r68201 81 81 # Post install happens in a different script. 82 82 %post --nochroot --log=/mnt/sysimage/root/ks-post.log 83 cp /run/install/repo/vboxpostinstall.sh /mnt/sysimage/root/vboxpostinstall.sh 83 mkdir -p /tmp/vboxcdrom 84 mount /dev/cdrom /tmp/vboxcdrom 85 cp /tmp/vboxcdrom/vboxpostinstall.sh /mnt/sysimage/root/vboxpostinstall.sh 84 86 chmod a+x /mnt/sysimage/root/vboxpostinstall.sh 85 87 /bin/bash /mnt/sysimage/root/vboxpostinstall.sh --fedora 86 87 # eject /dev/sr0 - this causes reboot trouble with fedora 26, and is documented to no be a good idea... 88 # init 5 89 88 umount /tmp/vboxcdrom 90 89 %end 91 90 -
trunk/src/VBox/Main/UnattendedTemplates/redhat67_ks.cfg
r68071 r68201 24 24 25 25 # System language 26 lang en_US26 lang @@VBOX_INSERT_LOCALE@@ 27 27 28 28 # SELinux configuration … … 33 33 34 34 # System timezone 35 timezone Europe/London35 timezone@@VBOX_COND_IS_RTC_USING_UTC@@ --utc@@VBOX_COND_END@@ @@VBOX_INSERT_TIME_ZONE_UX@@ 36 36 37 37 # Network information 38 network --bootproto=dhcp --device=eth0 --onboot=on 38 network --bootproto=dhcp --device=eth0 --onboot=on --hostname=@@VBOX_INSERT_HOSTNAME_FQDN_SH@@ 39 39 40 40 # System bootloader configuration … … 53 53 54 54 # Reboot after installation 55 reboot 55 # Note! Not sure exctly when the --eject option was added. Need to find out an make it optional. 56 reboot --eject 56 57 57 %packages 58 # Packages. We currently ignore missing packages/groups here to keep things simpler. 59 %packages --ignoremissing 58 60 @base 59 61 @core 62 @@VBOX_COND_IS_NOT_MINIMAL_INSTALLATION@@ 60 63 @development 61 64 @basic-desktop … … 67 70 @remote-desktop-clients 68 71 @x11 72 @@VBOX_COND_END@@ 73 74 # Prepare building the additions kernel module, try get what we can from the cdrom as it may be impossible 75 # to install anything from the post script: 76 kernel-headers 77 kernel-devel 78 glibc-devel 79 glibc-headers 80 gcc 81 dkms 82 make 83 bzip2 84 perl 69 85 70 86 %end 71 87 72 %post --log=/root/ks-post.log 73 ## @todo fix this. 74 cp /cdrom/vboxpostinstall.sh /root/vboxpostinstall.sh && chmod a+x /root/vboxpostinstall.sh && /bin/bash /root/vboxpostinstall.sh 75 eject /dev/sr0 76 eject /dev/sr1 77 eject /dev/sr2 78 init 5 88 # Post install happens in a different script. 89 # Note! We mount the CDROM explictily here since the location differs between fedora 26 to rhel5 90 # and apparently there isn't any way to be certain that anaconda didn't unmount it already. 91 %post --nochroot --log=/mnt/sysimage/root/ks-post.log 92 df -h 93 mkdir -p /tmp/vboxcdrom 94 mount /dev/cdrom /tmp/vboxcdrom 95 cp /tmp/vboxcdrom/vboxpostinstall.sh /mnt/sysimage/root/vboxpostinstall.sh 96 chmod a+x /mnt/sysimage/root/vboxpostinstall.sh 97 /bin/bash /mnt/sysimage/root/vboxpostinstall.sh --rhel 98 umount /tmp/vboxcdrom 79 99 %end 100 -
trunk/src/VBox/Main/UnattendedTemplates/redhat_postinstall.sh
r68189 r68201 25 25 MY_LOGFILE="${MY_TARGET}/var/log/vboxpostinstall.log" 26 26 MY_CHROOT_CDROM="/cdrom" 27 MY_CDROM_NOCHROOT="/ run/install/repo"27 MY_CDROM_NOCHROOT="/tmp/vboxcdrom" 28 28 MY_EXITCODE=0 29 29 MY_DEBUG="" # "yes" … … 96 96 } 97 97 98 # Checks if $1 is a command on the PATH inside the target jail. 99 chroot_which() 100 { 101 for dir in /bin /usr/bin /sbin /usr/sbin; 102 do 103 if [ -x "${MY_TARGET}${dir}/$1" ]; then 104 return 0; 105 fi 106 done 107 return 1; 108 } 98 109 99 110 # … … 203 214 log_command_in_target systemctl -q enable vboxtxs 204 215 205 # Not systemd: Add support for upstart later... 216 # System V like: 217 elif [ -e /etc/init.d/ ]; then 218 219 # Install the script. On rhel6 scripts are under /etc/rc.d/ with /etc/init.d and /etc/rc?.d being symlinks. 220 if [ -d /etc/rc.d/init.d/ ]; then 221 MY_INIT_D_PATH="${MY_TARGET}/etc/rc.d" 222 log_command ln -s "../../../opt/validationkit/linux/vboxtxs" "${MY_INIT_D_PATH}/init.d/" 223 else 224 MY_INIT_D_PATH="${MY_TARGET}/etc" 225 log_command ln -s "../../opt/validationkit/linux/vboxtxs" "${MY_INIT_D_PATH}/init.d/" 226 fi 227 228 # Use runlevel management script if found. 229 if chroot_which chkconfig; then # Redhat based sysvinit systems 230 log_command_in_target chkconfig --add vboxtxs 231 elif chroot_which insserv; then # SUSE-based sysvinit systems 232 log_command_in_target insserv vboxtxs 233 elif chroot_which update-rc.d; then # Debian/Ubuntu-based systems 234 log_command_in_target update-rc.d vboxtxs defaults 235 elif chroot_which rc-update; then # Gentoo Linux 236 log_command_in_target rc-update add vboxtxs default 237 # Fall back on hardcoded symlinking. 238 else 239 log_command ln -s "../init.d/vboxtxs" "${MY_INIT_D_PATH}/rc0.d/K65vboxtxs" 240 log_command ln -s "../init.d/vboxtxs" "${MY_INIT_D_PATH}/rc1.d/K65vboxtxs" 241 log_command ln -s "../init.d/vboxtxs" "${MY_INIT_D_PATH}/rc6.d/K65vboxtxs" 242 log_command ln -s "../init.d/vboxtxs" "${MY_INIT_D_PATH}/rc2.d/S35vboxtxs" 243 log_command ln -s "../init.d/vboxtxs" "${MY_INIT_D_PATH}/rc3.d/S35vboxtxs" 244 log_command ln -s "../init.d/vboxtxs" "${MY_INIT_D_PATH}/rc4.d/S35vboxtxs" 245 log_command ln -s "../init.d/vboxtxs" "${MY_INIT_D_PATH}/rc5.d/S35vboxtxs" 246 fi 206 247 else 207 echo "** error: No systemd unit dir found. Using upstart or something?" | tee -a "${MY_LOGFILE}"248 echo "** error: Unknown init script system." | tee -a "${MY_LOGFILE}" 208 249 fi 209 250
Note:
See TracChangeset
for help on using the changeset viewer.