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

Commit

Permalink
ISO-9660 version 2 completed. A few GUI improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
nerun committed Feb 20, 2023
1 parent 22feacb commit f189229
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 44 deletions.
25 changes: 2 additions & 23 deletions remastersys-gui/usr/bin/remastersys-gui
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ About=$"About"
NoFileSelected=$"You didn't select any file.$Continue"

mainmenu() {
CHOICES=`$DIALOG_1_nf"$Choose" --title="$TITLETEXT" --width=750 --height=400 $MENU \
CHOICES=`$DIALOG_1_nf"$Choose" --title="$TITLETEXT" --width=765 --height=415 $MENU \
Backup "$BackupString" \
Dist "$DistString" \
DistCDFS "$DistCDFSString" \
Expand Down Expand Up @@ -119,46 +119,28 @@ Visit <a href=\"https://github.com/nerun/remastersys\">https://github.com/nerun/
fi
}

# Common procedure to backupmenu(), distmenu(), distcdfsmenu() e distisomenu().
SquashfsSizeCheckup(){
SQUASHFSSIZE=$(ls -s $WORKDIR/ISOTMP/live/filesystem.squashfs | awk -F " " '{print $1}')

if [ "$SQUASHFSSIZE" -gt "3999999" ]; then
$DIALOG_2$"The compressed file system is larger than the ISO 9660 specification allows for\na single file.\n\nYou must try to reduce the amount of data you are backing up and try again." --title="$TITLETEXT"
exit 1
fi
}

# Common procedure to backupmenu(), distmenu() e distisomenu().
FilesReady(){
$DIALOG_2$"Your $CUSTOMISO and $CUSTOMISO.md5 files are ready in\n$WORKDIR. It is recommended to test it in a virtual machine or on a\nrewritable CD/DVD to ensure it works as desired.\n\nClick on OK to return to the main menu." --title="$TITLETEXT"
$DIALOG_2$"Your files are ready:\n - $WORKDIR/$CUSTOMISO\n - $WORKDIR/$CUSTOMISO.md5\n\nIt is recommended to test it in a virtual machine or on a\nrewritable CD/DVD to ensure it works as desired.\n\nClick on OK to return to the main menu." --title="$TITLETEXT"
mainmenu
}

backupmenu() {
$DIALOG_2$"You have selected Backup Mode.\n\nDo not interrupt this process.\n\nClick OK to start the Backup Live CD/DVD process." --title="$TITLETEXT"
xterm -fn 9x15 -e "sudo remastersys backup"

SquashfsSizeCheckup

FilesReady
}

distmenu() {
$DIALOG_2$"You have selected Dist Mode.\n\nClick OK to start the Distributable Live CD/DVD process." --title="$TITLETEXT"
xterm -fn 9x15 -e "sudo remastersys dist"

SquashfsSizeCheckup

FilesReady
}

