diff options
-rw-r--r-- | makefile | 29 | ||||
-rw-r--r-- | readme.md | 4 |
2 files changed, 22 insertions, 11 deletions
@@ -2,10 +2,16 @@ include ./env export -CTR := sudo -n podman -MOUNT := sudo -n mount -UMOUNT := sudo -n umount -CP := sudo -n cp +# use sudo (non interactively) when running as regular user +ifneq ($(shell id -u),0) +AS_ROOT := sudo -n +endif + +CTR := $(AS_ROOT) podman +MOUNT := $(AS_ROOT) mount +UMOUNT := $(AS_ROOT) umount + +CP := cp GIT := git CTR_IMG_TAG := avans-linux @@ -36,11 +42,16 @@ os_bootloader: container_img $(SUBMODULE_INIT) $(CTRIZE) $(MAKE) -$(MAKEFLAGS) -C u-boot am335x_evm_config $(CTRIZE) $(MAKE) -$(MAKEFLAGS) -C u-boot -# sd card block device (assumed partition numbers, see readme.md) -SDCARD_BD := $(shell realpath /dev/disk/by-id/usb-Generic-_Multi-Card_20071114173400000-0:0) +# sd card block device prefix (assumed partition numbers, see readme.md) +# SDCARD_BD_PREFIX := /dev/sdc +SDCARD_BD_PREFIX := /dev/mmcblk0p load_bootloader: $(os_bootloader) mkdir -p /tmp/sdcard-boot - $(MOUNT) $(SDCARD_BD)1 /tmp/sdcard-boot - $(CP) u-boot/MLO u-boot/u-boot.img u-boot/u-boot.dtb /tmp/sdcard-boot - $(UMOUNT) $(SDCARD_BD)1 + $(MOUNT) $(SDCARD_BD_PREFIX)1 /tmp/sdcard-boot + $(AS_ROOT) $(CP) u-boot/MLO u-boot/u-boot.img u-boot/u-boot.dtb /tmp/sdcard-boot + $(UMOUNT) $(SDCARD_BD_PREFIX)1 + +format_sd: + $(AS_ROOT) mkfs.vfat -n BOOT -F 32 $(SDCARD_BD_PREFIX)1 + $(AS_ROOT) mkfs.ext4 -L ROOTFS -F $(SDCARD_BD_PREFIX)2 @@ -9,5 +9,5 @@ - partities: |#|size|fs|bootable| |-|-|-|-| - |1|64M|VFAT (W95 FAT32 / LBA)|\*| - |2|\*|ext4|| + |1|64M|W95 FAT32 (LBA)|ja| + |2|de rest|Linux|| |