From c58df53b97e262bee92e98e47d67250a6700b855 Mon Sep 17 00:00:00 2001 From: Maciej Prill Date: Sun, 11 Jun 2023 13:27:45 +0200 Subject: [PATCH] Beta support for Debian Bookworm. --- README.md | 6 ++++-- bookworm-amd64/bin/basefs_init | 0 bookworm-amd64/bin/dist_ipxe | 0 bookworm-amd64/bin/dist_iso | 22 +++++----------------- bookworm-amd64/bin/helperfs_config | 7 ------- bookworm-amd64/bin/ramdisk_config | 0 bookworm-amd64/bin/ramdisk_make | 3 ++- bookworm-amd64/bin/ramdisk_modules | 0 bookworm-amd64/bin/rootfs_clear | 0 bookworm-amd64/bin/rootfs_config | 24 ++++++++++++------------ bookworm-amd64/bin/rootfs_mksquashfs | 0 bookworm-amd64/mkrescue | 2 +- 12 files changed, 24 insertions(+), 40 deletions(-) mode change 100644 => 100755 bookworm-amd64/bin/basefs_init mode change 100644 => 100755 bookworm-amd64/bin/dist_ipxe mode change 100644 => 100755 bookworm-amd64/bin/dist_iso mode change 100644 => 100755 bookworm-amd64/bin/helperfs_config mode change 100644 => 100755 bookworm-amd64/bin/ramdisk_config mode change 100644 => 100755 bookworm-amd64/bin/ramdisk_make mode change 100644 => 100755 bookworm-amd64/bin/ramdisk_modules mode change 100644 => 100755 bookworm-amd64/bin/rootfs_clear mode change 100644 => 100755 bookworm-amd64/bin/rootfs_config mode change 100644 => 100755 bookworm-amd64/bin/rootfs_mksquashfs mode change 100644 => 100755 bookworm-amd64/mkrescue diff --git a/README.md b/README.md index 522f802..ecf6ed1 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,10 @@ Scripts for Debian Buster were tested on Ubuntu 18.04. Required packages: * debootstrap * dosfstools -* squashfs-tools -* unzip * grub-pc-bin * grub-efi-amd64-bin +* rsync +* squashfs-tools +* unzip * xorriso +* zstd diff --git a/bookworm-amd64/bin/basefs_init b/bookworm-amd64/bin/basefs_init old mode 100644 new mode 100755 diff --git a/bookworm-amd64/bin/dist_ipxe b/bookworm-amd64/bin/dist_ipxe old mode 100644 new mode 100755 diff --git a/bookworm-amd64/bin/dist_iso b/bookworm-amd64/bin/dist_iso old mode 100644 new mode 100755 index 7238133..6dee1d4 --- a/bookworm-amd64/bin/dist_iso +++ b/bookworm-amd64/bin/dist_iso @@ -35,24 +35,12 @@ echo TEMP_DIR_MEMTEST=$(mktemp -d) -#BIOS -wget -q http://www.memtest.org/download/5.01/memtest86+-5.01.zip -P ${TEMP_DIR_MEMTEST} -unzip -q ${TEMP_DIR_MEMTEST}/memtest86+-5.01.zip -d ${TEMP_DIR_MEMTEST} -cp ${TEMP_DIR_MEMTEST}/memtest86+-5.01.bin "$TEMP_DIR/memtest/memtest.bin" - -#EFI -mkdir ${TEMP_DIR_MEMTEST}/mountpoint -wget -q https://www.memtest86.com/downloads/memtest86-usb.zip -P ${TEMP_DIR_MEMTEST} -unzip -q ${TEMP_DIR_MEMTEST}/memtest86-usb.zip -d ${TEMP_DIR_MEMTEST} -losetup -o $((2048*512)) /dev/loop0 ${TEMP_DIR_MEMTEST}/memtest86-usb.img -mount /dev/loop0 ${TEMP_DIR_MEMTEST}/mountpoint -cp ${TEMP_DIR_MEMTEST}/mountpoint/EFI/BOOT/BOOTX64.efi "$TEMP_DIR/memtest/memtest86.efi" -umount ${TEMP_DIR_MEMTEST}/mountpoint -losetup -d /dev/loop0 - +wget -q https://memtest.org/download/v6.20/mt86plus_6.20.binaries.zip -P ${TEMP_DIR_MEMTEST} +unzip -q ${TEMP_DIR_MEMTEST}/mt86plus_6.20.binaries.zip -d ${TEMP_DIR_MEMTEST} +cp ${TEMP_DIR_MEMTEST}/memtest64.bin "$TEMP_DIR/memtest/memtest.bin" +cp ${TEMP_DIR_MEMTEST}/memtest64.efi "$TEMP_DIR/memtest/memtest86.efi" rm -r "${TEMP_DIR_MEMTEST}" - #GRUB echo @@ -83,7 +71,7 @@ cat /usr/lib/grub/i386-pc/boot.img ${TEMP_DIR_GRUB}/core.img > ${TEMP_DIR_GRUB}/ #EFI cp /usr/share/grub/unicode.pf2 $TEMP_DIR/boot/efi/fonts/ grub-mkimage -C xz -O x86_64-efi -p /boot/efi/ -o "${TEMP_DIR_GRUB}/bootx64.efi" linux chain iso9660 normal all_video gfxterm gfxmenu png linuxefi -truncate -s $(($(stat --printf="%s" ${TEMP_DIR_GRUB}/bootx64.efi) + 24576)) ${TEMP_DIR_GRUB}/efi.img +truncate -s $(($(stat --printf="%s" ${TEMP_DIR_GRUB}/bootx64.efi) + 32768)) ${TEMP_DIR_GRUB}/efi.img mkfs.vfat ${TEMP_DIR_GRUB}/efi.img mkdir ${TEMP_DIR_GRUB}/mountpoint mount ${TEMP_DIR_GRUB}/efi.img ${TEMP_DIR_GRUB}/mountpoint/ diff --git a/bookworm-amd64/bin/helperfs_config b/bookworm-amd64/bin/helperfs_config old mode 100644 new mode 100755 index 000c61c..1eee039 --- a/bookworm-amd64/bin/helperfs_config +++ b/bookworm-amd64/bin/helperfs_config @@ -18,13 +18,6 @@ FIRMWARES2="firmware-bnx2 firmware-bnx2x firmware-cavium \ firmware-misc-nonfree firmware-myricom firmware-netxen firmware-qlogic \ firmware-realtek" -cat << EOF > $TARGET/usr/sbin/policy-rc.d -#!/bin/sh -#echo "All runlevel operations denied by policy" >&2 -exit 101 -EOF -chmod a+x $TARGET/usr/sbin/policy-rc.d - chroot ${TARGET} mount -t proc proc /proc chroot ${TARGET} apt-get $APT_PARAM --yes install busybox-static > $STDOUT chroot ${TARGET} apt-get $APT_PARAM --yes install -t ${KERNEL_REPO} linux-image-${KERNEL_VERSION} linux-headers-${KERNEL_VERSION} > $STDOUT diff --git a/bookworm-amd64/bin/ramdisk_config b/bookworm-amd64/bin/ramdisk_config old mode 100644 new mode 100755 diff --git a/bookworm-amd64/bin/ramdisk_make b/bookworm-amd64/bin/ramdisk_make old mode 100644 new mode 100755 index 3550d34..0cb364e --- a/bookworm-amd64/bin/ramdisk_make +++ b/bookworm-amd64/bin/ramdisk_make @@ -10,4 +10,5 @@ if [ ! -d "${RAMDISK}" ]; then fi echo "Generating initramfs..." -(cd ${RAMDISK}; find . | cpio -H newc -o | gzip -1) > ${TARGET} +#(cd ${RAMDISK}; find . | cpio -H newc -o | gzip -1) > ${TARGET} +(cd ${RAMDISK}; find . | cpio -H newc -o | zstd -19 --check) > ${TARGET} diff --git a/bookworm-amd64/bin/ramdisk_modules b/bookworm-amd64/bin/ramdisk_modules old mode 100644 new mode 100755 diff --git a/bookworm-amd64/bin/rootfs_clear b/bookworm-amd64/bin/rootfs_clear old mode 100644 new mode 100755 diff --git a/bookworm-amd64/bin/rootfs_config b/bookworm-amd64/bin/rootfs_config old mode 100644 new mode 100755 index 348b484..4275a26 --- a/bookworm-amd64/bin/rootfs_config +++ b/bookworm-amd64/bin/rootfs_config @@ -12,30 +12,23 @@ if [ !$MKRESCUE_VERBOSE ]; then STDOUT='/dev/null' fi +# hddtemp + SOFTWARE="acl acpi-support-base attr bash-completion bind9-host binutils \ bridge-utils bsdmainutils ca-certificates debootstrap dialog \ dmidecode dosfstools ethtool fdisk file gddrescue gdisk \ - hddtemp hdparm ifenslave iproute2 iputils-ping less lsof lvm2 lzip mdadm \ + hdparm ifenslave iproute2 iputils-ping less lsof lvm2 lzip mdadm \ mtr-tiny netcat-traditional net-tools ntfs-3g nvme-cli parted pciutils pixz procps \ psmisc rsync screen scrub smartmontools ssh strace sysstat tar tcpdump \ - telnet traceroute tree usbutils vim vlan wget xz-utils systemd systemd-sysv \ + telnet traceroute tree usbutils vim vlan wget xz-utils systemd systemd-resolved systemd-sysv \ nfs-common ipxe grub-pc grub-efi-amd64-bin efibootmgr pv mtools xfsprogs \ - zfsutils-linux " - -cat << EOF > ${TARGET}/usr/sbin/policy-rc.d -#!/bin/sh -#echo "All runlevel operations denied by policy" >&2 -exit 101 -EOF -chmod a+x $TARGET/usr/sbin/policy-rc.d + zfsutils-linux zstd" chroot ${TARGET} apt-get $APT_PARAM --yes install ${SOFTWARE} > $STDOUT chroot ${TARGET} systemctl enable systemd-networkd.service chroot ${TARGET} systemctl enable systemd-resolved.service chroot ${TARGET} systemctl enable acpid.service -rm ${TARGET}/usr/sbin/policy-rc.d - echo "Etc/UTC" > ${TARGET}/etc/timezone chroot ${TARGET} dpkg-reconfigure -f noninteractive tzdata @@ -44,6 +37,7 @@ cat << EOF > ${TARGET}/etc/motd WARNING: Authorized access only! EOF + cat << EOF > ${TARGET}/etc/issue WMI Rescue Linux (based on Debian GNU/Linux ${DEBIAN_CODENAME^}) Version ${VERSION} AMD64 @@ -67,11 +61,13 @@ cat << EOF > ${TARGET}/etc/systemd/resolved.conf [Resolve] DNS=8.8.8.8 8.8.4.4 2001:4860:4860::8888 2001:4860:4860::8844 EOF + rm ${TARGET}/etc/resolv.conf ln -s /run/systemd/resolve/resolv.conf ${TARGET}/etc/resolv.conf rm ${TARGET}/etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service #use old network device names ln -s /dev/null ${TARGET}/etc/systemd/network/99-default.link + cat << EOF > ${TARGET}/etc/systemd/system/ssh-session-cleanup.service [Unit] Description=OpenBSD Secure Shell session cleanup @@ -87,15 +83,19 @@ Type=oneshot [Install] WantedBy=multi-user.target EOF + chroot ${TARGET} systemctl enable ssh-session-cleanup.service + cat << EOF > ${TARGET}/etc/screenrc startup_message off defscrollback 5000 EOF + cat << EOF > ${TARGET}/etc/sysctl.d/60-panic.conf kernel.panic = 5 kernel.panic_on_oops = 1 EOF + sed -i 's/" let g:skip_defaults_vim = 1/let g:skip_defaults_vim = 1/g' ${TARGET}/etc/vim/vimrc rsync -avS ${TARGET}/etc/skel/ ${TARGET}/root/ diff --git a/bookworm-amd64/bin/rootfs_mksquashfs b/bookworm-amd64/bin/rootfs_mksquashfs old mode 100644 new mode 100755 diff --git a/bookworm-amd64/mkrescue b/bookworm-amd64/mkrescue old mode 100644 new mode 100755 index e447a02..1762d22 --- a/bookworm-amd64/mkrescue +++ b/bookworm-amd64/mkrescue @@ -1,7 +1,7 @@ #!/bin/sh TARGET=$1 -VERSION=$(date +%g.%m) +VERSION=$(date +%g.%m)-deb12-beta1 OUTPUT=${TARGET}/output/${VERSION} DEBIAN_CODENAME='bookworm' KERNEL_VERSION='6.1.0-9-amd64'