Some changes in Makefile to correct incompatibilities

This commit is contained in:
Adrien Bourmault 2019-11-22 15:38:29 +01:00
parent d00c1b1f52
commit 268ab18b48
3 changed files with 18 additions and 22 deletions

View File

@ -22,7 +22,7 @@
# along with OS/K. If not, see <https://www.gnu.org/licenses/>. # # along with OS/K. If not, see <https://www.gnu.org/licenses/>. #
#=----------------------------------------------------------------------------=# #=----------------------------------------------------------------------------=#
.PHONY: all test test32 debug gdb install dust clean OS/K run .PHONY: all test test32 debug gdb installonimage dust clean OS/K run
.DELETE_ON_ERROR: $(BINDIR)/kaleid .DELETE_ON_ERROR: $(BINDIR)/kaleid
.DEFAULT_GOAL := all .DEFAULT_GOAL := all
@ -264,28 +264,24 @@ all :
@make OS/K -j 8 @make OS/K -j 8
## QEMU/DEBUG RELATED ## QEMU/DEBUG RELATED
testkvm: all install testkvm: all installonimage
@qemu-system-x86_64 -vga std -enable-kvm -soundhw pcspk -s \ @qemu-system-x86_64 -vga std -enable-kvm -soundhw pcspk -s \
-rtc base=localtime -m $(ram) -hda $(installdisk) \ -rtc base=localtime -m $(ram) -hda $(installdisk) \
-d cpu_reset,guest_errors,pcall,int 2> $(BUILDDIR)/qemu.log & -d cpu_reset,guest_errors,pcall,int 2> $(BUILDDIR)/qemu.log &
run: test run: test
test: all install test: all installonimage
@qemu-system-x86_64 -vga std -cpu $(cpu) -soundhw pcspk -s \ @qemu-system-x86_64 -vga std -cpu $(cpu) -soundhw pcspk -s \
-rtc base=localtime -m $(ram) -hda $(installdisk) \ -rtc base=localtime -m $(ram) -hda $(installdisk) \
-d cpu_reset,guest_errors,pcall,int 2> $(BUILDDIR)/qemu.log & -d cpu_reset,guest_errors,pcall,int 2> $(BUILDDIR)/qemu.log &
@qemu-system-x86_64 -vga std -soundhw pcspk -s \
-rtc base=localtime -m 8192 -hda /dev/sdc \
-d cpu_reset,guest_errors,pcall,int &
test32: all installonimage
test32: all install
@qemu-system-i386 -m $(ram) -hda $(installdisk) -d \ @qemu-system-i386 -m $(ram) -hda $(installdisk) -d \
cpu_reset,guest_errors,pcall,int 2> $(BUILDDIR)/qemu.log & cpu_reset,guest_errors,pcall,int 2> $(BUILDDIR)/qemu.log &
gdb: all install gdb: all installonimage
@setsid qemu-system-x86_64 -m $(ram) -soundhw pcspk -rtc base=localtime \ @setsid qemu-system-x86_64 -m $(ram) -soundhw pcspk -rtc base=localtime \
-hda $(installdisk) -no-reboot -no-shutdown -d \ -hda $(installdisk) -no-reboot -no-shutdown -d \
cpu_reset,guest_errors,pcall,int -s -S 2> $(BUILDDIR)/qemu.log & cpu_reset,guest_errors,pcall,int -s -S 2> $(BUILDDIR)/qemu.log &
@ -295,7 +291,7 @@ gdb: all install
-ex "symbol-file $(BINDIR)/kaleid" \ -ex "symbol-file $(BINDIR)/kaleid" \
-ex "break BtStartKern" \ -ex "break BtStartKern" \
ddd: all install_os_k ddd: all installonimage
@setsid qemu-system-x86_64 -m $(ram) -hda $(installdisk) -no-reboot -soundhw pcspk \ @setsid qemu-system-x86_64 -m $(ram) -hda $(installdisk) -no-reboot -soundhw pcspk \
-no-shutdown -d cpu_reset,guest_errors,pcall,int -s 2> $(BUILDDIR)/qemu.log & -no-shutdown -d cpu_reset,guest_errors,pcall,int -s 2> $(BUILDDIR)/qemu.log &
@ddd @ddd
@ -303,7 +299,7 @@ ddd: all install_os_k
## HD IMAGE RELATED ---------------------------------------------------------- # ## HD IMAGE RELATED ---------------------------------------------------------- #
install: $(installdisk) $(MBRDIR)/grub.cfg $(BINDIR)/kaleid installonimage: $(installdisk) $(MBRDIR)/grub.cfg
@echo ${CL2}[$@] ${NC}Installing MBR on image...${CL3} @echo ${CL2}[$@] ${NC}Installing MBR on image...${CL3}
@$(BUILDDIR)/install-os-k.sh $(installdisk) $(MBRDIR)/grub.cfg $(BINDIR)/kaleid @$(BUILDDIR)/install-os-k.sh $(installdisk) $(MBRDIR)/grub.cfg $(BINDIR)/kaleid
@echo ${CL2}[$@] ${CL}Success.${CL3} @echo ${CL2}[$@] ${CL}Success.${CL3}

