Author Topic: The 'remastered' mkremaster script: more options, and some error checking too!  (Read 25673 times)

Offline travisN000

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1758
NOTICE:  This has been backed down to an older version in the official repos.

NOTICE:  I've posted a new version for testing (attached at bottom of post); it should make it a little harder to make a bad remaster..  and it gives you even more options!.

Adding to mklivecd-0.7.1-28 package.



I just finished updating mkremaster, the zenity-based GUI for mklivecd, so that it has MANY MORE OPTIONS!  ;D

 Modified again by travisn000 on 2009-Jul-18
 --Added --help & --debug command line options
 --Revised file & directory exclusion options; added custom directory selection dialog
   that also verifies directories exist before adding them to exludes list
 --Added calculations to estimate needed temp space and iso size
 --Auto exclude user selected mklivecd temp directory from remaster; this prevents
   recursive expansion and associated errors.
 --Added sanity check for ramdisk; script will display warning message if detected
 --Added prompts for selecting default and secondary kernel if more than one installed
 --Added prompt for selecting default gfxboot theme from list of installed themes
 --Updated boot splash resolution choices to reflect updated mklivecd valid options

 Modified again by travisn000 on 2009-Feb-07
 --Option to generate a custom mkremaster script upon successful remaster
   Saves all selected options except iso and temp location; custom script will prompt for these
 --modified behavior of /etc/skel backup:
   the original /etc/skel is backed up to /etc/skel-original-bak
   subsequent backups are made to /etc/skel-previous-bak; if it already exists
   you are given option to overwrite it or leave previous /etc/skel-previous-bak

 Modified by travisn000 on 2008-06-17
 --option to create new user profile template (/etc/skel ) from an existing user home profile:
   previous /etc/skel is backed up to /etc/skel_old <see new modifications above>,
   the home directory of the selected user is copied to,
   /etc/skel, and then a root file manager session is opened so you can manually remove mail profiles, documents,
   etc., from the /etc/skel directory
 --always asks for the location of the working directory and .iso file
 --includes LVM partitions in the partion list prompt when asking for a working directory
 --added additional mklivecd option prompts for volumeid, publisher and preparer
 --added additional mklivecd option prompts for common files and directories to exclude
 --added other additional mklivecd options to the existing prompt


Here it is.. try it out and let me know what you think!

Code: [Select]
--See attachment: Exceeded maximum post length!

