Ask your questions here.
Post a reply
DJNightchild

- DJNightchild
- Posts: 5
- Joined: Fri Sep 18, 2015 10:59 pm

## [SOLVED] Two problems I encounterd

Fri Sep 18, 2015 11:08 pm

I noticed that when I create a livecd with refractasnapshot, refractasnapshot is copied over.
The same is for refractainstaller when installing the live-cd. How can I prevent this.
The second problem I encounterd is that refracta installer automatically creates a swapfile on install without even asking, while I have a swap partition. This seems to me like a bug.
Could you help me with this? Thanks in advance.
Extra info:
OS: Debian 8 (jessie)
Software used: refractasnapshot-base_9.1.6-2_all.deb & refractasnapshot-gui_9.1.6_all.deb
Last edited by DJNightchild on Wed Sep 23, 2015 1:27 pm, edited 1 time in total.
fsmithred

- fsmithred
- Posts: 2101
- Joined: Wed Mar 09, 2011 9:13 pm

## Re: Two problems I encounterd

Sat Sep 19, 2015 3:26 am

Refractasnapshot copies your system the way it is. That includes installed software and configurations. I'm not sure if you can do it cleanly. If you added the following lines to the excludes file, refractasnapshot will not be able to run, but the package manager might still think it's there. I'm not sure what problems it might cause, if any.

Code:
  `- /usr/bin/refractasnapshot*
  - /usr/lib/refractasnapshot
  - (/)etc/refractasnapshot.conf # without the parentheses
  - /usr/share/applications/refractasnapshot.desktop`

Damned forum bug won't let us type "/ e t c" correctly.
I don't muck around in the bowels of apt to know which files you'd need to edit to change the package status to 'not installed' but I'm sure there's a way to do it.
If you don't want refractainstaller in the installation, just uninstall it after you've installed the system and rebooted into it.
Use expert install, and check the box for 'use existing swap partition' to avoid the swapfile. (Note: it's also possible to change the size of the swapfile by editing the config file.)
thwak

- thwak
- Posts: 174
- Joined: Tue Nov 20, 2012 3:58 am

## Re: Two problems I encounterd

Sat Sep 19, 2015 6:13 am

> which files you'd need to edit to change the package status to 'not installed'

at a command prompt:
echo refractasnapshot hold | sudo dpkg --set-selections
then, if you're inclined to verify status change, search inside /var/lib/dpkg/status ("status" is a plaintext file) for "refractasnapshot.
What you'll see is:
Status: hold ok installed
I really wouldn't (don't) hand-edit the status file, and seldom **** with putting a "hold" on a given package. Pinning yes, hold no.
Instead, I refer to the installed files manifest, thwak most or all of 'em... and dpkg can just go on believing the package is installed.
Nightchild, I agree that it "seems like a bug" when the installer creates a redundant swap partition.
Seems?
IS !
Every time the installer has caught me offguard... it's created the extra swap partition on the same physical disk containing the existing swap. Senseless.

> The same is for refractainstaller when installing the live-cd. How can I prevent this.

The script pauses, inviting you to make changes (edit excludes_list, etc) Yes?
At that point, you can edit / weed out files from work_dir then resume the snapshot script.
DJNightchild

- DJNightchild
- Posts: 5
- Joined: Fri Sep 18, 2015 10:59 pm

## Re: Two problems I encounterd

Sat Sep 19, 2015 12:06 pm

Thanks for you help guys, I will try it out soon.

> The script pauses, inviting you to make changes (edit excludes_list, etc) Yes?
> At that point, you can edit / weed out files from work_dir then resume the snapshot script.

Is there a way to automate this thwak? I'd like to make this as user-friendly as possible so I can distribute this to friends who have lesser Linux experiences.
EDIT: To clarify myself, something like a bash/sh script that does this? I tried the post-install script, but this deletes files from the live-session, not the installed system.
fsmithred

- fsmithred
- Posts: 2101
- Joined: Wed Mar 09, 2011 9:13 pm

## Re: Two problems I encounterd

Sat Sep 19, 2015 12:22 pm

