overdue-scratch

Author Topic: Revisit Chameleon's package builder  (Read 144417 times)

0 Members and 2 Guests are viewing this topic.

ErmaC

  • Resident
  • Posts: 134
Re: Revisit Chameleon's package builder
« Reply #210 on: September 26, 2011, 01:17:16 AM »
I play with the main makefile.
Commit 1576.
I change the final compression for the package, from "gzip --best" to ditto command

Result now the pkg is compressed and the content preserve the ICON !!! :D

Makefile
from:
Code: [Select]
pkg installer: all
${SRCROOT}/package/buildpkg.sh ${SYMROOT}/package;
@echo "\t[GZ] ${DISTFILE}.pkg"
@gzip --best ${DISTFILE}.pkg
to:
Code: [Select]
pkg installer: all
${SRCROOT}/package/buildpkg.sh ${SYMROOT}/package;
@echo "\t[ZIP] ${DISTFILE}.pkg"
@ditto -c -k --sequesterRsrc ${DISTFILE}.pkg ${DISTFILE}.zip
@rm -r ${DISTFILE}.pkg
and into the buildpkg.sh (as I say some post ago...)
from:
Code: [Select]
#   Here is the place for assign a Icon to the pkg
#   command use to generate the file:
#   ditto -c -k --sequesterRsrc --keepParent Icon.icns Icon.zip
# ----
#    ditto -xk "${pkgroot}/Icons/pkg.zip" "${pkgroot}/Icons/"
#    DeRez -only icns "${pkgroot}/Icons/Icons/pkg.icns" > tempicns.rsrc
#    Rez -append tempicns.rsrc -o "${1%/*}/$packagename-${version}-r$revision.pkg"
#    SetFile -a C "${1%/*}/$packagename-${version}-r$revision.pkg"
#    rm -f tempicns.rsrc
#    rm -rf "${pkgroot}/Icons/Icons"
# End
to:
Code: [Select]
#   Here is the place for assign a Icon to the pkg
#   command use to generate the file:
#   ditto -c -k --sequesterRsrc --keepParent Icon.icns Icon.zip
# ----
    ditto -xk "${pkgroot}/Icons/pkg.zip" "${pkgroot}/Icons/"
    DeRez -only icns "${pkgroot}/Icons/Icons/pkg.icns" > tempicns.rsrc
    Rez -append tempicns.rsrc -o "${1%/*}/$packagename-${version}-r$revision.pkg"
    SetFile -a C "${1%/*}/$packagename-${version}-r$revision.pkg"
    rm -f tempicns.rsrc
    rm -rf "${pkgroot}/Icons/Icons"
# End

:D
Now I not commit personally this change into main trunk code (I hope meklort or other do that...)
No idea about the effect for the Builtbot and the better compression method....

Anyway the "patch" is this and finally the Icon can be showed!

Fabio
« Last Edit: September 27, 2011, 02:32:36 AM by iFabio »
P6T Deluxe v1 i7 940 Quadro Fx 5600
P6T SE i7 920 GeForce GT 240

meklort

  • VoodooLabs
  • Posts: 65
Re: Revisit Chameleon's package builder
« Reply #211 on: September 26, 2011, 03:38:39 AM »
I've been a bit busy lately, but I'll see if I can find some time this week to look it over. As far as buildbot changes, it'll just be one line in a config file.
return c ? c : !c;

ErmaC

  • Resident
  • Posts: 134
Re: Revisit Chameleon's package builder
« Reply #212 on: October 03, 2011, 10:27:22 PM »
I follow the recently changes into the Blackosx's branch

Good works! Blackosx!

From now I no find issue...

You think is ready to merge it into the main code?

Fabio
P6T Deluxe v1 i7 940 Quadro Fx 5600
P6T SE i7 920 GeForce GT 240

Blackosx

  • Forum Moderator
  • Posts: 1150
Re: Revisit Chameleon's package builder
« Reply #213 on: October 04, 2011, 09:04:18 AM »
Good works! Blackosx!

From now I no find issue...
Hi Fabio

Thanks for trying out the package installer in my branch. It's working well here too and I have performed many successfully test installations running it.