distcdfsmenu() {
$DIALOG_2$"You have selected Dist CDFS Mode.\n\nClick OK to start the Distributable Live CD/DVD file system build process." --title="$TITLETEXT"
xterm -fn 9x15 -e "sudo remastersys dist cdfs"

SquashfsSizeCheckup

$DIALOG_2$"Your Live CD File System is ready in $WORKDIR. You can now add files\nto the CD and then run the Dist ISO option when you are done.\n\nClick on OK to return to the main menu." --title="$TITLETEXT"

mainmenu
Expand All @@ -168,9 +150,6 @@ distisomenu() {
if [ -f "$WORKDIR/ISOTMP/live/filesystem.squashfs" ]; then
$DIALOG_2$"You have selected DistISO Mode.\n\nClick OK to create the ISO file." --title="$TITLETEXT"
xterm -fn 9x15 -e "sudo remastersys dist iso"

SquashfsSizeCheckup

FilesReady
else
$DIALOG_2$"The Live CD file system does not exist.\n\nClick OK to go back to the main menu and try the normal Dist mode or the Dist\nCDFS again." --title="$TITLETEXT"
Expand Down
2 changes: 1 addition & 1 deletion remastersys-gui/usr/lib/remastersys/libremastersysgui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# NOTE: attribute --fixed do not allows to use --width or --height
# actually it works, but not with --text weird...
declare -r DIALOG="$(which yad) --window-icon=/usr/share/icons/hicolor/16x16/apps/remastersys.png --center --always-print-result --dialog-sep --image=/usr/share/icons/hicolor/48x48/apps/remastersys.png"
declare -r DIALOG="$(which yad) --window-icon=/usr/share/icons/hicolor/16x16/apps/remastersys.png --center --borders=10 --always-print-result --dialog-sep --image=/usr/share/icons/hicolor/48x48/apps/remastersys.png"
# Cancel / Ok buttons are the default when --button is not provided
declare -r MSGBOX="--button=Ok:0"
declare -r MENU="--list --column=$Pick --column=$Info"
Expand Down
2 changes: 1 addition & 1 deletion remastersys/etc/remastersys/grub/grub.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# All labels that looks like "__LABEL__" are replaced by SED in
# /usr/bin/remastersys around lines 359-415.
# /usr/bin/remastersys around lines 345-400.
# Translations in /usr/share/locale/pt_BR/LC_MESSAGES/remastersys.po

set default="0"
Expand Down
2 changes: 1 addition & 1 deletion remastersys/etc/remastersys/isolinux/isolinux.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# All labels that looks like "__LABEL__" are replaced by SED in
# /usr/bin/remastersys around lines 359-415.
# /usr/bin/remastersys around lines 345-400.
# Translations in /usr/share/locale/pt_BR/LC_MESSAGES/remastersys.po

default /isolinux/vesamenu.c32
Expand Down
20 changes: 2 additions & 18 deletions remastersys/usr/bin/remastersys
Original file line number Diff line number Diff line change
Expand Up @@ -141,26 +141,13 @@ case $1 in

esac

# Used inside both cdfs() and iso(), around lines 550-570
SpecIso9660=$"The compressed file system is larger than the ISO 9660 specification for a single file allows. You should reduce the amount of files you are trying to backup and try again."

# Function log_msg extracted from PinguyBuilder v5.2 with a few changes.
# https://sourceforge.net/projects/pinguy-os/files/ISO_Builder/
# Added log_msg to reduce size. Code provided by Ivailo (a.k.a. SmiL3y)
log_msg() {
echo -e "$1" >> $WORKDIR/remastersys.log
}

CheckFileSystemSize(){
#checking the size of the compressed filesystem to ensure it meets the iso9660 spec for a single file"
SQUASHFSSIZE=$(ls -s $WORKDIR/ISOTMP/live/filesystem.squashfs | awk -F " " '{print $1}')
if [ "$SQUASHFSSIZE" -gt "3999999" ]; then
echo $SpecIso9660
log_msg $SpecIso9660
exit 1
fi
}

cdfs(){

# STEP 1 - Create the CD tree in $WORKDIR/ISOTMP
Expand Down Expand Up @@ -537,8 +524,6 @@ cdfs(){
log_msg "$stripe\nCommand-line options: $@\n$stripe"

sleep 1

CheckFileSystemSize # call function at line 180
}

iso(){
Expand All @@ -559,8 +544,6 @@ iso(){
exit 1
fi

CheckFileSystemSize # call function at line 180

#isolinux mode

sleep 1
Expand All @@ -576,7 +559,8 @@ iso(){
phrase1="$Creating $CUSTOMISO $In $WORKDIR $Using grub-mkrescue."
echo -e "$phrase1"
log_msg "$phrase1"
grub-mkrescue -o $WORKDIR/$CUSTOMISO $WORKDIR/ISOTMP/ 2>>$WORKDIR/remastersys.log 1>>$WORKDIR/remastersys.log
grub-mkrescue -iso-level 4 \
-o $WORKDIR/$CUSTOMISO $WORKDIR/ISOTMP/ 2>>$WORKDIR/remastersys.log 1>>$WORKDIR/remastersys.log
else
phrase2="$Creating $CUSTOMISO $In $WORKDIR $Using $CREATEISO."
echo -e "$phrase2"
Expand Down

0 comments on commit f189229

Please sign in to comment.