Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

Commit

Permalink
Clean up Arch/Fedora support and modify expand.sh to include it
Browse files Browse the repository at this point in the history
  • Loading branch information
MilkyDeveloper committed Mar 25, 2022
1 parent ad3436a commit c46293c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
4 changes: 3 additions & 1 deletion expand.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash

sudo apt install -y cloud-guest-utils fdisk e2fsck-static || true
source utils/system.sh

installDependencies cloud-guest-utils e2fsprogs

lsblk | grep -v loop

Expand Down
3 changes: 0 additions & 3 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ source utils/distros/${DISTRO}.sh
# Exit on errors
set -e

# Determine host system
whichOperatingSystem

# Many much importance
installDependencies toilet

Expand Down
24 changes: 23 additions & 1 deletion utils/system.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

# Source other files to simplify importing this script on more minimal bash scripts
# (e.g. expand.sh or genimg.sh)
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source ${DIR}/functions.sh

# Determine host system
function whichOperatingSystem {

Expand Down Expand Up @@ -38,12 +43,19 @@ function installDependencies () {

# NOTE: "$*" is used to call all function arguments

# Identify the distro if it is undefined
if [[ -z $DIST ]]; then
whichOperatingSystem
fi

echo "Installing $*"

# Download dependencies based on distribution
case $DIST in

Debian)
# Install dependencies on a Debian host system
sudo apt install -y $*
sudo apt install -y "$@"
;;

Arch)
Expand All @@ -60,6 +72,11 @@ function installDependencies () {
var=vboot-utils;
;;

# growpart
cloud-guest-utils)
var=growpartfs;
;;

# cgpt
cgpt)
unset var; # Included in vboot-utils
Expand Down Expand Up @@ -87,6 +104,11 @@ function installDependencies () {
var=vboot-utils;
;;

# growpart
cloud-guest-utils)
var=cloud-utils-growpart;
;;

# cgpt
cgpt)
unset var; # Included in vboot-utils
Expand Down

0 comments on commit c46293c

Please sign in to comment.