Commit 7c3b85bb authored by OSAK Buildhauer's avatar OSAK Buildhauer

Finished create_offlinerepo.sh and added offlinerepo creation to build process

parent 2d7f46ec
......@@ -24,6 +24,7 @@ mv "$workspace/part_files"/grub/* "$workspace/part_files"/boot/grub/
rm -rf "$workspace/part_files"/grub
cp "$iso_file" "$workspace/part_files/kubuntu.iso"
./create_offlinerepo.sh "$workspace/part_files/archive" "$iso_file" vim htop
rm -f "$workspace/part.img"
truncate -s "$image_size" "$workspace/part.img"
......
......@@ -17,24 +17,52 @@ shift || usage
packages="$@"
workspace="/workspace"
APT_SOURCE_URL_OVERRIDE="http://ftp.halifax.rwth-aachen.de/ubuntu/"
rm -rf "$workspace"/offlinerepo
mkdir -p "$workspace"/offlinerepo
mkdir -p "$dest"
7z e -so "$iso_file" casper/filesystem.squashfs > "$workspace"/offlinerepo/filesystem.squashfs
unsquashfs -no-xattrs -d "$workspace"/offlinerepo/squashfs-root "$workspace"/offlinerepo/filesystem.squashfs
ISO_RELEASE="$(grep DISTRIB_CODENAME "$workspace/offlinerepo/squashfs-root/etc/lsb-release" | cut -d= -f 2-)"
ISO_VERSION="$(grep DISTRIB_RELEASE "$workspace/offlinerepo/squashfs-root/etc/lsb-release" | cut -d= -f 2-)"
ISO_DESCRIPTION="$(grep DISTRIB_DESCRIPTION "$workspace/offlinerepo/squashfs-root/etc/lsb-release" | cut -d'"' -f 2)"
echo "deb $APT_SOURCE_URL_OVERRIDE ${ISO_RELEASE} main restricted universe multiverse" > "$workspace/offlinerepo/squashfs-root/etc/apt/sources.list"
echo "deb $APT_SOURCE_URL_OVERRIDE ${ISO_RELEASE}-security main restricted universe multiverse" >> "$workspace/offlinerepo/squashfs-root/etc/apt/sources.list"
echo "deb $APT_SOURCE_URL_OVERRIDE ${ISO_RELEASE}-updates main restricted universe multiverse" >> "$workspace/offlinerepo/squashfs-root/etc/apt/sources.list"
apt-get -o Dir="$workspace"/offlinerepo/squashfs-root update
{
apt-get -o Dir="$workspace"/offlinerepo/squashfs-root upgrade --print-uris -qq
apt-get -o Dir="$workspace"/offlinerepo/squashfs-root install --reinstall --print-uris -qq $packages
} | cut -d"'" -f2 | while read url; do wget -nc -P "$dest" "$url"; done
apt-get -o Dir="$workspace"/offlinerepo/squashfs-root install --reinstall --print-uris -qq $packages
{
cd "$dest"
rm -rf "$dest"/Packages.*
dpkg-scanpackages . | gzip > Packages.gz
}
mkdir -p "$dest/dists/$ISO_RELEASE/lip/binary-amd64"
( cd "$dest" && dpkg-scanpackages . | gzip > "dists/$ISO_RELEASE/lip/binary-amd64/Packages.gz" )
cat <<EOF > "$dest/dists/$ISO_RELEASE/lip/binary-amd64/Release"
Archive: $ISO_RELEASE
Version: $ISO_VERSION
Component: lip
Origin: Ubuntu
Label: Ubuntu
Architecture: amd64
EOF
touch "$dest/.aptignr"
cat <<EOF > "$dest/Release"
Origin: Ubuntu
Label: LIP Ubuntu Extra Packages
Suite: $ISO_RELEASE
Version: $ISO_VERSION
Codename: $ISO_RELEASE
Date: $(LC_ALL=C date -u)
Architectures: amd64
Components: lip
Description: $ISO_DESCRIPTION
EOF
# Maybe sort files into the usual directory structure ("pool/main/g/glib2.0...")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment