The initrd is now supported for local install and deb files.
This commit is contained in:
parent
c157e65352
commit
86351d9274
30
Makefile
30
Makefile
|
@ -16,13 +16,17 @@ DEBFILE:=builds/$(DEBNAME).deb
|
||||||
PACKAGENAME:=sortix
|
PACKAGENAME:=sortix
|
||||||
ISODIR:=builds/$(DEBNAME)-iso
|
ISODIR:=builds/$(DEBNAME)-iso
|
||||||
ISOFILE:=builds/$(DEBNAME).iso
|
ISOFILE:=builds/$(DEBNAME).iso
|
||||||
JSNAME:=jssortix_$(VERSION)_$(CPU).bin
|
|
||||||
INITRDDIR:=initrd
|
INITRDDIR:=initrd
|
||||||
|
INITRD=sortix/sortix.initrd
|
||||||
|
|
||||||
all:
|
suball:
|
||||||
(for D in $(MODULES); do $(MAKE) all $(MFLAGS) --directory $$D; done)
|
(for D in $(MODULES); do $(MAKE) all $(MFLAGS) --directory $$D || exit 1; done)
|
||||||
clean:
|
|
||||||
(for D in $(MODULES); do $(MAKE) clean $(MFLAGS) --directory $$D; done)
|
all: $(INITRD)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(INITRD)
|
||||||
|
(for D in $(MODULES); do $(MAKE) clean $(MFLAGS) --directory $$D || exit 1; done)
|
||||||
|
|
||||||
distclean: clean cleanbuilds
|
distclean: clean cleanbuilds
|
||||||
|
|
||||||
|
@ -30,7 +34,11 @@ cleanbuilds:
|
||||||
rm -rf builds/
|
rm -rf builds/
|
||||||
rm -f sortix.iso
|
rm -f sortix.iso
|
||||||
|
|
||||||
everything: all deb iso jssortix
|
everything: all deb iso
|
||||||
|
|
||||||
|
# Initializing RamDisk
|
||||||
|
$(INITRD): suball
|
||||||
|
(cd $(INITRDDIR) && ../mkinitrd/mkinitrd * -o ../$(INITRD))
|
||||||
|
|
||||||
# Statistics
|
# Statistics
|
||||||
linecount:
|
linecount:
|
||||||
|
@ -40,6 +48,7 @@ linecount:
|
||||||
|
|
||||||
install: all
|
install: all
|
||||||
cp sortix/sortix.bin /boot
|
cp sortix/sortix.bin /boot
|
||||||
|
cp $(INITRD) /boot
|
||||||
cp debsrc/etc/grub.d/42_sortix /etc/grub.d/42_sortix
|
cp debsrc/etc/grub.d/42_sortix /etc/grub.d/42_sortix
|
||||||
chmod +x /etc/grub.d/42_sortix
|
chmod +x /etc/grub.d/42_sortix
|
||||||
update-grub
|
update-grub
|
||||||
|
@ -54,6 +63,7 @@ uninstall:
|
||||||
install-remote: all
|
install-remote: all
|
||||||
scp -r ./ $(REMOTE):$(REMOTECOPYDIR)
|
scp -r ./ $(REMOTE):$(REMOTECOPYDIR)
|
||||||
scp sortix/sortix.bin root@$(REMOTE):/boot
|
scp sortix/sortix.bin root@$(REMOTE):/boot
|
||||||
|
scp $(INITRD) root@$(REMOTE):/boot
|
||||||
ssh root@$(REMOTE) "init 6"
|
ssh root@$(REMOTE) "init 6"
|
||||||
|
|
||||||
uninstall-remote:
|
uninstall-remote:
|
||||||
|
@ -69,6 +79,7 @@ debfile: all
|
||||||
cp -r debsrc/. $(DEBDIR)
|
cp -r debsrc/. $(DEBDIR)
|
||||||
mkdir -p $(DEBDIR)/boot
|
mkdir -p $(DEBDIR)/boot
|
||||||
cp sortix/sortix.bin $(DEBDIR)/boot
|
cp sortix/sortix.bin $(DEBDIR)/boot
|
||||||
|
cp sortix/sortix.initrd $(DEBDIR)/boot
|
||||||
cat debsrc/DEBIAN/control | \
|
cat debsrc/DEBIAN/control | \
|
||||||
sed "s/SORTIX_PACKAGE_NAME/$(PACKAGENAME)/g" | \
|
sed "s/SORTIX_PACKAGE_NAME/$(PACKAGENAME)/g" | \
|
||||||
sed "s/SORTIX_VERSION/$(VERSION)/g" | \
|
sed "s/SORTIX_VERSION/$(VERSION)/g" | \
|
||||||
|
@ -87,11 +98,6 @@ debsource: all
|
||||||
(cd builds && tar cfzv $(DEBSRCNAME)-src.tar.gz $(DEBSRCNAME)-src)
|
(cd builds && tar cfzv $(DEBSRCNAME)-src.tar.gz $(DEBSRCNAME)-src)
|
||||||
rm -rf $(DEBSRCDIR)
|
rm -rf $(DEBSRCDIR)
|
||||||
|
|
||||||
jssortix: all
|
|
||||||
mkdir -p builds
|
|
||||||
$(MAKE) jssortix $(MFLAGS) --directory sortix
|
|
||||||
cp sortix/jssortix.bin builds/$(JSNAME)
|
|
||||||
|
|
||||||
# Bootable images
|
# Bootable images
|
||||||
|
|
||||||
iso: all debsource
|
iso: all debsource
|
||||||
|
@ -100,7 +106,7 @@ iso: all debsource
|
||||||
mkdir -p $(ISODIR)
|
mkdir -p $(ISODIR)
|
||||||
cp -r isosrc/. $(ISODIR)
|
cp -r isosrc/. $(ISODIR)
|
||||||
cp sortix/sortix.bin $(ISODIR)/boot
|
cp sortix/sortix.bin $(ISODIR)/boot
|
||||||
(cd $(INITRDDIR) && ../mkinitrd/mkinitrd * -o ../$(ISODIR)/boot/sortix.initrd)
|
cp $(INITRD) $(ISODIR)/boot/sortix.initrd
|
||||||
cp builds/$(DEBSRCNAME)-src.tar.gz $(ISODIR)
|
cp builds/$(DEBSRCNAME)-src.tar.gz $(ISODIR)
|
||||||
grub-mkrescue -o $(ISOFILE) $(ISODIR)
|
grub-mkrescue -o $(ISOFILE) $(ISODIR)
|
||||||
rm -rf $(ISODIR)
|
rm -rf $(ISODIR)
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
if [ -f /boot/sortix.bin ]; then
|
for KERNEL in `ls /boot | grep sortix | grep bin`; do
|
||||||
echo "Found Sortix kernel: /boot/sortix" >&2
|
echo "Found Sortix kernel: $KERNEL" >&2
|
||||||
|
INITRD=`echo "$KERNEL" | sed 's/bin/initrd/g'`
|
||||||
cat << EOF
|
echo "menuentry \"Sortix\" {"
|
||||||
menuentry "Sortix" {
|
echo "\tmultiboot /boot/$KERNEL"
|
||||||
multiboot /boot/sortix.bin
|
echo "\tmodule /boot/$INITRD"
|
||||||
}
|
echo "}"
|
||||||
EOF
|
done
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue