updates nov 16th.
This commit is contained in:
10
build_filesystem.sh
Executable file
10
build_filesystem.sh
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
dir=$(dirname "$0")
|
||||||
|
echo $dir
|
||||||
|
podman run --rm -d --name ubuntu ubuntu:latest /bin/bash -c "while true; do sleep 1; done"
|
||||||
|
podman export -o ./ubuntu.tar ubuntu
|
||||||
|
echo 'exported.'
|
||||||
|
podman stop ubuntu
|
||||||
|
|
||||||
@@ -12,4 +12,5 @@ echo "CONFIG_EFI=y" >> ./.config
|
|||||||
echo "CONFIG_SYSFB=y" >> ./.config
|
echo "CONFIG_SYSFB=y" >> ./.config
|
||||||
echo "CONFIG_FB=y" >> ./.config
|
echo "CONFIG_FB=y" >> ./.config
|
||||||
echo "CONFIG_FRAMEBUFFER_CONSOLE=y" >> ./.config
|
echo "CONFIG_FRAMEBUFFER_CONSOLE=y" >> ./.config
|
||||||
|
/usr/bin/make olddefconfig
|
||||||
/usr/bin/make -j ${cores}
|
/usr/bin/make -j ${cores}
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
if [ "$(id -u)" -ne 0 ]; then
|
||||||
|
echo "switching from $(id -un) to root"
|
||||||
|
exec sudo "$0" "$@"
|
||||||
|
fi
|
||||||
set -e
|
set -e
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
dir=$(dirname "$0")
|
dir=$(dirname "$0")
|
||||||
@@ -35,7 +39,8 @@ mkdir -p $dir/mnt/
|
|||||||
mkdir -p $dir/mnt/{efi,sys,grub}
|
mkdir -p $dir/mnt/{efi,sys,grub}
|
||||||
mount -t vfat /dev/mapper/${disk_efi} $dir/mnt/efi
|
mount -t vfat /dev/mapper/${disk_efi} $dir/mnt/efi
|
||||||
mount -t ext4 /dev/mapper/${disk_sys} $dir/mnt/sys
|
mount -t ext4 /dev/mapper/${disk_sys} $dir/mnt/sys
|
||||||
|
tar -xvf ./ubuntu.tar --directory ./mnt/sys/
|
||||||
|
rm ./ubuntu.tar
|
||||||
#--grub-mkdevicemap=$dir/mnt/device.map
|
#--grub-mkdevicemap=$dir/mnt/device.map
|
||||||
#echo "(hd0) /dev/${disk_grub}" > $dir/mnt/device.map
|
#echo "(hd0) /dev/${disk_grub}" > $dir/mnt/device.map
|
||||||
#--efi-directory=$dir/mnt/efi --boot-directory=$dir/mnt/grub --root-directory=$dir/mnt/sys
|
#--efi-directory=$dir/mnt/efi --boot-directory=$dir/mnt/grub --root-directory=$dir/mnt/sys
|
||||||
@@ -57,6 +62,10 @@ cp $dir/initramfs.cpio.gz $dir/mnt/efi/EFI/patronage/
|
|||||||
cp $dir/grub.cfg $dir/mnt/efi/EFI/patronage/
|
cp $dir/grub.cfg $dir/mnt/efi/EFI/patronage/
|
||||||
#cp $dir/grub.cfg $dir/mnt/sys/boot/grub/
|
#cp $dir/grub.cfg $dir/mnt/sys/boot/grub/
|
||||||
cp $dir/grub.cfg $dir/mnt/efi/EFI/BOOT/
|
cp $dir/grub.cfg $dir/mnt/efi/EFI/BOOT/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sync
|
sync
|
||||||
#exit
|
#exit
|
||||||
if mountpoint -q "$dir/mnt/efi"; then
|
if mountpoint -q "$dir/mnt/efi"; then
|
||||||
|
|||||||
9
init.sh
9
init.sh
@@ -1,8 +1,13 @@
|
|||||||
#!/bin/busybox sh
|
#!/bin/busybox sh
|
||||||
/bin/busybox mount -t devtmpfs devtmpfs /dev
|
/bin/busybox mount -t devtmpfs devtmpfs /dev
|
||||||
/bin/busybox mount -t proc none /proc
|
/bin/busybox mount -t proc proc /proc
|
||||||
/bin/busybox mount -t sysfs none /sys
|
/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 ln -s "/lib/modules/" "/lib/modules/$(uname -r)"
|
#/bin/busybox ln -s "/lib/modules/" "/lib/modules/$(uname -r)"
|
||||||
#depmod -a
|
#depmod -a
|
||||||
#/bin/busybox modprobe nbd max_part=2
|
#/bin/busybox modprobe nbd max_part=2
|
||||||
exec /bin/busybox sh
|
|
||||||
|
exec switch_root /newroot /bin/bash
|
||||||
|
#exec /bin/busybox sh
|
||||||
|
|||||||
Reference in New Issue
Block a user