Refracta Development, Scripts, etc.
Post a reply
fsmithred

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

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

Sat May 17, 2014 6:21 pm

OK, dollar signs stay. Translation is good.
Newer version of refractasnapshot at ibiblio. Distro name should work with zenity now, but I don't have a sid install with zenity to test it right now.
One weird thing with the cli script - the read command doesn't appear to be working - nothing shows up in the prompt, but the variable is set correctly. In my case, DISTRO="Debian" because that's the lsb-release name, and I didn't edit e-t-c/issue. It should show up with 'read -e -i $DISTRO answer' but the line is blank. Anything that gets typed there will be used, but if you're expecting 'GNU/Linux `uname -r`' to appear in your boot menu, you'll be disappointed.
Here's the code. If I put this in a separate script, it works. I can see "Debian" on the line, and I can change it if I want.

Code:
  `DISTRO=$(lsb_release -i -s 2>/dev/null)
  if $(grep -q Refracta /*CENSORED*/issue) ; then
  DISTRO="Refracta"
  fi
  while true ; do
  echo "
  This is the distribution name that will appear in the boot menu for the
  live image. You can change it to something else, or you can blank this,
  and the the menu entries will just say \"GNU/Linux <kernel-version>\" "
  read -e -i "$DISTRO" answer
  break
  done
  `

fsmithred

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

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

Sun May 18, 2014 2:22 pm

I tested refractasnapshot 9.1.1 with a sid install that uses zenity. Distro name works.
Oddities in the resulting snapshots -
On the desktop exit button, everything but 'log out' is greyed.
sudo doesn't work - sudoers.d/live isn't being created. Tried with nothing added to the boot line, tried with

Code:
  `components=openssh-server,sudo
  and
  components=openssh-server,sudo username=user`

Also tried both of those with 'nocomponents=lightdm'.
SSH works, autologin works, but no sudo.
dzz

- dzz
- Posts: 647
- Joined: Wed Apr 27, 2011 11:53 am
- Location: Devon, England

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

Mon May 19, 2014 11:57 am

Assuming your sid is current..
"components=openssh-server,sudo" works as expected here on a current sid image (which does not have sudo preset and uses sysvinit). You would need to boot with debug=1 and read the logs, also check that the state files are in /var/lib/live/config match what you told it to do.
Watch out for xinit, it is a real nuisance for this type of image.
Make sure also the contents of /var/lib/live/config/ are excluded from your snapshot. If a script finds a state file there it exits early, assuming it's already run.
Read here: http://forums.debian.net/viewtopic.php? ... 6d2cbfb72c
Not convinced that's entirely true but did notice I could not logout reboot or shutdown without adding sudo to "components". Something pam- or policykit-related might be missing, misconfigured or has bug.
I'm off the case for a few days, will try to help debug this later.
fsmithred

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

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

Thu May 22, 2014 1:01 am