View File

@ -36,8 +36,8 @@ dd if=/dev/zero of=$1 bs=512 count=131072 status=progress
## Partition the image ## Partition the image
echo ${CL2}[create_disk.sh]${NC} Partitionning image... \(parted\)${CL3} echo ${CL2}[create_disk.sh]${NC} Partitionning image... \(parted\)${CL3}
#/sbin/parted --script $1 mktable msdos mkpart primary 2048s 100% set 1 boot on #sudo parted --script $1 mktable msdos mkpart primary 2048s 100% set 1 boot on
/sbin/fdisk $1 > /dev/null <<EEOF sudo fdisk $1 > /dev/null <<EEOF
n n
p p
1 1
@ -49,7 +49,7 @@ EEOF
## Mount ## Mount
echo ${CL2}[create_disk.sh]${NC} Mount image... \(losetup\)${CL3} echo ${CL2}[create_disk.sh]${NC} Mount image... \(losetup\)${CL3}
lpblock=$(/sbin/losetup -f) lpblock=$(sudo losetup -f)
sudo losetup $lpblock $1 -o 1048576 sudo losetup $lpblock $1 -o 1048576
echo ${CL2}[create_disk.sh]${NC} Sync image... \(sync\)${CL3} echo ${CL2}[create_disk.sh]${NC} Sync image... \(sync\)${CL3}
sync sync
@ -66,9 +66,9 @@ sudo losetup -d $lpblock
## Mount ## Mount
echo ${CL2}[create_disk.sh]${NC} Mount image... \(losetup\)${CL3} echo ${CL2}[create_disk.sh]${NC} Mount image... \(losetup\)${CL3}
lpblock=$(/sbin/losetup -f) lpblock=$(sudo losetup -f)
sudo losetup $lpblock $1 -o 1048576 sudo losetup $lpblock $1 -o 1048576
lpblockbase=$(/sbin/losetup -f) lpblockbase=$(sudo losetup -f)
sudo losetup $lpblockbase $1 sudo losetup $lpblockbase $1
sudo udisksctl mount -b $lpblock --no-user-interaction sudo udisksctl mount -b $lpblock --no-user-interaction

View File

@ -30,22 +30,22 @@ NC='\033[1;37m'
set -e #exit if error set -e #exit if error
echo ${CL2}[create_disk.sh]${NC} Mount image... \(udisksctl\)${CL3} echo ${CL2}[install-os-k.sh]${NC} Mount image... \(udisksctl\)${CL3}
udisksctl loop-setup --offset 1048576 --no-user-interaction --file $1 udisksctl loop-setup --offset 1048576 --no-user-interaction --file $1
lpblock=$(/sbin/losetup -j $1 | cut -d ':' -f 1) lpblock=$(/sbin/losetup -j $1 | cut -d ':' -f 1)
echo ${CL2}[create_disk.sh]${NC} Sync image... \(sync\)${CL3} echo ${CL2}[install-os-k.sh]${NC} Sync image... \(sync\)${CL3}
sync sync
mountpoint=$(udisksctl info -b $lpblock | grep MountPoint | cut -d ':' -f 2 | sed 's/ //g') mountpoint=$(udisksctl info -b $lpblock | grep MountPoint | cut -d ':' -f 2 | sed 's/ //g')
echo ${CL2}[grub-install.sh]${NC} Copying grub.cfg echo ${CL2}[install-os-k.sh]${NC} Copying grub.cfg
cp $2 $mountpoint/boot/grub/grub.cfg cp $2 $mountpoint/boot/grub/grub.cfg
echo ${CL2}[grub-install.sh]${NC} Copying kernel echo ${CL2}[install-os-k.sh]${NC} Copying kernel
cp $3 $mountpoint/boot/kaleid cp $3 $mountpoint/boot/kaleid
echo ${CL2}[grub-install.sh]${NC} Sync image... \(sync\)${CL3} echo ${CL2}[install-os-k.sh]${NC} Sync image... \(sync\)${CL3}
sync sync
echo ${CL2}[create_disk.sh]${NC} Unmount image... \(udisksctl\)${CL3} echo ${CL2}[install-os-k.sh]${NC} Unmount image... \(udisksctl\)${CL3}
udisksctl unmount --no-user-interaction -b $lpblock udisksctl unmount --no-user-interaction -b $lpblock