--- 06-build-slint64-14.2.1.2.iso.sh 2019-10-12 20:44:29.455265981 +0200 +++ 06-build-slint64-14.2.1.3.iso.sh 2019-10-13 00:38:13.208161135 +0200 @@ -1,18 +1,13 @@ #!/bin/sh # Author: Didier Spaier, Paris, France -# -# Before running this script, adapt MIRROR and PATHTOISO below to your -# installation as well as other environments variables -# -# CWD=$(pwd) SLACKVERSION="current" OLDSLACKVERSION="14.2" -SLINTVERSION="14.2.1.2" +SLINTVERSION="14.2.1.3" TAG="" TAGVERSION=${SLINTVERSION}$TAG -KVER=4.19.30 +KVER=4.19.79 usage() { printf %b "Usage: $0" exit @@ -23,7 +18,7 @@ SOURCE=/storage/repo/x86_64/slint-testing/source MIRROR=/data/slackware64-$SLACKVERSION SCRIPTS=/storage/repo/x86_64/slint-testing/source/localization/scripts -KERNELMODULES=source/kernel/kernel-modules*txz +KERNELMODULES=source/kernel/kernel-modules-${KVER}*txz DATESTAMP=`date -u +%Y%m%d` if [ ! $UID -eq 0 ]; then printf "%b" "Please execute this script as root.\n" @@ -49,60 +44,29 @@ sed "s//$DATESTAMP/;s/+version+/slint64-${TAGVERSION}.iso/" docs/CONTENT.TXT > $ISO/CONTENT.TXT sed "s/+version+/$TAGVERSION/g" docs/README.TXT > $ISO/README.TXT echo $DATESTAMP > $ISO/DateBuilt -# Copy to $ISO/{EFI,isolinux,kernels} -rm -rf $ISO/{EFI,isolinux} -mkdir -p $ISO/isolinux -mkdir -p $ISO/EFI/BOOT -cp source/EFI/BOOT/grub.cfg $ISO/EFI/BOOT/ -cp source/EFI/BOOT/osdetect.cfg $ISO/EFI/BOOT/ -cp source/EFI/BOOT/tools.cfg $ISO/EFI/BOOT/ -cp source/EFI/BOOT/grub-embedded.cfg $ISO/EFI/BOOT/ +rm -rf $ISO/boot/grub +mkdir -p $ISO/boot/grub +cp source/boot/grub/grub.cfg $ISO/boot/grub/ +cp source/boot/grub/osdetect.cfg $ISO/boot/grub/ +cp source/boot/grub/tools.cfg $ISO/boot/grub/ +cp source/boot/grub/main.cfg $ISO/boot/grub/ +cp source/boot/grub/instructions $ISO/boot/grub/ cp source/kernel/kernel-huge-${KVER}-x86_64-1/boot/vmlinuz-huge-$KVER \ -$ISO/isolinux/linux -(cd $ISO/EFI/BOOT/ -grub-mkimage --format=x86_64-efi --output=$ISO/EFI/BOOT/bootx64.efi \ ---config=grub-embedded.cfg --compression=xz --prefix=/EFI/BOOT \ -play part_gpt part_msdos fat ext2 hfs hfsplus iso9660 udf ufs1 ufs2 \ -zfs chain linux boot appleldr configfile normal regexp minicmd \ -reboot halt search search_fs_file search_fs_uuid search_label \ -gfxterm gfxmenu efi_gop efi_uga all_video loadbios gzio echo true \ -probe loadenv bitmap_scale font cat help ls png jpeg tga test \ -at_keyboard usb_keyboard -) -cp source/isolinux/{f1.txt,isolinux.bin,BEEP,vesamenu.c32} $ISO/isolinux -iconv -f UTF-8 -t CP437 -o $ISO/isolinux/isolinux.cfg source/isolinux/isolinux-vesamenu.cfg.64 +$ISO/linux # Third step: prepare and put in $TMP stuff needed for internationalization # ========================================== # printf "%b" "\nPreparation in progress..." mkdir $TMP/initrd ( cd $TMP/initrd - gunzip -cd < $CWD/source/initrd/initrd.img-14.2 | \ - cpio -i -d -m -H newc --no-absolute-filenames -) -rm -r $TMP/initrd/lib/modules -# Let's replace the firmware files by those shipped in the initrd of -# Slacwkare64-current that includes the same kernel modules that we will -# include in this installer's initrd. -# Make sure this firmware matches the kernel shipped in this initrd -# TODO: save the firmware outside the local mirror next time as we won't -# use a kernel that has been released just a few hours ago, to be safe. -INITRD2=$MIRROR/isolinux/initrd.img -TMP2=$(mktemp -d) || exit 1 -mkdir $TMP2/initrd -( cd $TMP2/initrd - xz -cd < $CWD/source/initrd/initrd.img | \ + xz -cd < $CWD/source/initrd/initrd-current-20191012.img | \ cpio -i -d -m -H newc --no-absolute-filenames ) -rm -r $TMP/initrd/lib/firmware -cp -r $TMP2/initrd/lib/firmware $TMP/initrd/lib -rm -r $TMP2 -# End of the modification to replace /lib/firmware in initrd of the -# Slint installer. -# -cp source/util-linux/util-linux-2.27.1-x86_64-1/sbin/wipefs \ +cp /sbin/wipefs \ $TMP/initrd/usr/sbin chmod 755 $TMP/initrd/usr/sbin/wipefs +read -p "Press Enter" dummy + # TODO: cheery pick the libs we need instead of isnaytlling whole # packages, to save some space /sbin/installpkg --root $TMP/initrd $(find $SLINTREPO -name brltty.installer*.t?z) @@ -145,6 +109,8 @@ FDF chmod 755 $TMP/initrd/etc/profile.d/alias.sh +read -p "Press Enter" dummy + # Add the modules /sbin/installpkg --root $TMP/initrd $KERNELMODULES @@ -163,13 +129,6 @@ echo "--- depmod has be run ---" mkdir -p $TMP/initrd/usr/share/fonts cp fonts/* $TMP/initrd/usr/share/fonts -# Copying new and modified files in $ISO/isolinux/ - -# We'll include a font (encoded in CP437), as if no font is set, text files are -# displayed using native font (confirmed by Gene Cumm on syslinux mailing list), -# but native (or hardware) code page can differ upon country, according to: -# http://www.drdos.net/documentation/usergeng/17ugch17.htm -cp -p source/isolinux/ter-i16b.psf $ISO/isolinux # Copying new and modified files in $TMP/initrd/ for i in $(<$CWD/source/scripts); do mkdir -p $TMP/initrd/$(dirname $i) @@ -276,64 +235,19 @@ # We won't use Slackware color scheme, for dialog, but our own. # Additionally, --noshadow will give us more usable lines and rows. cp $SOURCE/dialog/dialogrc $TMP/initrd/etc -chown -R root:root $ISO/isolinux # Register the target cp $ISO/slint/DONOTREMOVEME.TXT $TMP/initrd/.target rm $TMP/initrd/.installer-version # Build the initrd ( cd $TMP/initrd - # find . -print | cpio -o --owner root:root -H newc | gzip -9 > $ISO/isolinux/initrd.img - find . | cpio -o -H newc | xz -9fv -C crc32 > $ISO/isolinux/initrd.img + find . | cpio -o -H newc | xz -9fv -C crc32 > $ISO/initrd ) -mv $ISO/isolinux/initrd.img $ISO/isolinux/initrd -# Fifth step: build the ISO file -# ================ - -( cd $ISO - size=$(BLOCKSIZE=1M du -s EFI|sed "s/\([[:digit:]][[:digit:]]\).*/\1/") - rsize=$(( $size + 1 )) - dd if=/dev/zero of=efiboot.img bs=1M count=$rsize - # Format the image as FAT16: - mkfs.fat efiboot.img - # Create a temporary mount point: - MOUNTPOINT=$(mktemp -d) - # Mount the image there: - mount -o loop efiboot.img $MOUNTPOINT - # Copy the the whole EFI directory to the mountpoint as elilo needs to - # find everything it deals with there. - # On the other hand, no need to include EFI in the ISO. - cp -a EFI $MOUNTPOINT - # Unmount and clean up: - umount $MOUNTPOINT - rmdir $MOUNTPOINT - # Move the efiboot.img to ../../isolinux: - mv efiboot.img $ISO/isolinux -# Now $ISO contains all files to be put on the ISO image, so we can -# complete $ISO/CONTENT.TXT with the file tree -sed -i "s//64-${SLINTVERSION}$SUFFIX/g" CONTENT.TXT -tree >> CONTENT.TXT -EFIOPTIONS="-eltorito-alt-boot -e isolinux/efiboot.img -isohybrid-gpt-basdat -no-emul-boot" -xorriso -as mkisofs \ - -isohybrid-mbr /usr/share/syslinux/isohdpfx.bin \ - -hide-rr-moved \ - -U \ - -V "ISO64_CURRENT" \ - -J \ - -joliet-long \ - -r \ - -v \ - -x kernels \ - -o $PATHTOISO \ - -b isolinux/isolinux.bin \ - -c isolinux/boot.cat \ - -no-emul-boot \ - -boot-info-table $EFIOPTIONS . \ -) 2>${PATHTOISO%iso}log.txt -chown -R `stat -c %U:%G $CWD` $PATHTOISO ${PATHTOISO%iso}log.txt $ISO +grub-mkrescue -v --locales='none' --themes='' --compress=xz \ +-o $PATHTOISO -iso_mbr_part_type 0x83 -partition_offset 16 -J \ +--xorriso=./grub-mkrescue-sed.sh $ISO printf "%b" "** Completed. *** If writing the ISO was successful an hybrid DVD/USB image: $PATHTOISO is ready.\n" -echo "Check the directory $TMP" -#rm -r $TMP +rm -r $TMP