Stuff that has not yet gone into the official build.
Post a reply
fsmithred

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

## Re: Bloat alert! zenity vs. yad (wheezy)

Wed Jul 18, 2012 6:27 pm

I just converted my latest refractainstaller-gui from zenity to yad, and it appears to work. Did a single-partition install with no extra options checked. I need to make a few other changes (not related to yad) and still need to work in the code for putting the bootloader into a partition. Will probably get it done and wrapped up into debs this weekend.
I like yad a lot. I especially like being able to have more than two buttons in a window. I'm adding an Exit button to several windows, so you will be able to abort the installation a lot easier.
dzz

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

## Re: Bloat alert! zenity vs. yad (wheezy)

Wed Jul 18, 2012 9:14 pm

> still need to work in the code for putting the bootloader into a partition

(with proc, sys and dev bind mounts)

Code:
  `chroot /target /bin/bash grub-install --recheck --no-floppy --force $INSTALLPARTITION`

it's a bit harder for legacy (which BTW will pobably fail with grub-install --force); I do this:

Code:
  `# grub-install fails to a partition! gives "error 22: No such partition"
  # this will probable give error 22 but gets the files in /boot (grub shell might not)
  chroot /target /bin/bash grub-install $INSTALLPARTITION
  # isolate the device (sdx) letter then use tr like this to translate to the right number for grub
  GRUBDEVICENUM=$(echo $INSTALLPARTITION |sed 's:/dev/sd::' |sed 's:[0-9]::'g |tr '[a-j]' '[0-9]')
  # isolate the partition number
  INSTALLPARTNUM=$(echo $INSTALLPARTITION |sed 's:/dev/sd::'|sed 's:[a-z]::')
  # and reduce it by 1 for grub
  GRUBPARTNUM=$(expr $INSTALLPARTNUM - 1)
  # finally get the finished grub root syntax
  GRUBROOT="(hd$GRUBDEVICENUM,$GRUBPARTNUM)"
  # now use grub shell in batch mode (grub-install fails to a partition)
  grub --batch <<EOF
  root $GRUBROOT
  setup $GRUBROOT
  quit
  EOF`

Depends if or how much you want to support legacy/gfxboot, at the moment refracta installer does. I still use gfxboot in mbr (chainloads grub2 in partition for my refracta and some other installs, which at the moment must be done manually) Debian grub-legacy (yes it is still in sid) doesn't support ext4 nor gpt and never will. I use the mepis/antiX gfxboot which does.
Re yad: discovered with my experimental installer that it's not so difficult to do a check for yad and zenity, and use yad in preference if installed else zenity, setting $DIALOG It gets a little awkward with custom ok/cancel buttons though, had to use a case statement for yad or zenity then..
Trouble with yad, it's not in Debian repos, you have to install manually (or configure a 3rd party repo) clumsy either way. If the installer/snapshot stuff is to be for other Debian too maybe zenity should be also supported.
Simple working example:

Code:
  `GRUBINST=$($DIALOG --width=400 --height=400 --title=$"$TITLE" --list --separator="" --column="" --text="$TEXT" "MBR of first hard disk" "MBR of installation disk" "Installation partition" "Do not install Grub")`

More on that later if anyone is interested.
fsmithred

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

## Re: Bloat alert! zenity vs. yad (wheezy)

Fri Jul 20, 2012 7:35 pm

For now, I'm going to keep the yad and zenity versions separate. I plan to do more with custom buttons in the yad version. The two-button limit in zenity has been bugging me for a long time. I suppose I could put the yad debs on ibiblio with the installer and snapshot debs, so it would be easy to find.
I do want to keep supporting grub-legacy. Is there an easy way to tell if grub-legacy or grub-pc is installed?
dzz

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

## Re: Bloat alert! zenity vs. yad (wheezy)

Sun Jul 22, 2012 4:12 pm

> Is there an easy way to tell if grub-legacy or grub-pc is installed?

Code:
  `GRUBVERSION=$(dpkg -l |grep ii|grep grub|grep -v "grub-common"|grep -v theme|awk '{print $2}')`

Grub-gfxboot is much the same as legacy, except the boot screen is customisable beyond just superimposing a picture or using someone else's preset theme (one of many annoyances with grub-pc)
fsmithred

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

## Re: Bloat alert! zenity vs. yad (wheezy)

Mon Jul 23, 2012 4:08 am

