Skip to content

Commit a666728

Browse files
committed
Version 1.0. Needs testing but should do everything.
ROM Modders wanted.
1 parent e5c78a3 commit a666728

File tree

7 files changed

+183
-59
lines changed

7 files changed

+183
-59
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
*.zip
22
tmp_files
33
data
4+
table.sct
5+
rom-partition

README

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# This file describes what the user has to do currently
22
# to get a custom ROM image.
33

4-
edit custom.conf, staying strictly to the rules
4+
run customize-rom.sh
5+
6+
OR
7+
8+
run modFiles.pl
59
remove the data directory if you want to start from scratch
610
run reget_files.sh to be sure you have all the files
7-
run customize_rom.sh to remove unwanted files (only removes for now)
11+
run rm-files.sh to remove unwanted files (only removes for now)
812
run makerom.sh with "-d XdX" to write to the drive at /dev/XdX
913
or
1014
run makerom.sh without "-d" to just make a rom-partition file
11-

appMap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@ QuickTour - That annoying post-hard-reset app|pTutorial
2121
Movie|p100.asf
2222
JPGs|P*.jpg
2323
Tmobile|Parrow.gif|Pback_arrow.gif|Pbtn_ready2sign.gif|Pbtn_signup.gif|Phdr_tmobile.gif|Pnext_arrow.gif|ptmobile|PTMobileHotSpot.prc
24-

customize-rom.sh

Lines changed: 35 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,41 @@
11
#!/bin/sh
2-
#
3-
4-
cut_line()
5-
{
6-
echo $1 | cut -c $2
7-
}
8-
9-
echo "" > locales
10-
echo "" > remove_files
11-
12-
cat custom.conf | while read LINE; do
13-
if [ ! -z "$LINE" -a "`echo $LINE | cut -c 1`" != "#" ]; then
14-
15-
# remove this locale
16-
if [ "$(cut_line $LINE 1)" == "l" ]; then
17-
LOCALE="$(cut_line $LINE "1-6")"
18-
# case $LOCALE in
19-
# * ) echo "$LOCALE" >> locales
20-
echo "$LOCALE" >> locales
21-
# esac
22-
fi
23-
24-
#remove this program
25-
if [ "$(cut_line $LINE 1)" = "p" -o "$(cut_line $LINE 1)" = "P" ]; then
26-
PROGRAM="$(cut_line $LINE "1-")"
27-
BEGINN="$(cut_line $LINE "1")"
28-
case $BEGINN in
29-
p ) echo "$PROGRAM\*" >> remove_files
30-
P ) echo "$PROGRAM" >> remove_files
31-
esac
32-
fi
33-
34-
fi
2+
#run modFiles.pl
3+
#remove the data directory if you want to start from scratch
4+
#run reget_files.sh to be sure you have all the files
5+
#run rm-files.sh to remove unwanted files (only removes for now)
6+
#run makerom.sh with "-d XdX" to write to the drive at /dev/XdX
7+
# or
8+
#run makerom.sh without "-d" to just make a rom-partition file
9+
10+
./modFiles.pl
11+
echo ""
12+
echo -n "Do you wish to start with fresh files? [Y/n] "
13+
while read -n 1 YESNO; do
14+
if [ "$YESNO" == "y" -o "$YESNO" == "Y" ]; then
15+
rm -rf data
16+
fi
17+
if [ "$YESNO" == "n" -o "$YESNO" == "N" ]; then
18+
break
19+
fi
3520
done
3621

37-
if [ ! -d data ]; then
38-
unzip brahma-palmos -d data > /dev/null || exit
39-
fi
40-
41-
cd data
42-
mv ../locales ./
43-
mv ../remove_files ./
44-
45-
# Removes locales not wanted
46-
cat locales | while read LOCALE; do
47-
if [ -n "$LOCALE" ]; then
48-
LOCALE=${LOCALE:1:5}
49-
#rm *$LOCALE.oprc
22+
echo ""
23+
echo "Getting any necessary files now:"
24+
25+
./reget_files.sh
26+
./rm-files.sh
27+
28+
echo "If you know the /dev/ entry of your microdrive, enter it now."
29+
echo "If you do not, enter \"dunno\" without quotes."
30+
while read DEV; do
31+
if [ -n "$DEV" -a "$DEV" != "dunno" ]; then
32+
DDEV="-d $DEV"
33+
break
34+
elif [ "$DEV" == "dunno" ]; then
35+
DDEV=""
36+
break
5037
fi
5138
done
5239

53-
# Removes programs not wanted
54-
cat remove_files | while read PROG; do
55-
if [ -n "$PROG" ]; then
56-
LOCALE=${LOCALE:1:5}
57-
58-
#rm *$LOCALE.oprc
59-
fi
60-
done
40+
./make_rom.sh $DDEV
41+
echo "Finished."

make_rom.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if [ "$1" == "--help" -o "$1" == "-h" ]; then
77
fi
88

