Refracta Development, Scripts, etc.
Post a reply

New versions of installer and snapshot (9.1.x) for sid

Fri Mar 28, 2014 3:01 pm

9.1.0 base and gui packages for refractainstaller and refractasnapshot
http://distro.ibiblio.org/refracta/files/Testing/

Refracta Snapshot changes:
* Added cpulimit to config for rsync and mksquashfs.
* Snapshot creates /e-t-c/sudoers.d/live for primary user, NOPASSWD
* Boot menu for live image is generated with variable for distro name.


refractainstaller-base (9.1.0) unstable; urgency=low

* (refractainstaller)
* updated tests for special characters in hostname (for jessie/sid)
* Changed the way sudo is handled:
* -remove sudoers.d/live
* -remove username from sudoers
* -add user to sudo group if sudo is desired
*
* (change-username)
* change-username does nothing with sudo.
* other options for sudo are in the installer script.
*
* (loc-timezn.sh)
* Fixed bug that checked all locales if no default set.
* Fixed duplicate run problem with dpkg-reconfigure.


refractainstaller-gui (9.1.0) unstable; urgency=low

* updated tests for special characters in hostname (for jessie/sid)
* Changed the way sudo is handled:
* -remove sudoers.d/live
* -remove username from sudoers
* -add user to sudo group if sudo is desired
* Added graphical entry for passwords and cryptsetup passphrase.
* Increased height of some zenity windows.
* If live-tools is not installed, use stock update-initramfs.
* Commented-out old lines for update-initramfs.[distrib|debian]

Re: New versions of installer and snapshot (9.1.0) for sid

Fri Mar 28, 2014 3:08 pm

Couple of notes off the top of my head...

You only get asked to change the user password if you are changing the user name.
If you enter blanks in the graphical password entry box, you get told that the passwords don't match. If you say "no" to trying again, the password won't be changed. True for both user and root.

The distro name used in the syslinux boot menu will use the lsb_release name if etc/issue does not contain the string, "Refracta". This name is used as the default entry-text in a dialog box. You can change it if you want, so you're not stuck with the menu saying Refracta when you actually used the snapshot tool on another distro. If you enter a blank, the menu will say "GNU/Linux <kernel-version>".

Re: New versions of installer and snapshot (9.1.0) for sid

Sun Mar 30, 2014 7:50 pm

Great news, thanks fsr. I just built a new iso with those included but out of time to test it just now.

Re: New versions of installer and snapshot (9.1.0) for sid

Mon Mar 31, 2014 1:45 am

It's looking good but.. set password isn't working for user and root. I installed twice to be sure. But this is sid after all..

Code:
Enter new UNIX password: Retype new UNIX password: passwd: Authentication token manipulation error
passwd: password unchanged
Enter new UNIX password: Retype new UNIX password: passwd: Authentication token manipulation error
passwd: password unchanged


There probably isn't much wrong and we already proved it can be done like this. I really am out of time to debug it right now.

Working (far as I know) example is in my last experimental sid ISO http://exegnulinux.net/refracta/iso/sna ... 140325.iso ..

I might even have posted those (experimental and scrappily coded ) installer debs somewhere.. they were a bit more radical because I reviewed again the gui password and sudo issue and was looking also at TDE Desktop R14 and initial translation support (wishlist for future official refractainstaller)

Writing from rather nice new live sid session .. "findiso" from hd with RW access, booted from grub-pc menu, working swap!

Re: New versions of installer and snapshot (9.1.0) for sid

Mon Mar 31, 2014 8:20 am

aaargh, posted to wrong thread.

I've now posted over here:
post3647.html#p3647
Last edited by thwak on Tue Apr 01, 2014 1:18 am, edited 1 time in total.

Re: New versions of installer and snapshot (9.1.0) for sid

Mon Mar 31, 2014 10:26 am

The passwords are set in lines 1545 & 1567

Code:
echo $newpass | chroot /target passwd

