This commit is contained in:
Matt Knoop
2025-12-09 00:07:51 -07:00
parent fb75cc36df
commit 09eb3c54ba
6 changed files with 32 additions and 50 deletions

View File

@@ -5,34 +5,12 @@ echo "${cores}"
/usr/bin/make defconfig /usr/bin/make defconfig
sed -i 's/CONFIG_SYSTEM_TRUSTED_KEYS="\.\*"/CONFIG_SYSTEM_TRUSTED_KEYS=""/' ./.config sed -i 's/CONFIG_SYSTEM_TRUSTED_KEYS="\.\*"/CONFIG_SYSTEM_TRUSTED_KEYS=""/' ./.config
sed -i 's/CONFIG_SYSTEM_REVOCATION_KEYS="\.\*"/CONFIG_SYSTEM_REVOCATION_KEYS=""/' ./.config sed -i 's/CONFIG_SYSTEM_REVOCATION_KEYS="\.\*"/CONFIG_SYSTEM_REVOCATION_KEYS=""/' ./.config
sed -i 's/CONFIG_EFI_STUB="\.\*"/CONFIG_EFI_STUB="y"/' ./.config list="CONFIG_VIRTIO_GUEST CONFIG_FB_EFI CONFIG_EFI CONFIG_SYSFB CONFIG_FB CONFIG_VIRTIO CONFIG_DRM_VIRTIO_GPU CONFIG_VIRTIO_PCI CONFIG_VIRTIO_BALLOON CONFIG_HW_RANDOM_VIRTIO CONFIG_PCI CONFIG_DRM CONFIG_VIRTIO_MEM CONFIG_VIRTIO_MMIO CONFIG_VIRTIO_IOMMU CONFIG_VIRTIO_VDPA CONFIG_BLK_MQ_VIRTIO CONFIG_VIRTIO_CONSOLE CONFIG_VIRTIO_BLK CONFIG_VIRTIO_VSOCKETS CONFIG_VIRTIO_VSOCKETS_COMMON CONFIG_RPMSG_VIRTIO CONFIG_VIRTIO_FS CONFIG_VIRTIO_INPUT CONFIG_VIRTIO_PCI_LIB CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES CONFIG_VIRTIO_ANCHOR CONFIG_SCSI_VIRTIO CONFIG_VIRTIO_MENU CONFIG_HIGH_RES_TIMERS CONFIG_DEBUG_INFO CONFIG_KVM_GUEST CONFIG_PARAVIRT CONFIG_VIRTIO_NET CONFIG_KVM_CLOCK"
echo "CONFIG_FB_EFI=y" >> ./.config
echo "CONFIG_EFI=y" >> ./.config for item in $list; do
echo "CONFIG_SYSFB=y" >> ./.config echo $item
echo "CONFIG_FB=y" >> ./.config ./scripts/config --set-val $item y
echo "CONFIG_VIRTIO=y" >> ./.config ./scripts/config --state $item
echo "CONFIG_FRAMEBUFFER_CONSOLE=y" >> ./.config done
echo "CONFIG_DRM_VIRTIO_GPU=y" >> ./.config
echo "CONFIG_VIRTIO_PCI=y" >> ./.config
echo "CONFIG_VIRTIO_BLK=y" >> ./.config
echo "CONFIG_VIRTIO_ANCHOR=y" >> ./.config
echo "CONFIG_SCSI_VIRTIO=y" >> ./.config
echo "CONFIG_VIRTIO_NET=y" >> ./.config
echo "CONFIG_VIRTIO_CONSOLE=y" >> ./.config
echo "CONFIG_VIRTIO_PCI_LIB=y" >> ./.config
echo "CONFIG_VIRTIO_PCI_LIB_LEGACY=y" >> ./.config
echo "CONFIG_VIRTIO_MENU=y" >> ./.config
echo "CONFIG_VIRTIO_BALLOON=y" >> ./.config
echo "CONFIG_HW_RANDOM_VIRTIO=y" >> ./.config
echo "CONFIG_VIRTIO_PCI_LEGACY=y" >> ./.config
echo "CONFIG_VIRTIO_MEM=y" >> ./.config
echo "CONFIG_VIRTIO_MMIO=y" >> ./.config
echo "CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y" >> ./.config
echo "CONFIG_VIRTIO_IOMMU=y" >> ./.config
echo "CONFIG_VIRTIO_FS=y" >> ./.config
echo "CONFIG_PCI=y" >> ./.config
echo "CONFIG_PCI_HOST_GENERIC=y" >> ./.config
echo "CONFIG_RPMSG_VIRTIO=y" >> ./.config
echo "CONFIG_DRM=y" >> ./.config
/usr/bin/make olddefconfig /usr/bin/make olddefconfig
/usr/bin/make -j ${cores} /usr/bin/make -j ${cores}

