diff options
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/FreeBSD_install_cdrom.conf | 16 | ||||
-rwxr-xr-x | release/scripts/atlas-upload.sh | 159 | ||||
-rw-r--r-- | release/scripts/box.ovf | 226 | ||||
-rwxr-xr-x | release/scripts/list-new-changesets.py | 118 | ||||
-rwxr-xr-x | release/scripts/make-manifest.sh | 26 | ||||
-rwxr-xr-x | release/scripts/mk-vmimage.sh | 122 | ||||
-rwxr-xr-x | release/scripts/mm-mtree.sh | 160 | ||||
-rwxr-xr-x | release/scripts/pkg-stage.sh | 90 | ||||
-rwxr-xr-x | release/scripts/relnotes-search.sh | 133 |
9 files changed, 1050 insertions, 0 deletions
diff --git a/release/scripts/FreeBSD_install_cdrom.conf b/release/scripts/FreeBSD_install_cdrom.conf new file mode 100644 index 0000000..7a6d787 --- /dev/null +++ b/release/scripts/FreeBSD_install_cdrom.conf @@ -0,0 +1,16 @@ +# +# $FreeBSD$ +# +# The pkg(8) repository configuration file for the installation DVD. +# + +FreeBSD_install_cdrom: { + url: "file:///dist/packages/${ABI}", + mirror_type: "none", + enabled: yes +} + +FreeBSD: { + enabled: no +} + diff --git a/release/scripts/atlas-upload.sh b/release/scripts/atlas-upload.sh new file mode 100755 index 0000000..bf1dbf1 --- /dev/null +++ b/release/scripts/atlas-upload.sh @@ -0,0 +1,159 @@ +#!/bin/sh +#- +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# Upload a Vagrant image to Hashicorp's Atlas service +# +# $FreeBSD$ +# + +ATLAS_API_URL='' +ATLAS_UPLOAD_URL='https://binstore.hashicorp.com' +DESCRIPTION="FreeBSD Snapshot Build" + +usage() { + echo "${0} usage:" + echo "-b box-name -d 'box description' -f box-to-upload -k api-key -p provider -u user -v version" + return 1 +} + +main () { + while getopts "b:d:f:k:p:u:v:" arg; do + case "${arg}" in + b) + BOX="${OPTARG}" + ;; + d) + DESCRIPTION="${OPTARG}" + ;; + f) + FILE="${OPTARG}" + ;; + k) + KEY="${OPTARG}" + ;; + p) + PROVIDER="${OPTARG}" + ;; + u) + USERNAME="${OPTARG}" + ;; + v) + VERSION="${OPTARG}" + ;; + *) + ;; + esac + done + + if [ -z "${BOX}" -o \ + -z "${FILE}" -o \ + -z "${KEY}" -o \ + -z "${PROVIDER}" -o \ + -z "${USERNAME}" -o \ + -z "${VERSION}" ]; + then + usage || exit 0 + fi + + # Check to see if the box exists or create it + BOXRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}?access_token=${KEY}") + if [ $? != 0 ]; then + echo "Failed to connect to the API" + exit 2; + fi + echo $BOXRESULT | grep "\"name\":\"${BOX}\"" > /dev/null + if [ $? != 0 ]; then + echo "Creating box: ${BOX}" + /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/boxes -X POST -d "box[name]=${BOX}" -d "access_token=${KEY}" > /dev/null + /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX} -X PUT -d "box[is_private]=false" -d "access_token=${KEY}" > /dev/null + /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX} -X PUT -d "box[description]='${DESCRIPTION}'" -d "access_token=${KEY}" > /dev/null + else + echo "Box already exists" + fi + + # Check to see if the version exists or create it + VERSIONRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}?access_token=${KEY}") + if [ $? != 0 ]; then + echo "Failed to connect to the API" + exit 2; + fi + echo $VERSIONRESULT | grep "\"version\":\"${VERSION}\"" > /dev/null + if [ $? != 0 ]; then + echo "Creating version: ${VERSION}" + /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/versions -X POST -d "version[version]=${VERSION}" -d "access_token=${KEY}" > /dev/null + /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION} -X PUT -d "version[description]=${DESCRIPTION}" -d "access_token=${KEY}" > /dev/null + VERSIONRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}?access_token=${KEY}") + echo $VERSIONRESULT | grep "\"version\":\"${VERSION}\"" > /dev/null + if [ $? != 0 ]; then + echo "Failed to create version" + exit 2 + fi + else + echo "Version already exists" + fi + + # Check to see if the provider exists or create it + PROVIDERRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}/provider/${PROVIDER}?access_token=${KEY}") + if [ $? != 0 ]; then + echo "Failed to connect to the API" + exit 2; + fi + echo $PROVIDERRESULT | grep "\"name\":\"${PROVIDER}\"" > /dev/null + if [ $? != 0 ]; then + echo "Creating provider: ${PROVIDER}" + /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}/providers -X POST -d "provider[name]=${PROVIDER}" -d "access_token=${KEY}" > /dev/null + else + echo "Provider already exists" + fi + + # Request an upload token + TOKENRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}/provider/${PROVIDER}/upload?access_token=${KEY}") + if [ $? != 0 ]; then + echo "Failed to get the token from the API" + exit 2; + fi + echo ${TOKENRESULT} | grep "\"token\":" > /dev/null + if [ $? != 0 ]; then + echo "No token found from the API" + exit 2 + else + TOKEN=$(echo $TOKENRESULT | sed -e 's/.*token":"//' -e 's/".*//') + echo "Uploading to Atlas" + UPLOADRESULT=$(/usr/local/bin/curl -s -X PUT --upload-file ${FILE} ${ATLAS_UPLOAD_URL}/${TOKEN}) + + # Validate the Upload + echo "Validating" + VALIDRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}/provider/${PROVIDER}?access_token=${KEY}") + HOSTED_TOKEN=$(echo $VALIDRESULT | sed -e 's/.*hosted_token":"//' -e 's/".*//') + if [ ! -z ${HOSTED_TOKEN} -a ! -z ${TOKEN} -a ${HOSTED_TOKEN} != ${TOKEN} ]; then + echo "Upload failed, try again." + exit 2 + fi + + # Release the version + echo "Releasing ${VERSION} of ${BOX} in Atlas" + /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}/release -X PUT -d "access_token=${KEY}" > /dev/null + fi +} + +main "$@" diff --git a/release/scripts/box.ovf b/release/scripts/box.ovf new file mode 100644 index 0000000..571e36f --- /dev/null +++ b/release/scripts/box.ovf @@ -0,0 +1,226 @@ +<?xml version="1.0"?> +<Envelope ovf:version="1.0" xml:lang="en-US" xmlns="http://schemas.dmtf.org/ovf/envelope/1" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:vbox="http://www.virtualbox.org/ovf/machine"> + <References> + <File ovf:href="vagrant.vmdk" ovf:id="file1"/> + </References> + <DiskSection> + <Info>List of the virtual disks used in the package</Info> + <Disk ovf:capacity="10632560640" ovf:diskId="vmdisk1" ovf:fileRef="file1" ovf:format="http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized" vbox:uuid="e349f8b6-c400-4e7a-9825-598becab2f94"/> + </DiskSection> + <NetworkSection> + <Info>Logical networks used in the package</Info> + <Network ovf:name="NAT"> + <Description>Logical network used by this appliance.</Description> + </Network> + </NetworkSection> + <VirtualSystem ovf:id="freebsd"> + <Info>A virtual machine</Info> + <OperatingSystemSection ovf:id="78"> + <Info>The kind of installed guest operating system</Info> + <Description>FreeBSD_64</Description> + <vbox:OSType ovf:required="false">FreeBSD_64</vbox:OSType> + </OperatingSystemSection> + <VirtualHardwareSection> + <Info>Virtual hardware requirements for a virtual machine</Info> + <System> + <vssd:ElementName>Virtual Hardware Family</vssd:ElementName> + <vssd:InstanceID>0</vssd:InstanceID> + <vssd:VirtualSystemIdentifier>freebsd</vssd:VirtualSystemIdentifier> + <vssd:VirtualSystemType>virtualbox-2.2</vssd:VirtualSystemType> + </System> + <Item> + <rasd:Caption>1 virtual CPU</rasd:Caption> + <rasd:Description>Number of virtual CPUs</rasd:Description> + <rasd:ElementName>1 virtual CPU</rasd:ElementName> + <rasd:InstanceID>1</rasd:InstanceID> + <rasd:ResourceType>3</rasd:ResourceType> + <rasd:VirtualQuantity>1</rasd:VirtualQuantity> + </Item> + <Item> + <rasd:AllocationUnits>MegaBytes</rasd:AllocationUnits> + <rasd:Caption>512 MB of memory</rasd:Caption> + <rasd:Description>Memory Size</rasd:Description> + <rasd:ElementName>512 MB of memory</rasd:ElementName> + <rasd:InstanceID>2</rasd:InstanceID> + <rasd:ResourceType>4</rasd:ResourceType> + <rasd:VirtualQuantity>512</rasd:VirtualQuantity> + </Item> + <Item> + <rasd:Address>0</rasd:Address> + <rasd:Caption>ideController0</rasd:Caption> + <rasd:Description>IDE Controller</rasd:Description> + <rasd:ElementName>ideController0</rasd:ElementName> + <rasd:InstanceID>3</rasd:InstanceID> + <rasd:ResourceSubType>PIIX4</rasd:ResourceSubType> + <rasd:ResourceType>5</rasd:ResourceType> + </Item> + <Item> + <rasd:Address>1</rasd:Address> + <rasd:Caption>ideController1</rasd:Caption> + <rasd:Description>IDE Controller</rasd:Description> + <rasd:ElementName>ideController1</rasd:ElementName> + <rasd:InstanceID>4</rasd:InstanceID> + <rasd:ResourceSubType>PIIX4</rasd:ResourceSubType> + <rasd:ResourceType>5</rasd:ResourceType> + </Item> + <Item> + <rasd:AddressOnParent>0</rasd:AddressOnParent> + <rasd:Caption>disk1</rasd:Caption> + <rasd:Description>Disk Image</rasd:Description> + <rasd:ElementName>disk1</rasd:ElementName> + <rasd:HostResource>/disk/vmdisk1</rasd:HostResource> + <rasd:InstanceID>5</rasd:InstanceID> + <rasd:Parent>3</rasd:Parent> + <rasd:ResourceType>17</rasd:ResourceType> + </Item> + <Item> + <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation> + <rasd:Caption>Ethernet adapter on 'NAT'</rasd:Caption> + <rasd:Connection>NAT</rasd:Connection> + <rasd:ElementName>Ethernet adapter on 'NAT'</rasd:ElementName> + <rasd:InstanceID>6</rasd:InstanceID> + <rasd:ResourceSubType>E1000</rasd:ResourceSubType> + <rasd:ResourceType>10</rasd:ResourceType> + </Item> + </VirtualHardwareSection> + <vbox:Machine ovf:required="false" version="1.12-macosx" uuid="{8b837be7-fa96-48fc-b119-e90cfa144456}" name="freebsd" OSType="FreeBSD_64" snapshotFolder="Snapshots" lastStateChange="2014-03-13T13:50:05Z"> + <ovf:Info>Complete VirtualBox machine configuration in VirtualBox format</ovf:Info> + <ExtraData> + <ExtraDataItem name="GUI/LastGuestSizeHint" value="720,400"/> + <ExtraDataItem name="GUI/LastNormalWindowPosition" value="400,183,720,421"/> + </ExtraData> + <Hardware version="2"> + <CPU count="1" hotplug="false"> + <HardwareVirtEx enabled="true"/> + <HardwareVirtExNestedPaging enabled="true"/> + <HardwareVirtExVPID enabled="true"/> + <HardwareVirtExUX enabled="true"/> + <PAE enabled="true"/> + <HardwareVirtExLargePages enabled="true"/> + <HardwareVirtForce enabled="false"/> + </CPU> + <Memory RAMSize="512" PageFusion="false"/> + <HID Pointing="PS2Mouse" Keyboard="PS2Keyboard"/> + <HPET enabled="false"/> + <Chipset type="PIIX3"/> + <Boot> + <Order position="1" device="HardDisk"/> + <Order position="2" device="DVD"/> + <Order position="3" device="None"/> + <Order position="4" device="None"/> + </Boot> + <Display VRAMSize="8" monitorCount="1" accelerate3D="false" accelerate2DVideo="false"/> + <VideoCapture/> + <RemoteDisplay enabled="false" authType="Null"/> + <BIOS> + <ACPI enabled="true"/> + <IOAPIC enabled="true"/> + <Logo fadeIn="true" fadeOut="true" displayTime="0"/> + <BootMenu mode="MessageAndMenu"/> + <TimeOffset value="0"/> + <PXEDebug enabled="false"/> + </BIOS> + <USBController enabled="false" enabledEhci="false"/> + <Network> + <Adapter slot="0" enabled="true" MACAddress="080027D14C66" cable="true" speed="0" type="82540EM"> + <DisabledModes/> + <NAT> + <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/> + <Alias logging="false" proxy-only="false" use-same-ports="false"/> + </NAT> + </Adapter> + <Adapter slot="1" enabled="false" MACAddress="080027058FF2" cable="true" speed="0" type="82540EM"> + <DisabledModes> + <NAT> + <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/> + <Alias logging="false" proxy-only="false" use-same-ports="false"/> + </NAT> + </DisabledModes> + </Adapter> + <Adapter slot="2" enabled="false" MACAddress="08002763A181" cable="true" speed="0" type="82540EM"> + <DisabledModes> + <NAT> + <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/> + <Alias logging="false" proxy-only="false" use-same-ports="false"/> + </NAT> + </DisabledModes> + </Adapter> + <Adapter slot="3" enabled="false" MACAddress="0800279C6D17" cable="true" speed="0" type="82540EM"> + <DisabledModes> + <NAT> + <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/> + <Alias logging="false" proxy-only="false" use-same-ports="false"/> + </NAT> + </DisabledModes> + </Adapter> + <Adapter slot="4" enabled="false" MACAddress="08002760C885" cable="true" speed="0" type="82540EM"> + <DisabledModes> + <NAT> + <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/> + <Alias logging="false" proxy-only="false" use-same-ports="false"/> + </NAT> + </DisabledModes> + </Adapter> + <Adapter slot="5" enabled="false" MACAddress="0800279ECE95" cable="true" speed="0" type="82540EM"> + <DisabledModes> + <NAT> + <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/> + <Alias logging="false" proxy-only="false" use-same-ports="false"/> + </NAT> + </DisabledModes> + </Adapter> + <Adapter slot="6" enabled="false" MACAddress="08002730E8BE" cable="true" speed="0" type="82540EM"> + <DisabledModes> + <NAT> + <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/> + <Alias logging="false" proxy-only="false" use-same-ports="false"/> + </NAT> + </DisabledModes> + </Adapter> + <Adapter slot="7" enabled="false" MACAddress="080027AD8EF8" cable="true" speed="0" type="82540EM"> + <DisabledModes> + <NAT> + <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/> + <Alias logging="false" proxy-only="false" use-same-ports="false"/> + </NAT> + </DisabledModes> + </Adapter> + </Network> + <UART> + <Port slot="0" enabled="false" IOBase="0x3f8" IRQ="4" hostMode="Disconnected"/> + <Port slot="1" enabled="false" IOBase="0x2f8" IRQ="3" hostMode="Disconnected"/> + </UART> + <LPT> + <Port slot="0" enabled="false" IOBase="0x378" IRQ="7"/> + <Port slot="1" enabled="false" IOBase="0x378" IRQ="7"/> + </LPT> + <AudioAdapter controller="AC97" driver="CoreAudio" enabled="false"/> + <RTC localOrUTC="local"/> + <SharedFolders/> + <Clipboard mode="Disabled"/> + <DragAndDrop mode="Disabled"/> + <IO> + <IoCache enabled="true" size="5"/> + <BandwidthGroups/> + </IO> + <HostPci> + <Devices/> + </HostPci> + <EmulatedUSB> + <CardReader enabled="false"/> + </EmulatedUSB> + <Guest memoryBalloonSize="0"/> + <GuestProperties> + <GuestProperty name="/VirtualBox/HostInfo/GUI/LanguageID" value="en_US" timestamp="1394718154090069000" flags=""/> + </GuestProperties> + </Hardware> + <StorageControllers> + <StorageController name="IDE Controller" type="PIIX4" PortCount="2" useHostIOCache="true" Bootable="true"> + <AttachedDevice type="HardDisk" port="0" device="0"> + <Image uuid="{e349f8b6-c400-4e7a-9825-598becab2f94}"/> + </AttachedDevice> + </StorageController> + </StorageControllers> + </vbox:Machine> + </VirtualSystem> +</Envelope> diff --git a/release/scripts/list-new-changesets.py b/release/scripts/list-new-changesets.py new file mode 100755 index 0000000..ffb4f48 --- /dev/null +++ b/release/scripts/list-new-changesets.py @@ -0,0 +1,118 @@ +#!/usr/bin/env python +# +# Copyright (c) 2014, Craig Rodrigues <rodrigc@FreeBSD.org> +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice unmodified, this list of conditions, and the following +# disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# $FreeBSD$ + +# Display SVN log entries for changesets which have files which were +# Added or Deleted. +# This script takes arguments which would normally be +# passed to the "svn log" command. +# +# Examples: +# +# (1) Display all new changesets in stable/10 branch: +# +# list-new-changesets.py --stop-on-copy \ +# svn://svn.freebsd.org/base/stable/10 +# +# (2) Display all new changesets between r254153 and r261794 in +# stable/9 branch: +# +# list-new-changesets.py -r254153:261794 \ +# svn://svn.freebsd.org/base/stable/9 + +from __future__ import print_function +import os +import subprocess +import sys +import xml.etree.ElementTree + +def print_logentry(logentry): + """Print an SVN log entry. + + Take an SVN log entry formatted in XML, and print it out in + plain text. + """ + rev = logentry.attrib['revision'] + author = logentry.find('author').text + date = logentry.find('date').text + msg = logentry.find('msg').text + + print("-" * 71) + print("%s | %s | %s" % (rev, author, date)) + print("Changed paths:") + for paths in logentry.findall('paths'): + for path in paths.findall('path'): + print(" %s %s" % (path.attrib['action'], path.text)) + + print() + print(msg.encode('utf-8')) + +def main(args): + """Main function. + + Take command-line arguments which would be passed to 'svn log'. + Prepend '-v --xml' to get verbose XML formatted output. + Only display entries which have Added or Deleted files. + """ + cmd = ["svn", "log", "-v", "--xml"] + cmd += args[1:] + + print(" ".join(cmd)) + + proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + (out, err) = proc.communicate() + + if proc.returncode != 0: + print(err) + sys.exit(proc.returncode) + + displayed_entries = 0 + root = xml.etree.ElementTree.fromstring(out) + + for logentry in root.findall('logentry'): + show_logentry = False + + for paths in logentry.findall('paths'): + for path in paths.findall('path'): + if path.attrib['action'] == 'A': + show_logentry = True + elif path.attrib['action'] == 'D': + show_logentry = True + + if show_logentry == True : + print_logentry(logentry) + displayed_entries += 1 + + if displayed_entries == 0: + print("No changesets with Added or Deleted files") + + if displayed_entries > 0: + print("-" * 71) + + +if __name__ == "__main__": + main(sys.argv) diff --git a/release/scripts/make-manifest.sh b/release/scripts/make-manifest.sh new file mode 100755 index 0000000..b21e8f5 --- /dev/null +++ b/release/scripts/make-manifest.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +# make-manifest.sh: create checksums and package descriptions for the installer +# +# Usage: make-manifest.sh foo1.txz foo2.txz ... +# +# The output file looks like this (tab-delimited): +# foo1.txz SHA256-checksum Number-of-files foo1 Description Install-by-default +# +# $FreeBSD$ + +desc_base="Base system (MANDATORY)" +desc_kernel="Kernel (MANDATORY)" +desc_doc="Additional documentation" +doc_default=off +desc_lib32="32-bit compatibility libraries" +desc_ports="Ports tree" +desc_src="System source code" +desc_tests="Test suite" +src_default=off +tests_default=off + +for i in $*; do + echo "`basename $i` `sha256 -q $i` `tar tvf $i | wc -l | tr -d ' '` `basename $i .txz` \"`eval echo \\\$desc_$(basename $i .txz)`\" `eval echo \\\${$(basename $i .txz)_default:-on}`" +done + diff --git a/release/scripts/mk-vmimage.sh b/release/scripts/mk-vmimage.sh new file mode 100755 index 0000000..fd84216 --- /dev/null +++ b/release/scripts/mk-vmimage.sh @@ -0,0 +1,122 @@ +#!/bin/sh +#- +# Copyright (c) 2014, 2015 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Glen Barber under sponsorship +# from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# mk-vmimage.sh: Create virtual machine disk images in various formats. +# +# $FreeBSD$ +# + +usage() { + echo "${0} usage:" + echo "${@}" + return 1 +} + +main() { + local arg + VMCONFIG="/dev/null" + while getopts "C:c:d:f:i:o:s:S:" arg; do + case "${arg}" in + C) + VMBUILDCONF="${OPTARG}" + ;; + c) + VMCONFIG="${OPTARG}" + ;; + d) + DESTDIR="${OPTARG}" + ;; + f) + VMFORMAT="${OPTARG}" + ;; + i) + VMBASE="${OPTARG}" + ;; + o) + VMIMAGE="${OPTARG}" + ;; + s) + VMSIZE="${OPTARG}" + ;; + S) + WORLDDIR="${OPTARG}" + ;; + *) + ;; + esac + done + shift $(( ${OPTIND} - 1)) + + if [ -z "${VMBASE}" -o \ + -z "${WORLDDIR}" -o \ + -z "${DESTDIR}" -o \ + -z "${VMSIZE}" -o \ + -z "${VMIMAGE}" ]; + then + usage || exit 0 + fi + + if [ -z "${VMBUILDCONF}" ] || [ ! -e "${VMBUILDCONF}" ]; then + echo "Must provide the path to vmimage.subr." + return 1 + fi + + . "${VMBUILDCONF}" + + if [ ! -z "${VMCONFIG}" ] && [ ! -c "${VMCONFIG}" ]; then + . "${VMCONFIG}" + fi + + case ${TARGET}:${TARGET_ARCH} in + arm64:aarch64) + ROOTLABEL="ufs" + NOSWAP=1 + ;; + *) + ROOTLABEL="gpt" + ;; + esac + + vm_create_base + vm_install_base + vm_extra_install_base + vm_extra_install_packages + vm_extra_install_ports + vm_extra_enable_services + vm_extra_pre_umount + vm_extra_pkg_rmcache + cleanup + vm_copy_base + vm_create_disk || return 0 + vm_extra_create_disk + + return 0 +} + +main "$@" diff --git a/release/scripts/mm-mtree.sh b/release/scripts/mm-mtree.sh new file mode 100755 index 0000000..4499c10 --- /dev/null +++ b/release/scripts/mm-mtree.sh @@ -0,0 +1,160 @@ +#!/bin/sh + +# mergemaster mtree database generator + +# This script is intended to be used as part of the release building +# process to generate the /var/db/mergemaster.mtree file relevant to +# the source tree used to create the release so that users can make +# use of mergemaster's -U option to update their files after updating +# to -stable. + +# Copyright 2009 Douglas Barton +# dougb@FreeBSD.org + +# $FreeBSD$ + +PATH=/bin:/usr/bin:/usr/sbin + +display_usage () { + VERSION_NUMBER=`grep "[$]FreeBSD:" $0 | cut -d ' ' -f 4` + echo "${0##*/} version ${VERSION_NUMBER}" + echo "Usage: ${0##*/} [-m /path] [-t /path] [-A arch] [-F <make args>] [-D /path]" + echo "Options:" + echo " -m /path/directory Specify location of source to do the make in" + echo " -t /path/directory Specify temp root directory" + echo " -A architecture Alternative architecture name to pass to make" + echo " -F <arguments for make> Specify what to put on the make command line" + echo ' -D /path/directory Specify the destination directory to install files to' + echo '' +} + +# Set the default path for the temporary root environment +# +TEMPROOT=`TMPDIR=/var/tmp mktemp -d -t temproot` + +# Assign the location of the mtree database +# +MTREEDB=${MTREEDB:-/var/db} +MTREEFILE="${MTREEDB}/mergemaster.mtree" + +# Check the command line options +# +while getopts "m:t:A:F:D:h" COMMAND_LINE_ARGUMENT ; do + case "${COMMAND_LINE_ARGUMENT}" in + m) + SOURCEDIR=${OPTARG} + ;; + t) + TEMPROOT=${OPTARG} + ;; + A) + ARCHSTRING='TARGET_ARCH='${OPTARG} + ;; + F) + MM_MAKE_ARGS="${OPTARG}" + ;; + D) + DESTDIR=${OPTARG} + ;; + h) + display_usage + exit 0 + ;; + *) + echo '' + display_usage + exit 1 + ;; + esac +done + +# Assign the source directory +# +SOURCEDIR=${SOURCEDIR:-/usr/src} +if [ ! -f ${SOURCEDIR}/Makefile.inc1 -a \ + -f ${SOURCEDIR}/../Makefile.inc1 ]; then + echo " *** The source directory you specified (${SOURCEDIR})" + echo " will be reset to ${SOURCEDIR}/.." + echo '' + sleep 3 + SOURCEDIR=${SOURCEDIR}/.. +fi + +# Setup make to use system files from SOURCEDIR +objp=${MAKEOBJDIRPREFIX} +[ -z "${objp}" ] && objp=/usr/obj +legacydir=${objp}${SOURCEDIR}/tmp/legacy +legacypath=${legacydir}/usr/sbin:${legacydir}/usr/bin:${legacydir}/bin +MM_MAKE_ARGS="${MM_MAKE_ARGS} PATH=${legacypath}:${PATH}" +MM_MAKE="make ${ARCHSTRING} ${MM_MAKE_ARGS} -m ${SOURCEDIR}/share/mk" + +delete_temproot () { + rm -rf "${TEMPROOT}" 2>/dev/null + chflags -R 0 "${TEMPROOT}" 2>/dev/null + rm -rf "${TEMPROOT}" || exit 1 +} + +[ -d "${TEMPROOT}" ] && delete_temproot + +echo "*** Creating the temporary root environment in ${TEMPROOT}" + +if mkdir -p "${TEMPROOT}"; then + echo " *** ${TEMPROOT} ready for use" +fi + +if [ ! -d "${TEMPROOT}" ]; then + echo '' + echo " *** FATAL ERROR: Cannot create ${TEMPROOT}" + echo '' + exit 1 +fi + +echo " *** Creating and populating directory structure in ${TEMPROOT}" +echo '' + +{ cd ${SOURCEDIR} || { echo "*** Cannot cd to ${SOURCEDIR}" ; exit 1;} + case "${DESTDIR}" in + '') ;; + *) + ${MM_MAKE} DESTDIR=${DESTDIR} distrib-dirs + ;; + esac + od=${TEMPROOT}/usr/obj + ${MM_MAKE} DESTDIR=${TEMPROOT} distrib-dirs && + MAKEOBJDIRPREFIX=$od ${MM_MAKE} _obj SUBDIR_OVERRIDE=etc && + MAKEOBJDIRPREFIX=$od ${MM_MAKE} everything SUBDIR_OVERRIDE=etc && + MAKEOBJDIRPREFIX=$od ${MM_MAKE} DESTDIR=${TEMPROOT} distribution;} || + { echo ''; + echo " *** FATAL ERROR: Cannot 'cd' to ${SOURCEDIR} and install files to"; + echo " the temproot environment"; + echo ''; + exit 1;} + +# We really don't want to have to deal with files like login.conf.db, pwd.db, +# or spwd.db. Instead, we want to compare the text versions, and run *_mkdb. +# Prompt the user to do so below, as needed. +# +rm -f ${TEMPROOT}/etc/*.db ${TEMPROOT}/etc/passwd + +# We only need to compare things like freebsd.cf once +find ${TEMPROOT}/usr/obj -type f -delete 2>/dev/null + +# Delete stuff we do not need to keep the mtree database small, +# and to make the actual comparison faster. +find ${TEMPROOT}/usr -type l -delete 2>/dev/null +find ${TEMPROOT} -type f -size 0 -delete 2>/dev/null +find -d ${TEMPROOT} -type d -empty -delete 2>/dev/null + +# Build the mtree database in a temporary location. +MTREENEW=`mktemp -t mergemaster.mtree` +mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null + +if [ -s "${MTREENEW}" ]; then + echo "*** Saving mtree database for future upgrades" + test -e "${DESTDIR}${MTREEFILE}" && unlink ${DESTDIR}${MTREEFILE} + mv ${MTREENEW} ${DESTDIR}${MTREEFILE} +fi + +delete_temproot + +exit 0 diff --git a/release/scripts/pkg-stage.sh b/release/scripts/pkg-stage.sh new file mode 100755 index 0000000..095f996 --- /dev/null +++ b/release/scripts/pkg-stage.sh @@ -0,0 +1,90 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +set -e + +export ASSUME_ALWAYS_YES="YES" +export PKG_DBDIR="/tmp/pkg" +export PERMISSIVE="YES" +export REPO_AUTOUPDATE="NO" +export PKGCMD="/usr/sbin/pkg -d" + +_DVD_PACKAGES="archivers/unzip +devel/subversion +devel/subversion-static +emulators/linux_base-f10 +misc/freebsd-doc-all +net/mpd5 +net/rsync +ports-mgmt/pkg +ports-mgmt/portmaster +shells/bash +shells/zsh +security/sudo +sysutils/screen +www/firefox +www/links +x11-drivers/xf86-video-vmware +x11/gnome3 +x11/kde4 +x11/xorg" + +# If NOPORTS is set for the release, do not attempt to build pkg(8). +if [ ! -f /usr/ports/Makefile ]; then + echo "*** /usr/ports is missing! ***" + echo "*** Skipping pkg-stage.sh ***" + echo "*** Unset NOPORTS to fix this ***" + exit 0 +fi + +if [ ! -x /usr/local/sbin/pkg ]; then + /etc/rc.d/ldconfig restart + /usr/bin/make -C /usr/ports/ports-mgmt/pkg install clean +fi + +export DVD_DIR="dvd/packages" +export PKG_ABI=$(pkg config ABI) +export PKG_ALTABI=$(pkg config ALTABI 2>/dev/null) +export PKG_REPODIR="${DVD_DIR}/${PKG_ABI}" + +/bin/mkdir -p ${PKG_REPODIR} +if [ ! -z "${PKG_ALTABI}" ]; then + (cd ${DVD_DIR} && ln -s ${PKG_ABI} ${PKG_ALTABI}) +fi + +# Ensure the ports listed in _DVD_PACKAGES exist to sanitize the +# final list. +for _P in ${_DVD_PACKAGES}; do + if [ -d "/usr/ports/${_P}" ]; then + DVD_PACKAGES="${DVD_PACKAGES} ${_P}" + else + echo "*** Skipping nonexistent port: ${_P}" + fi +done + +# Make sure the package list is not empty. +if [ -z "${DVD_PACKAGES}" ]; then + echo "*** The package list is empty." + echo "*** Something is very wrong." + # Exit '0' so the rest of the build process continues + # so other issues (if any) can be addressed as well. + exit 0 +fi + +# Print pkg(8) information to make debugging easier. +${PKGCMD} -vv +${PKGCMD} update -f +${PKGCMD} fetch -o ${PKG_REPODIR} -d ${DVD_PACKAGES} + +# Create the 'Latest/pkg.txz' symlink so 'pkg bootstrap' works +# using the on-disc packages. +mkdir -p ${PKG_REPODIR}/Latest +(cd ${PKG_REPODIR}/Latest && \ + ln -s ../All/$(${PKGCMD} rquery %n-%v pkg).txz pkg.txz) + +${PKGCMD} repo ${PKG_REPODIR} + +# Always exit '0', even if pkg(8) complains about conflicts. +exit 0 diff --git a/release/scripts/relnotes-search.sh b/release/scripts/relnotes-search.sh new file mode 100755 index 0000000..895f399 --- /dev/null +++ b/release/scripts/relnotes-search.sh @@ -0,0 +1,133 @@ +#!/bin/sh +#- +# Copyright (c) 2014 The FreeBSD Foundation +# All rights reserved. +# +# This software were developed by Glen Barber +# under sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +set -C + +PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin" +export PATH + +usage() { + echo "Usage:" + echo -n "$(basename ${0}) [-rNNNNNN]" + echo " [-l /path/for/output] /path/to/branch" + echo " -r: The oldest commit to include in the search" + echo "" + exit 1 +} + +main() { + while getopts "l:r:" arg ; do + case ${arg} in + l) + # Disallow '-rNNNNNN' argument for oldest + # revision # from becoming the log file + # accidentally. + where="${OPTARG##-r*}" + [ -z "${where}" ] && usage + if [ -e "${where}" ]; then + echo "Log file already exists:" + echo " (${where})" + return 2 + fi + ;; + r) + rev="${OPTARG##-r}" + c=$(echo -n ${rev} | tr -d '0-9' | wc -c) + if [ ${c} -ne 0 ]; then + echo "Revision number must be numeric." + return 2 + fi + # Since the last specified revision is + # specified, mangle the variable to + # make svn syntax happy. + rev="-r${rev}:rHEAD" + ;; + *) + usage + ;; + esac + done + shift $(( ${OPTIND} - 1 )) + + # This assumes a local working copy, which svn search + # allows exactly one repository path (although the root + # can still be the path). + [ "$#" -ne 1 ] && usage + + # If no log file, write to stdout. + [ -z "${where}" ] && where=/dev/stdout + + svn= + # Where is svn? + for s in /usr/bin /usr/local/bin; do + if [ -x ${s}/svn ]; then + svn=${s}/svn + break + fi + if [ -x ${s}/svnlite ]; then + svn=${s}/svnlite + break + fi + done + # Did we find svn? + if [ -z "${svn}" ]; then + echo "svn(1) binary not found." + return 2 + fi + # Is more than one path specified? (This should never + # be triggered, because the argument count is checked + # above, but better safe than sorry.) + if [ $# -gt 1 ]; then + echo "Cannot specify more than one working path." + return 2 + fi + # Does the directory exist? + if [ ! -d "${1}" ]; then + echo "Specified path (${1}) is not a directory." + return 2 + fi + # Is it a subversion repository checkout? + ${svn} info ${1} >/dev/null 2>&1 + if [ "$?" -ne 0 ]; then + echo "Cannot determine svn repository information for ${1}" + return 2 + fi + + # All tests passed. Let's see what can possibly go wrong + # from here. The search string specified should match this + # in PCRE speak: ':[\t ]*' + ${svn} log ${rev} --search 'Relnotes:*[A-Za-z0-9]*' ${1} > ${where} + return $? +} + +main "${@}" +exit $? |