Refracta Development, Scripts, etc.
Post a reply

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

Mon May 26, 2014 4:55 pm

Yeah, I noticed. I don't know how to edit the control file to say that it depends on syslinux 4.5 or syslinux 6.03 and isolinux 6.03, so for now, only syslinux will be listed in the deps, and if you don't also install the isolinux package, you'll get an error message.

OK, now I know how. It goes something like this. (I don't know what works between version 4.5 and version 6.03, so there's a blank spot in the logic here.)
Code:
Depends: syslinux (<=4.5) | syslinux (>= 6.03), syslinux (<=4.5) | isolinux (>=6.03), blah...


http://debian-handbook.info/browse/stab ... ation.html
In a list of conditions to be met, the comma serves as a separator. It must be interpreted as a logical “and”. In conditions, the vertical bar (“|”) expresses a logical “or” (it is an inclusive “or”, not an exclusive “either/or”). Carrying greater priority than “and”, it can be used as many times as necessary. Thus, the dependency “(A or B) and C” is written A | B, C. In contrast, the expression “A or (B and C)” should be written as “(A or B) and (A or C)”, since the Depends field does not tolerate parentheses that change the order of priorities between the logical operators “or” and “and”. It would thus be written A | B, A | C.

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

Mon May 26, 2014 8:59 pm

I think I have the deps sorted out (as described above) and can use either 6.00 or 6.03 as the cutoff point between versions. Should work with wheezy or sid. (Right now, jessie is still using the same version as wheezy, but that will probably change.)

Is there anything else major that needs to be changed before I make new debs?
- review the changes in the boot help files, let me know if something needs to be added, removed or changed.
- I'm adding some tests in various places to eliminate some of the non-fatal error messages that come up. (e.g. when it tries to remove files that aren't there or kill a non-existent pid)
- Entry box for distro name is moved up to before rsync and updatedb, so you can let the script run through to the end instead of waiting for it to copy the system.

Also fixed the initial text for 'read -i' in set_distro_name in the cli script. Needed to stop redirecting stderr to the logfile for the read command.

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

Tue May 27, 2014 12:11 am

http://distro.ibiblio.org/refracta/file ... .2_all.deb
http://distro.ibiblio.org/refracta/file ... .2_all.deb

Code:
refractasnapshot-base (9.1.2) unstable; urgency=low

  * Replaced genisoimage and isohybrid commands with xorriso
  * Added support for syslinux and isolinux version 6.x
  * Moved entry for distribution name to beginning of program.
  * Added tests for cpulimit and rm to reduce error messages.
  * -n, -d and -c command-line options can be used together.
  * Fixed initial text in 'read' command in set_distro_name.


refractasnapshot-gui (9.1.2) unstable; urgency=low

  * Replaced genisoimage and isohybrid commands with xorriso
  * Added support for syslinux and isolinux version 6.x
  * Moved entry window for distribution name to beginning of program.
  * Added tests for cpulimit and rm to reduce error messages.
  * -d and -c command-line options can be used together.

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

Tue May 27, 2014 12:19 am

Too late, you posted them as I write! Maybe for next time then.

There isn't so much to do for the help menus. References to Refracta 7 and Wheezy could maybe change to more generic terms. Here's a suggested rewrite of f5.txt (some formatting might not display right):

0fRefracta!07 07

You can specify the default language at the boot prompt below in combination
with the boot method (see <09F307>) and any other options (see <09F407>).
Examples:
Use default boot method (live); set locale and keyboard layout for Germany:
0fboot: components=locales,keyboard-configuration locales=de_DE.UTF-8 keyboard-layouts=de07
Do same with refracta-lang (experimental, this will also automatically set the keyboard):
0fboot: components=refracta-lang lang=de_DE 07

Or, at the boot menu screen, press TAB and append the boot line with the
locale options. (e.g. 0fcomponents=locales locales=de_DE.UTF-807 or
0fcomponents=locales,keyboard-configuration locales=de_DE.UTF-8 keyboard-layouts=de07)

