Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d4baa191d6 | ||
|
|
98c0ab336f |
@@ -9,16 +9,21 @@
|
||||
# GNU General Public License for more details.
|
||||
|
||||
PWD := $(shell pwd)
|
||||
PACKAGE := $(shell echo $(PWD)|sed 's/.*\///')
|
||||
SNAPDIR = $(PWD)/SNAP
|
||||
ROOT = $(PWD)/ROOT
|
||||
|
||||
# This allows the package Makefile to override the name
|
||||
# of the package file. Added for the kernel package
|
||||
# though could be useful for others
|
||||
# This will set PACKAGE only if the package itself has
|
||||
# not provided a package name
|
||||
|
||||
ifndef SNAP
|
||||
SNAP := $(PACKAGE)-$(VERSION).snap
|
||||
ifndef PACKAGE
|
||||
PACKAGE := $(shell echo $(PWD)|sed 's/.*\///')
|
||||
endif
|
||||
|
||||
# This defines the name of the package file unless
|
||||
# specified
|
||||
|
||||
ifndef PKGFILE
|
||||
PKGFILE := $(PACKAGE)-$(VERSION).snap
|
||||
endif
|
||||
|
||||
SNAPINFO = $(SNAPDIR)/snapinfo
|
||||
@@ -31,7 +36,7 @@ FILES = $(SNAPDIR)/files.tar.gz
|
||||
# if we find that not to be supplied we're going to
|
||||
# assume that the SRCPKG is the same as the PACKAGE
|
||||
|
||||
ifndef SRCPKG)
|
||||
ifndef SRCPKG
|
||||
SRCPKG := $(PACKAGE)
|
||||
endif
|
||||
|
||||
@@ -41,19 +46,19 @@ ifndef VERSION
|
||||
$(error VERSION is not set)
|
||||
endif
|
||||
|
||||
$(SNAP): $(SNAPINFO) $(FILES)
|
||||
@if [ -f $(SNAP) ]; then \
|
||||
rm -v $(SNAP); \
|
||||
$(PKGFILE): $(SNAPINFO) $(FILES)
|
||||
@if [ -f $(PKGFILE) ]; then \
|
||||
rm -v $(PKGFILE); \
|
||||
fi
|
||||
|
||||
@ar cvr $(SNAP) $(SNAPINFO) $(MANIFEST); \
|
||||
@ar cvr $(PKGFILE) $(SNAPINFO) $(MANIFEST); \
|
||||
if [ -f $(USHER) ]; then \
|
||||
chmod +x $(USHER); \
|
||||
ar cvr $(SNAP) $(USHER); \
|
||||
ar cvr $(PKGFILE) $(USHER); \
|
||||
fi; \
|
||||
ar cvr $(SNAP) $(FILES)
|
||||
ar cvr $(PKGFILE) $(FILES)
|
||||
|
||||
@echo "Successfully built $(SNAP)"
|
||||
@echo "Successfully built $(PKGFILE)"
|
||||
|
||||
$(SNAPINFO): $(MANIFEST)
|
||||
@>$(SNAPINFO)
|
||||
|
||||
@@ -89,7 +89,7 @@ use constant VERFILE => eval {
|
||||
}
|
||||
};
|
||||
use constant {
|
||||
VERSION => '0.9',
|
||||
VERSION => '0.11',
|
||||
SNAPDIR => TARGET . '/var/lib/snap',
|
||||
PKGDIR => TARGET . '/var/lib/snap/packages',
|
||||
INSTDIR => TARGET . '/var/lib/snap/installed',
|
||||
|
||||
@@ -84,6 +84,17 @@ foreach my $package ( @$packages ) {
|
||||
$package->install();
|
||||
}
|
||||
|
||||
if ( $virtfs ) {
|
||||
my $pid;
|
||||
|
||||
if ( $pid = fork() ) {
|
||||
waitpid( $pid, 0 );
|
||||
}
|
||||
else {
|
||||
exec( "chroot " . Snap->TARGET . " passwd" );
|
||||
}
|
||||
}
|
||||
|
||||
virtfs( 'umount' );
|
||||
|
||||
print "\n";
|
||||
|
||||
Reference in New Issue
Block a user