I've made many tweaks to the existing scripts. The slimpkg script now matches the buildpkg script where applicable and I've changed, renamed, added and removed folders and files in the package folder so it probably looks quite different to how you knew it. Boot0md now supersedes Boot0hfs throughout. If there is an existing /Extra folder at the root of the target partition it will be backed up by the installer before making a new one.

One of the big changes I've made is to incorporate the scripts from my previous work on the package installer (http://forum.voodooprojects.org/index.php/topic,1521.msg8870.html#msg8870), though this time link them in to work with the buildpkg script. I had learned a bit about packages when I'd previously played with Packagemaker so that helped me understand the process better, though I still haven't read and understood everything. But to be honest building the package without using the Packagemaker app GUI is by far a better way to do it. It's worth noting that I haven't included the part of code from my previous scripts which deleted /Volumes/EFI after installing to the EFI system partition as this I believed was (somehow) the source of the problem in the past. So currently this needs to be removed manually.

The other big change is there is now an install log generated by the installer which gets saved to the root of the selected target partition. This is so users can know what has been installed where on their system as I have read many posts in the past here from users who either can't find the installed files, or have more than one /Extra folder so any changes made aren't reflected upon next boot. I have a plan to add a feature for the install scripts to scan a users machine for other existence(s) of Chameleon and notify users prior to installation.

I've changed the way boot options and kernel flags are setup/managed/created as having an exact same script using the exact same code for each boot option seemed silly and was a waste of time when it came to making changes. It's quite dynamic now and very simple to add/remove/change them and I've also tried to make use of the 'exclusive' option which is working, but I haven't figured out how (if possible) to set the 'choose none' option to be selected by default.

The code is functional but I'm sure it can be simplified/improved by someone with a wider knowledge of bash scripting commands.

The English localizable strings have changed and I might  re-order them again at some point so the other languages will need to be updated to match. I know you've put much work in to adding different languages so sorry to have created more work for either you or someone else.

There are more things to improve/change and add in time but most of the big changes have been done for now. There is no support for RAID yet, though it's something I feel the installer should be able to deal with. And maybe the order/folders of boot options that I currently have could be changed?

You think is ready to merge it into the main code?

I think soon, but I would prefer to hear more feedback and see some results from more users trials before it is and for that I will need to post a preview test package. I'll try to do that later today.

UPDATE:
Here's a beta v1 of the package installer from my branch.