REQUIREMENTS:
(1) zenity must be installed (install from synaptic.. the script will prompt you and open synaptic if you don't)
(2) the script must be installed  :D
     -- as root, open konqueror, save the attached text file in /usr/sbin/ and name it something like
        mkremaster2
     -- make it executable by right clicking, selecting Properties, Permissions, check 'is executable',
        and click 'OK'
(3) a file manger.. the script will look for (in order) thunar, nautilus, dolphin, and konqueror to use as a file manager when using the advanced option to create a new default user profile in /etc/skel.  If you don't have one of these installed, you will be prompted to open one yourself at the appropriate time.


NOTE: Pressing cancel at the very first prompt will exit the program.  Pressing cancel at either of the last two prompts (for a temp directory/partition, and location to save the completed iso) will also exit the program without creating your remaster.  Pressing cancel on any of the other prompts will only cancel adding the options listed in those prompts.
.

[attachment deleted by admin]
« Last Edit: October 04, 2009, 02:21:08 PM by travisn000 »

Offline davey

  • Hero Member
  • *****
  • Posts: 919
Re: My (updated) mkremaster script
« Reply #1 on: June 16, 2008, 11:04:17 AM »
Travis, looks like a giant leap forward, and a big effort. I'll be trying it soon on the brand-new PCLOS I just put on my sister's laptop. Thanks.

Just one question: Zenity is a Gnome app -- will the script work equally well on either DE?

Offline catlord17

  • Hero Member
  • *****
  • Posts: 784
Re: My (updated) mkremaster script
« Reply #2 on: June 16, 2008, 01:01:42 PM »
Looks really nice!  Thank you for the effort and time you've put into this.  I am going to try it out as soon as possible.  Hopefully it will fix the challenges I was having with remastering.  :)

Offline Padma

  • Hero Member
  • *****
  • Posts: 1099
  • The Outbond
    • Civilization Fanatics Center
Re: My (updated) mkremaster script
« Reply #3 on: June 16, 2008, 01:14:54 PM »
I'm going to try this once I get a chance, too.  Good job! ;D
1st Lieutenant, USAFR (Retired)
Co-Administrator: Civilization Fanatics Center

Ramblings of a Professional Computer Geek


Offline travisN000

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1758
Re: My (updated) mkremaster script
« Reply #4 on: June 16, 2008, 01:58:59 PM »
Just one question: Zenity is a Gnome app -- will the script work equally well on either DE?

Zenity works just fine when installed from the repo's (as will most Gnome apps) because any required gnome libraries are installed by synaptic automagically.



...Again, please continue to post any feedback; I want to submit my changes to the original author once I get sufficient positive feedback.

EDIT:  Original author says he is no longer maintaining this.. apparently he is a mandriva user, and it has changed so that mklivecd doesn't work!?  ..maybe they are having the same initrd / squash problems that plague some of us here at PCLOS.
« Last Edit: August 20, 2008, 06:37:10 PM by travisn000 »

Sy Ali

  • Guest
Re: My 'remastered' mkremaster script
« Reply #5 on: August 19, 2008, 07:36:27 PM »
Just a quick note that I'll be checking out your work soonish.  I'm roughing out some of my own remaster, and it would be nice to participate in the testing of scripts like this to help make the remasterer's life easier.  =)

henrik

  • Guest
Re: My 'remastered' mkremaster script
« Reply #6 on: August 19, 2008, 10:23:33 PM »
Hi,
I really like the idea, but for me it just stops after opening a terminal window with the title "Creating your personal remaster.."

Here's the output from the original terminal
I have tried with and without advanced options. Any idea what I'm doing wrong? I'm convinced it's me and not the script...

thanks
Henrik

:+ TITLE='PCLOSLive remaster-on-the-fly'
+ '[' -f /usr/bin/kdialog ']'
+ DIALOG=kdialog
+ '[' 0 '!=' 0 ']'
+ '[' '!' -e /usr/bin/zenity ']'
+ '[' -d /union ']'
+ echo 'Running in installed mode...'
Running in installed mode...
+ ROOT=/
+ zenity --title 'PCLOSLive remaster-on-the-fly' --question --text 'You'\''re about to create a
remaster livecd/harddrive.\n
* A compressed image of the running system will be created on a chosen
partition.\n
* Requirements: min. 2 GB free space on the chosen partition.\n
* A Windows FAT filesystem can'\''t be used.'
/root/.gtkrc-2.0:56: Clearlooks configuration option "menuitemstyle" is not supported and will be ignored.
/root/.gtkrc-2.0:57: Clearlooks configuration option "listviewitemstyle" is not supported and will be ignored.
/root/.gtkrc-2.0:58: Clearlooks configuration option "progressbarstyle" is not supported and will be ignored.
/usr/share/themes/Clearlooks/gtk-2.0/gtkrc:42: Invalid symbolic color 'fg_color'
/usr/share/themes/Clearlooks/gtk-2.0/gtkrc:42: error: invalid identifier `fg_color', expected valid identifier
+ '[' 0 == 1 ']'
+ kdialog --title PCLOSLive remaster-on-the-fly --yesno 'Would you like to provide some advanced
options?'
kbuildsycoca running...
+ '[' 1 == 0 ']'
+ '[' / == / ']'
++ df -h --exclude-type=vfat --exclude-type=ntfs
++ grep
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
++ 'hd\|sd\|map'
/usr/sbin/mkremaster2: line 216: hd\|sd\|map: command not found
++ zenity --list '--title=PCLOSLive remaster-on-the-fly' '--text=Select a
partition for the temporary files.' --width=450 --height=200
/root/.gtkrc-2.0:56: Clearlooks configuration option "menuitemstyle" is not supported and will be ignored.
/root/.gtkrc-2.0:57: Clearlooks configuration option "listviewitemstyle" is not supported and will be ignored.
/root/.gtkrc-2.0:58: Clearlooks configuration option "progressbarstyle" is not supported and will be ignored.
/usr/share/themes/Clearlooks/gtk-2.0/gtkrc:42: Invalid symbolic color 'fg_color'
/usr/share/themes/Clearlooks/gtk-2.0/gtkrc:42: error: invalid identifier `fg_color', expected valid identifier
No column titles specified for List dialog.
++ --column=Partition
/usr/sbin/mkremaster2: line 218: --column=Partition: command not found
+ TMPDEV=
+ '[' 127 == 1 ']'
++ echo ''
++ cut -d% -f2
++ sed -e 's/^[ \t]*//'
+ TMPPART=
+ '[' -d /tmp ']'
+ TMPDIR=/tmp
++ echo '/tmpmklivecd.*'
+ testmklivecd='/tmpmklivecd.*'
+ rm -rf '/tmpmklivecd.*'
++ zenity '--title=PCLOSLive remaster-on-the-fly' --file-selection --save
/root/.gtkrc-2.0:56: Clearlooks configuration option "menuitemstyle" is not supported and will be ignored.
/root/.gtkrc-2.0:57: Clearlooks configuration option "listviewitemstyle" is not supported and will be ignored.
/root/.gtkrc-2.0:58: Clearlooks configuration option "progressbarstyle" is not supported and will be ignored.
/usr/share/themes/Clearlooks/gtk-2.0/gtkrc:42: Invalid symbolic color 'fg_color'
/usr/share/themes/Clearlooks/gtk-2.0/gtkrc:42: error: invalid identifier `fg_color', expected valid identifier
++ --filename=/remaster.iso
/usr/sbin/mkremaster2: line 277: --filename=/remaster.iso: No such file or directory
+ ISOFILE=/root/test.iso
+ '[' 127 == 1 ']'
+ '[' -e /initrd/loopfs/etc/rc.d/init.d/halt ']'
+ echo 'Running mklivecd to create the remaster...'
Running mklivecd to create the remaster...
+ '[' -e /usr/bin/konsole ']'
+ konsole -T 'Creating your personal remaster...' --nomenubar
kbuildsycoca running...
ICE default IO error handler doing an exit(), pid = 6261, errno = 0

Offline travisN000

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1758
Re: My 'remastered' mkremaster script
« Reply #7 on: August 19, 2008, 11:51:18 PM »
..I've had reports of it working as recently as just a couple of days ago; I havn't changed anything, so It should still be working..


I do see a few errors in the output you posted..  the first occurs when the script is trying to read the filesystem to come up with a list of non FAT/NTFS partitions to use for a selection list for the temporary files location.  Why it does not work on your system and it does on others, I don't know. 

I am not near my PCLOS box to test it at the moment, but if you would like to test, try to copy and paste the following into Konsole and post your results:

Code: [Select]
df -h --exclude-type=vfat --exclude-type=ntfs | grep "hd\|sd\|map"
« Last Edit: August 20, 2008, 01:10:19 AM by travisn000 »

Offline travisN000

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1758
Re: My 'remastered' mkremaster script
« Reply #8 on: August 20, 2008, 01:10:42 AM »

..the above syntax seems to work for me.  After a little closer review of your post, it looks like your problem might be coming from alot of extra line breaks in the middle of commands ..you have multiple errors from commands missing arguments, which are immediately followed by the missing arguments trying to be executed as commands and causing more errors. 

My theory is further supported by the line numbers.. one of your errors is reported to be on line 277, but there are only 263 lines of code total (that line of code should be line number 208 if line breaks are where they should be). 

Try opening /usr/sbin/mkremaster2 in kwrite (as root):
Code: [Select]
kwrite /usr/sbin/mkremaster2
..and then delete all of its contents, and replace them with a new copy of the script.

Before you save and close, press F11 in Kwrite to toggle line numbering on; double check your line count.  You should have between 262 and 264 lines total (depending on if you copy the blank line at the beginning and end).  If your count is much higher, send me a PM with your email, and I will email you a copy of the script without the extra linebreaks in the middle of the commands.

CO

  • Guest
Re: My 'remastered' mkremaster script
« Reply #9 on: August 20, 2008, 02:50:49 AM »
A suggestion if I may ......... there are quite a number of places where the user is asked a question with the option to press OK or Cancel.
Pressing Cancel just moves the script on to the next page.
There seems to be no method to exit the script at those points. Pressing the 'X' on the page seems to be the same as Cancel.
Maybe a check for the user input and an option to either go back or exit would be beneficial, if possible.

I have not used it, just run it through part way.
« Last Edit: August 20, 2008, 02:52:43 AM by CO »

Offline Ambertone

  • Hero Member
  • *****
  • Posts: 619
  • Australia
Re: My 'remastered' mkremaster script
« Reply #10 on: August 20, 2008, 05:22:52 AM »
What a great piece of work! Having made remasters and manually updated /etc/skel I know that to be a pain. This is way to cool :-)

Rod
The ultimate oxymoron --- "Microsoft Works"

Offline fraxinus

  • Hero Member
  • *****
  • Posts: 518
Re: My 'remastered' mkremaster script
« Reply #11 on: August 20, 2008, 05:31:51 AM »
Thank you for sharing this, Travis. I will not have time to try this out for a few days yet, but it looks as if you have rendered a significant service to our community - especially given that remasterme ought to be one of PCLOS's main selling points for new users.

Offline travisN000

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1758
Re: My 'remastered' mkremaster script
« Reply #12 on: August 20, 2008, 10:29:05 AM »
A suggestion if I may ......... there are quite a number of places where the user is asked a question with the option to press OK or Cancel.
Pressing Cancel just moves the script on to the next page.
There seems to be no method to exit the script at those points. Pressing the 'X' on the page seems to be the same as Cancel.
Maybe a check for the user input and an option to either go back or exit would be beneficial, if possible.

I have not used it, just run it through part way.

..there are a few places where pressing cancel will exit the script, but in other places pressing cancel just cancels adding to the the mkliveCD options.  If it helps, I will take a quick look through the code and add a list of prompt to the documentation where you can exit the script using cancel.

EDIT:
Here you go!

Quote
Pressing cancel at the very first prompt will exit the program.  Pressing cancel at either of the last two prompts (for a temp directory/partition, and location to save the completed iso) will also exit the program without creating your remaster.
  ;D
« Last Edit: August 20, 2008, 10:43:22 AM by travisn000 »

CO

  • Guest
Re: My 'remastered' mkremaster script
« Reply #13 on: August 20, 2008, 10:30:53 AM »
A suggestion if I may ......... there are quite a number of places where the user is asked a question with the option to press OK or Cancel.
Pressing Cancel just moves the script on to the next page.
There seems to be no method to exit the script at those points. Pressing the 'X' on the page seems to be the same as Cancel.
Maybe a check for the user input and an option to either go back or exit would be beneficial, if possible.

I have not used it, just run it through part way.

..there are a few places where pressing cancel will exit the script, but in other places pressing cancel just cancels adding to the the mkliveCD options.  If it helps, I will take a quick look through the code and add a list of prompt to the documentation where you can exit the script using cancel.

No need for that   ;)
Just thought that the app should abort when the X is pressed. Instead it goes on as if the Cancel is pressed.

Offline travisN000

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1758
Re: My 'remastered' mkremaster script
« Reply #14 on: August 20, 2008, 10:53:11 AM »
No need for that   ;)
Just thought that the app should abort when the X is pressed. Instead it goes on as if the Cancel is pressed.

..I beat you to it; I already added a note to the bottom of the first post  ;D

...
the X in the corner of the zenity window always does the same as the as the cancel button (returns a false or zero value to the command that called it), it is not possible to code the x to do something different from the cancel button for a given prompt  :( 

Thank you for the feedback though, it is appreciated.

« Last Edit: August 20, 2008, 06:50:41 PM by travisn000 »