echo $newpass | chroot /target passwd "$newname"

I remember difficulty here setting passwords.. this is what eventually seemed to work:

Code:
chroot /target /bin/bash -c "echo -e \"$newpass\n$newpass\n\" | passwd $newusername"

chroot /target /bin/bash -c "echo -e \"$newpass\n$newpass\n\" | passwd root"

You have to echo the password a second time to confirm, using a newline (and get the vars to register in the chroot)

thwak.. I'm a bit confused.. viewtopic.php?f=16&t=347&start=130 is currently for refracta2usb !

Re: New versions of installer and snapshot (9.1.0) for sid

Mon Mar 31, 2014 5:39 pm

That's weird. The password entry works fine here. I did four or five installations with it, and I ran it in a test script first. I can change it. It won't be too long before I make new debs - the zenity-based installer is a little behind the yad version, as usual. It won't give you a second chance to enter user or root password if the entries don't match.

The code you wrote for handling sudo works, thanks. I think I'd like to refine it a bit, so that it tests the setup and gives an appropriate message. Right now, it says that the system uses sudo with no password, but that may not be true if someone is using the installer on a different distro.

I didn't test how it works in a system with no root account. I don't even remember if the installer works with ubuntu. Anyone tried it recently?

Re: New versions of installer and snapshot (9.1.0) for sid

Mon Mar 31, 2014 5:50 pm

@thwak:
I want to respond to your post, but I'm out of time, and yeah, we're in the wrong thread. You could repost it on the right thread, or I'll just quote your whole post and reply over there. It's in Experimental, I think it's the alternative usb part 2 thread. I'll post a link here when I reply.

Here's the reply:
alternative-usb-installation-method-part-2-t347-130.html#p3648

Re: New versions of installer and snapshot (9.1.0) for sid

Mon Mar 31, 2014 8:15 pm

It's a mystery why password change worked for you. Here there was no mismatch warning and it went like I said, twice over.

My most recent experimental debs (base and gui) are posted here: http://exegnulinux.net/refracta/experimental/installer/ I forget where I put things sometimes! The zenity or cli scripts were unchanged. Other stuff in there is probably outdated.

You probably haven't seen them. I think I later did more than the diff I posted here before.. might be worth unpacking them and taking a look. You might not like some of it but they work.. use/modify what you want or not. I was also aiming at switching to refractainstaller for my TDE builds (couldn't do it with only extra postinst scripts) and wanted to reinstall without reformat (fast, for test) so rsync options were changed ( --delete-before --delete-excluded )

Re: New versions of installer and snapshot (9.1.0) for sid

Thu Apr 10, 2014 2:49 pm

dzz, your way for changing password didn't work so well for me. If the two entries don't match, it doesn't give you a second chance to enter them. I entered the password once and hit the enter key. They get tested as different, but it doesn't offer a second chance to enter.

I ended up doing a combination of your code and mine, and it seems to work. The newlines are incorporated in the $newpass variable (as I did before) and then the chroot line is like yours otherwise.

Code:
newpass=$(echo "$entry" | sed 's/@_@/\n/g')
#newpass=$(echo $entry | awk -F"@_@" '{print $1}')
   if [[ -n "$newpass" ]] ; then
      #echo $newpass | chroot /target passwd "$newname"
      chroot /target /bin/bash -c "echo -e $newpass | passwd $newname"


And the other part I changed was the test. Changed single-brackets to double-brackets to get rid of a "unary operator expected" error.
Code:
if [ $(echo $entry | awk -F"@_@" '{print $1}') != $(echo $entry | awk -F"@_@" '{print $2}') ] ; then

if [[ $(echo $entry | awk -F"@_@" '{print $1}') != $(echo $entry | awk -F"@_@" '{print $2}') ]] ; then

I'm not sure which of those changes made the difference.

Also added the code for excluding lost+found, and that works. I put a test file in lost+found and told the installer not to format. Testfile was still there after the installation.
Post a reply