What I posted above happened with a build that had zenity installed and yad disabled. A lot of stuff got added, and maybe something got removed. I didn't pay attention, because I'm not planning on keeping that build. I guess I failed to expect any problems with it other than the ones I created in the script. Oops. This is sid.
Here's what I found when I switched back to my regular sid. That's the same one I used to make the recent snapshot I uploaded. Yad is installed; zenity is not. Last update/upgrade was April 9. I did this before you posted. I'll check the libpam stuff mentioned in the thread you linked. Busy with other stuff on this end, too. We'll get it sorted out eventually.

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.`

/var/lib/live/config/* is not in the current excludes list. I'll take a look in the squash file to see what's there.
dzz

- dzz
- Posts: 647
- Joined: Wed Apr 27, 2011 11:53 am
- Location: Devon, England

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

Sat May 24, 2014 4:05 pm

The shutdown and reboot buttons just got disabled on my main sid install after DU.
Installed libpam-systemd now the buttons are back.
But watch out, if you want to keep sysvinit.. you need first to install systemd-shim else systemd-sysv is pulled in and syvinit-core removed (i.e. sysvinit is gone).
It still boots normally with sysvinit (systemd is optional, by adding init=/bin/systemd to cmdline)
Systemd libs are starting to get pulled in as deps by gnome packages, now cups but systemd default boot is not yet compulsory.

Code:
  `:~$ dpkg -l | grep systemd
  ii libpam-systemd:i386 204-10 i386 system and service manager - PAM module
  ii libsystemd-daemon0:i386 204-10 i386 systemd utility library
  ii libsystemd-id128-0:i386 204-10 i386 systemd 128 bit ID utility library
  ii libsystemd-journal0:i386 204-10 i386 systemd journal utility library
  ii libsystemd-login0:i386 204-10 i386 systemd login utility library
  ii systemd 204-10 i386 system and service manager
  ii systemd-shim 6-3 i386 shim for systemd`

> I'll take a look in the squash file to see what's there

note: udevil can mount squashfs simply and without root!
dzz

- dzz
- Posts: 647
- Joined: Wed Apr 27, 2011 11:53 am
- Location: Devon, England

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

Sat May 24, 2014 10:39 pm

On another tangent: Snapshot uses the command "isohybrid". It was part of the syslinux package but just got removed. . Need to use xorriso now for sid, to make isohybrid. Rough example, partially tested here:

Code:
  `xorriso -as mkisofs -r -J -joliet-long -l -isohybrid-mbr /usr/lib/syslinux/mbr/isohdpfx.bin -partition_offset 16 -V "snapshot-live-cd" -b $BOOT_IMAGE -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o "$filename" iso/`

Something like that will need to replace the previous "genisoimage" command ( " -as mkisofs" is mkisofs/genisoimage compatibility mode for xorriso) I read somewhere that's what live-build does.
fsmithred

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

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

Mon May 26, 2014 12:55 am

/var/lib/live/config is empty in the iso - it was made from an installed system, not from a live system.
Made the following changes to refractasnapshot-gui for syslinux/isolinux 6.03...
At line 450:

Code:
  `copy_isolinux () {
  #
  if [[ -f /usr/lib/ISOLINUX/isolinux.bin ]] ; then
  isolinuxbin="/usr/lib/ISOLINUX/isolinux.bin"
  elif [[ -f /usr/lib/syslinux/isolinux.bin ]] ; then
  isolinuxbin="/usr/lib/syslinux/isolinux.bin"
  else
  $DIALOG --title=Error --$ERROR --${BUTTON0}="OK"${BUTTON0NUM} \
  --text="You need to install the isolinux package."
  exit 1
  fi
  if [[ -f /usr/lib/syslinux/modules/bios/vesamenu.c32 ]] ; then
  vesamenu="/usr/lib/syslinux/modules/bios/vesamenu.c32"
  else
  vesamenu="/usr/lib/syslinux/vesamenu.c32"
  fi
  rsync -a "$isolinuxbin" "$iso_dir"/isolinux/
  rsync -a "$vesamenu" "$iso_dir"/isolinux/
  }`

around line 650:

Code:
  `# genisoimage -r -J -l -D -o "$snapshot_dir"/"$filename" -cache-inodes \
  # -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
  # -boot-info-table -allow-limited-size iso/ | tee >($DIALOG --title="Creating CD/DVD image file..." --progress --pulsate --auto-close --width 300)
  if [[ $make_isohybrid = "yes" ]]; then
  # isohybrid "$snapshot_dir"/"$filename"
  isohybrid_opt="-isohybrid-mbr /usr/lib/syslinux/mbr/isohdpfx.bin"
  fi
  xorriso -as mkisofs -r -J -joliet-long -l ${isohybrid_opt} \
  -partition_offset 16 -V "snapshot-live-cd" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot \
  -boot-load-size 4 -boot-info-table -o "$snapshot_dir"/"$filename" iso/ \
  | tee >($DIALOG --title="Creating CD/DVD image file..." --progress --pulsate --auto-close --width 300)
  if [[ $make_md5sum = "yes" ]]; then
  md5sum "$snapshot_dir"/"$filename" > "$snapshot_dir"/"$filename".md5
  fi`

The iso is 1.7GB. When the squashing was around 97%, filesystem.squashfs was still under 500MB.
When I try to boot the iso in vbox, I get the following error:

> Failed to load ldlinux.c32
> Boot failed: press a key to retry...

The missing file is found at /usr/lib/syslinux/modules/bios/ldlinux.c32. Where does it go? I'm guessing it goes in the isolinux directory, but I can't get to the syslinux wiki right now.
fsmithred

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

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

Mon May 26, 2014 1:33 pm

Update: The extra size was from an extra copy of myfs inside $work_dir/iso/isolinux. Yikes! Looks like that happened a couple days ago, but I'm not sure how. I did abort a run and then ran with the nocopy option, so maybe I did something weird.
Testing now with adding ldlinux.c32, libcom32.c32, libutil.c32 from /usr/lib/syslinux/modules/bios/ into $iso_dir/isolinux directory. So far, it seems to be working. (squashing now...)
fsmithred

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

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

Mon May 26, 2014 3:03 pm

Tried to boot the last iso again. Got an error not loading libcom32, but there was a boot prompt, so I typed "live", and it boots.
Trying the next iso now - It's a normal size (500MB). OK, this one boots normally. Cool.
Thanks, dzz. Somebody asked for xorriso recently, and you delivered.
Here's the updated copy_isolinux function.

Code:
  `copy_isolinux () {
  #
  if [[ -f /usr/lib/ISOLINUX/isolinux.bin ]] ; then
  isolinuxbin="/usr/lib/ISOLINUX/isolinux.bin"
  elif [[ -f /usr/lib/syslinux/isolinux.bin ]] ; then
  isolinuxbin="/usr/lib/syslinux/isolinux.bin"
  else
  $DIALOG --title=Error --$ERROR --${BUTTON0}="OK"${BUTTON0NUM} \
  --text="You need to install the isolinux package."
  exit 1
  fi
  if [[ -f /usr/lib/syslinux/modules/bios/vesamenu.c32 ]] ; then
  vesamenu="/usr/lib/syslinux/modules/bios/vesamenu.c32"
  rsync -a /usr/lib/syslinux/modules/bios/ldlinux.c32 "$iso_dir"/isolinux/
  rsync -a /usr/lib/syslinux/modules/bios/libcom32.c32 "$iso_dir"/isolinux/
  rsync -a /usr/lib/syslinux/modules/bios/libutil.c32 "$iso_dir"/isolinux/
  else
  vesamenu="/usr/lib/syslinux/vesamenu.c32"
  fi
  rsync -a "$isolinuxbin" "$iso_dir"/isolinux/
  rsync -a "$vesamenu" "$iso_dir"/isolinux/
  }`

dzz

- dzz
- Posts: 647
- Joined: Wed Apr 27, 2011 11:53 am
- Location: Devon, England

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

Mon May 26, 2014 3:10 pm

There is more to investigate yet.. For a start, isolinux is now a separate package ("add-on") from syslinux, it's needed for isolinux.bin .. and "isohybrid" is there too (although xorriso might still be the way to go)
EDIT you must have already noticed that.. your last code box sorts it
Yet to test if an isohybrid made that way with xorriso can dd to a usb. I don't have one I can afford to trash at the moment.
I tested my latest iso in virtualbox but didn't see any boot errors as described. (i386 machine with bios)
Usually I boot them from file on HD (from grub menu) but then you don't see if the actual cd image's boot functions have any errors.
Need to add xorriso as a dep if it is to be used. To keep wheezy-compatible, maybe rather than add isolinux as a dep, maybe there is a way to use a pre-install script to check syslinux version.
Last edited by dzz on Mon May 26, 2014 4:58 pm, edited 1 time in total.
Post a reply
Jump to:

Powered by phpBB © phpBB Group.

phpBB Mobile / SEO by Artodia.