99
cd data
10-
zip ../data.zip *
10+
zip ../data.zip * > /dev/null
1111
cd ..
1212

1313
python makecafe.py -c data.zip > rom-partition

modFiles.pl

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#!/usr/bin/perl
2+
# Fahhem's attempt at writing a perl script to customize the
3+
# LD BigROM. I haven't used perl for many years and I don't
4+
# even remember what I wrote with it.
5+
6+
# Loop through the non-comment lines in appMap
7+
# Ask if they want the app
8+
# If no, continue;
9+
# If yes, add the lines to custom.conf
10+
11+
$customconf = 'custom.conf';
12+
$appmap = 'appMap';
13+
14+
# create a lock file
15+
$lockfile="custom.conf.loc";
16+
if (-e $lockfile) {
17+
print "Please wait for other instances of this program to finish.\nIf there are no instances running, delete $lockfile.\n";
18+
die;
19+
}
20+
open (LOCK,">$lockfile") || die ("Cannot open lock file!\n");
21+
close (LOCK);
22+
23+
open (CONF,">$customconf");
24+
print CONF <<EOF;
25+
# Comments start with #
26+
#
27+
# HowTo Modify this file:
28+
#
29+
# General info:
30+
# Locale: l_LOCALE
31+
# Program with ending wildcard: pFILENAMES
32+
# Program with no wildcards: PFILENAME
33+
# Program with beginning/middle wildcards: PBEGINNING*MIDDLE*ENDING
34+
#
35+
# Verbose info:
36+
# To delete a locale, place:
37+
# "l_enUS" for enUS and "l_ptBR" for brazilian portugese
38+
# programs are "pNAME" so pAddIt removes files starting with AddIt
39+
# for support with name with wildcards in different places, put a *
40+
# in the name.
41+
# To specify that tmobile filenames are tmobile*_app* you can put
42+
# ptmobile*_app (the last * is implied unless you put P at the beginning)
43+
#
44+
EOF
45+
46+
47+
open (FILE,$appmap);
48+
@lines = <FILE>;
49+
close(FILE);
50+
51+
foreach $line(@lines) {
52+
if ($line !~ /^#/ )
53+
{
54+
#print $line;
55+
$_=$line;
56+
/\|/;
57+
#print "$`\n$&\n$'\n";
58+
$start=$`;
59+
$line=$';
60+
print "Do you want to remove $start? ";
61+
while(chomp($yesno = <>))
62+
{
63+
if ( $yesno =~ /^y/i ) {
64+
$start=~ s/^(\S+) *.*$/\1/;
65+
print "$start will be removed.\n";
66+
while ($line =~ /(.+?)(\||\Z)/g) {
67+
print CONF "$1\n";
68+
}
69+
last;
70+
} elsif ( $yesno =~ /^n/i ) {
71+
print "$start will be kept.\n";
72+
last;
73+
}
74+
}
75+
}
76+
}
77+
close(CONF);
78+
print "Finished.\n";
79+
unlink($lockfile);

rm-files.sh

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/sh
2+
#
3+
4+
cut_line()
5+
{
6+
echo $1 | cut -c $2
7+
}
8+
9+
echo "" > locales
10+
echo "" > remove_files
11+
12+
cat custom.conf | while read LINE; do
13+
if [ ! -z "$LINE" -a "`echo $LINE | cut -c 1`" != "#" ]; then
14+
15+
# remove this locale
16+
if [ "$(cut_line $LINE 1)" == "l" ]; then
17+
LOCALE="$(cut_line $LINE "1-6")"
18+
# case $LOCALE in
19+
# * ) echo "$LOCALE" >> locales
20+
echo "$LOCALE" >> locales
21+
# esac
22+
fi
23+
24+
#remove this program
25+
if [ "$(cut_line $LINE 1)" = "p" -o "$(cut_line $LINE 1)" = "P" ]; then
26+
PROGRAM="$(cut_line $LINE "1-")"
27+
BEGINN="$(cut_line $LINE "1")"
28+
case $BEGINN in
29+
"p") echo "$PROGRAM\*" >> remove_files;;
30+
"P") echo "$PROGRAM" >> remove_files;;
31+
esac
32+
fi
33+
34+
fi
35+
done
36+
37+
if [ ! -d data ]; then
38+
unzip brahma-palmos -d data > /dev/null || exit
39+
fi
40+
41+
cd data
42+
mv ../locales ./
43+
mv ../remove_files ./
44+
45+
# Removes locales not wanted
46+
cat locales | while read LOCALE; do
47+
if [ -n "$LOCALE" ]; then
48+
LOCALE=${LOCALE:1:5}
49+
#rm *$LOCALE.oprc
50+
fi
51+
done
52+
53+
# Removes programs not wanted
54+
cat remove_files | while read PROG; do
55+
if [ -n "$PROG" ]; then
56+
LOCALE=${LOCALE:1:5}
57+
58+
#rm *$LOCALE.oprc
59+
fi
60+
done

0 commit comments

Comments
 (0)