added cleanup commands and so logic fixes #16

Merged
maximstewart merged 1 commits from develop into master 2020-05-04 04:47:13 +00:00
6 changed files with 70 additions and 33 deletions

View File

@ -21,7 +21,7 @@ SYSTEM_RELEASE=""
# $RELEASE is the version of Ubuntu/Debian you intend to build an ISO for. # $RELEASE is the version of Ubuntu/Debian you intend to build an ISO for.
# Some options: xenal, bionic, disco, focal # Some options: xenal, bionic, disco, focal
# Versions: xenal (16.0.4), bionic (18.04), disco (19.04), focal (20.04) # Versions: xenal (16.0.4), bionic (18.04), disco (19.04), focal (20.04)
RELEASE="focal" RELEASE=""
# $ARCH is the target processor architecture. # $ARCH is the target processor architecture.
@ -29,9 +29,9 @@ RELEASE="focal"
# For newer 64-bit x86 systems (also known as x64, x86_64, Intel 64, and AMD64) use amd64. # For newer 64-bit x86 systems (also known as x64, x86_64, Intel 64, and AMD64) use amd64.
ARCH="" ARCH=""
# the name of your distro and ISO # The name and version of your distro and ISO
OS_NAME="" OS_NAME=""
OS_VER="1.00" OS_VER=""
# The user of the live boot # The user of the live boot
LIVE_USER="" LIVE_USER=""

View File

