Skip to content
GitLab
    • Explore Projects Groups Topics Snippets
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • P proj356 Dev-Env-Deploy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 6
    • Issues 6
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • 空格斜杠全角
  • proj356 Dev-Env-Deploy
  • Merge requests
  • !7

Resolve "Ubuntu 部署脚本更新"

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged 刁翔宇 requested to merge 14-ubuntu into main 1 year ago
  • Overview 0
  • Commits 12
  • Pipelines 0
  • Changes 6

Closes #14 (closed)

Compare
  • version 11
    93812091
    1 year ago

  • version 10
    c235d38c
    1 year ago

  • version 9
    a9287efe
    1 year ago

  • version 8
    96f02582
    1 year ago

  • version 7
    c5ac7b19
    1 year ago

  • version 6
    323ffec3
    1 year ago

  • version 5
    2a8b0fc5
    1 year ago

  • version 4
    9c54f863
    1 year ago

  • version 3
    a2f8c435
    1 year ago

  • version 2
    a97ea2ae
    1 year ago

  • version 1
    af4efc95
    1 year ago

  • main (base)

and
  • latest version
    f8bfc5bc
    12 commits, 1 year ago

  • version 11
    93812091
    11 commits, 1 year ago

  • version 10
    c235d38c
    10 commits, 1 year ago

  • version 9
    a9287efe
    9 commits, 1 year ago

  • version 8
    96f02582
    8 commits, 1 year ago

  • version 7
    c5ac7b19
    7 commits, 1 year ago

  • version 6
    323ffec3
    6 commits, 1 year ago

  • version 5
    2a8b0fc5
    5 commits, 1 year ago

  • version 4
    9c54f863
    4 commits, 1 year ago

  • version 3
    a2f8c435
    3 commits, 1 year ago

  • version 2
    a97ea2ae
    2 commits, 1 year ago

  • version 1
    af4efc95
    1 commit, 1 year ago

6 files
+ 122
− 42

    Preferences

    File browser
    Compare changes
deploy-scripts/local/bin/arch-deploy-aur.sh
+ 8
− 3
  • View file @ f8bfc5bc

  • Edit in single-file editor

  • Open in Web IDE