Here's what I'm up to with the yad version. It's not finished yet and hasn't been fully tested, but it seems to be working. I've mostly been running it from my home directory and stopping it before it makes any changes, getting all the preliminary steps to work right.
https://gist.github.com/3161926
Dean did an install with a version from earlier in the day. Not sure how successful he was. I did an install yesterday with an even earlier version, and it worked.
Here's a shorter version of the line you posted (and it's still not in the script)

Code:
  `grubversion=$(dpkg -l | awk '$2 ~ "grub-[lp]" { print $2}')`

dzz

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

## Re: Bloat alert! zenity vs. yad (wheezy)

Mon Jul 23, 2012 10:29 am

Short of time now to look in detail at the gist script, ... Some quick observations using yad_0.12.4-1~stable1_i386 in squeeze (later versions might behave different):
"yad --info " doesn't work.

Code:
  `Unable parse command line: Unknown option --info`

Needs to be "yad --image=gtk-dialog-info ", same with error, warning... (can probably use any icon you want as image)
Using buttons to set a variable doesn't actually return the button text, just the status $?, i.e. 0, 1, 2... (maybe you dealt with that and I missed it)
I found, in some yad dialogs, if you don't specify window size it doesn't display properly
Re checking grub version, you are right that simple is good but: Possible grub versions are grub-pc, grub-legacy or grub-gfxboot. Also any one could be fully installed but another still dpkg-listed as "rc"

Code:
  `grubversion=$(dpkg -l | grep ii | grep -v doc | awk '$2 ~ "grub-[glp]" { print $2}')`

is more robust (note, grub-legacy-doc could exist)
fsmithred

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

## Re: Bloat alert! zenity vs. yad (wheezy)

Mon Jul 23, 2012 11:58 am

Oh boy, I'm using yad-17.1.1. If there's no --info option in earlier versions, that's a problem. I'll have to look at some earlier versions. The buttons returning only the status is not a problem, but sequential checks for exit status are a problem. You can't test for $? multiple times, because the second test will look at the exit status of the first test. That was giving me problems for awhile yesterday. Solution was to set a variable to equal the exit status of the yad window, then test that variable.
Oops. I didn't count on packages listed as rc. I also see there's a package called grub-linuxbios, which could cause a problem. There doesn't appear to be a grub-gfxboot - all I find is gfxboot and gfxboot-*. The description says "gfxboot is tool to test and create graphical boot logos for gfxboot compliant
boot loaders. Currently, this includes grub, lilo, and syslinux (all payloads)." I'm not sure what I need to do with that.
Another problem: grub-legacy doesn't support ext4, but for the simple install (which was removed and then restored yesterday) ext4 is the default. All I can think of right now (not fully awake yet) is to disallow the grub-legacy die-hards from doing a simple install. Good thing we've got some time before this has to be finished.
dzz

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

## Re: Bloat alert! zenity vs. yad (wheezy)

Mon Jul 23, 2012 1:15 pm

grub-gfxboot is not and never was in official Debian. It is an adaption of legacy originally from suze, later many other distros used it, e.g. mepis, antiX, sidux, ubuntu. Many did (some still do) use it on otherwise straight Debian. Some Debian users may have configured repos which have it. Some later versions do support ext4.
yad_0.17.1.1-1 needs deps from Wheezy libgdk-pixbuf2.0-0 (>= 2.22.0) libgtk2.0-0 (>= 2.24.0) and deps of deps. Backports don't help.
fsmithred

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

## Re: Bloat alert! zenity vs. yad (wheezy)

Mon Jul 23, 2012 3:03 pm

I got yad - 0.17.1.1-1~webupd8~lucid from here -
https://launchpad.net/~webupd8team/+arc ... /+packages
and it installed on squeeze with no problems.
Can the same commands be used for installing the bootloader with grub-legacy and grub-gfx? If so, I should be able to assume that grub-legacy is installed, and test only for grub-pc. Anyone using lilo or syslinux is on their own. I suppose another approach would be to let the user figure out which bootloader they have, and put it in the config file.
dzz

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

## Re: Bloat alert! zenity vs. yad (wheezy)

Mon Jul 23, 2012 4:54 pm

yad - 0.17.1.1-1 does nothing with --info, it's useless. At least it doesn't error out. If you want the icon like in zenity, still need --image=gtk-dialog-info
Tried the lucid version in squeeze , it does install and installed the yad official deb 0.17.1.1-1 in my wheezy. Not everyone is happy about installing ubuntu packages to Debian.
grub-legacy and grub-gfx are installed and set up in exactly the same way
Yad appears to be not in sid
Post a reply
Jump to:

Powered by phpBB © phpBB Group.

phpBB Mobile / SEO by Artodia.