Commit d2a69a4b authored by arpinux's avatar arpinux
Browse files

improve build script + still testing ...

parent 0360d4e0
......@@ -15,12 +15,12 @@ construire une ISO :
* ajuster les paquets contenus dans pkgs/foo selon vos besoins
* vérifier les mises à jour de bashmount et veracrypt
* lancer en mode administrateur :
* `./nakedbuild 32` > nakedeb i386 (~800M)
* `./nakedbuild 64` > nakedeb amd64 (~750M)
* `./nakedbuild 32 nf` > nakedeb i386 non-free (~915M)
* `./nakedbuild 64 nf` > nakedeb amd64 non-free (~865M)
* `./nakedbuild 32 nf full` > nakedeb i386 non-free full system (~1.36G)
* `./nakedbuild 64 nf full` > nakedeb amd64 non-free full system (~1.3G)
* `./nakedbuild 32` > nakedeb i386 (~xxxM)
* `./nakedbuild 64` > nakedeb amd64 (~xxxM)
* `./nakedbuild 32 nf` > nakedeb i386 non-free (~xxxM)
* `./nakedbuild 64 nf` > nakedeb amd64 non-free (~xxxM)
* `./nakedbuild 32 full` > nakedeb i386 non-free full system (~xxxG)
* `./nakedbuild 64 full` > nakedeb amd64 non-free full system (~xxxG)
* `./nakedbuild clean` > nettoyage du dossier de construction et du cache
assurez-vous de lancer `nakedbuild clean` avant de construire une autre architecture
......
......@@ -6,7 +6,6 @@ lb config noauto \
--apt-indices "false" \
--apt-recommends "false" \
--apt-source-archives "false" \
--archive-areas "main contrib" \
--backports "true" \
--binary-image "iso-hybrid" \
--bootloaders "syslinux grub-efi" \
......@@ -16,7 +15,6 @@ lb config noauto \
--distribution "bullseye" \
--firmware-binary "true" \
--firmware-chroot "true" \
--linux-package "linux-image" \
--memtest "memtest86+" \
--system "live" \
--updates "true" \
......
......@@ -13,8 +13,15 @@ LOG="${NKDIR}/${VERSION}.log"
RESET="## automatic edition by nakedbuild\n## DO NOT EDIT!"
VCHOOK="${NKDIR}/config/hooks/normal/n3-veracrypt.chroot"
NFHOOK="${NKDIR}/config/hooks/normal/n4-nonfree.chroot"
FULLHOOK="${NKDIR}/config/hooks/normal/n5-fullsystem.chroot"
NFLIST="${NKDIR}/config/package-lists/nakedeb-nf.list.chroot"
FULLLIST="${NKDIR}/config/package-lists/nakedeb-full.list.chroot"
NFPKGS="firmware-linux firmware-linux-nonfree firmware-misc-nonfree \
firmware-ralink intel-microcode iucode-tool firmware-realtek amd64-microcode \
atmel-firmware bluez-firmware firmware-atheros firmware-bnx2 firmware-bnx2x \
firmware-brcm80211 firmware-intel-sound firmware-intelwimax firmware-iwlwifi"
FULLPKGS="firefox-esr thunderbird gthumb gimp inkscape mcomix filezilla audacity \
easytag libreoffice libreoffice-gtk3 libreoffice-l10n-fr unison-gtk \
broadcom-sta-dkms"
# cd work directory ----------------------------------------------------
cd ${NKDIR}
......@@ -30,8 +37,8 @@ elif [ "$1" == "clean" ]; then
lb clean
rm -Rf cache
echo -e "${RESET}" > ${VCHOOK}
echo -e "${RESET}" > ${NFHOOK}
echo -e "${RESET}" > ${FULLHOOK}
echo -e "${RESET}" > ${NFLIST}
echo -e "${RESET}" > ${FULLLIST}
exit 0
else
# no args or wrong args > help
......@@ -47,11 +54,15 @@ echo -e "live-build-$(lb -v) - Debian-$(cat /etc/debian_version)" >> ${LOG}
echo -e "$(uname -a)" >> ${LOG}
if [ "$2" == "nf" ]; then
echo -e "building non-free release" >> ${LOG}
elif [ "$2" == "full" ]; then
echo -e "building non-free full release" >> ${LOG}
else
echo -e "building main release" >> ${LOG}
fi
# setup veracrypt ------------------------------------------------------
# mise en place de la version (32/64) de VeraCrypt dans le dossier de build
echo -e "----\nINFO: setting up veracrypt" >> ${LOG}
echo -e "----\nINFO: setting up veracrypt-${ARCH}" >> ${LOG}
VERA="veracrypt_1.24-Update7"
mkdir -p config/includes.chroot
cp ${NKDIR}/ressources/veracrypt/${VERA}_${ARCH}.tar.gz ${NKDIR}/config/includes.chroot/
......@@ -64,59 +75,47 @@ tar zxf ${VERA}_${ARCH}.tar.gz
rm ${VERA}_${ARCH}.tar.gz
EOF
# nonfree option hook --------------------------------------------------
# option pour ajouter les dépôts non-free et les firmwares non-free à nakeDeb.
# ajoutez vos firmwares préférés ici.
if [ "$2" == "nf" ]; then
echo -e "----\nINFO: setting up nonfree option hook" >> ${LOG}
cat <<EOF > ${NFHOOK}
#!/bin/sh
set -e
echo "deb http://deb.debian.org/debian/ bullseye non-free" > /etc/apt/sources.list.d/nonfree.list
echo "deb http://security.debian.org/debian-security bullseye-security non-free" >> /etc/apt/sources.list.d/nonfree.list
echo "deb http://deb.debian.org/debian/ bullseye-updates non-free" >> /etc/apt/sources.list.d/nonfree.list
echo "deb http://deb.debian.org/debian/ bullseye-proposed-updates non-free" >> /etc/apt/sources.list.d/nonfree.list
apt update
apt upgrade -y
apt install -y firmware-linux firmware-linux-nonfree firmware-misc-nonfree \
firmware-ralink intel-microcode iucode-tool firmware-realtek amd64-microcode \
atmel-firmware bluez-firmware firmware-atheros firmware-bnx2 firmware-bnx2x \
firmware-brcm80211 firmware-intel-sound firmware-intelwimax firmware-iwlwifi
EOF
else
echo -e "${RESET}" > ${NFHOOK}
fi
# full system option hook ----------------------------------------------
# cette version n'est pas distribuée : c'est un option à utiliser @home
# en complément de la version non-free.
# vous pouvez ajouter/enlever les applications désirées dans la liste.
if [ "$3" == "full" ]; then
echo -e "----\nINFO: setting up full system option hook" >> ${LOG}
if [ "$1" == "32" ]; then
HEADERS="linux-headers-686"
else
HEADERS="linux-headers-amd64"
fi
cat <<EOF > ${FULLHOOK}
#!/bin/sh
set -e
apt update
apt install -y firefox-esr thunderbird gthumb gimp inkscape mcomix filezilla \
audacity easytag libreoffice libreoffice-gtk3 libreoffice-l10n-fr unison-gtk \
${HEADERS} broadcom-sta-dkms
EOF
else
echo -e "${RESET}" > ${FULLHOOK}
fi
# setup preseed --------------------------------------------------------
# mise en place du fichier de pré-configuration de l'installateur debian.
echo -e "----\nINFO: setting up naked preseed" >> ${LOG}
mkdir -p config/includes.chroot/usr/bin
install -m 755 ressources/nakedpreseed config/includes.chroot/usr/bin/nakedpreseed
# configure build ------------------------------------------------------
echo -e "----\nINFO: configuration de ${VERSION}-${ARCH}\n" >> ${LOG}
# kernel/arch
case ${ARCH} in
i386) lb config -a "${ARCH}" -k 686 | tee -a ${LOG};;
amd64) lb config -a "${ARCH}" | tee -a ${LOG};;
esac
# common config
lb config --iso-volume "${VERSION}" --iso-application "${VERSION}" \
--iso-publisher "${PROJECT}; ${HOMEPAGE}; ${CONTACT}" | tee -a ${LOG}
# if apt-cacher-ng
if dpkg-query -W apt-cacher-ng &>"/dev/null"; then
export http_proxy="http://127.0.0.1:3142/"
lb config --apt-http-proxy "${http_proxy}"
fi
# main/nonfree/full versions
if [ "$2" == "nf" ]; then
echo -e "----\nINFO: setting up non-free release" >> ${LOG}
lb config --archive-areas "main contrib non-free" \
--linux-package "linux-image" | tee -a ${LOG}
echo -e "${NFPKGS}" > ${NFLIST}
echo -e "${RESET}" > ${FULLLIST}
elif [ "$2" == "full" ]; then
echo -e "----\nINFO: setting up non-free full system release" >> ${LOG}
lb config --archive-areas "main contrib non-free" \
--linux-package "linux-image linux-headers" | tee -a ${LOG}
echo -e "${NFPKGS}" > ${NFLIST}
echo -e "${FULLPKGS}" > ${FULLLIST}
else
lb config --archive-areas "main contrib" \
--linux-package "linux-image" | tee -a ${LOG}
echo -e "${RESET}" > ${NFLIST}
echo -e "${RESET}" > ${FULLLIST}
fi
# setup debs -----------------------------------------------------------
# construction des paquets-modules intégrés à nakeDeb
echo -e "----\nINFO: building deb's" >> ${LOG}
......@@ -131,22 +130,6 @@ echo -e "----\nINFO: nakedpkgs lintian output" >> ${LOG}
find pkgs -iname "*.deb" -exec lintian -q {} >> ${LOG} \;
find pkgs -iname "*.deb" -exec mv {} config/packages \;
# configure build ------------------------------------------------------
echo -e "----\nINFO: configuration de ${VERSION}-${ARCH}\n" >> ${LOG}
# kernel/arch - bios/uefi options
case ${ARCH} in
i386) lb config -a "${ARCH}" -k 686 | tee -a ${LOG};;
amd64) lb config -a "${ARCH}" | tee -a ${LOG};;
esac
# if apt-cacher-ng
if dpkg-query -W apt-cacher-ng &>"/dev/null"; then
export http_proxy="http://127.0.0.1:3142/"
lb config --apt-http-proxy "${http_proxy}"
fi
# common config
lb config --iso-volume "${VERSION}" --iso-application "${VERSION}" \
--iso-publisher "${PROJECT}; ${HOMEPAGE}; ${CONTACT}" | tee -a ${LOG}
# build ISO ------------------------------------------------------------
echo -e "----\nINFO: construction de ${VERSION}-${ARCH}\n" >> ${LOG}
lb build
......@@ -156,11 +139,9 @@ if test -f live-image-${ARCH}.hybrid.iso; then
echo -e "----\nINFO: renommer"
ISODIR="${NKDIR}/nakedeb-${ARCH}"
if [ "$2" == "nf" ]; then
if [ "$3" == "full" ]; then
NAME="${VERSION}-${DEBV}-${ARCH}-nonfree-full"
else
NAME="${VERSION}-${DEBV}-${ARCH}-nonfree"
fi
NAME="${VERSION}-${DEBV}-${ARCH}-nonfree"
elif [ "$2" == "full" ]; then
NAME="${VERSION}-${DEBV}-${ARCH}-nonfree-full"
else
NAME="${VERSION}-${DEBV}-${ARCH}"
fi
......@@ -181,8 +162,8 @@ if test -f live-image-${ARCH}.hybrid.iso; then
chown -R arp:arp ${ISODIR}
echo -e "----\nINFO: nettoyage"
echo -e "${RESET}" > ${VCHOOK}
echo -e "${RESET}" > ${NFHOOK}
echo -e "${RESET}" > ${FULLHOOK}
echo -e "${RESET}" > ${NFLIST}
echo -e "${RESET}" > ${FULLLIST}
lb clean
echo -e "----\nbuild made in $(($SECONDS/60)) minutes\n"; exit 0
else
......
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