This commit is contained in:
Amazed 2021-01-22 16:45:43 +01:00
commit 927863dbc8
6 changed files with 236 additions and 0 deletions

18
grub/grub.cfg Normal file
View File

@ -0,0 +1,18 @@
if loadfont /boot/grub/font.pf2 ; then
set gfxmode=auto
insmod efi_gop
insmod efi_uga
insmod gfxterm
terminal_output gfxterm
fi
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
set timeout=0
menuentry "Demarrer ou installer Linux Mint 20.1 MATE 64-bit LIS67" --class linuxmint {
set gfxpayload=keep
linux /casper/vmlinuz file=/cdrom/preseed/linuxmint.seed boot=casper iso-scan/filename=${iso_path} quiet splash --
initrd /casper/initrd.lz
}

44
isolinux/isolinux.cfg Normal file
View File

@ -0,0 +1,44 @@
default vesamenu.c32
timeout 100
menu background splash.png
menu title Bienvenue sur Linux Mint 20.1 MATE 64bit LIS67
menu color screen 37;40 #80ffffff #00000000 std
MENU COLOR border 30;44 #40ffffff #a0000000 std
MENU COLOR title 1;36;44 #ffffffff #a0000000 std
MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all
MENU COLOR unsel 37;44 #50ffffff #a0000000 std
MENU COLOR help 37;40 #c0ffffff #a0000000 std
MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std
MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std
MENU COLOR msg07 37;40 #90ffffff #a0000000 std
MENU COLOR tabmsg 31;40 #ffDEDEDE #00000000 std
MENU WIDTH 80
MENU MARGIN 14
MENU ROWS 7
MENU VSHIFT 10
MENU TABMSGROW 12
MENU CMDLINEROW 12
MENU HELPMSGROW 16
MENU HELPMSGENDROW 29
label live
menu label Demarrer ou installer Linux Mint
kernel /casper/vmlinuz
append file=/cdrom/preseed/linuxmint.seed boot=casper initrd=/casper/initrd.lz quiet splash --
label check
menu label Verifier l'integrite
kernel /casper/vmlinuz
append boot=casper integrity-check initrd=/casper/initrd.lz quiet splash --
label hdt
menu label Detection du materiel
kernel hdt.c32
label memtest
menu label Test memoire
kernel /casper/memtest
label local
menu label Demarrer sur le disque local
COM32 chain.c32
APPEND hd0

BIN
isolinux/splash.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

77
prepare.sh Executable file
View File