@ -13,3 +13,21 @@ dpkg-divert --rename --remove /sbin/initctl
# Remove old kernels # Remove old kernels
# dpkg -l 'linux-*' | sed '/^ii/!d;/hwe/d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt -y purge; update-grub # dpkg -l 'linux-*' | sed '/^ii/!d;/hwe/d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt -y purge; update-grub
# ---- Get rid of some 'unneeded' blob. (Probably doing satans work with how this is aproached....)
# /usr/lib/firmware consumes nearly 550MB!! Ouch....
mkdir /usr/lib/me-tmp/
mv /usr/lib/firmware/RTL8192E /usr/lib/me-tmp/
mv /usr/lib/firmware/amd /usr/lib/me-tmp/
mv /usr/lib/firmware/amd-ucode /usr/lib/me-tmp/
mv /usr/lib/firmware/amdgpu /usr/lib/me-tmp/
mv /usr/lib/firmware/intel /usr/lib/me-tmp/
mv /usr/lib/firmware/intel-ucode /usr/lib/me-tmp/
mv /usr/lib/firmware/nvidia /usr/lib/me-tmp/
mv /usr/lib/firmware/qcom /usr/lib/me-tmp/
rm -rf /usr/lib/firmware/*
mv /usr/lib/me-tmp/* /usr/lib/firmware/
rmdir /usr/lib/me-tmp

View File

@ -1,7 +1,6 @@
#!/bin/bash #!/bin/bash
. CONFIG_SCRIPTS.sh . CONFIG_SCRIPTS.sh
. GET_PPA_GPG_KEYS.sh
# ---- Setup Variables ---- # # ---- Setup Variables ---- #

View File

@ -47,15 +47,16 @@ function start_menu_mesage() {
echo "NOTE: Remember to check the CONFIG.sh and set the variables!" echo "NOTE: Remember to check the CONFIG.sh and set the variables!"
echo "\nWhat do you want to run?" echo "\nWhat do you want to run?"
echo "\t1) Update & Upgrade" echo "\t1) Update & Upgrade"
echo "\t2) Install Core and Live ISO Dependencies" echo "\t2) Install Core and Live ISO Dependencies (Ubuntu)"
echo "\t3) Install Base System Packages" echo "\t3) Install Core and Live ISO Dependencies (Debian)"
echo "\t4) Install Gaming Apps" echo "\t4) Install Base System Packages"
echo "\t5) Install Media Apps" echo "\t5) Install Gaming Apps"
echo "\t6) Install Office Apps" echo "\t6) Install Media Apps"
echo "\t7) Install Debs" echo "\t7) Install Office Apps"
echo "\t8) Transfer Setting" echo "\t8) Install Debs"
echo "\t9) Add PPA Repos" echo "\t9) Transfer Setting"
echo "\t10) Add PPA Repo Keys" echo "\t10) Add PPA Repo Enteries"
echo "\t11) Cleanup (Should run before exiting chroot.)" echo "\t11) Add PPA Repo Keys"
echo "\t12) Cleanup (Should run before exiting chroot.)"
echo "\t0) EXIT" echo "\t0) EXIT"
} }

View File

@ -17,21 +17,23 @@ function main() {
[[ $ANSR != "4" ]] && [[ $ANSR != "5" ]] && \ [[ $ANSR != "4" ]] && [[ $ANSR != "5" ]] && \
[[ $ANSR != "6" ]] && [[ $ANSR != "7" ]] && \ [[ $ANSR != "6" ]] && [[ $ANSR != "7" ]] && \
[[ $ANSR != "8" ]] && [[ $ANSR != "9" ]] && \ [[ $ANSR != "8" ]] && [[ $ANSR != "9" ]] && \
[[ $ANSR != "10" ]] && [[ $ANSR != "11" ]]; do [[ $ANSR != "10" ]] && [[ $ANSR != "11" ]] && \
[[ $ANSR != "12" ]]; do
read -p "--> : " ANSR read -p "--> : " ANSR
done done
case $ANSR in case $ANSR in
"1" ) update_and_upgrade;; "1" ) update_and_upgrade;;
"2" ) install_live_iso_dependencies;; "2" ) install_live_iso_dependencies "ubuntu";;
"3" ) install_base;; "3" ) install_live_iso_dependencies "debian";;
"4" ) install_gaming;; "4" ) install_base;;
"5" ) install_media;; "5" ) install_gaming;;
"6" ) install_office;; "6" ) install_media;;
"7" ) install_debs;; "7" ) install_office;;
"8" ) transfer_settings;; "8" ) install_debs;;
"9" ) ./GET_PPA_REPOSITORIES.sh;; "9" ) transfer_settings;;
"10" ) ./GET_PPA_GPG_KEYS.sh;; "10" ) ./GET_PPA_REPOSITORIES.sh;;
"11" ) ./CLEANUP.sh;; "11" ) ./GET_PPA_GPG_KEYS.sh;;
"12" ) ./CLEANUP.sh;;
"0" ) exit;; "0" ) exit;;
* ) echo "Don't know how you got here but that's a bad sign...";; * ) echo "Don't know how you got here but that's a bad sign...";;
esac esac
@ -51,12 +53,14 @@ function install_live_iso_dependencies() {
apt-get install -y casper lupin-casper apt-get install -y casper lupin-casper
# Adds ~25MB of stuff # Adds ~25MB of stuff
apt-get install -y discover laptop-detect os-prober apt-get install -y discover laptop-detect os-prober
# Adds ~55MB of stuff
# In keeping with ubuntu-mini-remix structure I've added this here. # Get the generic requsit packages.
# Might be a bad idea. (Actually really is a bad idea... as this should be manually called.) case $1 in
# This breaks from keeping things generic for it and debian. (Maybe? Could just fail an install.) "ubuntu" ) install_ubuntu_live_pkgs;;
apt-get install -y \ "debian" ) install_debian_live_pkgs;;
ubuntu-minimal ubuntu-standard esac
install_installer
# The generic kernel can baloon a system with just the above # The generic kernel can baloon a system with just the above
# from ~130MB to 460+MB. (With good compression of squashfs and cleaning) # from ~130MB to 460+MB. (With good compression of squashfs and cleaning)
@ -64,7 +68,22 @@ function install_live_iso_dependencies() {
# I need to look into a kind of menu for the user where they could chose one. # I need to look into a kind of menu for the user where they could chose one.
# For right now, we'll use this... # For right now, we'll use this...
apt-get install -y linux-generic apt-get install -y linux-generic
}
function install_ubuntu_live_pkgs() {
# Adds ~55MB of stuff
apt-get install -y \
ubuntu-minimal ubuntu-standard
}
function install_debian_live_pkgs() {
# Adds ~55MB of stuff {Maybe...I actually haven't checked that these exist}
apt-get install -y \
debian-minimal debian-standard
}
function install_installer() {
echo "Do you want to install one of the OS installers?" echo "Do you want to install one of the OS installers?"
echo "\t1) ubiquity-frontend-gtk" echo "\t1) ubiquity-frontend-gtk"

View File

@ -12,10 +12,10 @@ function main() {
cd image/ cd image/
# Take note of the ending dot when changing this... # Take note of the ending dot when changing this...
sudo mkisofs -r -V "${OS_NAME}" -cache-inodes -J -l \ sudo mkisofs -r -V "${OS_NAME}"-"${OS_VER}" -cache-inodes -J -l \
-boot-info-table -no-emul-boot -boot-load-size 4 \ -boot-info-table -no-emul-boot -boot-load-size 4 \
-b isolinux/isolinux.bin -c isolinux/boot.cat \ -b isolinux/isolinux.bin -c isolinux/boot.cat \
-o ../"${OS_NAME}".iso . -o ../"${OS_NAME}"-"${OS_VER}".iso .
cd .. cd ..
} }