VirtualBox

Changeset 68201 in vbox for trunk/src


Ignore:
Timestamp:
Jul 31, 2017 1:00:32 PM (7 years ago)
Author:
vboxsync
Message:

Unattended: Made rhel6 install work.

Location:
trunk/src/VBox/Main/UnattendedTemplates
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/UnattendedTemplates/debian_postinstall.sh

    r68189 r68201  
    107107}
    108108
     109# Checks if $1 is a command on the PATH inside the target jail.
     110chroot_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}
    109120
    110121#
     
    223234    log_command_in_target systemctl -q enable vboxtxs
    224235
    225 # Not systemd:  Add support for upstart later...
     236# System V like:
     237elif [ -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
    226267else
    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}"
    228269fi
    229270
  • trunk/src/VBox/Main/UnattendedTemplates/fedora_ks.cfg

    r68164 r68201  
    8181# Post install happens in a different script.
    8282%post --nochroot --log=/mnt/sysimage/root/ks-post.log
    83 cp /run/install/repo/vboxpostinstall.sh /mnt/sysimage/root/vboxpostinstall.sh
     83mkdir -p /tmp/vboxcdrom
     84mount /dev/cdrom /tmp/vboxcdrom
     85cp /tmp/vboxcdrom/vboxpostinstall.sh /mnt/sysimage/root/vboxpostinstall.sh
    8486chmod a+x /mnt/sysimage/root/vboxpostinstall.sh
    8587/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 
     88umount /tmp/vboxcdrom
    9089%end
    9190
  • trunk/src/VBox/Main/UnattendedTemplates/redhat67_ks.cfg

    r68071 r68201  
    2424
    2525# System language
    26 lang en_US
     26lang @@VBOX_INSERT_LOCALE@@
    2727
    2828# SELinux configuration
     
    3333
    3434# System timezone
    35 timezone  Europe/London
     35timezone@@VBOX_COND_IS_RTC_USING_UTC@@ --utc@@VBOX_COND_END@@ @@VBOX_INSERT_TIME_ZONE_UX@@
    3636
    3737# Network information
    38 network  --bootproto=dhcp --device=eth0 --onboot=on
     38network  --bootproto=dhcp --device=eth0 --onboot=on --hostname=@@VBOX_INSERT_HOSTNAME_FQDN_SH@@
    3939
    4040# System bootloader configuration
     
    5353
    5454# Reboot after installation
    55 reboot
     55# Note! Not sure exctly when the --eject option was added. Need to find out an make it optional.
     56reboot --eject
    5657
    57 %packages
     58# Packages.  We currently ignore missing packages/groups here to keep things simpler.
     59%packages --ignoremissing
    5860@base
    5961@core
     62@@VBOX_COND_IS_NOT_MINIMAL_INSTALLATION@@
    6063@development
    6164@basic-desktop
     
    6770@remote-desktop-clients
    6871@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:
     76kernel-headers
     77kernel-devel
     78glibc-devel
     79glibc-headers
     80gcc
     81dkms
     82make
     83bzip2
     84perl
    6985
    7086%end
    7187
    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
     92df -h
     93mkdir -p /tmp/vboxcdrom
     94mount /dev/cdrom /tmp/vboxcdrom
     95cp /tmp/vboxcdrom/vboxpostinstall.sh /mnt/sysimage/root/vboxpostinstall.sh
     96chmod a+x /mnt/sysimage/root/vboxpostinstall.sh
     97/bin/bash /mnt/sysimage/root/vboxpostinstall.sh --rhel
     98umount /tmp/vboxcdrom
    7999%end
     100
  • trunk/src/VBox/Main/UnattendedTemplates/redhat_postinstall.sh

    r68189 r68201  
    2525MY_LOGFILE="${MY_TARGET}/var/log/vboxpostinstall.log"
    2626MY_CHROOT_CDROM="/cdrom"
    27 MY_CDROM_NOCHROOT="/run/install/repo"
     27MY_CDROM_NOCHROOT="/tmp/vboxcdrom"
    2828MY_EXITCODE=0
    2929MY_DEBUG="" # "yes"
     
    9696}
    9797
     98# Checks if $1 is a command on the PATH inside the target jail.
     99chroot_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}
    98109
    99110#
     
    203214    log_command_in_target systemctl -q enable vboxtxs
    204215
    205 # Not systemd:  Add support for upstart later...
     216# System V like:
     217elif [ -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
    206247else
    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}"
    208249fi
    209250
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette