VirtualBox

Changeset 68087 in vbox


Ignore:
Timestamp:
Jul 21, 2017 6:19:28 PM (7 years ago)
Author:
vboxsync
Message:

Unattended: Try make debian 9.0 work with GAs and TXS too.

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

Legend:

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

    r68084 r68087  
    33# Post installation script template for debian-like distros.
    44#
    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.
    68#
    79
     
    1820#
    1921
    20 #MY_DEBUG="yes"
    21 MY_DEBUG=""
     22
     23#
     24# Globals.
     25#
    2226MY_TARGET="/target"
    2327MY_LOGFILE="${MY_TARGET}/var/log/vboxpostinstall.log"
    2428MY_EXITCODE=0
     29MY_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#
     36if [ "$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" "$@"
     67fi
     68
     69
     70#
     71# Commands.
     72#
    2573
    2674# Logs execution of a command.
     
    4290}
    4391
     92# Logs execution of a command inside the target.
    4493log_command_in_target()
    4594{
     
    58107
    59108#
    60 # Header.
     109# Log header.
    61110#
    62111echo "******************************************************************************" >> "${MY_LOGFILE}"
     
    64113echo "** Date:    `date -R`" >> "${MY_LOGFILE}"
    65114echo "** Started: $0 $*" >> "${MY_LOGFILE}"
     115
    66116
    67117#
     
    80130fi
    81131
     132
    82133#
    83134# We want the ISO available inside the target jail.
    84135#
     136if [ -d "${MY_TARGET}/cdrom" ]; then
     137    MY_RMDIR_TARGET_CDROM=
     138else
     139    MY_RMDIR_TARGET_CDROM="yes"
     140    log_command mkdir -p ${MY_TARGET}/cdrom
     141fi
     142
    85143if [ -f "${MY_TARGET}/cdrom/vboxpostinstall.sh" ]; then
    86144    MY_UNMOUNT_TARGET_CDROM=
     
    99157fi
    100158
     159
    101160#
    102161# Debug
     
    104163if [ "${MY_DEBUG}" = "yes" ]; then
    105164    log_command id
     165    log_command ps
     166    log_command ps auxwwwf
     167    log_command env
    106168    log_command df
    107169    log_command mount
    108170    log_command_in_target df
    109171    log_command_in_target mount
    110     log_command find /
     172    #log_command find /
    111173    MY_EXITCODE=0
    112174fi
    113175
     176
    114177#
    115178# Packages needed for GAs.
    116179#
     180echo "--------------------------------------------------" >> "${MY_LOGFILE}"
    117181echo '** Installing packages for building kernel modules...' | tee -a "${MY_LOGFILE}"
    118182log_command_in_target apt-get -y install build-essential
    119183log_command_in_target apt-get -y install linux-headers-$(uname -r)
    120184
     185
    121186#
    122187# GAs
    123188#
    124189@@VBOX_COND_IS_INSTALLING_ADDITIONS@@
     190echo "--------------------------------------------------" >> "${MY_LOGFILE}"
    125191echo '** Installing VirtualBox Guest Additions...' | tee -a "${MY_LOGFILE}"
    126192MY_IGNORE_EXITCODE=2  # returned if modules already loaded and reboot required.
     
    130196@@VBOX_COND_END@@
    131197
     198
    132199#
    133200# Test Execution Service.
    134201#
    135202@@VBOX_COND_IS_INSTALLING_TEST_EXEC_SERVICE@@
     203echo "--------------------------------------------------" >> "${MY_LOGFILE}"
    136204echo '** Installing Test Execution Service...' | tee -a "${MY_LOGFILE}"
    137205log_command_in_target test "/cdrom/vboxvalidationkit/linux/@@VBOX_INSERT_OS_ARCH@@/TestExecService"
     
    167235EOF
    168236    fi
    169     log_command chmod 755 "${MY_UNIT_PATH}/vboxtxs.service"
     237    log_command chmod 644 "${MY_UNIT_PATH}/vboxtxs.service"
    170238    log_command_in_target systemctl -q enable vboxtxs
    171239
     
    176244
    177245@@VBOX_COND_END@@
     246
    178247
    179248#
     
    185254@@VBOX_COND_END@@
    186255
     256
    187257#
    188258# Unmount the cdrom if we bound it and clean up the chroot if we set it up.
     
    192262    log_command umount "${MY_TARGET}/cdrom"
    193263fi
     264
     265if [ -n "${MY_RMDIR_TARGET_CDROM}" ]; then
     266    log_command rmdir "${MY_TARGET}/cdrom"
     267fi
     268
    194269if [ -n "${MY_HAVE_CHROOT_SETUP}" ]; then
    195270    if chroot_cleanup; then
     
    201276
    202277#
    203 # Footer.
     278# Log footer.
    204279#
    205280echo "******************************************************************************" >> "${MY_LOGFILE}"
  • trunk/src/VBox/Main/UnattendedTemplates/debian_preseed.cfg

    r68075 r68087  
    2626d-i clock-setup/utc-auto boolean true
    2727d-i clock-setup/utc boolean true
     28## @todo set this
    2829d-i time/zone string US/Pacific
     30## @todo do we want ntp? probably not if GAs are installed.
    2931d-i clock-setup/ntp boolean true
    3032
     
    3234d-i base-installer/kernel/override-image string linux-server
    3335d-i base-installer/kernel/override-image string linux-image-amd64
     36## @todo use nearest mirror somehow...
     37# debug tip: Replace US with DE.
    3438d-i mirror/country string US
    3539d-i mirror/http/proxy string
     40d-i pkgsel/install-language-support boolean false
     41# debug tip: disable the following for minimal install
    3642d-i apt-setup/restricted boolean true
    3743d-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
    3948
    4049# Users
     
    6170d-i finish-install/reboot_in_progress note
    6271
    63 # Custom Commands
     72# Custom Commands.
     73# Note! Debian netboot images use busybox, so no bash.
     74#       Tell script to use target bash.
    6475d-i preseed/late_command string cp /cdrom/vboxpostinstall.sh /target/root/vboxpostinstall.sh \
    6576 && chmod +x /target/root/vboxpostinstall.sh \
    66  && /bin/bash /root/vboxpostinstall.sh
     77 && /bin/sh /target/root/vboxpostinstall.sh --need-target-bash --preseed-late-command
    6778
  • trunk/src/VBox/Main/UnattendedTemplates/ubuntu_preseed.cfg

    r68075 r68087  
    6464d-i preseed/late_command string cp /cdrom/vboxpostinstall.sh /target/root/vboxpostinstall.sh \
    6565 && chmod +x /target/root/vboxpostinstall.sh \
    66  && /bin/bash /root/vboxpostinstall.sh
     66 && /bin/bash /root/vboxpostinstall.sh --preseed-late-command
    6767
    6868# Same as above, but for ubiquity.
     69ubiquity ubiquity/success_command string vboxpostinstall.sh
    6970ubiquity ubiquity/success_command string cp /cdrom/vboxpostinstall.sh /target/root/vboxpostinstall.sh \
    7071 && chmod +x /target/root/vboxpostinstall.sh \
    71  && /bin/bash /target/root/vboxpostinstall.sh
     72 && /bin/bash /target/root/vboxpostinstall.sh --ubiquity-success-command
    7273
     74# automatically reboot after installation.
     75ubiquity ubiquity/reboot boolean true
     76
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