Last active
March 4, 2024 05:56
-
-
Save SaileshBellamkonda/d5342cfe19ee3ec46f1693851edfa46a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ex | |
__Arch=s390x | |
__RootFsDir=/crossfs/$__Arch | |
__CodeName=bionic | |
__PackagesToInstall="build-essential symlinks libicu-dev liblttng-ust-dev libnuma-dev libcurl4-openssl-dev libkrb5-dev libssl-dev openjdk-11-jdk zlib1g-dev" | |
__RepoUrl=http://ports.ubuntu.com/ubuntu-ports/ | |
export DEBIAN_FRONTEND=noninteractive | |
apt-get update | |
apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
gnupg \ | |
locales \ | |
software-properties-common \ | |
vim \ | |
wget | |
if [[ ! -f /etc/apt/trusted.gpg.d/apt.kitware.com.asc ]]; then | |
wget -qO- https://apt.kitware.com/keys/kitware-archive-latest.asc | tee /etc/apt/trusted.gpg.d/apt.kitware.com.asc | |
fi | |
apt-add-repository -y "deb https://apt.kitware.com/ubuntu/ ${__CodeName} main" | |
apt-get update | |
apt-get install -y \ | |
autoconf \ | |
automake \ | |
binfmt-support \ | |
binutils-arm-linux-gnueabihf \ | |
binutils-multiarch \ | |
binutils-s390x-linux-gnu \ | |
bison \ | |
bisonc++ \ | |
build-essential \ | |
clang-9 \ | |
cmake \ | |
cpio \ | |
curl \ | |
debootstrap \ | |
flex \ | |
gdb \ | |
gettext \ | |
git \ | |
jq \ | |
libarchive-dev \ | |
libbsd-dev \ | |
libbz2-dev \ | |
libc6-dev-s390x-cross \ | |
libc6-s390x-cross \ | |
libcurl4-openssl-dev \ | |
lldb-9 \ | |
libgdiplus \ | |
libicu-dev \ | |
libkrb5-dev \ | |
liblldb-9-dev \ | |
liblttng-ust-dev \ | |
liblzma-dev \ | |
libmpc-dev \ | |
libnuma-dev \ | |
libssl-dev \ | |
libtool \ | |
libunwind8 \ | |
libunwind8-dev \ | |
llvm-9 \ | |
libxml2-utils \ | |
libz-dev \ | |
libzstd-dev \ | |
make \ | |
nasm \ | |
openjdk-11-jdk \ | |
python-lldb-9 \ | |
qemu \ | |
qemu-user-static \ | |
rpm2cpio \ | |
ruby-dev \ | |
tar \ | |
texinfo \ | |
uuid-dev \ | |
zip \ | |
zlib1g-dev | |
gem install public_suffix -v 4.0.7 | |
gem install dotenv -v 2.8.1 | |
gem install fpm | |
wget https://cmake.org/files/v3.23/cmake-3.23.1-linux-x86_64.tar.gz | |
tar -xf cmake-3.23.1-linux-x86_64.tar.gz --strip 1 -C /usr/local | |
rm cmake-3.23.1-linux-x86_64.tar.gz | |
locale-gen en_US.UTF-8 | |
apt-get autoremove --purge -y | |
rm -rf /var/lib/apt/lists/* | |
mkdir -p $__RootFsDir | |
debootstrap "--variant=minbase" --arch "$__Arch" "$__CodeName" "$__RootFsDir" "$__RepoUrl" | |
cat <<EOF > "$__RootFsDir/etc/apt/sources.list" | |
deb $__RepoUrl ${__CodeName} main restricted universe | |
deb-src $__RepoUrl ${__CodeName} main restricted universe | |
deb $__RepoUrl ${__CodeName}-updates main restricted universe | |
deb-src $__RepoUrl ${__CodeName}-updates main restricted universe | |
deb $__RepoUrl ${__CodeName}-backports main restricted | |
deb-src $__RepoUrl ${__CodeName}-backports main restricted | |
deb $__RepoUrl ${__CodeName}-security main restricted universe multiverse | |
deb-src $__RepoUrl ${__CodeName}-security main restricted universe multiverse | |
EOF | |
mount -t proc /proc $__RootFsDir/proc/ | |
mount --rbind /sys $__RootFsDir/sys/ | |
mount --rbind /dev $__RootFsDir/dev/ | |
chroot "$__RootFsDir" apt-get update | |
chroot "$__RootFsDir" apt-get -f -y install | |
chroot "$__RootFsDir" apt-get -y install $__PackagesToInstall | |
chroot "$__RootFsDir" symlinks -cr /usr | |
chroot "$__RootFsDir" apt-get clean | |
chroot "$__RootFsDir" rm -rf /var/lib/apt/lists/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment