folder reorganization.
This commit is contained in:
8
config/build_containerfile
Executable file
8
config/build_containerfile
Executable file
@@ -0,0 +1,8 @@
|
||||
from ubuntu:latest
|
||||
run apt-get update
|
||||
run apt-get upgrade -y
|
||||
run apt-get install -y bison flex gcc make libncurses-dev git bc build-essential git libncurses5-dev lzop perl libssl-dev bison flex kmod device-tree-compiler dwarves libelf-dev libdwarf-dev libdw-dev python3 gawk zstd
|
||||
workdir /linux
|
||||
add ./config/container_cmd.sh /
|
||||
run chmod +x /container_cmd.sh
|
||||
cmd ["/usr/bin/bash","-c","/container_cmd.sh"]
|
||||
34
config/container_cmd.sh
Executable file
34
config/container_cmd.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
set -e
|
||||
cores=$(nproc)
|
||||
echo "${cores}"
|
||||
/usr/bin/make clean
|
||||
/usr/bin/make defconfig
|
||||
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_EFI_STUB="\.\*"/CONFIG_EFI_STUB="y"/' ./.config
|
||||
echo "CONFIG_FB_EFI=y" >> ./.config
|
||||
echo "CONFIG_EFI=y" >> ./.config
|
||||
echo "CONFIG_SYSFB=y" >> ./.config
|
||||
echo "CONFIG_FB=y" >> ./.config
|
||||
echo "CONFIG_VIRTIO=y" >> ./.config
|
||||
echo "CONFIG_FRAMEBUFFER_CONSOLE=y" >> ./.config
|
||||
echo "CONFIG_DRM_VIRTIO_GPU=y" >> ./.config
|
||||
echo "CONFIG_VIRTIO_PCI=y" >> ./.config
|
||||
echo "CONFIG_VIRTIO_BLK=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_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_DRM=y" >> ./.config
|
||||
/usr/bin/make olddefconfig
|
||||
/usr/bin/make -j ${cores}
|
||||
5
config/filesystem_cmd.sh
Normal file
5
config/filesystem_cmd.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
fakechroot
|
||||
debootstrap --version
|
||||
debootstrap --variant=fakechroot --arch amd64 bionic /tmp/rootfs/ http://archive.ubuntu.com/ubuntu
|
||||
11
config/filesystem_containerfile
Executable file
11
config/filesystem_containerfile
Executable file
@@ -0,0 +1,11 @@
|
||||
FROM ubuntu:latest
|
||||
run ls /
|
||||
run apt-get update
|
||||
run apt-get install -y pacstrap
|
||||
run mkdir -p /tmp/
|
||||
run mkdir -p /tmp/rootfs/
|
||||
workdir /linux
|
||||
add ./config/filesystem_cmd.sh /
|
||||
add ./config/polystrap.cfg /tmp
|
||||
run chmod +x /filesystem_cmd.sh
|
||||
cmd ["/usr/bin/bash","-c","/filesystem_cmd.sh"]
|
||||
20
config/grub.cfg
Executable file
20
config/grub.cfg
Executable file
@@ -0,0 +1,20 @@
|
||||
set timeout=1
|
||||
set default=0
|
||||
echo 'loading modules..'
|
||||
insmod normal
|
||||
insmod fat
|
||||
insmod part_gpt
|
||||
insmod gzio
|
||||
insmod ext
|
||||
|
||||
echo 'loading menu..'
|
||||
set root='(hd0,gpt1)'
|
||||
ls (hd0,gpt1)/EFI/patronage/
|
||||
menuentry "PatronageOS" {
|
||||
|
||||
linux /EFI/patronage/bzImage boot=/init
|
||||
echo 'loaded kernel...'
|
||||
initrd /EFI/patronage/initramfs.cpio.gz
|
||||
echo 'loaded initial ramdisk...'
|
||||
boot
|
||||
}
|
||||
20
config/init.sh
Executable file
20
config/init.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/busybox sh
|
||||
/bin/busybox echo 'mounting filesystems and devices..'
|
||||
/bin/busybox mount -t devtmpfs devtmpfs /dev
|
||||
/bin/busybox mount -t proc proc /proc
|
||||
/bin/busybox mount -t sysfs none /sys
|
||||
/bin/busybox mount -t sysfs none /run
|
||||
/bin/busybox mkdir -p /newroot
|
||||
/bin/busybox mount /dev/sda2 /newroot
|
||||
#/bin/busybox mount --move /sys /newroot
|
||||
#/bin/busybox mount --move /dev /newroot
|
||||
#/bin/busybox mount --move /proc /newroot
|
||||
|
||||
#exec /bin/busybox sh
|
||||
|
||||
#/bin/busybox ln -s "/lib/modules/" "/lib/modules/$(uname -r)"
|
||||
#depmod -a
|
||||
#/bin/busybox modprobe nbd max_part=2
|
||||
/bin/busybox echo 'switching root.'
|
||||
exec switch_root /newroot /bin/systemd
|
||||
|
||||
9
config/polystrap.cfg
Normal file
9
config/polystrap.cfg
Normal file
@@ -0,0 +1,9 @@
|
||||
# /tmp/polystrap.cfg
|
||||
[system]
|
||||
target = amd64-linux-gnu
|
||||
rootfs = /tmp/rootfs
|
||||
host = host
|
||||
download = http://deb.debian.org/debian
|
||||
distribution = bullseye
|
||||
components = main contrib non-free
|
||||
architectures = amd64
|
||||
Reference in New Issue
Block a user