diff --git a/CONFIG.sh b/CONFIG.sh index f1d72cf..28109e9 100644 --- a/CONFIG.sh +++ b/CONFIG.sh @@ -6,14 +6,6 @@ shopt -s expand_aliases alias echo="echo -e" -# The system release version working from -function set_system_release() { - IN=$(cat /etc/os-release | grep "VERSION_CODENAME") - ARRY=(${IN//=/ }) - SYSTEM_RELEASE="${ARRY[1]}" -} - - # ---- Setup Variables ---- # SCRIPT_PATH="$( cd "$(dirname "")" >/dev/null 2>&1 ; pwd -P )"; @@ -52,9 +44,41 @@ LIVE_USER="" # ---- Call CONFIG Methods Here As Needed ---- # set_system_release; cd "${SCRIPT_PATH}"; +echo "Base Dir: " $(pwd) "\n"; + +# Make work structure +mkdir -p "${CHROOT_PTH}" +mkdir -p image/{casper,isolinux,install} + + + # ---- DO NOT CHANGE OR REMOVE UNLESS YOU KNOW WHAT YOU ARE DOING ---- # # Clean manifest-desktop file of unneeded parts REMOVE='ubiquity ubiquity-frontend-gtk ubiquity-frontend-kde casper lupin-casper live-initramfs user-setup discover1 xresprobe os-prober libdebian-installer4' + + +# The system release version working from +function set_system_release() { + IN=$(cat /etc/os-release | grep "VERSION_CODENAME") + ARRY=(${IN//=/ }) + SYSTEM_RELEASE="${ARRY[1]}" +} + +function confirm_dialouge() { + echo $1 + read -p "(yY/Nn) --> " ANSR + while [[ $ANSR != "y" ]] && [[ $ANSR != "Y" ]] && \ + [[ $ANSR != "n" ]] && [[ $ANSR != "N" ]] + do + read -p "(yY/Nn) --> " ANSR + done + + if [[ $ANSR == "n" ]] || [[ $ANSR == "N" ]]; then + return 1 + fi + + return 0 +} diff --git a/NOTES/LiveCDCustomizationFromScratch.pdf b/NOTES/LiveCDCustomizationFromScratch.pdf new file mode 100644 index 0000000..dd46d84 Binary files /dev/null and b/NOTES/LiveCDCustomizationFromScratch.pdf differ diff --git a/start.sh b/start.sh index c21f558..30feb86 100755 --- a/start.sh +++ b/start.sh @@ -8,26 +8,20 @@ . CONFIG.sh function main() { - sanity_check - if [[ $? -eq 1 ]]; then echo "\nExiting..."; return; fi + if [[ $(sanity_check) -eq 1 ]]; then echo "\nExiting..."; return; fi # First setup the debootstrap env... ./step_1_debootstrap.sh # Then setup and run chroot - # ./step_2_chroot.sh + ./step_2_chroot.sh } function sanity_check() { clear; - echo "Working Dir: " $(pwd) "\n"; - - # Make work structure - mkdir -p work/chroot ; - # Check for debootstrap command and then install from downloaded deb if not present. - # we could install from current apt buti want the user and myself to be fully aware - # of what they are chosing. IE, they could just run the install command themselves... + # We could install from current apt but I want the user and myself to be fully aware + # of what they are chosing. IE, we could just run the install command themselves... debootstrap_comm=$(which debootstrap) if [[ "${debootstrap_comm}" == "" ]]; then echo "No deboostrap command found so will try installing from local directory...\n" diff --git a/step_1_debootstrap.sh b/step_1_debootstrap.sh index ecc4bb4..ed797a4 100755 --- a/step_1_debootstrap.sh +++ b/step_1_debootstrap.sh @@ -9,6 +9,6 @@ # Debootstrap process function main() { - sudo debootstrap --arch=$ARCH $RELEASE chroot + sudo debootstrap --arch=$ARCH $RELEASE "${CHROOT_PTH}" } main $@; diff --git a/step_2_chroot.sh b/step_2_chroot.sh index cfcc0fd..4d41dd5 100755 --- a/step_2_chroot.sh +++ b/step_2_chroot.sh @@ -9,6 +9,11 @@ # Debootstrap process function main() { + ansr=$(confirm_dialouge "Launch Xephyr preview window?\n Resolution: ${RES} Window ID: ${ID}") + if [[ $ansr -eq 0 ]]; then + Xephyr -resizeable -screen "${RES}" "${ID}" & + fi + sudo mount --bind /dev "${CHROOT_PTH}"/dev sudo cp /etc/hosts "${CHROOT_PTH}"/etc/hosts @@ -17,6 +22,9 @@ function main() { sudo chroot "${CHROOT_PTH}" + # cleanup + sudo umount "${CHROOT_PTH}"/dev + # ---- OLD SETUP ---- # # ## Set Xephyr and set chrooting mounts