@@ -4,7 +4,8 @@ source ./bin/env-check-linux.sh
env-check 'Arch Linux'
yay_install="yay -Sy --needed "
function install-yay(){
cd /opt
mkdir ~/Workspace
cd ~/Workspace
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
@@ -12,7 +13,9 @@ function install-yay(){
}
function check-yay(){
echo "Checking yay"
if ! yay --version &> /dev/null
if ! yay --version
then
install-yay
else
@@ -20,7 +23,7 @@ function check-yay(){
fi
}
function install_aur_packages(){
function installing-aur-packages(){
checking-nonroot
check-yay
###################
@@ -53,3 +56,5 @@ function install_aur_packages(){
echo "No packages selected"
fi
}
installing-aur-packages
\ No newline at end of file
deploy-scripts/local/bin/arch-deploy.sh
+ 8
− 9
  • View file @ f8bfc5bc

  • Edit in single-file editor

  • Open in Web IDE


@@ -14,8 +14,7 @@ env-check-root 'Arch Linux'
pacman_install="pacman -Sy --needed --noconfirm "
function install_pacman_packages(){
function install-pacman-packages(){
PACMAN_PACKAGES=""
BASIC_PACKAGES="base linux linux-firmware nano vi usbutils dnsutils nmap arp-scan openssh sudo "
@@ -68,24 +67,24 @@ function install_pacman_packages(){
echo you should run arch-deploy-aur.sh to install aur packages
}
function setup_shell_prompt(){
function setup-shell-prompt(){
USERNAME=$(get-user-input "Enter the username to install shell prompt")
CUSTOM_PS1=$(cat $SCRIPT_DIR/share/bash-ps1-temp)
CUSTOM_PROMPT="export CUSTOM_NOTATON=$(get-user-input "Enter your custom prompt")"
CUSTOM_PROMPT="export CUSTOM_NOTATION=$(get-user-input "Enter your custom prompt")"
echo $CUSTOM_PROMPT>> /home/$USERNAME/.bashrc
echo $CUSTOM_PS1>> /home/$USERNAME/.bashrc
}
function installing_aur_packages(){
function install-aur-packages(){
check-package sudo $pacman_install
SUDO_USER=$(get-user-input "Enter the user to run yay")
sudo -u $SUDO_USER $SCRIPT_DIR/bin/arch-deploy-aur.sh
sudo-as-user $SUDO_USER "SCRIPT_DIR=$SCRIPT_DIR $SCRIPT_DIR/bin/arch-deploy-aur.sh"
}
function main(){
SELECTED_OPERATION=$(dialog --checklist "Select operation to perform:" 20 60 10 \
"install_pacman_packages" "Install Packages" on \
"install_aur_packages" "Install AUR Packages" on \
"setup_shell_prompt" "Setup Shell Prompt" on \
"install-pacman-packages" "Install Packages" on \
"install-aur-packages" "Install AUR Packages" on \
"setup-shell-prompt" "Setup Shell Prompt" on \
3>&1 1>&2 2>&3 3>&-)
if [ -z "$SELECTED_OPERATION" ]; then
echo "No operation selected"
deploy-scripts/local/bin/env-check-linux.sh
+ 12
− 6
  • View file @ f8bfc5bc

  • Edit in single-file editor

  • Open in Web IDE


@@ -3,7 +3,7 @@ function check-root(){
if [[ "$EUID" -ne 0 ]]
then
echo "This script must be executed with root permission"
PASSWD=0
export PASSED=0
else
echo "Root permission granted"
fi
@@ -14,7 +14,7 @@ function check-nonroot(){
echo "non-root check passed"
else
echo "This script must run as non-root"
PASSWD=0
export PASSED=0
fi
}
function check-os(){
@@ -22,7 +22,7 @@ function check-os(){
if ! grep -q "$1" /etc/os-release
then
echo "This script should be run in $1"
PASSWD=0
export PASSED=0
else
echo "OS is $1"
fi
@@ -31,13 +31,13 @@ function check-script-dir(){
if ! [[ -n "$SCRIPT_DIR" ]]
then
echo "No \$SCRIPT_DIR present"
PASSWD=0
export PASSED=0
else
echo "SCRIPT_DIR is $SCRIPT_DIR"
fi
}
function report-fail(){
if [[ "$PASSED" -eq 0 ]];
if [[ $PASSED -eq 0 ]];
then
echo
echo "At least one check above not passed"
@@ -86,7 +86,7 @@ function check-package(){
fi
}
get-user-input() {
function get-user-input() {
# $1 is the inputbox name
local result=$(dialog --inputbox "$1" 0 0 3>&1 1>&2 2>&3 3>&-)
echo "$result"
@@ -95,3 +95,9 @@ get-user-input() {
function check-proxy(){
:
}
function sudo-as-user(){
#$1 is then user
#$2 is the command
sudo -u $1 $2
}
deploy-scripts/local/bin/ubuntu-deploy.sh
+ 93
− 23
  • View file @ f8bfc5bc

  • Edit in single-file editor

  • Open in Web IDE

#!/bin/bash
source ./env-check.sh
env-check 'Ubuntu'
#basic
sudo apt update && sudo apt install -y --fix-missing python3 python3-pip python3-dev lib32z1 \
xinetd curl gcc gdb gdbserver g++ git libssl-dev libffi-dev build-essential \
iputils-ping cpio gdb-multiarch file net-tools socat ruby ruby-dev locales \
autoconf automake libtool make zsh openssh-server openssh-client ipython3 \
gdb-multiarch bison wget
#qemu
sudo apt install -y autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev \
gawk build-essential bison flex texinfo gperf libtool patchutils bc \
zlib1g-dev libexpat-dev pkg-config libglib2.0-dev libpixman-1-dev libsdl2-dev libslirp-dev \
git tmux python3 python3-pip ninja-build
wget https://download.qemu.org/qemu-7.0.0.tar.xz
tar xvJf qemu-7.0.0.tar.xz
cd qemu-7.0.0
./configure --target-list=riscv64-softmmu,riscv64-linux-user
make -j$(nproc)
echo "export PATH=$PATH:./qemu-7.0.0/build" >> ~/.bashrc
source ./env-check-linux.sh
env-check-root 'Ubuntu'
apt_install="apt install -y --fix-missing --install-recommends --install-suggests"
## packages
function install-apt-packages(){
APT_PACKAGES=""
PYTHON3_PACKAGES="python3 python3-pip python3-dev lib32z1 "
RUBY_PACKAGES="ruby ruby-dev"
BASIC_PACKAGES="git curl wget vim tmux zsh net-tools iputils-ping openssh-server openssh-client locales"
DEV_PACKAGES="gcc gdb gdbserver g++ libssl-dev libffi-dev build-essential gdb-multiarch "
DEBUG_PACKAGES="bison cpio"
QEMU_PACKAGES="autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev \
gawk build-essential bison flex texinfo gperf libtool patchutils bc \
zlib1g-dev libexpat-dev pkg-config libglib2.0-dev libpixman-1-dev libsdl2-dev libslirp-dev \
git tmux python3 python3-pip ninja-build"
#xinetd curl gcc gdb gdbserver g++ git libssl-dev libffi-dev build-essential \
#iputils-ping cpio gdb-multiarch file net-tools socat ruby ruby-dev locales \
#autoconf automake libtool make zsh openssh-server openssh-client ipython3 \
#gdb-multiarch bison wget
SELECTED_PACKAGES=$(dialog --checklist "Select apt packages to install:" 0 0 10 \
"PYTHON3_PACKAGES" "Python3 packages" on \
"RUBY_PACKAGES" "ruby ruby-dev etc." off \
"BASIC_PACKAGES" "packages for basic system setup" on \
"DEV_PACKAGES" "packages for basic development" on \
"DEBUG_PACKAGES" "packages debuging purpose" off \
"QEMU_PACKAGES" "Handy collected QEMU requirements" off \
3>&1 1>&2 2>&3 3>&-)
# Convert selected package names to their values
apt update
for package in $SELECTED_PACKAGES
do
echo $package
eval "APT_PACKAGES+=\"${!package}\""
done
if [[ -n "$APT_PACKAGES" ]]; then
$apt_install $APT_PACKAGES
else
echo "No packages selected"
fi
}
function installing-git-packages(){
mkdir ~/Workspace
cd ~/Workspace
wget https://download.qemu.org/qemu-7.0.0.tar.xz
tar xvJf qemu-7.0.0.tar.xz
cd qemu-7.0.0
./configure --target-list=riscv64-softmmu,riscv64-linux-user
make -j$(nproc)
}
function install-git-packages(){
sudo-as-user "$(get-user-input "user name to install git packages")" "installing-git-packages"
}
#qemu-git
function setup-shell-prompt(){
echo "export PATH=$PATH:~/Workspace/qemu-7.0.0/build" >> ~/.bashrc
}
function system-upgrade(){
apt update
apt upgrade
}
function main(){
SELECTED_OPERATION=$(dialog --checklist "Select operation to perform:" 0 0 0 \
"install-apt-packages" "Install regular apt Packages" on \
"install-git-packages" "Install selected Packages from git " off \
"setup-shell-prompt" "Setup Shell Prompt" on \
"system-upgrade" "do a (nearly) full system update" on \
3>&1 1>&2 2>&3 3>&-)
if [ -z "$SELECTED_OPERATION" ]; then
echo "No operation selected"
else
for operation in $SELECTED_OPERATION
do
eval "$operation"
done
fi
}
check-package 'dialog' "$apt_install"
check-package 'git' "$apt_install"
main
devcontainer/Dockerfile → dev-container/Dockerfile
+ 0
− 0
  • View file @ f8bfc5bc

  • Edit in single-file editor

  • Open in Web IDE

Unable to load file contents. Try again later.
File renamed with no changes. Show file contents
Assignee
刁翔宇's avatar
刁翔宇
Assign to
0 Reviewers
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
Lock merge request
Unlocked
2
2 Participants
邵志航
刁翔宇
Reference:
Source branch: 14-ubuntu

Menu

Explore Projects Groups Topics Snippets