View File

@@ -1,18 +1,20 @@
#add sources list for noble. #add sources list for noble.
set -e set -e
echo "deb https://archive.ubuntu.com/ubuntu noble main restricted universe multiverse" > /etc/apt/sources.list echo "deb https://archive.ubuntu.com/ubuntu questing main restricted universe multiverse" > /etc/apt/sources.list
echo "deb https://archive.ubuntu.com/ubuntu noble-updates main restricted universe multiverse" >> /etc/apt/sources.list echo "deb https://archive.ubuntu.com/ubuntu questing-updates main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb https://archive.ubuntu.com/ubuntu noble-backports main restricted universe multiverse" >> /etc/apt/sources.list echo "deb https://archive.ubuntu.com/ubuntu questing-backports main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb https://security.ubuntu.com/ubuntu noble-security main restricted universe multiverse" >> /etc/apt/sources.list echo "deb https://security.ubuntu.com/ubuntu questing-security main restricted universe multiverse" >> /etc/apt/sources.list
apt update apt update
apt upgrade -y
#set locale #set locale
locale-gen "en_US.UTF-8" locale-gen "en_US.UTF-8"
echo "LANG=en_US.UTF-8" > /etc/default/locale echo "LANG=en_US.UTF-8" > /etc/default/locale
#install base system packages #install base system packages
apt install -y --no-install-recommends gnome-core git curl flatpak systemd-resolved ufw nano htop ipset lm-sensors net-tools iputils-ping fish python3-bpfcc python3-pip bpfcc-tools gnome-shell-extension-ubuntu-dock gnome-shell-extension-ubuntu-tiling-assistant ffmpeg vlc apt install -y --no-install-recommends gnome-core
apt install -y git curl flatpak systemd-resolved ufw nano htop ipset lm-sensors net-tools iputils-ping fish python3-bpfcc python3-pip bpfcc-tools gnome-shell-extension-ubuntu-dock gnome-shell-extension-ubuntu-tiling-assistant ffmpeg vlc
pip install --break-system-packages dnslib psutil pip install --break-system-packages dnslib psutil
#add setuid for some applications #add setuid for some applications

View File

@@ -2,4 +2,4 @@
cd "$(dirname "$0")" cd "$(dirname "$0")"
cd .. cd ..
disk="./outputs/boot_image.img" disk="./outputs/boot_image.img"
qemu-system-x86_64 -bios /usr/share/ovmf/OVMF.fd -drive format=raw,file=$disk -m 16G -smp 8 -vga virtio -usb -device usb-tablet --display gtk,gl=off --device virtio-gpu-pci -enable-kvm -machine type=pc-q35-3.1,accel=kvm,kernel_irqchip=on qemu-system-x86_64 -bios /usr/share/ovmf/OVMF.fd -drive format=raw,file=$disk -m 16G -smp 8 -vga none -usb -device usb-tablet --display gtk --device virtio-gpu-pci -enable-kvm -machine type=pc-q35-3.1,accel=kvm,kernel_irqchip=on

View File

