diff --git a/.gitignore b/.gitignore index 4552c62..8ddef0b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ work/ airootfs/etc/skel/pkg +TEMPMNT/ diff --git a/airootfs/etc/skel/install.sh b/airootfs/etc/skel/install.sh index 0b29e89..6751a4e 100755 --- a/airootfs/etc/skel/install.sh +++ b/airootfs/etc/skel/install.sh @@ -108,11 +108,14 @@ customize_env() { esac # Desktop environment - echo "Choose your Desktop Environment (default=KDE)" + echo "Choose your Desktop Environment (default=${DESKTOP_ENV})" printf "(1) KDE (2) GNOME: " read ans case $ans in - ''|'1') + '') + DESKTOP_ENV="${DESKTOP_ENV}" + ;; + '1') DESKTOP_ENV="KDE" ;; '2') @@ -125,11 +128,14 @@ customize_env() { esac # Bootloader - echo "Choose your Bootloader (default=rEFInd)" + echo "Choose your Bootloader (default=${BOOTLOADER})" printf "(1) rEFInd (2) GRUB: " read ans case $ans in - ''|'1') + '') + BOOTLOADER="${BOOTLOADER}" + ;; + '1') BOOTLOADER="refind" ;; '2') @@ -142,11 +148,14 @@ customize_env() { esac # Xorg Drivers - echo "Choose your Graphic Drivers (default=nvidia)" + echo "Choose your Graphic Drivers (default=${XORG_DRIVERS})" printf "(1) nVidia (2) AMD (3) VBox (4) Intel: " read ans case $ans in - ''|'1') + '') + XORG_DRIVERS="${XORG_DRIVERS}" + ;; + '1') XORG_DRIVERS="nvidia" ;; '2') diff --git a/build.sh b/build.sh index bcb8061..bca93d2 100755 --- a/build.sh +++ b/build.sh @@ -216,12 +216,8 @@ make_iso() { mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" -L "${iso_label}" -o "${out_dir}" iso "${iso_name}-${iso_version}-custom.iso" } -# Make local pkg database and repo -make_local_repo() { - # Create obligatory directories - newroot="$(pwd)"/TEMPMNT - pkgdb="$(pwd)"/airootfs/etc/skel/pkg - +# Create needed folders for make_local_repo +make_folder() { # Make root directory if [[ ! -e "$newroot" ]]; then mkdir -p "$newroot" @@ -231,33 +227,31 @@ make_local_repo() { mkdir -m 0555 -p "$newroot"/{sys,proc} fi - # Pull packages from the Internet if needed - if [[ ! -e "$pkgdb" || -e "repo.lock" || -e "pkgdl.lock" || -e "pkgdb.lock" ]]; then - touch "repo.lock" - - if [[ ! -e "$pkgdb" ]]; then - mkdir -p "$pkgdb" - fi - - if [[ ! -e "pkgdb.lock" || ! -e "pkgdl.lock" ]]; then - touch "pkgdl.lock" - pacman -Syw --root "$newroot" --cachedir "$pkgdb" --noconfirm base base-devel yaourt vim grml-zsh-config gstreamer smplayer nvidia bumblebee refind-efi grub os-prober xorg xorg-xinit xorg-drivers cantarell-fonts gnome gnome-tweak-tool plasma kdebase kde-l10n-es virtualbox-guest-modules-arch virtualbox-guest-utils intel-ucode lynx alsa-utils - fi - - # Create DB - echo "" - echo "Creating DB for all packages in ${pkgdb}" - touch "pkgdb.lock" - repo-add "$pkgdb"/custom.db.tar.gz "$pkgdb"/*.xz - sync - - rm "pkgdl.lock" - rm "pkgdb.lock" - rm "repo.lock" + # Make repo folder + if [[ ! -e "$pkgdb" ]]; then + mkdir -p "$pkgdb" fi +} + +# Pull packages from Internet +make_download() { + pacman -Syw --root "$newroot" --cachedir "$pkgdb" --noconfirm base base-devel yaourt vim grml-zsh-config gstreamer smplayer nvidia bumblebee refind-efi grub os-prober xorg xorg-xinit xorg-drivers cantarell-fonts gnome gnome-tweak-tool plasma kdebase kde-l10n-es virtualbox-guest-modules-arch virtualbox-guest-utils intel-ucode lynx alsa-utils +} + +# Create Pacman DB +make_database() { + repo-add "$pkgdb"/custom.db.tar.gz "$pkgdb"/*.xz +} + +# Make local pkg database and repo +make_local_repo() { + run_once make_folder + run_once make_download + run_once make_database + sync echo "" - echo "*** Local repo is ready! ***" + echo "Local repo is ready!" } # Clean-up @@ -298,7 +292,13 @@ done mkdir -p ${work_dir} #### Main script #### -run_once make_local_repo +export newroot="$(pwd)"/TEMPMNT +export pkgdb="$(pwd)"/airootfs/etc/skel/pkg + +# Create new local repo only if needed +if [[ ! -e "$pkgdb/custom.db" ]]; then + run_once make_local_repo +fi run_once make_pacman_conf