/usr/bin/uck-remaster-finalize-alternate is in uck 2.4.7-0ubuntu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | #!/bin/bash
###################################################################################
# UCK - Ubuntu Customization Kit #
# Copyright (C) 2006-2010 UCK Team #
# #
# UCK is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# UCK is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with UCK. If not, see <http://www.gnu.org/licenses/>. #
###################################################################################
KEY_ID="$1"
REMASTER_HOME="$2"
#############################
# general purpose functions #
#############################
function usage()
{
echo "Usage: $0 gpg-key-id [remaster-dir]"
}
function failure()
{
echo "$@"
exit 1
}
#########################
# input parameter check #
#########################
if [ -z "$KEY_ID" ]; then
usage
exit 1
fi
if [ -z "$REMASTER_HOME" ]; then
REMASTER_HOME=~/tmp
fi
########
# main #
########
. libraries/remaster-live-cd.sh 2>/dev/null || . /usr/lib/uck/remaster-live-cd.sh 2>/dev/null || failure "libraries not found"
ISO_REMASTER_DIR="$REMASTER_HOME/remaster-iso"
REMASTER_ALT_TMP="$REMASTER_HOME/remaster-alt-tmp"
if [ ! -e "$ISO_REMASTER_DIR" ]; then
failure "ISO remastering directory does not exists"
fi
##########################
# detecting architecture #
##########################
if [ ! -d "$ISO_REMASTER_DIR"/dists/stable/main ]; then
ARCH=$(ls $ISO_REMASTER_DIR/dists/stable/main | grep binary | cut -d \- -f2 | head -1)
else
ARCH=$(ls "$ISO_REMASTER_DIR"/install/netboot/ubuntu-installer/)
fi
############################
# creating pool structures #
############################
mkdir -p $ISO_REMASTER_DIR/dists/stable/extras/binary-$ARCH $ISO_REMASTER_DIR/pool/extras
mkdir -p $REMASTER_ALT_TMP/keyring
mkdir -p $REMASTER_ALT_TMP/indices
#####################################
# creating realease file for extras #
#####################################
cat $ISO_REMASTER_DIR/dists/stable/main/binary-$ARCH/Release | sed 's/Component: main/Component: extras/' > $ISO_REMASTER_DIR/dists/stable/extras/binary-$ARCH/Release
##############################
# detecting release codename #
##############################
cd $ISO_REMASTER_DIR/dists
RELEASE_CODENAME=`find stable -printf %l`
#######################
# downloading indices #
#######################
cd $REMASTER_ALT_TMP/indices
wget -c http://archive.ubuntu.com/ubuntu/indices/override.$RELEASE_CODENAME.{extra.main,main,main.debian-installer,restricted,restricted.debian-installer}
#############################
# processing ubuntu-keyring #
#############################
cd $REMASTER_ALT_TMP/keyring
apt-get source ubuntu-keyring
cd ubuntu-keyring-*/keyrings
gpg --import < ubuntu-archive-keyring.gpg
PACKAGE_SIGN=`gpg --list-keys $KEY_ID | grep uid | sed 's/uid *//'`
gpg --export FBB75451 437D05B5 $KEY_ID > ubuntu-archive-keyring.gpg
cd ..
dpkg-buildpackage -rfakeroot -m"$PACKAGE_SIGN" -k$KEY_ID
cd ..
cp ubuntu-keyring*deb $ISO_REMASTER_DIR/pool/main/u/ubuntu-keyring
#######################
# generating apt.conf #
#######################
cat $ISO_REMASTER_DIR/dists/$RELEASE_CODENAME/Release | egrep -v "^ " | egrep -v "^(Date|MD5Sum|SHA1|SHA256)" | sed 's/: / "/' | sed 's/^/APT::FTPArchive::Release::/' | sed 's/$/";/' > $REMASTER_ALT_TMP/apt.conf
######################################
# generating apt-ftparchive-deb.conf #
######################################
echo "Dir {
ArchiveDir \"$ISO_REMASTER_DIR\";
};
TreeDefault {
Directory \"pool/\";
};
BinDirectory \"pool/main\" {
Packages \"dists/$RELEASE_CODENAME/main/binary-$ARCH/Packages\";
BinOverride \"$REMASTER_ALT_TMP/indices/override.$RELEASE_CODENAME.main\";
ExtraOverride \"$REMASTER_ALT_TMP/indices/override.$RELEASE_CODENAME.extra.main\";
};
BinDirectory \"pool/restricted\" {
Packages \"dists/$RELEASE_CODENAME/restricted/binary-$ARCH/Packages\";
BinOverride \"$REMASTER_ALT_TMP/indices/override.$RELEASE_CODENAME.restricted\";
};
Default {
Packages {
Extensions \".deb\";
Compress \". gzip\";
};
};
Contents {
Compress \"gzip\";
};" > $REMASTER_ALT_TMP/apt-ftparchive-deb.conf
#######################################
# generating apt-ftparchive-udeb.conf #
#######################################
echo "Dir {
ArchiveDir \"$ISO_REMASTER_DIR\";
};
TreeDefault {
Directory \"pool/\";
};
BinDirectory \"pool/main\" {
Packages \"dists/$RELEASE_CODENAME/main/debian-installer/binary-$ARCH/Packages\";
BinOverride \"$REMASTER_ALT_TMP/indices/override.$RELEASE_CODENAME.main.debian-installer\";
};
BinDirectory \"pool/restricted\" {
Packages \"dists/$RELEASE_CODENAME/restricted/debian-installer/binary-$ARCH/Packages\";
BinOverride \"$REMASTER_ALT_TMP/indices/override.$RELEASE_CODENAME.restricted.debian-installer\";
};
Default {
Packages {
Extensions \".udeb\";
Compress \". gzip\";
};
};
Contents {
Compress \"gzip\";
};" > $REMASTER_ALT_TMP/apt-ftparchive-udeb.conf
#########################################
# generating apt-ftparchive-extras.conf #
#########################################
echo "Dir {
ArchiveDir \"$ISO_REMASTER_DIR\";
};
TreeDefault {
Directory \"pool/\";
};
BinDirectory \"pool/extras\" {
Packages \"dists/$RELEASE_CODENAME/extras/binary-$ARCH/Packages\";
};
Default {
Packages {
Extensions \".deb\";
Compress \". gzip\";
};
};
Contents {
Compress \"gzip\";
};" > $REMASTER_ALT_TMP/apt-ftparchive-extras.conf
##########################
# running apt-ftparchive #
##########################
cd $ISO_REMASTER_DIR
apt-ftparchive -c $REMASTER_ALT_TMP/apt.conf generate $REMASTER_ALT_TMP/apt-ftparchive-deb.conf
apt-ftparchive -c $REMASTER_ALT_TMP/apt.conf generate $REMASTER_ALT_TMP/apt-ftparchive-udeb.conf
apt-ftparchive -c $REMASTER_ALT_TMP/apt.conf generate $REMASTER_ALT_TMP/apt-ftparchive-extras.conf
apt-ftparchive -c $REMASTER_ALT_TMP/apt.conf release dists/$RELEASE_CODENAME/ > dists/$RELEASE_CODENAME/Release
###################
# signing release #
###################
rm -f $ISO_REMASTER_DIR/dists/$RELEASE_CODENAME/Release.gpg
gpg --default-key "$KEY_ID" --output $ISO_REMASTER_DIR/dists/$RELEASE_CODENAME/Release.gpg -ba $ISO_REMASTER_DIR/dists/$RELEASE_CODENAME/Release
|