@@ -9,34 +9,32 @@ cd "$(dirname "$0")"
DIR="$(dirname "$0")" DIR="$(dirname "$0")"
cd .. cd ..
echo $PWD echo $PWD
if mountpoint -q "./outputs/chroot/proc/"; then
umount -lf "./outputs/chroot/proc/"
fi
rm -rf './outputs/root'
if [ ! -d ./outputs/root/bin ]; then if [ ! -d ./outputs/root/bin ]; then
rm -rf './outputs/root' rm -rf './outputs/root'
mkdir -p ./outputs/root/ mkdir -p ./outputs/root/
debootstrap noble ./outputs/root https://us.archive.ubuntu.com/ubuntu debootstrap questing ./outputs/root https://us.archive.ubuntu.com/ubuntu
fi fi
rm -rf './outputs/chroot'
mkdir -p ./outputs/chroot/
rsync -av ./outputs/root/ ./outputs/chroot/
mkdir -p ./outputs/chroot/proc
if mountpoint -q "./outputs/chroot/proc/"; then if mountpoint -q "./outputs/chroot/proc/"; then
umount -lf "./outputs/chroot/proc/" umount -lf "./outputs/chroot/proc/"
fi fi
rm -rf './outputs/chroot'
mkdir -p ./outputs/chroot/
if mountpoint -q "./outputs/root/proc/"; then
umount -lf "./outputs/root/proc/"
fi
rsync -a ./outputs/root/ ./outputs/chroot/
mkdir -p ./outputs/chroot/proc
mount --bind /proc ./outputs/chroot/proc mount --bind /proc ./outputs/chroot/proc
cp ./config/filesystem_chroot_install.sh ./outputs/chroot/filesystem_chroot_install.sh cp ./config/filesystem_chroot_install.sh ./outputs/chroot/filesystem_chroot_install.sh
cp ./config/interfaces.network ./outputs/chroot/etc/systemd/network/10-all.network
cp ./config/resolved.conf ./outputs/chroot/etc/systemd/resolved.conf
chmod +x ./outputs/chroot/filesystem_chroot_install.sh chmod +x ./outputs/chroot/filesystem_chroot_install.sh
chroot ./outputs/chroot /bin/bash -c "/filesystem_chroot_install.sh" chroot ./outputs/chroot /bin/bash -c "/filesystem_chroot_install.sh"
cp ./config/interfaces.network ./outputs/chroot/etc/systemd/network/10-all.network
cp ./config/resolved.conf ./outputs/chroot/etc/systemd/resolved.conf
cd $DIR cd $DIR
cd .. cd ..
if mountpoint -q "./outputs/chroot/proc/"; then if mountpoint -q "./outputs/chroot/proc/"; then
umount -lf "./outputs/chroot/proc/" umount -lf "./outputs/chroot/proc/"
fi fi
echo 'root filesystem created.' echo 'root filesystem created.'

View File

@@ -47,7 +47,10 @@ echo "efi loop: ${disk_efi}"
echo "sys loop: ${disk_sys}" echo "sys loop: ${disk_sys}"
grub-install -s --compress=gz --target=x86_64-efi --recheck --no-floppy --efi-directory=./outputs/efi --boot-directory=./outputs/efi --root-directory=./outputs/sys --bootloader-id=patronage /dev/$loop grub-install -s --compress=gz --target=x86_64-efi --recheck --no-floppy --efi-directory=./outputs/efi --boot-directory=./outputs/efi --root-directory=./outputs/sys --bootloader-id=patronage /dev/$loop
echo 'copying filesystem to mounted image..' echo 'copying filesystem to mounted image..'
sudo rsync -av './outputs/chroot/' './outputs/sys/' if mountpoint -q "./outputs/chroot/proc/"; then
umount -lf "./outputs/chroot/proc/"
fi
rsync -a './outputs/chroot/' './outputs/sys/'
#tar -xf ./patronagefs.tar --directory ./mnt/sys/ #tar -xf ./patronagefs.tar --directory ./mnt/sys/
echo 'copied..' echo 'copied..'
echo 'copying boot files..' echo 'copying boot files..'

View File

@@ -12,4 +12,5 @@ cd ..
echo $PWD echo $PWD
cat ./config/build_containerfile | /usr/bin/podman build --volume /lib/modules:/lib/modules:z -f - -t patronagekernel:latest . cat ./config/build_containerfile | /usr/bin/podman build --volume /lib/modules:/lib/modules:z -f - -t patronagekernel:latest .
nice -n 20 /usr/bin/podman run -it --volume /lib/modules:/lib/modules:z --volume ./dependencies/linux:/linux patronagekernel:latest nice -n 20 /usr/bin/podman run -it --volume /lib/modules:/lib/modules:z --volume ./dependencies/linux:/linux patronagekernel:latest
mkdir -p ./outputs/
cp ./dependencies/linux/arch/x86_64/boot/bzImage ./outputs/bzImage cp ./dependencies/linux/arch/x86_64/boot/bzImage ./outputs/bzImage