Editing the excludes file can be done ahead of time. (/usr/lib/refractasnapshot/snapshot_excludes.list)
Removing files from the work dir can be done once manually, and if you show me the commands you used, I can probably show you where to put them in the script. (The programs are just bash scripts, so it's easy to change them - no compiling necessary.) You must set edit_boot_menu="yes" in etc/refractasnapshot.conf to get the script to pause. It will resume when you close the editor window that opens.
@thwak - Thanks for the info!
And you got me thinking about making 'use existing swap' the default setting in expert install. If I do that, I think I'll have to add some test to make sure that there really is an existing swap. Oh... boxed checked by default if swap exists. I should be able to do that. That would work with simple install, too.
DJNightchild

- DJNightchild
- Posts: 5
- Joined: Fri Sep 18, 2015 10:59 pm

## Re: Two problems I encounterd

Sat Sep 19, 2015 12:43 pm

> fsmithred wrote:Editing the excludes file can be done ahead of time. (/usr/lib/refractasnapshot/snapshot_excludes.list)
> Removing files from the work dir can be done once manually, and if you show me the commands you used, I can probably show you where to put them in the script. (The programs are just bash scripts, so it's easy to change them - no compiling necessary.) You must set edit_boot_menu="yes" in etc/refractasnapshot.conf to get the script to pause. It will resume when you close the editor window that opens.
> @thwak - Thanks for the info!
> And you got me thinking about making 'use existing swap' the default setting in expert install. If I do that, I think I'll have to add some test to make sure that there really is an existing swap. Oh... boxed checked by default if swap exists. I should be able to do that. That would work with simple install, too.

@fsmithred the commands:

Code:
  `rm (/)etc/modules && mv (/)etc/.modules (/)etc/modules #I'm using virtualbox to build the live-cd. live-cd doesn't need them.
  rm (/)etc/sudoers && mv (/)etc/.sudoers (/)etc/sudoers #live user has no password. so needed to restore the original.
  apt-get purge refracta* -y && apt-get autoremove -y # i don't want the end-user to have Refracta installed. (I even considerd to use "rm -rf /*/refracta*)
  `

fsmithred

- fsmithred
- Posts: 2101
- Joined: Wed Mar 09, 2011 9:13 pm

## Re: Two problems I encounterd

Sat Sep 19, 2015 1:27 pm

Prepend the paths with "$work_dir"/myfs

Code:
  `rm "$work_dir"/myfs(/)etc/modules && mv "$work_dir"/myfs(/)etc/.modules "$work_dir"/myfs(/)etc/modules #I'm using virtualbox to build the live-cd. live-cd doesn't need them.
  rm "$work_dir"/myfs(/)etc/sudoers && mv "$work_dir"/myfs(/)etc/.sudoers (/)etc/sudoers #live user has no password. so needed to restore the original.`

If you do this, you're removing the program while you're running it. It might still work, since it's already in memory, but it sounds like a bad idea.

Code:
  `apt-get purge refracta* -y`

This would remove packages that got automatically installed with the refracta tools, such as xorriso or squashfs-tools, which are needed to complete the snapshot.

Code:
  `apt-get autoremove -y # i don't want the end-user to have Refracta installed. (I even considerd to use "rm -rf /*/refracta*)
  `

And neither of those two commands above would remove anything from the work dir, which contains the filesystem that goes into the live iso.
Safer course is to remove the important files from the work dir.

Code:
  `rm "$work_dir"/myfs/usr/bin/refractasnapshot* "$work_dir"/myfs/usr/share/applications/refractasnapshot.desktop
  rm -r "$work_dir"/myfs/usr/lib/refractasnapshot`

Put those lines between these two sections (Pause to edit and Squash the filesystem.) In refractasnapshot-gui, that's around line 720, and in refractasnapshot around line 600. Line numbers might be off a bit, depending on which version you're using, and the code in the cli version looks different, but the comments are the same.

Code:
  `# Pause to edit the boot menu or anything else in $work_dir
  if [[ $edit_boot_menu = "yes" ]]; then
  $DIALOG --$QUESTION --title="Edit Boot Menu" --${BUTTON0}="Yes"${BUTTON0NUM} --${BUTTON1}="No"${BUTTON1NUM} \
  --text="The program will now pause to allow you to edit any files in the work directory.
  Select Yes to review or edit the boot menu or select No
  to bypass this step and continue creating the snapshot. "
  if [[ $? = 0 ]] ; then
  "$gui_editor" "${editor_option}" "$work_dir"/iso/isolinux/"$boot_menu"
  fi
  fi
  # PUT YOUR CODE HERE
  # Squash the filesystem copy
  if [[ $limit_cpu = "yes" ]] ; then`

And I hope I didn't give you any typos. Still drinking my second cup of coffee and not full awake. Remove the parens near etc.
fsmithred

- fsmithred
- Posts: 2101
- Joined: Wed Mar 09, 2011 9:13 pm

## Re: Two problems I encounterd

Sat Sep 19, 2015 1:30 pm

Oh yeah...
After you add those lines, you can set edit_boot_menu="no" so the script won't pause and will finish the job unattended.
DJNightchild

- DJNightchild
- Posts: 5
- Joined: Fri Sep 18, 2015 10:59 pm

## Re: Two problems I encounterd

Sat Sep 19, 2015 1:49 pm

@fsmithred
Wow this was excactly what I was hoping for. Btw I was thinking, is it possible to disable the creating of a swap file, let the system -using this kind of script in the refractainstaller.conf- check if there is a swap partition, and if not: create a swap file.
Mindmap:

Code:
  `If /dev/sdx fs= swap
  then
  places /path/to/swappartition in fstab
  else
  create swapfile
  places /path/to/swapfile in fstab
  fi
  `

fsmithred

- fsmithred
- Posts: 2101
- Joined: Wed Mar 09, 2011 9:13 pm

## Re: Two problems I encounterd

Sat Sep 19, 2015 5:14 pm

Right now, it's manual. If you choose to use the existing swap partition, it won't make a swapfile. I believe I can automate that, such that if you have a swap partition, the box for it will be checked in expert install, and in simple install, it will just use the swap partition.
Post a reply
Jump to:

Powered by phpBB © phpBB Group.

phpBB Mobile / SEO by Artodia.