It's built from the exact code from my branch apart from:
• All the languages other than English have been removed.
• The two 'Exclusive' options have been disabled.
• The Welcome.rftd and Conclusion.rtfd files have been changed to include '(Beta test installer v1 - blackosx branch)'.
• buildpkg.sh has had '(blackosx branch)' removed from being appended to stage=${version##*-}

UPDATE 2:
v1 removed and v2 now posted.
Changed post script so it won't make an empty Extra folder when not needed.

UPDATE 3:
v2 removed and v3 now posted.
Added a check for an existing Chameleon installation on a different partition of same target disk to help stop new users from confusing themselves.

UPDATE 4: 5th October 23:30
v3 removed and v4 now posted.
Don't create /Extra folder if process is stopped due to exisiting Chameleon installation found.

UPDATE 5: 7th October 08:21
v4 removed and v5 now posted.
Tweaks and code cleanups. This could almost be the final beta?

UPDATE 6: 7th October 15:19
v5 removed and new beta package now posted to InsanelyMac for testing.
« Last Edit: October 10, 2011, 05:25:36 PM by Blackosx »
10.10.5 / 10.11 GM1 | Asus Maximum IV Gene-Z | i7-2600 3.40GHz | 4GB | Radeon 5770 1GB

ErmaC

  • Resident
  • Posts: 134
Re: Revisit Chameleon's package builder
« Reply #214 on: October 04, 2011, 08:16:33 PM »
Hi Blackosx.

Feel free to post in the Chameleon package topic @IM for a large scale test :p

Fabio
P6T Deluxe v1 i7 940 Quadro Fx 5600
P6T SE i7 920 GeForce GT 240

Blackosx

  • Forum Moderator
  • Posts: 1150
Re: Revisit Chameleon's package builder
« Reply #215 on: October 05, 2011, 12:12:52 AM »
Thanks Fabio. I'll do so when I think it's ready.
10.10.5 / 10.11 GM1 | Asus Maximum IV Gene-Z | i7-2600 3.40GHz | 4GB | Radeon 5770 1GB

ErmaC

  • Resident
  • Posts: 134
Re: Revisit Chameleon's package builder
« Reply #216 on: October 05, 2011, 02:05:10 AM »
Thanks Fabio. I'll do so when I think it's ready.
Hi Blackosx.

Translating here and "merge" your tweak into my branch...
one question
from your English Localizable.strings
Quote
// ============================================================================
// Exclusive boot options string - These are added automatically by buildpkg
// Name to be used should be ChooseNone-xxxxxx
// Where xxxxx = the name of the BootOptions file (minus the .txt)
// ----------------------------------------------------------------------------
"ChooseNone-Resolution_title" = "None";
"ChooseNone-Resolution_description" = "Don't choose a resolution.";

"ChooseNone-keylayout_title" = "None";
"ChooseNone-keylayout_description" = "Don't choose a keylayout.";

??? how exactly use that?


Fabio
P6T Deluxe v1 i7 940 Quadro Fx 5600
P6T SE i7 920 GeForce GT 240

Blackosx

  • Forum Moderator
  • Posts: 1150
Re: Revisit Chameleon's package builder
« Reply #217 on: October 05, 2011, 08:26:01 AM »
When using the exclusive option, the package installer will force the user to select only one option in that list and will select one of the existing options as enabled by default ( I haven't figured out how to control that default option yet).  But in the instance where the user won't want to select any of the options, not even the default one, there would be no option in the list that reads 'don't install'.

There are two approaches to this:
1) Add a 'Don't Install' line to the top of each option list where Exclusive=True.
2) Have buildpkg add the 'Don't Install' option automatically when it finds an option list where Exclusive=True.

I chose to go with option 2.

Now, there has to be a unique title/description for each package installer option in localizable.strings. This means that I can't have a 'Don't Install' option for each options list where Exclusive=True as doing so has the side effect of when clicking one of them, the others also act as they've been ticked too.

To overcome this, buildpkg adds a new option in to the list using the name 'ChooseNone-' followed by the filename of the options list (not including .txt). So for example:
• for the Resolution.txt options list, it'll be named: ChooseNone-Resolution.
• If you make a new list named abcdefg.txt list, it'll be named: ChooseNone-abcdefg.

Note: For keylayouts, the exclusive option is set in the buildpkg code because the keylayout package installer options are automatically generated based on the contents of the Keymaps folder created when compiling Chameleon. But the same principle applies for the exclusive option and it'll be named: ChooseNone-keylayout.

So for any option list that uses Exclusive=True, there should be an equivalent title/description in the localizable strings using the ChooseNone-xxxxxx name.

Hope this helps.
10.10.5 / 10.11 GM1 | Asus Maximum IV Gene-Z | i7-2600 3.40GHz | 4GB | Radeon 5770 1GB

ErmaC

  • Resident
  • Posts: 134
Re: Revisit Chameleon's package builder
« Reply #218 on: October 16, 2011, 01:07:37 AM »
Hi Blackosx.

Yesterday I upload all the language "modified" with your English Layout.
In this way is easy for Existing semi-translated language finish the job.

Fabio
P6T Deluxe v1 i7 940 Quadro Fx 5600
P6T SE i7 920 GeForce GT 240

Blackosx

  • Forum Moderator
  • Posts: 1150
Re: Revisit Chameleon's package builder
« Reply #219 on: October 16, 2011, 11:33:25 PM »
Great. That'll make updating the trunk with the revised package installer code simpler.

I'm pretty happy the installer is working well. I submitted commit 1630 today to add some code for trying to keep a users system intact if they try to install a secondary Chameleon boot partition to their HDD. It's working here, but it needs some testing so I've posted the latest build to your topic at InsanelyMac.

Ideally I want to take a step back and look at the whole package installer code to maybe organise it better as I've been adding extra code here and there, and clean it up. And I still have to work out how to set what will be the default choice if the 'exclusive' option is used.

