2011-02-07 21:30:21 -01:00
|
|
|
#!/bin/bash -e
|
|
|
|
#
|
2017-06-19 13:00:05 +00:00
|
|
|
# boot-sparc64
|
2011-02-07 21:30:21 -01:00
|
|
|
#
|
2017-06-19 13:00:05 +00:00
|
|
|
# Do install stuff for sparc64, including making first CD bootable
|
2011-02-07 21:30:21 -01:00
|
|
|
|
|
|
|
. $BASEDIR/tools/boot/$DI_CODENAME/common.sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
N=$1
|
|
|
|
CDDIR=$2
|
|
|
|
|
2017-06-19 13:00:05 +00:00
|
|
|
# Exit if this is not CD#1/DVD#1
|
|
|
|
if [ $N != "1" ]; then
|
|
|
|
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"
|
|
|
|
exit 0
|
2011-02-07 21:30:21 -01:00
|
|
|
fi
|
|
|
|
|
2017-06-19 13:00:05 +00:00
|
|
|
if [ "$DI_WWW_HOME" = "default" ]; then
|
|
|
|
DI_WWW_HOME="https://d-i.debian.org/daily-images/sparc64/daily/cdrom/"
|
|
|
|
try_di_image_cache
|
|
|
|
else
|
|
|
|
DI_WWW_HOME=$(echo $DI_WWW_HOME | sed "s,%ARCH%,$ARCH,")
|
|
|
|
fi
|
2011-02-07 21:30:21 -01:00
|
|
|
|
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-G boot1/boot/isofs.b -B ..."
|
|
|
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_dirs "boot1"
|
|
|
|
|
|
|
|
inst=boot1
|
|
|
|
|
|
|
|
cd $CDDIR/..
|
|
|
|
|
|
|
|
# Setup directories
|
|
|
|
mkdir -p $inst/boot
|
|
|
|
|
|
|
|
silo_deb=$(find_pkg_file silo)
|
|
|
|
if [ -z "$silo_deb" ]; then
|
|
|
|
echo "ERROR: silo package is required"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
# put the relevant parts of SILO boot loader
|
|
|
|
(dpkg --fsys-tarfile $MIRROR/$silo_deb | \
|
|
|
|
tar xf - -C $inst/ ./boot/{isofs,second}.b)
|
|
|
|
|
2013-03-07 05:34:07 -01:00
|
|
|
if [ -n "$ARCHIVE_EXTRACTED_SOURCES" ]; then
|
|
|
|
echo $silo_deb >> $CDDIR/../$N.pkgs_extracted
|
|
|
|
find_pkg_file silo source >> $CDDIR/../$N.pkgs_extracted
|
|
|
|
fi
|
2011-02-07 21:30:21 -01:00
|
|
|
|
|
|
|
# Some custom etc files
|
2017-06-19 13:07:09 +00:00
|
|
|
cp -f -p $BASEDIR/data/${CODENAME}/sparc64/silo.conf $inst/boot/
|
2011-02-07 21:30:21 -01:00
|
|
|
if [ -n "$KERNEL_PARAMS" ]; then
|
|
|
|
# Add KERNEL_PARAMS to any existing append line
|
|
|
|
sed -i "/^[[:space:]]*append=\"/ s|append=\"|append=\"$KERNEL_PARAMS |" \
|
|
|
|
$inst/boot/silo.conf
|
|
|
|
# If there is no default append= line, add it
|
|
|
|
if ! grep -q "^append=" $inst/boot/silo.conf; then
|
|
|
|
sed -i "/^default=/ a\append=\"$KERNEL_PARAMS\"" \
|
|
|
|
$inst/boot/silo.conf
|
|
|
|
fi
|
|
|
|
fi
|
2017-06-19 13:07:09 +00:00
|
|
|
cat $BASEDIR/data/${CODENAME}/sparc64/debian.txt \
|
2011-02-07 21:30:21 -01:00
|
|
|
| sed "s/\${MEDIA_TYPE}/CDROM/" \
|
|
|
|
| sed "s/\${DEBIAN_VERSION}/${CODENAME}/g" \
|
|
|
|
| sed "s/\${BUILD_DATE}/${BUILD_DATE}/g" \
|
|
|
|
> $inst/boot/debian.txt
|
2017-06-19 13:07:09 +00:00
|
|
|
cp $BASEDIR/data/${CODENAME}/sparc64/notsupported.txt $inst/boot/
|
2011-02-07 21:30:21 -01:00
|
|
|
|
|
|
|
# Sparc64 kernel is so big, that uncompressing it corrupts SILO memory, so
|
|
|
|
# uncompress it before hand.
|
|
|
|
|
|
|
|
if [ ! "$DI_WWW_HOME" ];then
|
|
|
|
if [ ! "$DI_DIR" ];then
|
|
|
|
DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images/cdrom"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
DI_DIR="cdrom"
|
|
|
|
mkdir "./$DI_DIR"
|
2016-01-03 11:54:46 -01:00
|
|
|
$WGET "$DI_WWW_HOME" -O ./$DI_DIR/di.dir
|
2011-02-07 21:30:21 -01:00
|
|
|
sparc64=$(sed -n 's/.*a href="\(vmlinuz-.*-sparc64\)".*/\1/ip' ./$DI_DIR/di.dir)
|
2016-01-03 11:54:46 -01:00
|
|
|
$WGET "$DI_WWW_HOME/$sparc64" -O ./$DI_DIR/vmlinuz-x-sparc64
|
|
|
|
$WGET "$DI_WWW_HOME/initrd.gz" -O ./$DI_DIR/initrd.gz
|
2011-02-07 21:30:21 -01:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -e "$DI_DIR"/initrd.gz ] ; then
|
2017-09-06 12:13:51 +00:00
|
|
|
DI_DIR="$DI_DIR"/cdrom
|
2011-02-07 21:30:21 -01:00
|
|
|
fi
|
|
|
|
cp "$DI_DIR"/initrd.gz "$inst/boot/initrd.gz"
|
|
|
|
#cp "$DI_DIR"/vmlinuz-*-sparc32 "$inst/boot/sparc32"
|
|
|
|
zcat "$DI_DIR"/vmlinuz-*-sparc64 > "$inst/boot/sparc64"
|