@ -0,0 +1,77 @@
#!/bin/bash
set -eE
function clean() {
echo "==== CLEAN ERR ===="
sudo umount "$WORKDIR/squashfs" || :
sudo umount /tmp/livecd || :
}
trap clean ERR
SPATH=$(cd $(dirname $0) && pwd)
if [ -z $1 ]; then
echo "Usage: prepare.sh <iso_path>"
exit 1
fi
full_iso=$1
iso_wo_ext=${full_iso##*/}
iso_wo_ext=${iso_wo_ext%.iso}
WORKDIR="$SPATH/$iso_wo_ext"
echo "==== Prepare CD ===="
mkdir /tmp/livecd || :
sudo mount -o loop "$1" /tmp/livecd
mkdir -p "$WORKDIR"
rsync --exclude=/casper/filesystem.squashfs -a /tmp/livecd/ "$WORKDIR/cd"
mkdir "$WORKDIR/squashfs" "$WORKDIR/custom"
sudo modprobe squashfs
sudo mount -t squashfs -o loop /tmp/livecd/casper/filesystem.squashfs "$WORKDIR/squashfs/"
echo "==== Copy squashfs contents to $WORKDIR/custom ===="
sudo cp -a "$WORKDIR"/squashfs/* "$WORKDIR/custom"
# network access
sudo cp /etc/resolv.conf /etc/hosts "$WORKDIR/custom/etc/"
# mount proc, sys, opens a shell (for changes), and clean everything after
echo "==== CHROOT ===="
cat "$SPATH/tasks.sh" | sudo chroot "$WORKDIR/custom" /bin/bash
echo "==== Mod ISOLINUX (BIOS) AND GRUB (EFI) ===="
# isolinux
chmod -R +w "$WORKDIR/cd/isolinux"
cp isolinux/* "$WORKDIR/cd/isolinux/"
# grub
chmod -R +w "$WORKDIR/cd/boot/grub"
cp grub/* "$WORKDIR/cd/boot/grub/"
# setup iso
echo "==== Setup ISO ===="
chmod +w "$WORKDIR/cd/casper/filesystem.manifest"
sudo chroot "$WORKDIR/custom" dpkg-query -W --showformat='${Package} ${Version}\n' > "$WORKDIR/cd/casper/filesystem.manifest"
sudo cp "$WORKDIR/cd/casper/filesystem.manifest" "$WORKDIR/cd/casper/filesystem.manifest-desktop"
sudo mksquashfs "$WORKDIR/custom" "$WORKDIR/cd/casper/filesystem.squashfs"
sudo rm "$WORKDIR/cd/MD5SUMS"
sudo chmod +w "$WORKDIR/cd"
sudo bash -c 'cd '"$WORKDIR"'/cd && find . -type f -exec md5sum {} +' > "$WORKDIR"/cd/MD5SUMS
# create iso
echo "==== Create ISO ===="
cd "$WORKDIR/cd"
# create a DVD-burnable ISO with BIOS (isolinux) and EFI (grub) support
sudo mkisofs -U -A "$iso_wo_ext-LIS67" -V "$iso_wo_ext-LIS67" -volset "$iso_wo_ext-LIS67" -J -joliet-long -r -v -T -o "$WORKDIR/$iso_wo_ext-lis67.iso" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot .
# convert iso to a bootable USB drive iso
sudo isohybrid --uefi "$WORKDIR/$iso_wo_ext-lis67.iso"
# umount & clean
echo "==== Clean ===="
sudo umount "$WORKDIR/squashfs"
sudo umount /tmp/livecd
sudo chown -R $USER: "$WORKDIR"
echo "Final ISO: $WORKDIR/$iso_wo_ext-lis67.iso"
echo "Done"

29
reset.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
SPATH=$(cd $(dirname $0) && pwd)
if [ -z $1 ]; then
echo "Usage: reset.sh <work_path>"
exit 1
fi
full_iso=$1
iso_wo_ext=${full_iso##*/}
iso_wo_ext=${iso_wo_ext%.iso}
WORKDIR="$SPATH/$iso_wo_ext"
[ -z "$WORKDIR" ] && exit 1
echo "$WORKDIR"
# mount proc, sys, opens a shell (for changes), and clean everything after
echo "==== CHROOT ===="
sudo chroot "$WORKDIR/custom" /bin/bash << EOF
umount /sys
umount /proc
umount /dev/pts
EOF
# umount & clean
echo "==== Clean ===="
sudo umount "$WORKDIR/squashfs"
sudo umount /tmp/livecd
sudo rm -rf "$WORKDIR"
echo "Done"

68
tasks.sh Normal file
View File

@ -0,0 +1,68 @@
# setup - do not touch
mount -t proc none /proc/
mount -t sysfs none /sys/
mount -t devpts none /dev/pts/
# end setup
# set timezone
echo "Europe/Paris" > /etc/timezone
sudo apt-get update
# install lang pack
lang=fr
for l in $(cat /usr/share/linuxmint/mintlocale/language_packs); do
category=$(echo $l | awk -F ':' '{print $1}')
if [ $category = 'tr' ]; then
languagecode=$(echo $l | awk -F ':' '{print $2}')
if [ -z $languagecode ] || [ $languagecode = 'fr' ]; then
dep=$(echo $l | awk -F ':' '{print $3}')
if [ -z $dep ] || dpkg -l $dep > /dev/null 2>&1; then
pull=$(echo $l | awk -F ':' '{print $4}')
echo "Installing $pull$lang because dep is '$dep'"
sudo apt-get install -y $pull$lang
fi
fi
fi
done
# gen locales
locale-gen fr
# language french
update-locale LANG=fr_FR.UTF-8 LANGUAGE=fr_FR.UTF-8 LC_ALL=fr_FR.UTF-8
# keyboard french
sed -i 's/us/fr/g' /etc/default/keyboard
# install custom packages
# ANCESTRIS
sudo add-apt-repository -y ppa:ancestris/ancestris-stable
sudo apt-get update
sudo apt-get install -y ancestris
# ABRICOTINE
wget "https://github.com/brrd/abricotine/releases/download/1.0.0/abricotine-1.0.0-ubuntu-debian-x64.deb"
sudo dpkg -i abricotine-1.0.0-ubuntu-debian-x64.deb
rm abricotine-1.0.0-ubuntu-debian-x64.deb
# BAOBAB
sudo apt-get install -y baobab
# SCRIBUS
sudo apt-get install -y scribus
# KEEPASSXC
sudo add-apt-repository -y ppa:phoerious/keepassxc
sudo apt-get update
sudo apt-get install -y keepassxc
# clean - do not touch
rm -rf /tmp/*
rm -f /etc/hosts /etc/resolv.conf
umount /proc/
umount /sys/
umount /dev/pts