Compare commits

...

6 Commits

Author SHA1 Message Date
ed barz 4af04f573d lilo config maker script added 2020-05-01 19:37:34 +02:00
ed barz 3d0afc2944 lilo target added 2020-05-01 19:37:06 +02:00
ed barz 61b0a7fcc1 set-fstab target added 2020-05-01 12:10:03 +02:00
ed barz 5d37856e73 blank fstab added 2020-05-01 11:49:20 +02:00
ed barz 275d18d137 base-from-archive target added 2020-05-01 11:46:00 +02:00
ed barz 2318f83a35 archive target added and tested ok 2020-05-01 11:43:21 +02:00
4 changed files with 62 additions and 1 deletions

View File

@ -1,7 +1,7 @@
include config.mk
define vinstall
export XBPS_ARCH=$(VOID_ARCH) && xbps-install -Su -R $(VOID_REPO) -r $(MNTDIR) $(1)
export XBPS_ARCH=$(VOID_ARCH) && xbps-install -Suy -R $(VOID_REPO) -r $(MNTDIR) $(1)
endef
base-fs:
@ -22,6 +22,13 @@ umnt-system:
base: base-fs mnt-system
$(call vinstall,base-system)
base-from-archive:
tar -xpf $(VOID_ARCHIVE) -C $(MNTDIR)
mount -t proc proc $(MNTDIR)/proc
mount -t sysfs sys $(MNTDIR)/sys
mount -o bind /dev $(MNTDIR)/dev
mount -t devpts pts $(MNTDIR)/dev/pts
set-term:
cp -r files/terminfo $(MNTDIR)/usr/share/
chmod -R 755 $(MNTDIR)/usr/share/terminfo
@ -33,4 +40,23 @@ set-resolv:
tools:
$(call vinstall,base-devel git tcc wget vim-x11 tmux)
archive:
tar -cvpjf void-fs.tar.bz2 \
--exclude=./dev/* \
--exclude=./proc/* \
--exclude=./sys/* \
--exclude=./tmp/* \
--exclude=./run/* \
-C $(MNTDIR) .
set-fstab:
cp files/fstab $(MNTDIR)/etc/fstab
echo "$(shell file -s $(DRIVE)|tr ' ' '\n'|grep UUID) / ext4 rw,noatime,discard 0 1" >> $(MNTDIR)/etc/fstab
scripts:
cp scripts/* $(MNTDIR)/usr/local/bin/
chmod 755 $(MNTDIR)/usr/local/bin/*
lilo: set-fstab scripts
$(call vinstall,lilo)
chroot $(MNTDIR) lilo-conf-mkr.sh $(LBOOT)

View File

@ -1,7 +1,9 @@
VOID_ARCH=x86_64
VOID_REPO="https://alpha.de.repo.voidlinux.org/current"
VOID_ARCHIVE=void-fs.tar.bz2
DRIVE=/dev/sdb1
LBOOT=/dev/sdb
MNTDIR=/mnt

1
files/fstab Normal file
View File

@ -0,0 +1 @@
#<device> <dir> <type> <options> <dump> <fsck>

32
scripts/lilo-conf-mkr.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/sh
IMG=$(ls /boot/vmlinuz*|sort -r|sed 1q)
VERS=$(echo $IMG | sed 's/\/boot\/vmlinuz-//')
INIT=/boot/initramfs-$VERS.img
ROOT_UUID=$(cat /etc/fstab|grep "UUID"|awk '{print $1}')
LBOOT="$1"
#global setup
printf "boot=$LBOOT
prompt
timeout=150
lba32
root=\"$ROOT_UUID\"
vga=normal
read-only
menu-title=\"edbarz9's computer\"
\n\n
#image setup
image = $IMG
\tlabel = \"$VERS\"
\t#root = \"$ROOT_UUID\"
\tread-only
\tinitrd = $INIT\n" > /etc/lilo.conf
lilo