├── .gitmodules ├── LICENSE ├── README.md ├── SECURITY.md ├── dsc.version ├── omi.version └── updateVersion.sh /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "pal"] 2 | path = pal 3 | url = git@github.com:Microsoft/pal.git 4 | branch = master 5 | [submodule "omi"] 6 | path = omi 7 | url = git@github.com:Microsoft/omi.git 8 | branch = master 9 | [submodule "dsc"] 10 | path = dsc 11 | url = git@github.com:Microsoft/PowerShell-DSC-for-Linux.git 12 | branch = master 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Build-PowerShell-DSC-for-Linux 2 | 3 | Copyright (c) Microsoft Corporation 4 | All rights reserved. 5 | 6 | MIT License 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining 9 | a copy of this software and associated documentation files (the 10 | ""Software""), to deal in the Software without restriction, including 11 | without limitation the rights to use, copy, modify, merge, publish, 12 | distribute, sublicense, and/or sell copies of the Software, and to 13 | permit persons to whom the Software is furnished to do so, subject to 14 | the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be 17 | included in all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, 20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 23 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 24 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 25 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Build Powershell DSC (Desired State Configuration) for Linux 2 | The primary purpose of this project is to build universal Linux .rpm and .deb packages for distribution. 3 | The ULinux build of [Powershell DSC for Linux](https://github.com/Microsoft/PowerShell-DSC-for-Linux) is built upon the OMI, PAL and the ostc-openssl projects. 4 | 5 | If local or development builds are desired, please follow the instructions in the README.md from the [Powershell DSC for Linux](https://github.com/Microsoft/PowerShell-DSC-for-Linux) project. 6 | ### Configuration: 7 | 8 | To prepare your build system you must read and follow the steps below from the Build-omi project: 9 | 10 | - [Glossary of Terms](https://github.com/Microsoft/Build-omi#glossary-of-terms) 11 | - [Setting up a machine to build OMI](https://github.com/Microsoft/Build-omi#setting-up-a-machine-to-build-omi) 12 | - [Dependencies to build a native package](https://github.com/Microsoft/Build-omi#dependencies-to-build-a-native-package) 13 | - [Setting up a system to build a universal package](https://github.com/Microsoft/Build-omi#setting-up-a-system-to-build-a-universal-package) 14 | - [Setting up your system for git](https://github.com/Microsoft/ostc-docs/blob/master/setup-git.md) 15 | 16 | DSC also requires curl and the curl development packages: 17 | - RHEL, CentOS : 18 | ``` 19 | sudo yum install curl libcurl-devel 20 | ``` 21 | - SLES: 22 | ``` 23 | sudo zypper install curl libcurl-devel 24 | ``` 25 | - Debian/Ubuntu: 26 | There are several back-ends for libcurl-dev. The 'apt-get' will list the candidates. Pick the appropriate one to install. 27 | ``` 28 | sudo apt-get install curl libcurl-dev 29 | ``` 30 | 31 | ### Clone repository 32 | To clone the repository to build PowerShell-DSC-for-Linux, issue the following command: 33 | 34 | ``` 35 | git clone --recursive git@github.com:Microsoft/Build-Powershell-DSC-for-Linux.git bld-dsc 36 | ``` 37 | 38 | After this, you need to make sure that you're on the master branch for each 39 | of the subprojects. To do this, issue the following commands: 40 | 41 | ``` 42 | cd bld-dsc 43 | git checkout master 44 | git submodule foreach git checkout master 45 | ``` 46 | 47 | You can also use an alias like ```git co-master``` if you followed 48 | [Configuring git](https://github.com/Microsoft/ostc-docs/blob/master/setup-git.md) 49 | recommendations. 50 | 51 | There will be three projects under bld-dsc: 52 | ``` 53 | dsc 54 | omi 55 | pal 56 | ``` 57 | 58 | ### Building 59 | 60 | ``` 61 | cd dsc/build 62 | ./configure --enable-ulinux 63 | make 64 | ``` 65 | - Packages are placed into bld-dsc/dsc/release. 66 | 67 | 68 | 69 | 70 | 71 | ### Code of Conduct 72 | 73 | This project has adopted the [Microsoft Open Source Code of Conduct] 74 | (https://opensource.microsoft.com/codeofconduct/). For more 75 | information see the [Code of Conduct FAQ] 76 | (https://opensource.microsoft.com/codeofconduct/faq/) or contact 77 | [opencode@microsoft.com](mailto:opencode@microsoft.com) with any 78 | additional questions or comments. 79 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Security 4 | 5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). 6 | 7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. 8 | 9 | ## Reporting Security Issues 10 | 11 | **Please do not report security vulnerabilities through public GitHub issues.** 12 | 13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). 14 | 15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). 16 | 17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). 18 | 19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: 20 | 21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) 22 | * Full paths of source file(s) related to the manifestation of the issue 23 | * The location of the affected source code (tag/branch/commit or direct URL) 24 | * Any special configuration required to reproduce the issue 25 | * Step-by-step instructions to reproduce the issue 26 | * Proof-of-concept or exploit code (if possible) 27 | * Impact of the issue, including how an attacker might exploit the issue 28 | 29 | This information will help us triage your report more quickly. 30 | 31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. 32 | 33 | ## Preferred Languages 34 | 35 | We prefer all communications to be in English. 36 | 37 | ## Policy 38 | 39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). 40 | 41 | 42 | -------------------------------------------------------------------------------- /dsc.version: -------------------------------------------------------------------------------- 1 | # -*- mode: Makefile; -*- 2 | #-------------------------------------------------------------------------------- 3 | # Copyright (c) Microsoft Corporation. All rights reserved. 4 | #-------------------------------------------------------------------------------- 5 | # 2015-10-06 6 | #-------------------------------------------------------------------------------- 7 | 8 | DSC_BUILDVERSION_MAJOR=1 9 | DSC_BUILDVERSION_MINOR=2 10 | DSC_BUILDVERSION_PATCH=0 11 | DSC_BUILDVERSION_BUILDNR=0 12 | DSC_BUILDVERSION_DATE=20210420 13 | DSC_BUILDVERSION_STATUS=Developer_Build 14 | -------------------------------------------------------------------------------- /omi.version: -------------------------------------------------------------------------------- 1 | # -*- mode: Makefile; -*- 2 | 3 | # Build Version Information 4 | 5 | OMI_BUILDVERSION_MAJOR=1 6 | OMI_BUILDVERSION_MINOR=6 7 | OMI_BUILDVERSION_PATCH=0 8 | OMI_BUILDVERSION_BUILDNR=129 9 | OMI_BUILDVERSION_DATE=20181206 10 | OMI_BUILDVERSION_STATUS=Developer_Build 11 | OMI_BUILDVERSION_NUGET=1.6.100129 12 | 13 | #-------------------------------- End of File ----------------------------------- 14 | -------------------------------------------------------------------------------- /updateVersion.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | # 3 | # Update the version file each day for the daily build 4 | # 5 | 6 | # Exit on error 7 | set -e 8 | 9 | # Parsing logic 10 | 11 | usage() 12 | { 13 | echo "$0 " 14 | echo 15 | echo "Valid options are:" 16 | echo " -f: Version file to update (mandatory option)" 17 | echo " -h: This message" 18 | echo " -i: Increment build number and set date" 19 | echo " -r: Set for release build" 20 | echo " -v: Verbose output" 21 | echo 22 | echo "With only the -f option specified, -i is assumed" 23 | 24 | exit 1 25 | } 26 | 27 | P_INCREMENT=0 28 | P_RELEASE=0 29 | VERBOSE=0 30 | 31 | while getopts "h?f:irv" opt; do 32 | case "$opt" in 33 | h|\?) 34 | usage 35 | ;; 36 | f) 37 | VERSION_FILE=$OPTARG 38 | ;; 39 | 40 | i) 41 | P_INCREMENT=1 42 | ;; 43 | r) 44 | P_RELEASE=1 45 | ;; 46 | v) 47 | VERBOSE=1 48 | ;; 49 | esac 50 | done 51 | shift $((OPTIND-1)) 52 | 53 | if [ "$@ " != " " ]; then 54 | echo "Parsing error: '$@' is unparsed, use -h for help" 1>& 2 55 | exit 1 56 | fi 57 | 58 | if [ -z "$VERSION_FILE" ]; then 59 | echo "Must specify -f qualifier (version file)" 1>& 2 60 | exit 1 61 | fi 62 | 63 | if [ ! -f $VERSION_FILE ]; then 64 | echo "Can't find file $VERSION_FILE" 1>& 2 65 | exit 1 66 | fi 67 | 68 | if [ ! -w $VERSION_FILE ]; then 69 | echo "File $VERSION_FILE is not writeable" 1>& 2 70 | exit 1 71 | fi 72 | 73 | # Set default behavior 74 | [ $P_RELEASE -eq 0 ] && P_INCREMENT=1 75 | 76 | # Increment build number 77 | if [ $P_INCREMENT -ne 0 ]; then 78 | VERSION_OLD=`grep '^[A-Z]*_BUILDVERSION_BUILDNR' $VERSION_FILE | cut -d= -f2` 79 | DATE_OLD=`grep '^[A-Z]*_BUILDVERSION_DATE' $VERSION_FILE | cut -d= -f2` 80 | 81 | VERSION_NEW=$(( $VERSION_OLD + 1 )) 82 | DATE_NEW=`date +%Y%m%d` 83 | 84 | perl -i -pe "s/(^[A-Z]*_BUILDVERSION_BUILDNR)=.*/\1=$VERSION_NEW/" $VERSION_FILE 85 | perl -i -pe "s/(^[A-Z]*_BUILDVERSION_DATE)=.*/\1=$DATE_NEW/" $VERSION_FILE 86 | 87 | if [ $VERBOSE -ne 0 ]; then 88 | echo "Updated version number, Was: $VERSION_OLD, Now $VERSION_NEW" 89 | echo "Updated release date, Was: $DATE_OLD, Now $DATE_NEW" 90 | fi 91 | fi 92 | 93 | # Set release build 94 | if [ $P_RELEASE -ne 0 ]; then 95 | perl -i -pe "s/^([A-Z]*_BUILDVERSION_STATUS)=.*/\1=Release_Build/" $VERSION_FILE 96 | [ $VERBOSE -ne 0 ] && echo "Set BUILDVERSION_STATUS to \"Release_Build\"" 97 | echo "WARNING: Never commit $VERSION_FILE with release build set!" 1>& 2 98 | fi 99 | 100 | exit 0 101 | --------------------------------------------------------------------------------