Chameleon Applications

Chameleon Applications Commit Details

Date:2011-05-22 14:41:27 (12 years 11 months ago)
Author:ErmaC
Commit:278
Parents: 277
Message:Start fixing the postinstall script. now fdisk440 no more fdisk
Changes:
D/branches/iFabio/Chameleon/package/fdisk
A/branches/iFabio/Chameleon/package/fdisk440
M/branches/iFabio/Chameleon/i386/modules/Resolution/Resolution.c
M/branches/iFabio/Chameleon/i386/libsa/string.c
M/branches/iFabio/Chameleon/package/buildpkg
M/branches/iFabio/Chameleon/package/Scripts/Standard/postinstall
M/branches/iFabio/Chameleon/package/Scripts/EFI/postinstall
M/branches/iFabio/Chameleon/i386/libsa/libsa.h

File differences

branches/iFabio/Chameleon/i386/modules/Resolution/Resolution.c
44
55
66
7
78
8
99
1010
11
12
1113
14
15
16
1217
1318
*/
#include "915resolution.h"
#include "gui.h"
void Resolution_start()
{
UInt32 bp = 0;
UInt32 x, y;
patchVideoBios();
getResolution(&x, &y, &bp);
gui.screen.width = x;
gui.screen.height = y;
}
branches/iFabio/Chameleon/i386/libsa/libsa.h
3535
3636
3737
38
38
3939
4040
4141
4242
43
43
4444
4545
4646
4747
48
48
4949
5050
5151
5252
53
53
5454
5555
5656
5757
58
58
5959
6060
6161
6262
63
63
6464
6565
6666
6767
68
68
6969
7070
7171
7272
7373
74
74
7575
7676
7777
......
9090
9191
9292
93
93
9494
9595
9696
/*
* ctype stuff (aserebln)
*/
static inline int isupper(char c)
static inline int isupper(int c)
{
return (c >= 'A' && c <= 'Z');
}
static inline int islower(char c)
static inline int islower(int c)
{
return (c >= 'a' && c <= 'z');
}
static inline int isalpha(char c)
static inline int isalpha(int c)
{
return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'));
}
static inline int isascii(char c)
static inline int isascii(int c)
{
return ( (c >= 0x20) && (c < 0x7f) );
}
static inline int isspace(char c)
static inline int isspace(int c)
{
return (c == ' ' || c == '\t' || c == '\n' || c == '\12');
}
static inline int isdigit(char c)
static inline int isdigit(int c)
{
return (c >= '0' && c <= '9');
}
static inline int isxdigit(char c)
static inline int isxdigit(int c)
{
return ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'));
}
//Azi: TODO - add more ponctuation characters as needed; at least these two, i need for PartNo.
static inline int ispunct(char c)
static inline int ispunct(int c)
{
return (c == '.' || c == '-');
}
extern void * memset(void * dst, int c, size_t n);
extern void * memcpy(void * dst, const void * src, size_t len);
extern int memcmp(const void * p1, const void * p2, int len);
extern int memcmp(const void * p1, const void * p2, size_t len);
extern int strcmp(const char * s1, const char * s2);
extern int strncmp(const char * s1, const char * s2, size_t n);
extern char * strcpy(char * s1, const char * s2);
branches/iFabio/Chameleon/i386/libsa/string.c
140140
141141
142142
143
143
144144
145145
146146
/* NOTE: Moved from ntfs.c */
int
memcmp(const void *p1, const void *p2, int len)
memcmp(const void *p1, const void *p2, size_t len)
{
while (len--) {
if (*(const char*)(p1++) != *(const char*)(p2++))
branches/iFabio/Chameleon/package/buildpkg
4040
4141
4242
43
4344
45
4446
4547
4648
......
4850
4951
5052
51
53
5254
55
5356
5457
5558
5659
57
60
5861
59
60
61
62
62
63
64
65
6366
64
67
6568
6669
6770
68
71
6972
7073
7174
......
7679
7780
7881
79
82
8083
8184
8285
......
8588
8689
8790
88
91
8992
90
93
9194
9295
9396
......
109112
110113
111114
112
115
113116
114117
115118
......
183186
184187
185188
186
189
187190
188191
189192
......
221224
222225
223226
224
227
225228
226229
227230
......
290293
291294
292295
293
296
294297
295298
296299
......
437440
438441
439442
443
444
440445
446
441447
442448
443449
rm -R -f "${1}"
echo ""
echo -e $COL_BLACK"----------------------------------"$COL_RESET
echo -e $COL_BLACK"Building $packagename Install Package"$COL_RESET
echo -e $COL_BLACK"----------------------------------"$COL_RESET
echo ""
outline[$((outlinecount++))]="${indent[$xmlindent]}<choices-outline>"
# build core package
echo "================= Core ================="
((xmlindent++))
packagesidentity="org.chameleon.core.pkg"
packagesidentity="org.chameleon"
mkdir -p ${1}/Core/Root/usr/sbin
mkdir -p ${1}/Core/Root/usr/local/bin
mkdir -p ${1}/Core/Root/usr/standalone/i386
cp -f ${1%/*}/i386/boot ${1}/Core/Root/usr/standalone/i386
cp -f ${1%/*}/i386/boot0 ${1}/Core/Root/usr/standalone/i386
cp -f ${1%/*}/i386/boot0hfs ${1}/Core/Root/usr/standalone/i386
#cp -f ${1%/*}/i386/boot1f32 ${1}/Core/Root/usr/standalone/i386
cp -f ${1%/*}/i386/boot1f32 ${1}/Core/Root/usr/standalone/i386
cp -f ${1%/*}/i386/boot1h ${1}/Core/Root/usr/standalone/i386
#cp -f ${1%/*}/i386/boot1he ${1}/Core/Root/usr/standalone/i386
#cp -f ${1%/*}/i386/boot1hp ${1}/Core/Root/usr/standalone/i386
#cp -f ${1%/*}/i386/cdboot ${1}/Core/Root/usr/standalone/i386
#cp -f ${1%/*}/i386/chain0 ${1}/Core/Root/usr/standalone/i386
cp -f ${1%/*}/i386/boot1he ${1}/Core/Root/usr/standalone/i386
cp -f ${1%/*}/i386/boot1hp ${1}/Core/Root/usr/standalone/i386
cp -f ${1%/*}/i386/cdboot ${1}/Core/Root/usr/standalone/i386
cp -f ${1%/*}/i386/chain0 ${1}/Core/Root/usr/standalone/i386
fixperms "${1}/Core/Root/"
cp -f ${pkgroot}/fdisk ${1}/Core/Root/usr/sbin
cp -f ${pkgroot}/fdisk440 ${1}/Core/Root/usr/sbin
cp -f ${1%/*}/i386/bdmesg ${1}/Core/Root/usr/sbin
local coresize=$( du -hkc "${1}/Core/Root" | tail -n1 | awk {'print $1'} )
echo "[BUILD] i386 "
buildpackage "${1}/Core" "/tmpcham" "0" "start_visible=\"false\" start_selected=\"true\"" >/dev/null 2>&1
buildpackage "${1}/Core" "/" "0" "start_visible=\"false\" start_selected=\"true\"" >/dev/null 2>&1
# build Chameleon package
echo "================= Chameleon ================="
mkdir -p ${1}/Standard/Root
mkdir -p ${1}/Standard/Scripts/Tools
cp -f ${pkgroot}/Scripts/Standard/* ${1}/Standard/Scripts
ditto --arch i386 `which SetFile` ${1}/Standard/Scripts/Tools/SetFile
# ditto --arch i386 `which SetFile` ${1}/Standard/Scripts/Tools/SetFile
echo "[BUILD] Standard "
buildpackage "${1}/Standard" "/tmpcham" "${coresize}" "start_enabled=\"true\" start_selected=\"upgrade_allowed()\" selected=\"exclusive(choices['EFI']) &amp;&amp; exclusive(choices['noboot'])\"" >/dev/null 2>&1
# End build standard package
mkdir -p ${1}/EFI/Root
mkdir -p ${1}/EFI/Scripts/Tools
cp -f ${pkgroot}/Scripts/EFI/* ${1}/EFI/Scripts
ditto --arch i386 `which SetFile` ${1}/EFI/Scripts/Tools/SetFile
# ditto --arch i386 `which SetFile` ${1}/EFI/Scripts/Tools/SetFile
echo "[BUILD] EFI "
buildpackage "${1}/EFI" "/tmpcham" "${coresize}" "start_visible=\"systemHasGPT()\" start_selected=\"false\" selected=\"exclusive(choices['Standard']) &amp;&amp; exclusive(choices['noboot'])\"" >/dev/null 2>&1
buildpackage "${1}/EFI" "/" "${coresize}" "start_visible=\"systemHasGPT()\" start_selected=\"false\" selected=\"exclusive(choices['Standard']) &amp;&amp; exclusive(choices['noboot'])\"" >/dev/null 2>&1
# End build efi package
# build reset choice package
mkdir -p "${1}/${modules[$i]##*/}/Scripts"
ditto --noextattr --noqtn "${modules[$i]}/postinstall" "${1}/${modules[$i]##*/}/Scripts/postinstall"
echo "[BUILD] ${modules[$i]##*/} "
buildpackage "${1}/${modules[$i]##*/}" "/tmpcham" "" "start_selected=\"false\"" >/dev/null 2>&1
buildpackage "${1}/${modules[$i]##*/}" "/" "" "start_selected=\"false\"" >/dev/null 2>&1
rm -R -f "${1}/${i##*/}"
done
((xmlindent--))
mkdir -p "${1}/${options[$i]##*/}/Scripts"
ditto --noextattr --noqtn "${options[$i]}/postinstall" "${1}/${options[$i]##*/}/Scripts/postinstall"
echo "[BUILD] ${options[$i]##*/} "
buildpackage "${1}/${options[$i]##*/}" "/tmpcham" "" "start_selected=\"false\"" >/dev/null 2>&1
buildpackage "${1}/${options[$i]##*/}" "/" "" "start_selected=\"false\"" >/dev/null 2>&1
done
# End build base options packages
mkdir -p "${1}/${optionsadv[$i]##*/}/Scripts"
ditto --noextattr --noqtn "${optionsadv[$i]}/postinstall" "${1}/${optionsadv[$i]##*/}/Scripts/postinstall"
echo "[BUILD] ${optionsadv[$i]##*/} "
buildpackage "${1}/${optionsadv[$i]##*/}" "/tmpcham" "" "start_selected=\"false\"" >/dev/null 2>&1
buildpackage "${1}/${optionsadv[$i]##*/}" "/" "" "start_selected=\"false\"" >/dev/null 2>&1
done
((xmlindent--))
mkdir -p ${1}/Post/Scripts
cp -f ${pkgroot}/Scripts/Post/* ${1}/Post/Scripts
echo "[BUILD] Post "
buildpackage "${1}/Post" "/tmpcham" "" "start_visible=\"false\" start_selected=\"true\"" >/dev/null 2>&1
buildpackage "${1}/Post" "/" "" "start_visible=\"false\" start_selected=\"true\"" >/dev/null 2>&1
outline[$((outlinecount++))]="${indent[$xmlindent]}</choices-outline>"
# build meta package
md5=$( md5 "${1%/*}/${packagename// /}-${version}-r${revision}.pkg" | awk {'print $4'} )
echo "MD5 (${packagename// /}-${version}-r${revision}.pkg) = ${md5}" > "${1%/*}/${packagename// /}-${version}-r${revision}.pkg.md5"
echo ""
echo -e $COL_BLACK"--------------------------"$COL_RESET
echo -e $COL_BLACK"Building process complete!"$COL_RESET
echo -e $COL_BLACK"--------------------------"$COL_RESET
echo ""
echo -e $COL_BLACK"Build info."
echo -e $COL_BLACK"==========="
branches/iFabio/Chameleon/package/Scripts/Standard/postinstall
291291
292292
293293
294
295
294
295
296296
297297
298298
299299
300
301
300
301
302302
303303
304304
......
332332
333333
334334
335
335
336336
337337
338338
......
342342
343343
344344
345
345
346346
347347
348348
#---------------------------------------------------------------------
if [ ${disksignature} == "00000000" ]; then
echo "Executing command: fdisk -u -f /usr/standalone/i386/${diskloader} -y ${bootdisk}"
fdisk -u -f "${bootvolume}/usr/standalone/i386/${diskloader}" -y ${bootdisk}
echo "Executing command: fdisk440 -u -f /usr/standalone/i386/${diskloader} -y ${bootdisk}"
fdisk440 -u -f "${bootvolume}/usr/standalone/i386/${diskloader}" -y ${bootdisk}
else
#---------------------------------------------------------------------
# If it exists then Windows is also installed on the HDD and we need to write boot0hfs
#---------------------------------------------------------------------
echo "Executing command: fdisk -u -f /usr/standalone/i386/${diskloaderdualboot} -y ${bootdisk}"
fdisk -u -f "${bootvolume}/usr/standalone/i386/${diskloaderdualboot}" -y ${bootdisk}
echo "Executing command: fdisk440 -u -f /usr/standalone/i386/${diskloaderdualboot} -y ${bootdisk}"
fdisk440 -u -f "${bootvolume}/usr/standalone/i386/${diskloaderdualboot}" -y ${bootdisk}
fi
else
echo "Diskupdate is false, so no stage 0 file was written"
if [ ${disksignature} == "00000000" ]; then
# echo "Windows is not installed so let's change the active partition"
partitionactive=$( fdisk -d ${bootrdisk} | grep -n "*" | awk -F: '{print $1}')
partitionactive=$( fdisk440 -d ${bootrdisk} | grep -n "*" | awk -F: '{print $1}')
echo "Current Active Partition: ${partitionactive}"
if [ "${partitionactive}" = "${bootslice}" ]; then
# BadAxe requires EFI partition to be flagged active.
# but it doesn't' hurt to do it for any non-windows partition.
fdisk -e ${bootrdisk} <<-MAKEACTIVE
fdisk440 -e ${bootrdisk} <<-MAKEACTIVE
print
flag ${bootslice}
write
branches/iFabio/Chameleon/package/Scripts/EFI/postinstall
11
22
3
4
5
6
7
3
4
5
6
7
88
99
1010
......
434434
435435
436436
437
437
#!/bin/bash
diskloader="/usr/standalone/i386/boot0"
diskloaderdualboot="/usr/standalone/i386/boot0hfs"
partitionloaderhfs="/usr/standalone/i386/boot1h"
partitionloaderfat="/usr/standalone/i386/boot1f32"
filesystemloader="/usr/standalone/i386/boot"
diskloader="boot0"
diskloaderdualboot="boot0hfs"
partitionloaderhfs="boot1h"
partitionloaderfat="boot1f32"
filesystemloader="boot"
bootervolumename="EFI"
booterextensions="Extra/Extensions"
#ln -s "/Volumes/${bootervolumename}" "${2}/.Chameleon"
# setup link for extras
exit
exit

Archive Download the corresponding diff file

Revision: 278