elks-enhanced
public
Read
Owner: themaster
Branch: master
Commits: 6893
Updated: 2026-04-19 00:15
Git CLI clone URL
git clone https://www.xt-emporium.com/git/elks-enhanced.git
Fullscreen desktop URL
Code
Commits
History
Branches
Bug Reports
Discussions
Compare
Settings
elks-enhanced
/
image
/
Make.image
File editor
# Makefile for ELKS images # include selected config file for image instructions include $(CONFIG) include Make.defs #VERBOSE=-v # Determine what to build for 'image' target TARGETS = ifdef CONFIG_IMG_BOOT TARGETS += $(FD_MINIX_BOOT) $(FD_FAT_BOOT) $(ELKS_DIR)/arch/i86/boot/Image endif ifdef CONFIG_IMG_MINIX TARGETS += template minixfs endif ifdef CONFIG_IMG_FAT TARGETS += template fatfs endif ifdef CONFIG_IMG_ROM TARGETS += template romfs ifdef CONFIG_ARCH_SWAN TARGETS += swanrom endif endif .PHONY: image $(TARGETS) image: $(TARGETS) copyminix: minixfs copyfat: fatfs copyrom: romfs # Populate template for filesystem genfs template: -rm -rf $(DESTDIR) cp -a $(TEMPLATE_DIR) $(DESTDIR) -chmod 777 $(DESTDIR)/tmp find $(DESTDIR) -name .keep -delete $(MAKE) -C $(ELKSCMD_DIR) -f Make.install install "CONFIG=$(CONFIG)" -chmod 1755 $(DESTDIR)/bin/romprg ifdef CONFIG_APPS_360K -rm $(DESTDIR)/etc/hosts -rm $(DESTDIR)/etc/net.cfg -rm $(DESTDIR)/etc/sashrc -rm $(DESTDIR)/bin/net -rm $(DESTDIR)/bin/setup endif ifdef CONFIG_APPS_COMPRESS awk /`echo ":nocomp" | tr -d ' '`/{print} $(TOPDIR)/elkscmd/Applications | sed '/^#/d' | sed 's#.*/##g' | cut -d" " -f 1 | sed 's#\(^.*\)#/\1/d#' > Nocomp ls $(DESTDIR)/bin | sed -f Nocomp > Filelist cd $(DESTDIR)/bin; elks-compress `cat $(TOPDIR)/image/Filelist` rm -f Nocomp Filelist endif $(MAKE) -C $(BOOTBLOCKS_DIR) bash -c "./ver.pl $(ELKS_DIR)/Makefile-rules > $(DESTDIR)/etc/issue" #git log --abbrev-commit | head -1 | sed 's/commit/ELKS built from commit/' > $(DESTDIR)/etc/motd ifdef CONFIG_IMG_BOOT install $(ELKS_DIR)/arch/i86/boot/Image $(DESTDIR)/linux endif ifdef CONFIG_TIME_TZ echo 'if test "$$TZ" = ""; then export' "TZ=$(CONFIG_TIME_TZ); fi" >> $(DESTDIR)/etc/profile endif ifdef CONFIG_TIME_RTC_LOCALTIME sed -e 's/clock -s -u/clock -s/' < $(DESTDIR)/etc/rc.sys > tmp mv tmp $(DESTDIR)/etc/rc.sys endif # Create MINIX filesystem from template # Create bootable ELKS MINIX disk image: # Select tagged files into filelist # Create empty filesystem # Add tagged files into filesystem (regular, directories, links) # Create special files in /dev # Write boot sector (and modify BPB (not completed)) # Check image integrity # Print filesystem used inode and block count minixfs: template rm -f $(TARGET_FILE) mfs $(VERBOSE) $(TARGET_FILE) mkfs $(MINIX_MKFSOPTS) ifndef CONFIG_SYS_NO_BININIT mfs -v $(TARGET_FILE) addfs Image.all $(DESTDIR) endif # rm -f Filelist # for f in $$(cd $(DESTDIR); find * -name '*'); do \ # echo $$f >> FileList; \ # done # mfs $(VERBOSE) $(TARGET_FILE) addfs Filelist $(DESTDIR) mfs $(VERBOSE) $(TARGET_FILE) genfs -a $(MINIX_MKFSOPTS) $(DESTDIR) # mfs $(VERBOSE) $(TARGET_FILE) genfs $(MINIX_MKFSOPTS) $(DESTDIR) ifdef CONFIG_IMG_DEV # command to make char/block devices in image (no sudo required) $(MAKE) -f Make.devices "MKDEV=mfs $(TARGET_FILE) mknod" endif ifdef CONFIG_IMG_BOOT setboot $(TARGET_FILE) $(BPB) $(FD_MINIX_BOOT) endif mfsck -fv $(TARGET_FILE) mfs $(TARGET_FILE) stat # Create FAT filesystem from template # Create bootable ELKS MSDOS disk image: # Select tagged files into filelist # Create empty filesystem # Create \linux as first directory entry # Add tagged files into filesystem (regular, directories, links) # Filename case is preserved # Note: filenames larger than 8.3 will create VFAT LFN entries # Write boot sector and modify ELKS PB # all mtools commands require image file # -i image image filename fatfs: template rm -f $(TARGET_FILE) dd if=/dev/zero of=$(TARGET_FILE) bs=1024 count=$(TARGET_BLKS) mformat -V mformat -i $(TARGET_FILE) $(FAT_MKFSOPTS) # Linux has to be the first file for the boot sector loader rm -f linux; touch linux mcopy -i $(TARGET_FILE) $(CPFS_OPTS) linux ::/linux rm linux ifdef CONFIG_IMG_DEV # Device folder has to be first or second for the 'fake dev' to work mmd -i $(TARGET_FILE) ::/dev endif for f in $$(cd $(DESTDIR); find * -name '*'); do \ if [ -d $(DESTDIR)/$$f -a "$$f" != "dev" ]; then mmd -D o -i $(TARGET_FILE) ::$$f || exit 1; fi; \ if [ -f $(DESTDIR)/$$f ]; then mcopy -i $(TARGET_FILE) $(FAT_COPYOPTS) $(DESTDIR)/$$f ::$$f || exit 1; fi; \ done # Protect contiguous /linux by marking as RO, System and Hidden mattrib -i $(TARGET_FILE) +r +s +h ::/linux # Read boot sector, skip FAT BPB, set ELKS PB sectors/heads and write boot ifdef CONFIG_IMG_BOOT ifdef CONFIG_IMG_FD1232 setboot $(TARGET_FILE) -K -F $(BPB) $(FD_FAT_BOOT) else setboot $(TARGET_FILE) -F $(BPB) $(FD_FAT_BOOT) endif endif # Create ROM filesystem from template romfs: template -rm -f romfs.devices $(MAKE) -f Make.devices "MKDEV=echo >> romfs.devices" mkromfs -d romfs.devices $(DESTDIR) -rm -f romfs.devices swanrom: rm -f $(TARGET_FILE) cat $(IMG_DIR)/romfs.bin > $(TARGET_FILE) truncate -s $(TARGET_ROMFS_BYTES) $(TARGET_FILE) cat $(ELKS_DIR)/arch/i86/boot/Image >> $(TARGET_FILE)
Commit message
This repository is read-only for this account.
Repository snapshot
Current branch
master
Visibility
public
Your access
Read
Remote
Configured
File activity
View file history