Refracta Development, Scripts, etc.
Post a reply

Re: Refracta Installer on Debian Distro - Makululinux

Sat Nov 16, 2013 9:28 pm

i managed to make it all work in the end, the refracta installer, not the debian, ill still mess around with debian installer. The issues i was having seemed to be related to root rights, for some reason snapshot was not keeping the live user in the sudo list. i managed to bypass this by changing launch command for installer to this : "sudo refractainstaller-gui" and ticking "run in terminal" , which is actually better since i can now monitor the whole installation progress via terminal. i need to now test if the installer icon gets properly removed from desktop after installation.

Could i ask why you did not add the option to change country/timezone in the refractainstaller advanced mode ?

With Remastersys becoming obsolete you will find more and more debian based distro's making use of refracta, and timezone/country langauge options would be handy, infact it may be a good idea to make a seperate build for debian users ? could make some nice cash on the side.... hell, id pay for descent tools to build my distro ... if you dont want to sell atleast put up a donation box, id gladly donate to the project :)

Re: Refracta Installer on Debian Distro - Makululinux

Sun Nov 17, 2013 9:08 pm

There's a place in the installation where you're asked to edit etc/sudoers, and then you're asked whether you commented out the line for user or switched "user" for a new name. I leave it up to the user to decide what to do, and if I were to force a default action, it would be to disable full admin privs for the user, especially since they're set with no password. Loose security like that may be appropriate for a live-CD, but not for a real installation.

You can set language at the login screen and keyboard on the panel. Oh right, you're not running Refracta. Uh, if there's a language selector on your graphical login screen, you could use that. Oh hell, it's debian-based, right?
As root, before you do the installation:
Code:
dpkg-reconfigure locales
dpkg-reconfigure keyboard-configuration
dpkg-reconfigure tzdata

The point is, get it working the way you want, and then install. Your changes will be copied.

I did have some separate scripts for this, but they stopped working, and I never tried to fix it. I just install gnome-system-tools and use that.

Re: Refracta Installer on Debian Distro - Makululinux

Sun Nov 17, 2013 10:30 pm

i meant for other users, for myself i can pre configure everything then build. but i make distrobution for thousands of users, in the past i used the remastersys installer which asked the user all the relevant questions and set the options, but remastersys is soon to be dead, the developer handed project to someone else and he isnt interested in keeping it updated with debian, its only a matter of time before it wont work anymore, so i started looking for an alternative and that is how i found you :)

your snapshot and installer is great, in many ways far better than remastersys, it has more options, supports encryption and it certainly has a better compression ratio, but on the installer itself it doesnt allow user to set timezone, which isnt hard to change afterwards, but to new linux users it can be a pain...

manual method to change timezone would be :

sudo dpkg-reconfigure tzdata


Could that not be added into the installer options ?

Re: Refracta Installer on Debian Distro - Makululinux

Mon Nov 18, 2013 2:44 pm

Not so difficult. Before "cleanup", in the installer script, this should work:

Code:
xterm -title 'Please set timezone for the new installation..' -e "chroot /target dpkg-reconfigure tzdata"

xterm -title "Please set locales for the new installation.." -e "chroot /target dpkg-reconfigure locales"


Possible future solution, to avoid a user needing to "hack" the main installer script for (any) special requirements:

One extra line in the installer to run a user-editable post-install subscript. A "dummy" script, with a few commented examples, could be included in /usr/lib/refractainstaller (which the user would be responsible to edit properly) This might help make refractainstaller more versatile and adaptable in some cases (similar to how live-config deals with custom extras) with minimal overhead on development and maintainence.
Last edited by dzz on Mon Nov 18, 2013 2:57 pm, edited 1 time in total.

Re: Refracta Installer on Debian Distro - Makululinux

Mon Nov 18, 2013 2:54 pm

I like that idea, dzz. I was actually thinking of doing something like that at the other end, and calling either dpkg-reconfigure or gkdebconf from the wrapper script that decides if it should run the yad or zenity version of the installer. Maybe have a dummy pre-install and post-install script, and they can be turned on or off in the main config file.

