Makefile: Make the preproot target inside the chroot
This commit is contained in:
parent
13512c8cbf
commit
1a9d97d016
13
Makefile
13
Makefile
|
@ -15,6 +15,7 @@ COMPILE_OPTIONS = $(CHROOT)/tmp/compile_options
|
||||||
SOFTWARE = $(CHROOT)/tmp/software
|
SOFTWARE = $(CHROOT)/tmp/software
|
||||||
KERNEL = $(CHROOT)/tmp/kernel
|
KERNEL = $(CHROOT)/tmp/kernel
|
||||||
GRUB = $(CHROOT)/tmp/grub
|
GRUB = $(CHROOT)/tmp/grub
|
||||||
|
PREPROOT = $(CHROOT)/tmp/preproot
|
||||||
STAGE4_TARBALL = $(CURDIR)/images/$(APPLIANCE).tar.xz
|
STAGE4_TARBALL = $(CURDIR)/images/$(APPLIANCE).tar.xz
|
||||||
VIRTIO = NO
|
VIRTIO = NO
|
||||||
TIMEZONE = UTC
|
TIMEZONE = UTC
|
||||||
|
@ -126,13 +127,13 @@ ifeq ($(EMERGE_RSYNC),YES)
|
||||||
$(inroot) emerge --sync --quiet
|
$(inroot) emerge --sync --quiet
|
||||||
endif
|
endif
|
||||||
|
|
||||||
preproot: $(STAGE3) $(PORTAGE_DIR) configs/fstab
|
$(PREPROOT): $(STAGE3) $(PORTAGE_DIR) configs/fstab
|
||||||
mkdir -p $(PKGDIR) $(DISTDIR)
|
mkdir -p $(PKGDIR) $(DISTDIR)
|
||||||
#$(inroot) sed -i 's/root:.*/root::9797:0:::::/' /etc/shadow
|
#$(inroot) sed -i 's/root:.*/root::9797:0:::::/' /etc/shadow
|
||||||
cp configs/fstab $(CHROOT)/etc/fstab
|
cp configs/fstab $(CHROOT)/etc/fstab
|
||||||
rm -f $(CHROOT)/etc/resolv.conf
|
rm -f $(CHROOT)/etc/resolv.conf
|
||||||
cp -L /etc/resolv.conf $(CHROOT)/etc/resolv.conf
|
cp -L /etc/resolv.conf $(CHROOT)/etc/resolv.conf
|
||||||
touch preproot
|
touch $(PREPROOT)
|
||||||
|
|
||||||
stage3-$(ARCH)-latest.tar.bz2:
|
stage3-$(ARCH)-latest.tar.bz2:
|
||||||
@scripts/echo You do not have a stage3 tarball. Consider \"make sync_stage3\"
|
@scripts/echo You do not have a stage3 tarball. Consider \"make sync_stage3\"
|
||||||
|
@ -181,7 +182,7 @@ ifneq ($(EXTERNAL_KERNEL),YES)
|
||||||
endif
|
endif
|
||||||
touch $(KERNEL)
|
touch $(KERNEL)
|
||||||
|
|
||||||
$(SWAP_FILE): preproot
|
$(SWAP_FILE): $(PREPROOT)
|
||||||
ifneq ($(SWAP_SIZE),0)
|
ifneq ($(SWAP_SIZE),0)
|
||||||
@scripts/echo Creating swap file: $(SWAP_FILE)
|
@scripts/echo Creating swap file: $(SWAP_FILE)
|
||||||
dd if=/dev/zero of=$(SWAP_FILE) bs=1M count=$(SWAP_SIZE)
|
dd if=/dev/zero of=$(SWAP_FILE) bs=1M count=$(SWAP_SIZE)
|
||||||
|
@ -190,7 +191,7 @@ else
|
||||||
sed -i '/swap/d' $(CHROOT)/etc/fstab
|
sed -i '/swap/d' $(CHROOT)/etc/fstab
|
||||||
endif
|
endif
|
||||||
|
|
||||||
sysconfig: preproot $(SWAP_FILE)
|
sysconfig: $(PREPROOT) $(SWAP_FILE)
|
||||||
@echo $(VIRTIO)
|
@echo $(VIRTIO)
|
||||||
ifeq ($(VIRTIO),YES)
|
ifeq ($(VIRTIO),YES)
|
||||||
sed -i 's/sda/vda/' $(CHROOT)/etc/fstab
|
sed -i 's/sda/vda/' $(CHROOT)/etc/fstab
|
||||||
|
@ -215,7 +216,7 @@ ifeq ($(DASH),YES)
|
||||||
endif
|
endif
|
||||||
touch systools
|
touch systools
|
||||||
|
|
||||||
$(GRUB): preproot configs/grub.conf $(KERNEL) scripts/grub-headless.sed
|
$(GRUB): $(PREPROOT) configs/grub.conf $(KERNEL) scripts/grub-headless.sed
|
||||||
ifneq ($(EXTERNAL_KERNEL),YES)
|
ifneq ($(EXTERNAL_KERNEL),YES)
|
||||||
@scripts/echo Installing Grub
|
@scripts/echo Installing Grub
|
||||||
$(inroot) $(EMERGE) -nN $(USEPKG) sys-boot/grub-static
|
$(inroot) $(EMERGE) -nN $(USEPKG) sys-boot/grub-static
|
||||||
|
@ -334,7 +335,7 @@ eclean: $(COMPILE_OPTIONS)
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f preproot sysconfig systools
|
rm -f sysconfig systools
|
||||||
rm -rf --one-file-system -- $(CHROOT)
|
rm -rf --one-file-system -- $(CHROOT)
|
||||||
|
|
||||||
realclean: clean
|
realclean: clean
|
||||||
|
|
Loading…
Reference in New Issue