Update dist_Builder.sh

Updated logic to use Boot_Structure folder.
This commit is contained in:
Maxim 2019-02-24 01:37:26 -06:00 committed by GitHub
parent bd11d32108
commit 9b1ec504cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 48 additions and 6 deletions

View File

@ -5,7 +5,7 @@ rootNisoChk() {
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
softChk softChk
else else
echo "Sorry, you are not root." echo "Sorry, you need to use sudo."
exit 1 exit 1
fi fi
} }
@ -82,7 +82,7 @@ getIso() {
mkdir squashfs-root/ mkdir squashfs-root/
sudo debootstrap --components=main,contrib,nonfree \ sudo debootstrap --components=main,contrib,nonfree \
--variant=minbase \ --variant=minbase \
--include=linux-generic,grub-pc,nano,ssh \ --include=linux-generic,grub-pc \
--arch=amd64 bionic \ --arch=amd64 bionic \
./squashfs-root/ ./squashfs-root/
main main
@ -185,7 +185,28 @@ chrootr() {
umount -lf sys/ umount -lf sys/
cd .. cd ..
setConfigs
ANSR=""
while [[ $ANSR != "1" ]] && [[ $ANSR != "2" ]] && [[ $ANSR != "3" ]]; do
clear
echo -e "Are you using an extracted Ubuntu's iso/ or Boot_Structure/ folder?\n" \
"Which do you wish to use?\n" \
"1.) Use Ubuntu's\n" \
"2.) Use Boot_Structure/\n" \
"3.) Exit"
read -p "--> : " ANSR
done
if [[ $ANSR == "1" ]]; then
setConfigs
elif [[ $ANSR == "2" ]]; then
genSqush
elif [[ $ANSR == "3" ]]; then
exit
fi
} }
setConfigs() { setConfigs() {
@ -203,10 +224,30 @@ setConfigs() {
for i in $REMOVE; do for i in $REMOVE; do
sed -i "/${i}/d" iso/casper/filesystem.manifest-desktop sed -i "/${i}/d" iso/casper/filesystem.manifest-desktop
done done
genSqush
genSqushUbuntu
} }
genSqush() { genSqush() {
## Recreate squashfs
mksquashfs squashfs-root/ Boot_Structure/images/filesystem.squashfs -b 1048576 -comp xz -Xdict-size 100% -e squashfs-root/boot
## Write the filesystem.size file, which is needed by the installer:
sudo du -sx --block-size=1 squashfs-root/ | cut -f1 > Boot_Structure/casper/filesystem.size
chmod 444 Boot_Structure/casper/filesystem.size
## Calculate MD5
(cd Boot_Structure/ && find . -type f -print0 | xargs -0 md5sum | grep -v "\./md5sum.txt" > SHA256SUMS)
genIsoImg
}
genIsoImg() {
## Generate Iso
cd Boot_Structure/
./makeIso.sh
}
genSqushUbuntu() {
## Recreate squashfs ## Recreate squashfs
mksquashfs squashfs-root/ iso/casper/filesystem.squashfs -b 1048576 -comp xz -Xdict-size 100% -e squashfs-root/boot mksquashfs squashfs-root/ iso/casper/filesystem.squashfs -b 1048576 -comp xz -Xdict-size 100% -e squashfs-root/boot
@ -217,14 +258,15 @@ genSqush() {
## Calculate MD5 ## Calculate MD5
(cd iso && find . -type f -print0 | xargs -0 md5sum | grep -v "\./md5sum.txt" > SHA256SUMS) (cd iso && find . -type f -print0 | xargs -0 md5sum | grep -v "\./md5sum.txt" > SHA256SUMS)
genIsoImg genIsoImgUbuntu
} }
genIsoImg() { genIsoImgUbuntu() {
## Generate Iso ## Generate Iso
cd iso/ cd iso/
sudo mkisofs -D -r -cache-inodes -J -l -b isolinux/isolinux.bin -c \ sudo mkisofs -D -r -cache-inodes -J -l -b isolinux/isolinux.bin -c \
isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o \ isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o \
../"${NAME}".iso . ../"${NAME}".iso .
} }
rootNisoChk rootNisoChk