But overall I think it'll soon be ready to merge with the trunk.
« Last Edit: October 16, 2011, 11:36:35 PM by Blackosx »
10.10.5 / 10.11 GM1 | Asus Maximum IV Gene-Z | i7-2600 3.40GHz | 4GB | Radeon 5770 1GB

ErmaC

  • Resident
  • Posts: 134
Re: Revisit Chameleon's package builder
« Reply #220 on: October 21, 2011, 01:33:07 AM »
quick question...

now the ShowInfo key now is set by default to no from ...(I no remember the commit number..)

So Is better set that info also into the Localizable.strings file and for the new "layout"
from (Localizable.strings)
Quote
"ShowInfo_title" = "ShowInfo=No";
"ShowInfo_description" = "Disables display of partition and resolution details shown on the left side of the GUI under the boot banner. This is useful information for troubleshooting, though can clash with certain themes.";
to (localizable.strings)
Quote
"ShowInfo_title" = "ShowInfo=Yes";
"ShowInfo_description" = "Enables display of partition and resolution details shown on the left side of the GUI under the boot banner. This is useful information for troubleshooting, though can clash with certain themes.";

and from (Blackosx's OptionalSettings/Control.txt)
Quote
...
QuietBoot:QuietBoot=Yes
ShowInfo:ShowInfo=No
Wait:Wait=Yes
to
Quote
...
QuietBoot:QuietBoot=Yes
ShowInfo:ShowInfo=Yes
Wait:Wait=Yes

Fabio
P6T Deluxe v1 i7 940 Quadro Fx 5600
P6T SE i7 920 GeForce GT 240

Blackosx

  • Forum Moderator
  • Posts: 1150
Re: Revisit Chameleon's package builder
« Reply #221 on: October 21, 2011, 08:10:23 AM »
I've just checked and yes you're right. I didn't realise it had been changed.

I'll update my branch to reflect this. Thanks for the information Fabio.
10.10.5 / 10.11 GM1 | Asus Maximum IV Gene-Z | i7-2600 3.40GHz | 4GB | Radeon 5770 1GB

Blackosx

  • Forum Moderator
  • Posts: 1150
Re: Revisit Chameleon's package builder
« Reply #222 on: October 21, 2011, 06:34:10 PM »
Fabio. In commit 1644 of my branch, I've enabled building the .dmg that you worked on.

I changed the builddmg.sh script slightly to work with the latest name convention for the package installer, and also to just copy the BootHelp.txt and Users_Guide0.5.pdf in the documentation folder rather than everything from the /docs folder. So far so good.

I look at seeing what else I can do with it when I get some time. :)
10.10.5 / 10.11 GM1 | Asus Maximum IV Gene-Z | i7-2600 3.40GHz | 4GB | Radeon 5770 1GB

ErmaC

  • Resident
  • Posts: 134
Re: Revisit Chameleon's package builder
« Reply #223 on: October 23, 2011, 04:01:42 AM »
Hi Blackosx

thx for take a look and tweak the dmg part...

- would be nice rewrite the builddmg.sh script... until now that script overwrite recently compiled content into "old" pre-made
dmg image (look into ../package/dmg/ro.dmg)
I used this way because I have problem with resouce fork (.DS_Store file) and his creation...

- Also I need to "find" time to write a good "EULA" (Also resource fork file) to use with openUP utility (present into chameleon source "../i386/util/openUp.c" thx meklort to add it)
Because as you can see (from terminal.app) the build process "fails" in that part...

Fabio
« Last Edit: October 23, 2011, 04:04:30 AM by ErmaC »
P6T Deluxe v1 i7 940 Quadro Fx 5600
P6T SE i7 920 GeForce GT 240

Blackosx

  • Forum Moderator
  • Posts: 1150
Re: Revisit Chameleon's package builder
« Reply #224 on: October 24, 2011, 06:45:28 PM »
Hi Fabio

I haven't had time to look any further at the builddmg script but when I do I'll let you know.

But I see you've added a screenshot for the EULA for openUP. It looks good to me.
If that's all that's required then great. Well done :)

Have you added it to your branch?
10.10.5 / 10.11 GM1 | Asus Maximum IV Gene-Z | i7-2600 3.40GHz | 4GB | Radeon 5770 1GB