mirror of
https://github.com/YunoHost/cd_build.git
synced 2024-09-03 20:06:24 +02:00
Merge branch 'master' of https://github.com/YunoHost/cd_build
This commit is contained in:
commit
81c24338e2
4 changed files with 50 additions and 17 deletions
|
@ -13,7 +13,7 @@ Installation
|
||||||
```
|
```
|
||||||
git clone git://github.com/YunoHost/cd_build.git
|
git clone git://github.com/YunoHost/cd_build.git
|
||||||
cd cd_build
|
cd cd_build
|
||||||
sudo apt-get install -f simple-cdd genisoimage qemu-kvm xorriso syslinux-utils
|
sudo apt-get install -f simple-cdd genisoimage qemu-kvm xorriso syslinux-utils cpio
|
||||||
```
|
```
|
||||||
|
|
||||||
Build an image
|
Build an image
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
is_iso() {
|
is_iso() {
|
||||||
file "$1" | grep -q "ISO 9660"
|
file "$1" | grep -q "ISO 9660\|DOS/MBR boot sector"
|
||||||
}
|
}
|
||||||
|
|
||||||
is_initrd() {
|
is_initrd() {
|
||||||
|
|
|
@ -28,23 +28,41 @@ function build
|
||||||
sed -i "s#$REPO_URL jessie stable testing#$REPO_URL $DEB_DIST stable#" profiles/*.preseed
|
sed -i "s#$REPO_URL jessie stable testing#$REPO_URL $DEB_DIST stable#" profiles/*.preseed
|
||||||
sed -i "s#$REPO_URL stretch stable testing#$REPO_URL $DEB_DIST stable#" profiles/*.preseed
|
sed -i "s#$REPO_URL stretch stable testing#$REPO_URL $DEB_DIST stable#" profiles/*.preseed
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Build a simple/regular debian CD image ?
|
||||||
build-simple-cdd --dist $DEB_DIST --conf ./simple-cdd-$ARCH.conf
|
build-simple-cdd --dist $DEB_DIST --conf ./simple-cdd-$ARCH.conf
|
||||||
|
|
||||||
# Find the release version of debian
|
# Find the release version of debian
|
||||||
local DEBNUM="$(grep "Version:" tmp/${DEB_DIST}_Release | awk '{print $2;}')"
|
local DEBNUM="$(grep "Version:" tmp/${DEB_DIST}_Release | awk '{print $2;}')"
|
||||||
|
|
||||||
# Find the release version of YunoHost
|
# Find the release version of YunoHost
|
||||||
wget ${REPO_URL}dists/${DEB_DIST}/${DIST}/binary-i386/Packages.gz
|
info "Finding out current YunoHost's stable vesion number"
|
||||||
|
wget -q ${REPO_URL}dists/${DEB_DIST}/${DIST}/binary-i386/Packages.gz
|
||||||
gunzip Packages.gz
|
gunzip Packages.gz
|
||||||
YNH_VERSION=$(grep "^Package: yunohost$" --after-context=1 Packages | grep "Version" | awk '{print $2;}')
|
YNH_VERSION=$(grep "^Package: yunohost$" --after-context=1 Packages | grep "Version" | awk '{print $2;}')
|
||||||
rm -f Packages
|
rm -f Packages
|
||||||
|
|
||||||
rm -f images/yunohost-$DEB_DIST-$YNH_VERSION-$ARCH-$DIST.iso
|
local CD_STUFF="images/debian-$DEBNUM-$ARCH-CD"
|
||||||
$(pwd)/add-firmware-to images/debian-$DEBNUM-$ARCH-CD-1.iso images/yunohost-$DEB_DIST-$YNH_VERSION-$ARCH-$DIST.iso $DEB_DIST
|
|
||||||
rm -f images/debian-$DEBNUM-$ARCH-CD-1.iso
|
|
||||||
rm -f images/debian-$DEBNUM-$ARCH-CD-1.list.gz
|
|
||||||
success "The image should now be available in images/yunohost-$DEB_DIST-$YNH_VERSION-$ARCH-$DIST.iso"
|
|
||||||
|
|
||||||
|
# build-simple-cdd is stupid and doesn't name its output correctly -.- ...
|
||||||
|
mv images/debian-*-$ARCH-CD-1.iso $CD_STUFF.iso
|
||||||
|
mv images/debian-*-$ARCH-CD-1.list.gz $CD_STUFF.list.gz
|
||||||
|
|
||||||
|
local OUTPUT="images/yunohost-$DEB_DIST-$YNH_VERSION-$ARCH-$DIST.iso"
|
||||||
|
|
||||||
|
[ -e "$CD_STUFF.iso" ] \
|
||||||
|
|| critical "Expected to find $CD_STUFF.iso but it's not here ?"
|
||||||
|
|
||||||
|
rm -f $OUTPUT
|
||||||
|
|
||||||
|
$(pwd)/add-firmware-to $CD_STUFF.iso $OUTPUT $DEB_DIST
|
||||||
|
|
||||||
|
rm -f $CD_STUFF.iso
|
||||||
|
rm -f $CD_STUFF.list.gz
|
||||||
|
|
||||||
|
[ -e $OUTPUT ] \
|
||||||
|
&& success "The image should now be available in $OUTPUT" \
|
||||||
|
|| critical "Something wrong happened when build the image :|"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Sign the new iso
|
# Sign the new iso
|
||||||
|
@ -53,10 +71,14 @@ function sign
|
||||||
{
|
{
|
||||||
local ARCH="$1"
|
local ARCH="$1"
|
||||||
local NAME="images/yunohost-$DEB_DIST-$YNH_VERSION-$ARCH-$DIST.iso"
|
local NAME="images/yunohost-$DEB_DIST-$YNH_VERSION-$ARCH-$DIST.iso"
|
||||||
|
|
||||||
info "Signing image $NAME ..."
|
info "Signing image $NAME ..."
|
||||||
|
|
||||||
|
# Remove previous signature to prevent gpg to ask about overwriting
|
||||||
|
rm -f $NAME.sig
|
||||||
|
|
||||||
gpg --output $NAME.sig --detach-sig $NAME
|
gpg --output $NAME.sig --detach-sig $NAME
|
||||||
|
|
||||||
sha256sum $NAME > $NAME.sum
|
sha256sum $NAME > $NAME.sum
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +86,9 @@ function build_and_sign
|
||||||
{
|
{
|
||||||
local ARCH="$1"
|
local ARCH="$1"
|
||||||
|
|
||||||
rm -r $(pwd)/tmp
|
rm -rf $(pwd)/tmp
|
||||||
|
rm -rf $(pwd)/images/debian*
|
||||||
|
|
||||||
build $ARCH
|
build $ARCH
|
||||||
sign $ARCH
|
sign $ARCH
|
||||||
}
|
}
|
||||||
|
|
21
common.sh
21
common.sh
|
@ -29,15 +29,24 @@ function info()
|
||||||
function warn()
|
function warn()
|
||||||
{
|
{
|
||||||
local msg=${1}
|
local msg=${1}
|
||||||
echo " "
|
echo " " 2>&1
|
||||||
echo "[${BOLD}${ORANGE}WARN${NORMAL}] ${msg}"
|
echo "[${BOLD}${ORANGE}WARN${NORMAL}] ${msg}" 2>&1
|
||||||
echo " "
|
echo " " 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
function error()
|
function error()
|
||||||
{
|
{
|
||||||
local msg=${1}
|
local msg=${1}
|
||||||
echo " "
|
echo " " 2>&1
|
||||||
echo "[${BOLD}${RED}FAIL${NORMAL}] ${msg}"
|
echo "[${BOLD}${RED}FAIL${NORMAL}] ${msg}" 2>&1
|
||||||
echo " "
|
echo " " 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
function critical()
|
||||||
|
{
|
||||||
|
local msg=${1}
|
||||||
|
echo " " 2>&1
|
||||||
|
echo "[${BOLD}${RED}CRIT${NORMAL}] ${msg}" 2>&1
|
||||||
|
echo " " 2>&1
|
||||||
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue