File: boot-sparc64

package info (click to toggle)
debian-cd 3.2.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,848 kB
  • sloc: sh: 6,129; perl: 4,129; makefile: 413
file content (86 lines) | stat: -rwxr-xr-x 2,511 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
#
# Do install stuff for sparc64, including making bootable CDs
# Works with debian-installer
#
# $1 is the CD number
# $2 is the temporary CD build dir

. $BASEDIR/tools/boot/$DI_CODENAME/common.sh

set -e
#set -x

N=$1
CDDIR=$2
INSTALLDIR=$CDDIR/install

# Common mkisofs options when creating CDs
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-J -joliet-long"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-cache-inodes"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-l"

# mkisofs options specific to sparc64
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-G $CDDIR/../CD1/cdboot.img"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-B '...'"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "--grub2-sparc-core /boot/grub/core.img"

# Exit if this is not CD#1/DVD#1
if [ $N != "1" ]; then
    exit 0
fi

if [ "$DI_WWW_HOME" = "default" ]; then
    DI_WWW_HOME="https://d-i.debian.org/daily-images/sparc64/daily"
    try_di_image_cache
else
    DI_WWW_HOME=$(echo $DI_WWW_HOME | sed "s,%ARCH%,$ARCH,")
fi

case "$MKISOFS" in
    *xorriso*)
        XORRISO_VER=$(xorriso_version)
        ;;
    *)
	echo "ERROR: debian-cd now depends on xorriso for making sparc64 bootable CDs."
	exit 1;
	;;
esac

cd $CDDIR/..

BOOT_IMAGES="cdrom/initrd.gz cdrom/vmlinux cdrom/debian-cd_info.tar.gz"

# Download boot images.
for image in $BOOT_IMAGES; do
    if [ ! -e "$image" ]; then
        dir=$(dirname $image)
        mkdir -p $dir
        if [ -n "$LOCAL"  -a -f "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" ]; then
            cp "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" "$image"
        elif [ ! "$DI_WWW_HOME" ];then
            if [ ! "$DI_DIR" ];then
                DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images"
            fi
            cp "$DI_DIR/$image" "$image"
        else
            $WGET "$DI_WWW_HOME/$image" -O "$image"
        fi
    fi
done

# Boot setup including config and help files comes from d-i.
mkdir -pv $PWD/CD$N
cat cdrom/debian-cd_info.tar.gz | (cd CD$N/; tar zx)

# Prepend cdboot.img with 512 zero bytes as block 0 contains
# the SUN disk label and would get overwritten by xorriso
dd if=/dev/zero of=$CDDIR/../CD1/cdboot.img bs=512 count=1
dd if=$CDDIR/../CD1/boot/grub/sparc64-ieee1275/cdboot.img of=$CDDIR/../CD1/cdboot.img bs=512 count=1 oflag=append conv=notrunc

# Copy kernel and initrd
mkdir -p $INSTALLDIR
cp -lf cdrom/vmlinux $INSTALLDIR/
cp -lf cdrom/initrd.gz $INSTALLDIR/

exit 0