~ubuntu-core-dev/debian-installer/xenial-proposed

« back to all changes in this revision

Viewing changes to build/util/arm/thecus/up.sh

  • Committer: Colin Watson
  • Date: 2007-11-28 18:32:20 UTC
  • mfrom: (664.2.2667)
  • Revision ID: cjwatson@canonical.com-20071128183220-ilixcc1n5fw1m2t6
Tags: 20061102ubuntu1
* Resynchronise with Debian. Remaining changes:
  - Ubuntu branding of various kinds.
  - Use Ubuntu kernels. Various tweaks for different udeb splits.
  - Fetch distribution name and version number from lsb_release.
  - Use the full version number in image directories.
  - Build-depend on belocs-locales-bin.
  - Various boot screen text adjustments.
  - Add server boot options.
  - Add memtest boot option.
  - Add live CD boot screens.
  - Adjust memory size recommendations.
  - Document pci=noacpi.
  - Add translatable boot screen text for gfxboot.
  - Use ubuntu-keyring-udeb (and gpgv-udeb) instead of the Debian archive
    keyring.
  - Switch all images to initramfs.
  - Add netboot images suitable for USB memory sticks.
  - Remove floppy support, since it never used to work with 2.6. (This may
    be fixed in the future.)
  - Disable gtk frontend.
  - Add kickseed-common and initrd-kickseed to all images containing
    preseed-common and initrd-preseed.
  - Add nfs-modules to all netboot images except powerpc, for Kickstart.
  - kbd-chooser -> console-setup.
  - Include keymap decision tree in all.utf.
  - Replace cdebconf-newt-entropy with cdebconf-newt-detect-keys in
    EXTRAUDEBS.
  - Add bootchart-udeb to all images.
  - Add grepmap-udeb to all images.
  - Add hdparm-udeb to cdrom images.
  - Add nic-firmware to netboot images.
  - Ship elilo configuration on i386 for Intel-based Macs.
  - Use mkvmlinuz'\''s fallback object files on powerpc rather than relying
    on the kernel'\''s.
  - Remove sparc32.
  - Use ${RAMDISK_SIZE} in sparc'\''s silo.conf rather than a hardcoded size.
  - Add input-modules to the sparc netboot image.
* Set default suite to feisty.
* Fix server option to preseed "tasks=standard" instead of
  "pkgsel/install-pattern=~t^ubuntu-standard$".
* Move to 2.6.19-7 kernels. Handle various module udeb changes:
  ide-core-modules, loop-modules, scsi-core-modules, usb-storage-modules
  -> storage-core-modules; lots of filesystem modules -> fs-core-modules,
  fs-secondary-modules.
* Remove auto-install/ai-choosers targets, at least for now.
* Make nic-firmware optional, since it seems to have gone AWOL (filed
  #73896).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# Copyright (C) 2006  Martin Michlmayr <tbm@cyrius.com>
 
4
 
 
5
# This code is covered by the GNU General Public License.
 
6
 
 
7
# See installer/doc/devel/hardware/arm/thecus/firmware for an explanation
 
8
# of the upgrade process on Thecus machines.
 
9
 
 
10
 
 
11
info() {
 
12
        echo "$@" > /tmp/upgrade/message
 
13
}
 
14
 
 
15
debug() {
 
16
        echo "$@" > /tmp/upgrade/debug
 
17
}
 
18
 
 
19
# Note: the firmware upgrade script looks for the string "fail" in the
 
20
# error message, so make sure this passed to the error function.
 
21
error() {
 
22
        info "$@"
 
23
        debug "$@"
 
24
        rm -f /var/lock/upgrade.lock
 
25
        exit 1
 
26
}
 
27
 
 
28
mtddev() {
 
29
        grep "$1" /proc/mtd | cut -d: -f 1 | sed 's/mtd/\/dev\/mtd/'
 
30
}
 
31
 
 
32
mtddevblock() {
 
33
        grep "$1" /proc/mtd | cut -d: -f 1 | sed 's/mtd/\/dev\/mtdblock/'
 
34
}
 
35
 
 
36
 
 
37
 
 
38
lockfile /var/lock/upgrade.lock
 
39
 
 
40
cd /tmp/upgrade
 
41
 
 
42
# If hw_status is 0 the machine is being reset to "factory default".  In
 
43
# our case, this means that we don't check whether the machine name
 
44
# matches /app/manifest.txt.
 
45
HW_STATUS=$(redboot_config get /dev/mtdblock4 hw_status)
 
46
if [ $HW_STATUS -ne 1 ]; then
 
47
        product=$(grep "^type" /app/manifest.txt | cut -f 2)
 
48
        case $product in
 
49
                # N2100 and compatible machines
 
50
                n2100 | all6500)
 
51
                        info "N2100 compatible machine $product found"
 
52
                        ;;
 
53
                # N4100 and compatible machines
 
54
                n4100 | all6400 | PlatinumNAS)
 
55
                        info "N4100 compatible machine $product found"
 
56
                        ;;
 
57
                # Unknown
 
58
                *)
 
59
                        error "Machine detection of $product: fail"
 
60
                        ;;
 
61
        esac
 
62
fi
 
63
 
 
64
if [ ! -e /proc/mtd ]; then
 
65
        error "Finding /proc/mtd: fail"
 
66
fi
 
67
mtdramdisk=$(mtddevblock ramdisk)
 
68
mtdkernel=$(mtddev kernel)
 
69
if [ -z "$mtdramdisk" ]; then
 
70
        error "Finding mtd ramdisk: fail"
 
71
fi
 
72
if [ -z "$mtdkernel" ]; then
 
73
        error "Finding mtd kernel: fail"
 
74
fi
 
75
 
 
76
info "Writing installer ramdisk... please wait..."
 
77
ifile=initrd
 
78
size=$(grep "ramdisk" /proc/mtd | cut -d " " -f 2)
 
79
size=$(printf "%d" 0x$size)
 
80
isize=$(wc -c $ifile | cut -d " " -f 1)
 
81
pad=$(expr $size - $isize)
 
82
(
 
83
        cat $ifile
 
84
        dd if=/dev/zero bs=$pad count=1 2>/dev/null
 
85
) > $mtdramdisk
 
86
if [ $? -ne 0 ]; then
 
87
        error "Upgrading ramdisk: fail"
 
88
fi
 
89
 
 
90
info "Writing installer kernel... please wait..."
 
91
fcp vmlinuz $mtdkernel
 
92
if [ $? -ne 0 ]; then
 
93
        error "Upgrading kernel: fail"
 
94
fi
 
95
 
 
96
echo "Buzzer 0" > /proc/thecus_io
 
97
sleep 1
 
98
echo "Buzzer 1" > /proc/thecus_io
 
99
# The firmware upgrade script looks for the following string.  If it cannot
 
100
# find it, it won't terminate.
 
101
info "success"
 
102
rm -f /var/lock/upgrade.lock
 
103
 
 
104
exit 0
 
105