Build System: Create base directory for the FS

This commit is contained in:
Bananymous 2023-03-27 01:11:17 +03:00
parent f8a2c60c8d
commit 3dab392296
5 changed files with 7 additions and 8 deletions

15
disk.sh
View File

@ -2,6 +2,8 @@
set -e
. ./build.sh
cp -r base/* $SYSROOT
DISK_NAME=banan-os.img
DISK_SIZE=$[50 * 1024 * 1024]
MOUNT_DIR=/mnt
@ -46,14 +48,16 @@ PARTITION1=${LOOP_DEV}p1
PARTITION2=${LOOP_DEV}p2
PARTITION3=${LOOP_DEV}p3
sudo mkfs.ext2 $PARTITION3
sudo mount $PARTITION3 $MOUNT_DIR
echo 'hello' | sudo tee ${MOUNT_DIR}/hello.txt
sudo umount $MOUNT_DIR
sudo mkfs.ext2 $PARTITION2
sudo mount $PARTITION2 $MOUNT_DIR
sudo cp -r ${SYSROOT}/* ${MOUNT_DIR}/
sudo mkdir -p ${MOUNT_DIR}/usr/share/
sudo cp -r fonts ${MOUNT_DIR}/usr/share/
sudo mkdir -p ${MOUNT_DIR}/mnt/
sudo grub-install --no-floppy --target=i386-pc --modules="normal ext2 multiboot" --boot-directory=${MOUNT_DIR}/boot $LOOP_DEV
@ -74,9 +78,4 @@ menuentry "banan-os (no apic, no serial)" {
sudo umount $MOUNT_DIR
sudo mkfs.ext2 $PARTITION3
sudo mount $PARTITION3 $MOUNT_DIR
echo 'hello' | sudo tee ${MOUNT_DIR}/hello.txt
sudo umount $MOUNT_DIR
sudo losetup -d $LOOP_DEV