Some common locales:
France fr_FR.UTF-8
Spain es_ES.UTF-8
Russia ru_RU.UTF-8

The system clock will default to UTC. To set a local timezone (example):
0fcomponents=refracta-lang,tzdata lang=de_DE timezone=Europe/Berlin07

Note: "components=" is a live config setting. Scripts to invoke must be comma-separated
with no spaces, e.g. "components=script1,script2,script3"
If no live config scripts are wanted "nocomponents" must replace "components="

You may:
- press F1 to return to the help index
- type 0fmenu07 and press ENTER to go back to the boot screen
- press ENTER to boot


Other than that, a few "wishlist" options. Like rsync without format for installer and others mentioned before (if anyone except me wants them). Any other clean ways to customize without script-hacking. Support for TDE R14.

I suggest letting live-config sort sudo (I'm still getting shutdown problems without sudo)

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

Tue May 27, 2014 1:52 am

I can't test till a spare partition with a clean install is sorted. Virtualbox is too slow. Some immediate observations:

live.cfg will be a problem because some menu entries (including the default one!) don't have either "components=" or "nocomponents"

Without sudo I can't shutdown or reboot from xfce logout box in sid, reason unknown so far.

Compatibility issue: "components" needs to be "config" for wheezy live-config (version test?)

Need to check if "-partition_offset 16" belongs (only) with $isohybrid_opt

Compatibility issue: "isohdpfx.bin" (for isohybrid) is in /usr/lib/syslinux/mbr/ in sid but /usr/lib/syslinux/ in wheezy. Suggestion:

Code:
isohybrid_bin_file="$(find /usr/lib/syslinux -name isohdpfx.bin)"

It would be best if latest snapshot/installer is good for all current suites (and other distros, if reasonably possible).

Good to see "quiet" removed from the menu!

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

Tue May 27, 2014 10:47 am

I went ahead and made the deb so there would be a working refractasnapshot for up-to-date sid. And also because yesterday was the day I had time to do it.

I do want the tools to work with wheezy, jessie/sid and other distros. I'll fix the isohybrid issue. That should be easy. Not so easy is what to do with the menu. Sorting config= vs. components= is not a problem, now that the menu is generated from the script and includes a variable (distro name). I'll just add another variable, something like boot_configs="config" or boot_configs="components" depending on the version.

Deciding what components to include is more difficult. I left the default entry without any config/components so that autologin and sudo would be default. Snapshot does nothing with sudo as of 9.1.1. The code was commented out but not removed, in case someone wants to reactivate it, and until I'm more confident that I know what live-config is or isn't doing with sudo. BTW, I didn't remove quiet from the menu entries, but I could. What are you looking at?

I haven't tested the isohybrid on a usb stick, either. I should be able to do that some time this week. Maybe make new debs next weekend.

Oh yeah, one other probable issue. When looking at files in /usr/lib/syslinux/modules/bios, I noticed that /usr/lib/syslinux/modules/efi32 and /usr/lib/syslinux/modules/efi64 also exist with all the same files. Any idea what to do with those? Do the snapshots we make now work on newer hardware with efi?

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

Sat May 31, 2014 9:52 pm

I left the default entry without any config/components so that autologin and sudo would be default

Then (as discussed before) *all* live-config scripts will also attempt to run. Here are the state files of scripts that have run in a live session here, without specifying any components. Most exited early and did nothing at all. At the moment I can't see what harm they might have done but this needs further investigation.

Code:
ls /var/lib/live/config

hostname lightdm locales login openssh-server policykit refracta-lang ssl-cert sudo sysvinit sysv-rc tzdata util-linux xfce4-panel xinit xscreensaver

The presence of a state file means only that it has run, not that it did anything (the actual scripts are in /lib/live/config)

My personal default setup now is "components=lightdm,sudo,refracta-lang,openssh-server". This works exactly as expected and is verified by the logs and state files.

BTW I noticed accountsservice is needed for lightdm live autologin to work properly.

My mistake, "quiet" is still there (hides some important boot messages)

I don't have the hardware to test anything to do with efi.

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

Sat May 31, 2014 10:46 pm

I made a snapshot using xorriso, dd'd it to a usb stick and booted. I'm posting from that now.

Here's what I get for live-config scripts with no components listed:
Code:
ls /var/lib/live/config
hostname  lightdm  locales  sudo  sysvinit  sysv-rc  tzdata  xinit
I can't account for the difference in our results. I do have policykit-1, policykit-1-gnome, refracta-lang, util-linux, openssh-server, and xscreensaver installed.

I'll have to reboot and check my notes on when lightdm did and didn't work properly. I did get autologin on this boot. I don't have accountservices installed (assuming that's a package.)

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

