2 Commits

Author SHA1 Message Date
Jay Larson
d4baa191d6 Declared $pid in snapinstall 2017-06-02 18:54:55 -05:00
Jay Larson
98c0ab336f The following changes were made:
* Updated Makefile.snaplinux to be more flexible with package names
  * Added bit to set root password in snapinstall
2017-06-02 18:49:47 -05:00
3 changed files with 31 additions and 15 deletions

View File

@@ -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)

View File

@@ -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',

View File

@@ -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";