Re: Refracta Installer on Debian Distro - Makululinux

Mon Nov 18, 2013 3:18 pm

Just an option to edit is needed (maybe triggered by the conf file). If only commented example lines existed they would do nothing:

Code:
!#/bin/bash

## Commands added here will execute automatically after installation

## Typical examples:

#  xterm -title 'Please set default timezone..' -e 'chroot /target dpkg-reconfigure tzdata'
#  xterm -title "Please set locales for the new installation.." -e "chroot /target dpkg-reconfigure locales"
#  rm -f /target/home/*/Desktop/whatever

## Add custom post-install commands below (at user's risk only):

Re: Refracta Installer on Debian Distro - Makululinux

Mon Nov 18, 2013 6:06 pm

That works. I now have a French refracta-sid installation, on Paris time.

I'll add something like that in the next release of the installer. I'll probably use x-terminal-emulater instead of xterm.

Oh wait... these are prettier:
Code:
As root:
dpkg-reconfigure -fgnome locales
dpkg-reconfigure -fgnome tzdata

As user:
/usr/bin/gksu -u root '/usr/sbin/dpkg-reconfigure -fgnome locales'
/usr/bin/gksu -u root '/usr/sbin/dpkg-reconfigure -fgnome tzdata'

Re: Refracta Installer on Debian Distro - Makululinux

Mon Nov 18, 2013 8:41 pm

or..
Code:
dpkg-reconfigure --frontend=gnome tzdata
dpkg-reconfigure --frontend=kde tzdata

but that (or -fgnome) would fail in case of missing gtk/qt/perl deps (defaults then automatically to "dialog") unless launched from a terminal. Should work for preinstall, maybe not in a postinstall chroot

Re: Refracta Installer on Debian Distro - Makululinux

Tue Nov 19, 2013 11:01 am

ive been trying to remove the desktop installer icon after installation, but without success. i have added this :

- /home/*/Desktop/refractainstaller.desktop


to the excludes list (in usr/lib/refractainstaller/installer_exclude.list ), but after installation the desktop icon is still there. then i tried to add it to :

/usr/bin/refractainstaller-yad


and

/usr/bin/refractainstaller


yet still after all that the icon is still on the desktop after installation :(

Am i doing it wrong or is there anything else i can try ?

Re: Refracta Installer on Debian Distro - Makululinux

Tue Nov 19, 2013 3:31 pm

This goes in refractainstaller-yad, refractainstaller-gui and refractainstaller, at the end, before cleanup and before the error log is copied to the installation. Any executable scripts in /usr/lib/refractainstaller/post-install/ will run if the config is set to "yes".
Code:
# Run any post-install scripts
if [[ $run_postinstall = "yes" ]] ; then
   for file in /usr/lib/refractainstaller/post-install/* ; do
      if [[ -x "$file" ]] ; then
         bash "$file"
      fi
   done
fi



In etc/refractainstaller.conf:
Code:
run_postinstall = "yes"
(I'll add some explanatory text to that.)


Put this script in /usr/lib/refractainstaller/post-install/, and make it executable. The gnome frontend will run if it's available, otherwise, it'll run in the terminal. If you're running the cli installer, then dpkg-reconfigure will run in the console, or maybe will use the gnome frontend if you're running the cli installer inside a terminal on your graphical desktop. Not sure about that.
Code:
#!/usr/bin/env bash
# loc-timezn.sh


if  [[ $DISPLAY ]] ; then
   chroot /target dpkg-reconfigure -fgnome tzdata || chroot /target dpkg-reconfigure tzdata
   chroot /target dpkg-reconfigure -fgnome locales || chroot /target dpkg-reconfigure locales
#   chroot /target dpkg-reconfigure -fgnome tzdata || chroot /target dpkg-reconfigure keyboard-configuration
else
   echo -e "\n\tSet time zone and locales.\n"
   sleep 2
   chroot /target dpkg-reconfigure tzdata
   chroot /target dpkg-reconfigure locales
#   chroot /target dpkg-reconfigure keyboard-configuration
fi

exit 0


I'll roll this into a deb soon.
Post a reply