Sat May 31, 2014 11:54 pm

What I posted on the previous page:
Code:
    With no live-config components listed on boot line, sudo and autologin work,
    and reboot and shut down buttons work.

    components=openssh-server,sudo      # this works

    components=openssh-server,sudo nocomponents=lightdm      # sudo and autologin work,
    but can't reboot or shut down, and ssh host keys don't get created.


Add to that:
Code:
components=openssh-server,sudo,lightdm    # sudo, autologin, reboot/shutdown, and ssh host keys are all working.

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

Sun Jun 01, 2014 8:29 pm

dzz wrote:Other than that, a few "wishlist" options. Like rsync without format for installer and others mentioned before (if anyone except me wants them). Any other clean ways to customize without script-hacking. Support for TDE R14.


Installer has no_format and snapshot has nocopy. (no_copy is in the setup options in the gui script and is the -n command-line option in the cli script.) Is that what you mean?

What's needed for TDE R14?

Is this an example of making it more hackable? (the template for the boot menu can be a separate file, so changes could be made without editing the main script.)
Here's a sample script that sorts the version of live-config and creates the menu with two variables -
the distro name and config/components. Calling the function from refracta2usb is just for testing purposes. It's not needed in refractasnapshot-gui.
Code:
#!/bin/bash
# menugen
#set -x

source /usr/lib/refracta2usb/functions_r2u
yad_zenity_compat


iso_dir="/usr/lib/refractasnapshot/iso"
boot_menu="live.cfg"


set_distro_name () {
if [[ $iso_dir = "/usr/lib/refractasnapshot/iso" ]] && [[ $boot_menu = "live.cfg" ]] ; then

   DISTRO=$(lsb_release -i -s 2>/dev/null)

   if $(grep -q Refracta /*CENSORED*/issue) ; then
      DISTRO="Refracta"
   fi

   DISTRO=$($DIALOG --entry --title="Linux Distribution" --text="This is the distribution name that will appear in the boot menu
for the live image. If it's blank, the menu entries will just say
\"GNU/Linux (kernel-version)\" " \
   --entry-text="$DISTRO" --width=500 --${BUTTON0}="OK"${BUTTON0NUM})

   if [[ -z "$DISTRO" ]] ; then
      DISTRO="GNU/Linux `uname -r`"
   fi
fi
}   

set_distro_name

# get live-config version, so we know whether to use "config=" or "components=" in the boot menu.
live_config_version=$(dpkg -l live-config | awk '/^ii/ { print $3 }')
if $(echo $live_config_version | grep -q ^4); then
   CONFIGS="components"
else
   CONFIGS="config"
fi
false



# Use this line if menu_template is a separate file instead of
# echoing the menu text as in the section below this.
#sed -e "s:\$DISTRO:$DISTRO:g" menu_template | sed -e "s:\${CONFIGS}:$CONFIGS:g" > boot_menu


# Create the boot menu.
if [[ -n "$DISTRO" ]] ; then
echo "label live
   menu label $DISTRO (default)
    kernel /live/vmlinuz quiet
    append initrd=/live/initrd.img boot=live ip=frommedia union=aufs ${CONFIGS}=openssh-server
   
label nox
   menu label $DISTRO (text-mode)
    kernel /live/vmlinuz quiet
    append initrd=/live/initrd.img boot=live ip=frommedia union=aufs 3 ${CONFIGS}=openssh-server
"
# " > "$work_dir"/iso/isolinux/"$boot_menu"
fi

Post a reply