~tsimonq2/debian-cd/lubuntu-cosmic-changes

« back to all changes in this revision

Viewing changes to tools/calc

  • Committer: Colin Watson
  • Date: 2006-03-22 11:46:32 UTC
  • Revision ID: Arch-1:colin.watson@canonical.com--2005%debian-cd--ubuntu--0--patch-285
Add subarchitecture support
Add a simple kind of subarchitecture support; subarchitectures (e.g.
i386+mac) are distinguished by different boot methods. Subarchitectures have
a different set of temporary directories and different boot scripts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
2
 
3
3
# This script tries to get good estimations into the .calc files at
4
 
# boot/$CODENAME/boot-$ARCH.calc, so you can use it whenever you want to
 
4
# boot/$CODENAME/boot-$FULLARCH.calc, so you can use it whenever you want to
5
5
# update these .calc files with more recent estimations.
6
6
 
7
 
# It uses info taken from the temporary dir of a previous build for $ARCH,
 
7
# It uses info taken from the temporary dir of a previous build for $FULLARCH,
8
8
# $CODENAME. This doesn't need to be a full build, you can get the needed
9
9
# stuff by running a build.sh with something like:
10
10
# IMAGETARGET="ok bootable upgrade bin-infos bin-list"
11
11
 
12
12
# Temporary directory of the previous build.
13
 
BDIR="$TDIR/$CODENAME-$ARCH"
 
13
BDIR="$TDIR/$CODENAME-$FULLARCH"
14
14
 
15
15
#Get info from older build if it exists
16
16
if [ -d "$BDIR" ];
17
17
then
18
18
  echo Estimated sizes:
19
 
  rm -f "boot/$CODENAME/boot-$ARCH.calc"
 
19
  rm -f "boot/$CODENAME/boot-$FULLARCH.calc"
20
20
  for i in `du -sm "$BDIR"/CD[0123456789]* |
21
21
              sed -n 's/^\([0-9]\+\).*CD\([0-9]\+\)/\2=\1/p'`
22
22
  do
30
30
    fi
31
31
    #add it all up and write it to the .calc file
32
32
    echo BOOT_SIZE_${i%=*}=${i#*=}+$imgdu
33
 
    echo BOOT_SIZE_${i%=*}=$((${i#*=}+$imgdu)) >> "boot/$CODENAME/boot-$ARCH.calc"
34
 
    case "$ARCH" in
35
 
      m68k)     echo SIZE_MULT_${i%=*}=97 >> "boot/$CODENAME/boot-$ARCH.calc";;
 
33
    echo BOOT_SIZE_${i%=*}=$((${i#*=}+$imgdu)) >> "boot/$CODENAME/boot-$FULLARCH.calc"
 
34
    case "$FULLARCH" in
 
35
      m68k)     echo SIZE_MULT_${i%=*}=97 >> "boot/$CODENAME/boot-$FULLARCH.calc";;
36
36
    esac
37
37
  done
38
38
fi
42
42
   [ -n "$SIZELIMIT" ] && [ "$SIZELIMIT" -gt 1000000000 ] ||
43
43
   [ -n "$DEFBINSIZE" ] && [ "$DEFBINSIZE" -gt 1000 ]
44
44
then
45
 
  case "$ARCH" in
46
 
    powerpc)     echo SIZE_MULT_1=92 >> "boot/$CODENAME/boot-$ARCH.calc";;
 
45
  case "$FULLARCH" in
 
46
    powerpc)     echo SIZE_MULT_1=92 >> "boot/$CODENAME/boot-$FULLARCH.calc";;
47
47
  esac
48
48
else
49
 
  case "$ARCH" in
50
 
    powerpc)     echo SIZE_MULT_1=96 >> "boot/$CODENAME/boot-$ARCH.calc";;
 
49
  case "$FULLARCH" in
 
50
    powerpc)     echo SIZE_MULT_1=96 >> "boot/$CODENAME/boot-$FULLARCH.calc";;
51
51
  esac
52
52
fi