summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-03-04 15:15:37 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-03-04 15:15:37 +0000
commitcb7bb27a144083afe9b3f5955d8bc6def33eee9b (patch)
treecde32810741245119d21007348a20728e4a01be7
parent92d947b000ca27cd446c7050dfd45c2d4fb5113f (diff)
downloadalpine-iso-cb7bb27a144083afe9b3f5955d8bc6def33eee9b.tar.bz2
alpine-iso-cb7bb27a144083afe9b3f5955d8bc6def33eee9b.tar.xz
alpine-mini: add wifi tools, firmware and openssl
-rw-r--r--APKBUILD-svn.proto46
-rwxr-xr-x[-rw-r--r--]Makefile341
-rw-r--r--TODO12
-rw-r--r--abuild-keygen.in110
-rw-r--r--abuild-sign.in88
-rw-r--r--abuild-tar.c277
-rw-r--r--abuild.conf25
-rwxr-xr-xabuild.in1098
-rw-r--r--alpine-mini.packages4
-rwxr-xr-xalpine.mk302
-rwxr-xr-xbootchartd198
-rwxr-xr-xbuildrepo.in131
-rwxr-xr-xdevbuild.in61
-rw-r--r--functions.sh34
-rwxr-xr-xinitramfs-init305
-rwxr-xr-xmkalpine.in40
-rw-r--r--mkinitram88
-rw-r--r--mkmodloop37
-rwxr-xr-xnewapkbuild.in78
-rw-r--r--sample.APKBUILD49
-rw-r--r--sample.confd7
-rw-r--r--sample.initd29
-rw-r--r--sample.post-install4
-rw-r--r--sample.pre-install4
24 files changed, 283 insertions, 3085 deletions
diff --git a/APKBUILD-svn.proto b/APKBUILD-svn.proto
deleted file mode 100644
index 63fbbb1..0000000
--- a/APKBUILD-svn.proto
+++ /dev/null
@@ -1,46 +0,0 @@
-# This is an example PKGBUILD file. Use this as a start to creating your own,
-# and remove these comments.
-# NOTE: Please fill out the license field for your package! If it is unknown,
-# then please put 'unknown'.
-
-# Contributor: Your Name <youremail@domain.com>
-pkgname=NAME-svn
-pkgver=VERSION
-pkgrel=0
-pkgdesc=""
-url=""
-license="GPL"
-depends=""
-makedepends=""
-install=
-source="$pkgname-$pkgver.tar.gz"
-
-_svntrunk=SVNURL
-_svnmod=MODENAME
-
-build() {
- cd "$srcdir"
-
- if [ -d $_svnmod/.svn ]; then
- (cd $_svnmod && svn up -r $pkgver) || return 1
- else
- svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod \
- || return 1
- fi
-
- msg "Starting make..."
-
- rm -r "$srcdir/$_svnmod-build"
- cp -r "$srcdir/$_svnmod" "$srcdir/$_svnmod-build"
- cd "$srcdir/$_svnmod-build"
-
- #
- # BUILD
- #
- ./autogen.sh
- ./configure --prefix=/usr
- make || return 1
- make DESTDIR="$pkgdir/" install
-}
-
-md5sums="" # generate with 'abuild checksum'
diff --git a/Makefile b/Makefile
index 018ee9a..16c78a2 100644..100755
--- a/Makefile
+++ b/Makefile
@@ -1,85 +1,302 @@
+#!/usr/bin/make -f
-PACKAGE := abuild
-VERSION := 2.1
+PROFILE ?= alpine
-prefix ?= /usr
-sysconfdir ?= /etc
-datadir ?= $(prefix)/share/$(PACKAGE)
-apkcache ?= ~/.cache/apks
+-include $(PROFILE).conf.mk
-SCRIPTS := abuild devbuild mkalpine buildrepo abuild-keygen \
- abuild-sign newapkbuild
-USR_BIN_FILES := $(SCRIPTS) abuild-tar
-SAMPLES := sample.APKBUILD sample.initd sample.confd \
- sample.pre-install sample.post-install
+BUILD_DATE := $(shell date +%y%m%d)
+ALPINE_RELEASE ?= $(BUILD_DATE)
+ALPINE_NAME ?= alpine-test
+ALPINE_ARCH := x86
+DESTDIR ?= $(shell pwd)/isotmp.$(PROFILE)
-SCRIPT_SOURCES := $(addsuffix .in,$(SCRIPTS))
+MKCRAMFS = mkcramfs
+SUDO = sudo
-DISTFILES=$(SCRIPT_SOURCES) $(SAMPLES) Makefile abuild.conf
+ISO ?= $(ALPINE_NAME)-$(ALPINE_RELEASE)-$(ALPINE_ARCH).iso
+ISO_LINK ?= $(ALPINE_NAME).iso
+ISO_DIR := $(DESTDIR)/isofs
+ISO_PKGDIR := $(ISO_DIR)/apks
-GIT_REV := $(shell test -d .git && git describe || echo exported)
-ifneq ($(GIT_REV), exported)
-FULL_VERSION := $(patsubst $(PACKAGE)-%,%,$(GIT_REV))
-FULL_VERSION := $(patsubst v%,%,$(FULL_VERSION))
+APKS ?= $(shell sed 's/\#.*//; s/\*/\\*/g' $(PROFILE).packages)
+
+APK_OPTS := $(addprefix --repository ,$(APK_REPOS)) --keys-dir /etc/apk/keys
+
+find_apk_ver = $(shell apk search $(APK_OPTS) $(1) | sort | uniq)
+find_apk_file = $(addsuffix .apk,$(call find_apk_ver,$(1)))
+find_apk = $(addprefix $(ISO_PKGDIR)/,$(call find_apk_file,$(1)))
+
+# get apk does not support wildcards
+get_apk = $(addsuffix .apk,$(shell apk fetch --simulate $(APK_OPTS) $(1) 2>&1 | sed 's:^Downloading :$(ISO_PKGDIR)/:'))
+
+KERNEL_FLAVOR ?= grsec
+KERNEL_PKGNAME ?= linux-$(KERNEL_FLAVOR)
+KERNEL_NAME := $(KERNEL_FLAVOR)
+KERNEL_APK := $(call get_apk,$(KERNEL_PKGNAME))
+
+KERNEL := $(word 3,$(subst -, ,$(notdir $(KERNEL_APK))))-$(word 2,$(subst -, ,$(notdir $(KERNEL_APK))))
+
+ALPINEBASELAYOUT_APK := $(call find_apk,alpine-baselayout)
+UCLIBC_APK := $(call get_apk,uclibc)
+BUSYBOX_APK := $(call get_apk,busybox)
+APK_TOOLS_APK := $(call get_apk,apk-tools)
+STRACE_APK := $(call get_apk,strace)
+
+APKS_FILTER ?= | grep -v -- '-dev$$' | grep -v 'sources'
+
+APKS ?= '*'
+APK_FILES := $(call find_apk,$(APKS))
+
+all: isofs
+
+help:
+ @echo "Alpine ISO builder"
+ @echo
+ @echo "Type 'make iso' to build $(ISO)"
+ @echo
+ @echo "I will use the following sources files:"
+ @echo " 1. $(notdir $(KERNEL_APK)) (looks like $(KERNEL))"
+ @echo " 2. $(notdir $(MOD_APKS))"
+ @echo " 3. $(notdir $(ALPINEBASELAYOUT_APK))"
+ @echo " 4. $(notdir $(UCLIBC_APK))"
+ @echo " 5. $(notdir $(BUSYBOX_APK))"
+ifeq ($(APK_BIN),)
+ @echo " 6. $(notdir $(APK_TOOLS_APK))"
else
-FULL_VERSION := $(VERSION)
+ @echo " 6. $(APK_BIN)"
endif
+ @echo
+ @echo "ALPINE_NAME: $(ALPINE_NAME)"
+ @echo "ALPINE_RELEASE: $(ALPINE_RELEASE)"
+ @echo "KERNEL_FLAVOR: $(KERNEL_FLAVOR)"
+ @echo "KERNEL: $(KERNEL)"
+ @echo
-CHMOD := chmod
-SED := sed
-TAR := tar
+clean:
+ rm -rf $(MODLOOP) $(MODLOOP_DIR) $(MODLOOP_DIRSTAMP) \
+ $(INITFS) $(INITFS_DIRSTAMP) $(INITFS_DIR) \
+ $(ISO_DIR) $(ISO_REPOS_DIRSTAMP)
-SED_REPLACE := -e 's:@VERSION@:$(FULL_VERSION):g' \
- -e 's:@prefix@:$(prefix):g' \
- -e 's:@sysconfdir@:$(sysconfdir):g' \
- -e 's:@datadir@:$(datadir):g' \
- -e 's:@apkcache@:$(apkcache):g'
-SSL_LIBS := $(shell pkg-config --libs openssl)
+$(APK_FILES):
+ @mkdir -p "$(dir $@)";\
+ p="$(notdir $(basename $@))";\
+ apk fetch $(APK_REPO) -R -v -o "$(dir $@)" $${p%-[0-9]*}
+# apk fetch $(APK_OPTS) -R -v -o "$(dir $@)" \
+# `apk search -q $(APK_OPTS) $(APKS) | sort | uniq`
-.SUFFIXES: .sh.in .in
-.sh.in.sh:
- ${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@
- ${CHMOD} +x $@
+#
+# Modloop
+#
+MODLOOP := $(ISO_DIR)/boot/$(KERNEL_NAME).cmg
+MODLOOP_DIR := $(DESTDIR)/modloop
+MODLOOP_KERNELSTAMP := $(DESTDIR)/stamp.modloop.kernel
+MODLOOP_DIRSTAMP := $(DESTDIR)/stamp.modloop
+MODLOOP_EXTRA ?= $(addsuffix -$(KERNEL_FLAVOR), dahdi-linux iscsitarget xtables-addons)
+MODLOOP_PKGS = $(KERNEL_PKGNAME) $(MODLOOP_EXTRA)
-.in:
- ${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@
- ${CHMOD} +x $@
+modloop: $(MODLOOP)
-P=$(PACKAGE)-$(VERSION)
+$(MODLOOP_KERNELSTAMP):
+ @echo "==> modloop: Unpacking kernel modules";
+ @rm -rf $(MODLOOP_DIR)
+ @mkdir -p $(MODLOOP_DIR)/lib/modules/
+ @for i in $(MODLOOP_PKGS); do \
+ apk fetch $(APK_OPTS) --stdout $$i \
+ | tar -C $(MODLOOP_DIR) -xz; \
+ done
+ @cp $(MODLOOP_DIR)/usr/share/kernel/$(KERNEL_FLAVOR)/kernel.release $@
-all: $(USR_BIN_FILES)
+MODLOOP_KERNEL_RELEASE = $(shell cat $(MODLOOP_KERNELSTAMP))
-clean:
- @rm -f $(USR_BIN_FILES)
+$(MODLOOP_DIRSTAMP): $(MODLOOP_KERNELSTAMP)
+ @rm -rf $(addprefix $(MODLOOP_DIR)/lib/modules/*/, source build)
+ @depmod $(MODLOOP_KERNEL_RELEASE) -b $(MODLOOP_DIR)
+ @touch $(MODLOOP_DIRSTAMP)
-abuild-tar: abuild-tar.c
- $(CC) -o $@ $(SSL_LIBS) $^
+$(MODLOOP): $(MODLOOP_DIRSTAMP)
+ @echo "==> modloop: building image $(notdir $(MODLOOP))"
+ @mkdir -p $(dir $(MODLOOP))
+ @$(MKCRAMFS) $(MODLOOP_DIR)/lib $(MODLOOP)
-help:
- @echo "$(P) makefile"
- @echo "usage: make install [ DESTDIR=<path> ]"
- @echo " make dist"
-
-install: $(USR_BIN_FILES) $(SAMPLES) abuild.conf functions.sh
- mkdir -p $(DESTDIR)/$(prefix)/bin $(DESTDIR)/$(sysconfdir) \
- $(DESTDIR)/$(datadir)
- for i in $(USR_BIN_FILES); do\
- install -m 755 $$i $(DESTDIR)/$(prefix)/bin/$$i;\
+clean-modloop:
+ @rm -rf $(MODLOOP_DIR) $(MODLOOP_DIRSTAMP) $(MODLOOP_PKGSTAMP) $(MODLOOP)
+
+#
+# Initramfs rules
+#
+
+# isolinux cannot handle - in filenames
+#INITFS_NAME := initramfs-$(MODLOOP_KERNEL_RELEASE)
+INITFS_NAME := $(KERNEL_FLAVOR).gz
+INITFS := $(ISO_DIR)/boot/$(INITFS_NAME)
+
+INITFS_DIR := $(DESTDIR)/initfs
+INITFS_TMP := $(DESTDIR)/tmp.initfs
+INITFS_DIRSTAMP := $(DESTDIR)/stamp.initfs
+INITFS_FEATURES := ata base bootchart cdrom cramfs ext3 floppy raid scsi usb
+INITFS_PKGS := $(MODLOOP_PKGS) alpine-base acct
+
+initfs: $(INITFS)
+
+$(INITFS_DIRSTAMP):
+ @rm -rf $(INITFS_DIR) $(INITFS_TMP)
+ @mkdir -p $(INITFS_DIR) $(INITFS_TMP)
+ @for i in `apk fetch $(APK_OPTS) --simulate -R $(INITFS_PKGS) 2>&1\
+ | sed 's:^Downloading ::; s:-[0-9].*::' | sort | uniq`; do \
+ apk fetch $(APK_OPTS) --stdout $$i \
+ | tar -C $(INITFS_DIR) -zx || exit 1; \
done
- if [ -n "$(DESTDIR)" ] || [ ! -f "/$(sysconfdir)"/abuild.conf ]; then\
- cp abuild.conf $(DESTDIR)/$(sysconfdir)/; \
+ @cp -r /etc/apk/keys $(INITFS_DIR)/etc/apk/ || true
+ @touch $@
+
+#$(INITFS): $(shell mkinitfs -F "$(INITFS_FEATURES)" -l $(KERNEL))
+$(INITFS): $(INITFS_DIRSTAMP) $(MODLOOP_DIRSTAMP)
+ @mkinitfs -F "$(INITFS_FEATURES)" -t $(INITFS_TMP) \
+ -b $(INITFS_DIR) -o $@ $(MODLOOP_KERNEL_RELEASE)
+
+clean-initfs:
+ @rm -rf $(INITFS) $(INITFS_DIRSTAMP) $(INITFS_DIR)
+
+#
+# Vserver template rules
+#
+VSTEMPLATE := $(ISO_DIR)/vs-template.tar.bz2
+VSTEMPLATE_DIR := $(DESTDIR)/vs-template
+
+vstemplate: $(VSTEMPLATE)
+ @echo "==> vstemplate: built $(VSTEMPLATE)"
+
+#must be run as root or in fakeroot
+$(VSTEMPLATE):
+ @rm -rf "$(VSTEMPLATE_DIR)"
+ @mkdir -p "$(VSTEMPLATE_DIR)"
+ @apk add $(APK_OPTS) --initdb --root $(VSTEMPLATE_DIR) \
+ alpine-base
+ @cd $(VSTEMPLATE_DIR) && tar -jcf $@ *
+
+#
+# ISO rules
+#
+
+ISOLINUX_DIR := boot/isolinux
+ISOLINUX := $(ISO_DIR)/$(ISOLINUX_DIR)
+ISOLINUX_BIN := $(ISOLINUX)/isolinux.bin
+ISOLINUX_CFG := $(ISOLINUX)/isolinux.cfg
+SYSLINUX_CFG := $(ISO_DIR)/syslinux.cfg
+
+$(ISOLINUX_BIN):
+ @echo "==> iso: install isolinux"
+ @mkdir -p $(dir $(ISOLINUX_BIN))
+ @if ! apk fetch $(APK_REPO) --stdout syslinux | tar -O -zx usr/share/syslinux/isolinux.bin > $@; then \
+ rm -f $@ && exit 1;\
fi
- cp $(SAMPLES) $(DESTDIR)/$(prefix)/share/abuild
- cp functions.sh $(DESTDIR)/$(datadir)/
-dist: $(P).tar.bz2
+$(ISOLINUX_CFG):
+ @echo "==> iso: configure isolinux"
+ @mkdir -p $(dir $(ISOLINUX_BIN))
+ @echo "timeout 20" >$(ISOLINUX_CFG)
+ @echo "prompt 1" >>$(ISOLINUX_CFG)
+ @echo "default $(KERNEL_NAME)" >>$(ISOLINUX_CFG)
+ @echo "label $(KERNEL_NAME)" >>$(ISOLINUX_CFG)
+ @echo " kernel /boot/$(KERNEL_NAME)" >>$(ISOLINUX_CFG)
+ @echo " append initrd=/boot/$(INITFS_NAME) alpine_dev=cdrom:iso9660 modules=loop,cramfs,sd-mod,usb-storage,floppy quiet" >>$(ISOLINUX_CFG)
+
+$(SYSLINUX_CFG): $(MODLOOP_DIRSTAMP)
+ @echo "==> iso: configure syslinux"
+ @echo "timeout 20" >$@
+ @echo "prompt 1" >>$@
+ @echo "default $(KERNEL_NAME)" >>$@
+ @echo "label $(KERNEL_NAME)" >>$@
+ @echo " kernel /boot/$(KERNEL_NAME)" >>$@
+ @echo " append initrd=/boot/$(INITFS_NAME) alpine_dev=usbdisk:vfat modules=loop,cramfs,sd-mod,usb-storage quiet" >>$@
+
+clean-syslinux:
+ @rm -f $(SYSLINUX_CFG) $(ISOLINUX_CFG) $(ISOLINUX_BIN)
+
+ISO_KERNEL := $(ISO_DIR)/boot/$(KERNEL_NAME)
+ISO_REPOS_DIRSTAMP := $(DESTDIR)/stamp.isorepos
+ISOFS_DIRSTAMP := $(DESTDIR)/stamp.isofs
+
+$(ISO_REPOS_DIRSTAMP): $(ISO_PKGDIR)/APKINDEX.tar.gz
+ @touch $(ISO_PKGDIR)/.boot_repository
+ @rm -f $(ISO_PKGDIR)/.SIGN.*
+ @touch $@
+
+$(ISO_PKGDIR)/APKINDEX.tar.gz: $(APK_FILES)
+ @echo "==> iso: generating repository index"
+ @apk index --description "$(ALPINE_NAME) $(ALPINE_RELEASE)" \
+ -o $@ $(ISO_PKGDIR)/*.apk
+ @abuild-sign $@
+
+$(ISO_KERNEL): $(MODLOOP_DIRSTAMP)
+ @echo "==> iso: install kernel $(KERNEL)"
+ @mkdir -p $(dir $(ISO_KERNEL))
+ @apk fetch $(APK_OPTS) --stdout $(KERNEL_PKGNAME) \
+ | tar -C $(ISO_DIR) -xz boot
+ @rm -f $(ISO_DIR)/boot/$(KERNEL_NAME)
+ @ln -s vmlinuz-$(MODLOOP_KERNEL_RELEASE) $@
+ @rm -rf $(ISO_DIR)/.[A-Z]* $(ISO_DIR)/.[a-z]* $(ISO_DIR)/lib
+
+$(ISOFS_DIRSTAMP): $(MODLOOP) $(INITFS) $(ISOLINUX_CFG) $(ISOLINUX_BIN) $(ISO_KERNEL) $(ISO_REPOS_DIRSTAMP) $(SYSLINUX_CFG)
+ @echo "$(ALPINE_NAME)-$(ALPINE_RELEASE) $(BUILD_DATE)" \
+ > $(ISO_DIR)/.alpine-release
+ @touch $@
+
+$(ISO): $(ISOFS_DIRSTAMP)
+ @echo "==> iso: building $(notdir $(ISO))"
+ @genisoimage -o $(ISO) -l -J -R \
+ -b $(ISOLINUX_DIR)/isolinux.bin \
+ -c $(ISOLINUX_DIR)/boot.cat \
+ -no-emul-boot \
+ -boot-load-size 4 \
+ -boot-info-table \
+ -quiet \
+ -follow-links \
+ $(ISO_OPTS) \
+ $(ISO_DIR)
+ @ln -fs $@ $(ISO_LINK)
+
+isofs: $(ISOFS_DIRSTAMP)
+iso: $(ISO)
+
+#
+# SHA1 sum of ISO
+#
+ISO_SHA1 := $(ISO).sha1
+
+$(ISO_SHA1): $(ISO)
+ @echo "==> Generating sha1 sum"
+ @sha1sum $(ISO) > $@ || rm -f $@
+
+#
+# USB image
+#
+USBIMG := $(ALPINE_NAME)-$(ALPINE_RELEASE)-$(ALPINE_ARCH).img
+USBIMG_FREE ?= 8192
+USBIMG_SIZE = $(shell echo $$(( `du -s $(ISO_DIR) | awk '{print $$1}'` + $(USBIMG_FREE) )) )
+MBRPATH := /usr/share/syslinux/mbr.bin
+
+$(USBIMG): $(ISOFS_DIRSTAMP)
+ @echo "==> Generating $@"
+ @mformat -C -v 'ALPINE' -c 16 -h 64 -n 32 -i $(USBIMG) \
+ -t $$(($(USBIMG_SIZE) / 1000)) ::
+ @syslinux $(USBIMG)
+ @mcopy -i $(USBIMG) $(ISO_DIR)/* $(ISO_DIR)/.[a-z]* ::
+ @mcopy -i $(USBIMG) /dev/zero ::/zero 2>/dev/null || true
+ @mdel -i $(USBIMG) ::/zero
+
+USBIMG_SHA1 := $(USBIMG).sha1
+$(USBIMG_SHA1): $(USBIMG)
+ @echo "==> Generating sha1 sum"
+ @sha1sum $(USBIMG) > $@ || rm -f $@
+
+$(ALPINE_NAME).img: $(USBIMG)
+ @ln -sf $(USBIMG) $@
+
+img: $(ALPINE_NAME).img
+
+sha1: $(ISO_SHA1) $(USBIMG_SHA1)
-$(P).tar.bz2: $(DISTFILES)
- rm -rf $(P)
- mkdir -p $(P)
- cp $(DISTFILES) $(P)/
- tar -cjf $@ $(P)
- rm -rf $(P)
+release: $(ISO_SHA1)
-.PHONY: install dist
diff --git a/TODO b/TODO
deleted file mode 100644
index 3e07c74..0000000
--- a/TODO
+++ /dev/null
@@ -1,12 +0,0 @@
-- Automatically add $install to $source
-
-- Fetch sources from a specified mirror
-
-- Automatic dependency tracing
-
-- Find out how to "notify" kernel packages when kernel source is updated
- Whenever the kernel source is updated, all kernel packages depending on
- it should change the revision number and be rebuilt.
-
-- Find out what to do with user accounts that is needed during build time.
- (i.e gnats).
diff --git a/abuild-keygen.in b/abuild-keygen.in
deleted file mode 100644
index af1ad90..0000000
--- a/abuild-keygen.in
+++ /dev/null
@@ -1,110 +0,0 @@
-#!/bin/sh
-
-# generate signing keys
-# Copyright (c) 2009 Natanael Copa <ncopa@alpinelinux.org>
-#
-# Distributed under GPL-2
-#
-# Depends on: busybox utilities, fakeroot,
-#
-
-abuild_ver=@VERSION@
-sysconfdir=@sysconfdir@
-
-abuild_conf=${ABUILD_CONF:-"$sysconfdir/abuild.conf"}
-abuild_home=${ABUILD_USERDIR:-"$HOME/.abuild"}
-abuild_userconf=${ABUILD_USERCONF:-"$abuild_home/abuild.conf"}
-
-
-usage() {
- echo "abuild-keygen $abuild_ver"
- echo "usage: abuild-keygen [-ih]"
- echo "options:"
- echo " -a Set PACKAGER_PRIVKEY=<generated key> in $abuild_userconf"
- echo " -i Install public key into /etc/apk/keys using sudo"
- echo " -h Show this help"
- echo ""
- exit 1
-}
-
-# read config
-[ -f "$abuild_conf" ] && . "$abuild_conf"
-
-# read user config if exists
-[ -f "$abuild_userconf" ] && . "$abuild_userconf"
-
-emailaddr=${PACKAGER##*<}
-emailaddr=${emailaddr%%>*}
-
-# if PACKAGER does not contain a valid email address, then ask git
-if [ -z "$emailaddr" ] || [ "${emailaddr##*@}" = "$emailaddr" ]; then
- emailaddr=$(git config --get user.email 2>/dev/null)
-fi
-
-if [ -n "$emailaddr" ]; then
- default_name="$emailaddr-$(printf "%x" $(date +%s))"
-else
- default_name="$USER-$(printf "%x" $(date +%s))"
-fi
-
-while getopts "ahi" opt; do
- case $opt in
- a) append_config=yes;;
- h) usage;;
- i) install_pubkey=yes;
- esac
-done
-shift $(( $OPTIND - 1))
-
-mkdir -p "$abuild_home"
-
-echo "Generating public/private rsa key pair for abuild"
-echo -n "Enter file in which to save the key ($abuild_home/$default_name.rsa): "
-
-read line
-if [ -z "$line" ]; then
- privkey="$abuild_home/$default_name.rsa"
-else
- privkey="$line"
-fi
-pubkey="$privkey.pub"
-
-# generate the private key in a subshell with stricter umask
-(
-umask 0007
-openssl genrsa -out "$privkey" 2048
-)
-openssl rsa -in "$privkey" -pubout -out "$pubkey"
-
-
-if [ -n "$install_pubkey" ]; then
- echo "Installing $pubkey to /etc/apk/keys..."
- sudo mkdir -p /etc/apk/keys
- sudo cp -i "$pubkey" /etc/apk/keys/
-else
-
- echo ""
- echo "You'll need to install $pubkey into "
- echo "/etc/apk/keys to be able to install packages and repositories signed with"
- echo "$privkey"
-fi
-
-if [ -n "$append_config" ]; then
- if [ -f "$abuild_userconf" ]; then
- # comment out the existing values
- sed -i -e 's/^\(PACKAGER_PRIVKEY=.*\)/\#\1/' "$abuild_userconf"
- fi
- echo "PACKAGER_PRIVKEY=\"$privkey\"" >> "$abuild_userconf"
-else
- echo ""
- echo "You might want add following line to $abuild_userconf:"
- echo ""
- echo "PACKAGER_PRIVKEY=\"$privkey\""
- echo ""
-fi
-
-echo ""
-echo "Please remember to make a safe backup of your private key:"
-echo "$privkey"
-echo ""
-
diff --git a/abuild-sign.in b/abuild-sign.in
deleted file mode 100644
index aea651f..0000000
--- a/abuild-sign.in
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/bin/sh
-
-# sign indexes
-# Copyright (c) 2009 Natanael Copa <ncopa@alpinelinux.org>
-#
-# Distributed under GPL-2
-#
-# Depends on: busybox utilities, fakeroot,
-#
-
-abuild_ver=@VERSION@
-sysconfdir=@sysconfdir@
-
-abuild_conf=${ABUILD_CONF:-"$sysconfdir/abuild.conf"}
-abuild_home=${ABUILD_USERDIR:-"$HOME/.abuild"}
-abuild_userconf=${ABUILD_USERCONF:-"$abuild_home/abuild.conf"}
-
-die() {
- echo "$@" >&2
- exit 1
-}
-
-usage() {
- echo "abuild-sign $abuild_ver"
- echo "usage: abuild-sign [-hq] [-k PRIVKEY] [-p PUBKEY] INDEXFILE..."
- echo "options:"
- echo " -h Show this help"
- echo " -k The private key to use for signing"
- echo " -p The name of public key. apk add will look for /etc/apk/keys/PUBKEY"
- exit 1
-}
-
-# read config
-[ -f "$abuild_conf" ] && . "$abuild_conf"
-
-# read user config if exists
-[ -f "$abuild_userconf" ] && . "$abuild_userconf"
-
-privkey="$PACKAGER_PRIVKEY"
-
-while getopts "hk:p:q" opt; do
- case $opt in
- h) usage;;
- k) privkey=$OPTARG;;
- p) pubkey=$OPTARG;;
- q) quiet=yes;;
- esac
-done
-shift $(( $OPTIND - 1))
-
-if [ -z "$privkey" ]; then
- echo "No private key found. Use 'abuild-keygen' to generate the keys"
- echo "Then you can either:"
- echo " 1. set the PACKAGER_PRIVKEY in $abuild_userconf"
- echo " (Note that 'abuild-keygen -a' does this for you)"
- echo " 2. set the PACKAGER_PRIVKEY in $abuild_conf"
- echo " 3. specify the key with the -k option"
- echo ""
- exit 1
-fi
-
-if [ -z "$pubkey" ]; then
- pubkey=${PACKAGER_PUBKEY:-"${privkey}.pub"}
-fi
-
-# we are actually only interested in the name, not the file itself
-keyname=${pubkey##*/}
-
-for f in "$@"; do
- i=$(readlink -f $f)
- [ -d "$i" ] && i="$i/APKINDEX.tar.gz"
- repo="${i%/*}"
- cd "$repo" || die "Failed to sign $i"
- sig=".SIGN.RSA.$keyname"
- openssl dgst -sha1 -sign "$privkey" -out "$sig" "$i" || die "Failed to sign $i"
- tmptargz=$(mktemp)
- tar -c "$sig" | abuild-tar --cut | gzip -9 > "$tmptargz"
- tmpsigned=$(mktemp)
- cat "$tmptargz" "$i" > "$tmpsigned"
- rm -f "$tmptargz" "$sig"
- mv "$tmpsigned" "$i"
- chmod 644 "$i"
- if [ -z "$quiet" ]; then
- echo "Signed $i"
- fi
-done
-
-exit 0
diff --git a/abuild-tar.c b/abuild-tar.c
deleted file mode 100644
index 1b6e2fb..0000000
--- a/abuild-tar.c
+++ /dev/null
@@ -1,277 +0,0 @@
-/* abuild-tar.c - A TAR mangling utility for .APK packages
- *
- * Copyright (C) 2009 Timo Teräs <timo.teras@iki.fi>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation. See http://www.gnu.org/ for details.
- */
-
-#include <stdio.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdint.h>
-#include <getopt.h>
-#include <unistd.h>
-#include <string.h>
-
-#include <openssl/evp.h>
-
-#ifndef VERSION
-#define VERSION ""
-#endif
-
-struct tar_header {
- /* ustar header, Posix 1003.1 */
- char name[100]; /* 0-99 */
- char mode[8]; /* 100-107 */
- char uid[8]; /* 108-115 */
- char gid[8]; /* 116-123 */
- char size[12]; /* 124-135 */
- char mtime[12]; /* 136-147 */
- char chksum[8]; /* 148-155 */
- char typeflag; /* 156-156 */
- char linkname[100]; /* 157-256 */
- char magic[8]; /* 257-264 */
- char uname[32]; /* 265-296 */
- char gname[32]; /* 297-328 */
- char devmajor[8]; /* 329-336 */
- char devminor[8]; /* 337-344 */
- char prefix[155]; /* 345-499 */
- char padding[12]; /* 500-512 */
-};
-
-#define GET_OCTAL(s) get_octal(s, sizeof(s))
-#define PUT_OCTAL(s,v) put_octal(s, sizeof(s), v)
-
-static inline int dx(int c)
-{
- if (c >= '0' && c <= '9')
- return c - '0';
- if (c >= 'a' && c <= 'f')
- return c - 'a' + 0xa;
- if (c >= 'A' && c <= 'F')
- return c - 'A' + 0xa;
- return -1;
-}
-
-static int get_octal(char *s, size_t l)
-{
- unsigned int val;
- int ch;
-
- val = 0;
- while (l && s[0] != 0) {
- ch = dx(s[0]);
- if (ch < 0 || ch >= 8)
- break;
- val *= 8;
- val += ch;
-
- s++;
- l--;
- }
-
- return val;
-}
-
-static void put_octal(char *s, size_t l, size_t value)
-{
- char *ptr = &s[l - 1];
-
- *(ptr--) = '\0';
- while (value != 0 && ptr >= s) {
- *(ptr--) = '0' + (value % 8);
- value /= 8;
- }
- while (ptr >= s)
- *(ptr--) = '0';
-}
-
-static int usage(void)
-{
- fprintf(stderr,
-"abuild-tar " VERSION "\n"
-"\n"
-"usage: abuild-tar [--hash[=<algorithm>]] [--cut]\n"
-"\n"
-"options:\n"
-" --hash[=sha1|md5] Read tar archive from stdin, precalculate hash for \n"
-" regular entries and output tar archive on stdout\n"
-" --cut Remove the end of file tar record\n"
-"\n");
-}
-
-static ssize_t full_read(int fd, void *buf, size_t count)
-{
- ssize_t total, n;
-
- total = 0;
- do {
- n = read(fd, buf, count);
- if (n < 0 && errno == EINTR)
- continue;
- if (n <= 0)
- break;
- buf += n;
- total += n;
- count -= n;
- } while (1);
-
- if (total == 0 && n < 0)
- return -1;
-
- return total;
-}
-
-static ssize_t full_write(int fd, const void *buf, size_t count)
-{
- ssize_t total, n;
-
- total = 0;
- do {
- n = write(fd, buf, count);
- if (n < 0 && errno == EINTR)
- continue;
- if (n <= 0)
- break;
- buf += n;
- total += n;
- count -= n;
- } while (1);
-
- if (total == 0 && n < 0)
- return -1;
-
- return total;
-}
-
-static ssize_t full_splice(int from_fd, int to_fd, size_t count)
-{
- ssize_t total, n;
-
- total = 0;
- do {
- n = splice(from_fd, NULL, to_fd, NULL, count, 0);
- if (n < 0 && errno == EINTR)
- continue;
- if (n <= 0)
- break;
- count -= n;
- total += n;
- } while (1);
-
- if (total == 0 && n < 0)
- return -1;
-
- return total;
-}
-
-static int do_it(const EVP_MD *md, int cut)
-{
- struct tar_header hdr;
- size_t size, aligned_size;
- void *ptr;
- int dohash = 0, r;
- struct {
- char id[4];
- uint16_t nid;
- uint16_t size;
- } mdinfo;
-
- if (md != NULL) {
- memcpy(mdinfo.id, "APK2", 4);
- mdinfo.nid = EVP_MD_nid(md);
- mdinfo.size = EVP_MD_size(md);
- }
-
- do {
- if (full_read(STDIN_FILENO, &hdr, sizeof(hdr)) != sizeof(hdr))
- return 0;
-
- if (cut && hdr.name[0] == 0)
- return 0;
-
- size = GET_OCTAL(hdr.size);
- aligned_size = (size + 511) & ~511;
-
- if (md != NULL)
- dohash = (hdr.typeflag == '0' || hdr.typeflag == '7');
- if (dohash) {
- const unsigned char *src;
- int chksum, i;
-
- ptr = malloc(aligned_size);
- if (full_read(STDIN_FILENO, ptr, aligned_size) != aligned_size)
- return 1;
-
- memcpy(&hdr.linkname[3], &mdinfo, sizeof(mdinfo));
- EVP_Digest(ptr, size, &hdr.linkname[3+sizeof(mdinfo)],
- NULL, md, NULL);
-
- /* Recalculate checksum */
- memset(hdr.chksum, ' ', sizeof(hdr.chksum));
- src = (const unsigned char *) &hdr;
- for (i = chksum = 0; i < sizeof(hdr); i++)
- chksum += src[i];
- put_octal(hdr.chksum, sizeof(hdr.chksum)-1, chksum);
- }
-
- if (full_write(STDOUT_FILENO, &hdr, sizeof(hdr)) != sizeof(hdr))
- return 2;
-
- if (dohash) {
- if (full_write(STDOUT_FILENO, ptr, aligned_size) != aligned_size)
- return 2;
- free(ptr);
- } else if (aligned_size != 0) {
- r = full_splice(STDIN_FILENO, STDOUT_FILENO, aligned_size);
- if (r == -1) {
- while (aligned_size > 0) {
- if (full_read(STDIN_FILENO, &hdr, sizeof(hdr)) != sizeof(hdr))
- return 1;
- if (full_write(STDOUT_FILENO, &hdr, sizeof(hdr)) != sizeof(hdr))
- return 2;
- aligned_size -= sizeof(hdr);
- }
- } else if (r != aligned_size)
- return 2;
- }
- } while (1);
-}
-
-int main(int argc, char **argv)
-{
- static int cut = 0;
- static const struct option options[] = {
- { "hash", optional_argument },
- { "cut", no_argument, &cut, 1 },
- { NULL }
- };
- const EVP_MD *md = NULL;
- char *digest = NULL;
- int ndx;
-
- OpenSSL_add_all_algorithms();
- ENGINE_load_builtin_engines();
- ENGINE_register_all_complete();
-
- while (getopt_long(argc, argv, "", options, &ndx) != -1) {
- if (ndx == 0)
- digest = optarg ? optarg : "sha1";
- }
-
- if (digest == NULL && cut == 0)
- return usage();
- if (isatty(STDIN_FILENO))
- return usage();
-
- if (digest != NULL) {
- md = EVP_get_digestbyname(digest);
- if (md == NULL)
- return usage();
- }
-
- return do_it(md, cut);
-}
diff --git a/abuild.conf b/abuild.conf
deleted file mode 100644
index 315f3b5..0000000
--- a/abuild.conf
+++ /dev/null
@@ -1,25 +0,0 @@
-export CHOST=i486-alpine-linux-uclibc
-export CFLAGS="-march=i486 -Os -fomit-frame-pointer"
-export CXXFLAGS="$CFLAGS"
-export CPPFLAGS="$CFLAGS"
-export LDFLAGS="-Wl,--as-needed"
-
-export PATH=:/usr/i386-gentoo-linux-uclibc/binutils-bin/2.18:$PATH
-
-export JOBS=2
-export MAKEFLAGS=-j$JOBS
-
-# remove line below to disable colors
-USE_COLORS=1
-
-# uncomment line below to fetch sources to other location location
-#SRCDEST=/var/cache/distfiles
-
-# uncomment line below to store built packages in other location
-# The package will be stored as $REPODEST/$repo/$pkgname-$pkgver-r$pkgrel.apk
-# where $repo is the name of the parent directory of $startdir.
-#REPODEST=/var/lib/packages/
-
-# PACKAGER is used to create new aports with 'abuild -n ...'
-#PACKAGER="Your Name <your@email.address>"
-
diff --git a/abuild.in b/abuild.in
deleted file mode 100755
index 7668423..0000000
--- a/abuild.in
+++ /dev/null
@@ -1,1098 +0,0 @@
-#!/bin/sh
-
-# script to build apk packages (light version of makepkg)
-# Copyright (c) 2008 Natanael Copa <natanael.copa@gmail.com>
-#
-# Distributed under GPL-2
-#
-# Depends on: busybox utilities, fakeroot,
-#
-
-abuild_ver=@VERSION@
-sysconfdir=@sysconfdir@
-apkcache=@apkcache@
-datadir=@datadir@
-
-program=${0##*/}
-abuild_path=$(readlink -f $0)
-
-# defaults
-BUILD_BASE="build-base"
-SUDO=${SUDO:-"sudo"}
-FAKEROOT=${FAKEROOT:-"fakeroot"}
-
-# read config
-ABUILD_CONF=${ABUILD_CONF:-"$sysconfdir/abuild.conf"}
-[ -f "$ABUILD_CONF" ] && . "$ABUILD_CONF"
-
-
-#colors
-if [ -n "$USE_COLORS" ]; then
- NORMAL="\033[1;0m"
- STRONG="\033[1;1m"
- RED="\033[1;31m"
- GREEN="\033[1;32m"
- YELLOW="\033[1;33m"
- BLUE="\033[1;34m"
-fi
-
-
-# functions
-msg() {
- local prompt="$GREEN>>>${NORMAL}"
- local fake="${FAKEROOTKEY:+${BLUE}*${NORMAL}}"
- local name="${STRONG}${subpkgname:-$pkgname}${NORMAL}"
- [ -z "$quiet" ] && printf "${prompt} ${name}${fake}: $@\n" >&2
-}
-
-warning() {
- local prompt="${YELLOW}>>> WARNING:${NORMAL}"
- local fake="${FAKEROOTKEY:+${BLUE}*${NORMAL}}"
- local name="${STRONG}${subpkgname:-$pkgname}${NORMAL}"
- printf "${prompt} ${name}${fake}: $@\n" >&2
-}
-
-error() {
- local prompt="${RED}>>> ERROR:${NORMAL}"
- local fake="${FAKEROOTKEY:+${BLUE}*${NORMAL}}"
- local name="${STRONG}${subpkgname:-$pkgname}${NORMAL}"
- printf "${prompt} ${name}${fake}: $@\n" >&2
-}
-
-
-set_xterm_title() {
- if [ "$TERM" = xterm ]; then
- printf "\033]0;$1\007" >&2
- fi
-}
-
-cleanup() {
- set_xterm_title ""
- if [ -z "$install_after" ] && [ -n "$uninstall_after" ]; then
- $SUDO apk del $uninstall_after
- fi
-}
-
-die() {
- error "$@"
- cleanup
- exit 1
-}
-
-# check if apkbuild is basicly sane
-sanitycheck() {
- local i
- msg "Checking sanity of $APKBUILD..."
- [ -z "$pkgname" ] && die "Missing pkgname in APKBUILD"
- [ -z "${pkgname##* *}" ] && die "pkgname contains spaces"
- [ -z "$pkgver" ] && die "Missing pkgver in APKBUILD"
- if [ "$pkgver" != "volatile" ] && [ -z "$nodeps" ]; then
- apk version --check -q "$pkgver" ||\
- die "$pkgver is not a valid version"
- fi
- [ -z "$pkgrel" ] && warning "Missing pkgrel in APKBUILD. Using pkgrel=0"
- [ -z "$pkgdesc" ] && die "Missing pkgdesc in APKBUILD"
- [ -z "$url" ] && die "Missing url in APKBUILD"
- [ -z "$license" ] && die "Missing license in APKBULID"
-
- for i in $install; do
- [ -e "$startdir/$i" ] || die "install script $startdir/$i is missing"
- done
-
- [ -n "${triggers%%:*}" ] && [ ! -e "$startdir"/${triggers%%:*} ] \
- && die "trigger script $startdir/${triggers%%:*} is missing"
-
- if [ -n "$source" ]; then
- for i in $source; do
- if install_has "$i"; then
- warning "You should not have \$install in source"
- continue
- fi
- md5sums_has ${i##*/} || die "${i##*/} is missing in md5sums"
- case "$i" in
- https://*) makedepends_has wget || die "wget must be in makedepends when source has https://" ;;
- esac
- done
- fi
-
- if [ -n "$md5sums" ]; then
- for i in $(echo "$md5sums" | awk '{ print $2 }'); do
- source_has $i || die "$i exists in md5sums but is missing in source"
- done
- fi
-
- # common spelling errors
- [ -n "$depend" ] && die "APKBUILD contains 'depend'. It should be depends"
- [ -n "$makedepend" ] && die "APKBUILD contains 'makedepend'. It should be makedepends"
-
- grep '^# Maintainer:' $APKBUILD >/dev/null || warning "No maintainer"
-
- makedepends_has 'g++' && warning "g++ should not be in makedepends"
- return 0
-}
-
-md5check() {
- local dummy f
- if [ -z "$source" ]; then
- return 0
- fi
- if [ -z "$md5sums" ]; then
- die "Use 'abuild checksum' to generate/update the checksum(s)"
- fi
- if [ "$(echo $source | wc -l)" -ne "$(echo $md5sums | wc -l)" ]; then
- die "Number of md5sums does not correspond to number of sources"
- fi
- fetch || return 1
- msg "Checking md5sums..."
- cd "$srcdir" && echo "$md5sums" | md5sum -c
-}
-
-uri_fetch() {
- local uri="$1"
- local d="${s##*/}" # $(basename $s)
- local opts
- [ -n "$quiet" ] && opts="-q"
- [ -f "$SRCDEST/$d" ] && return 0
-
-
- # we need GNU wget for this
- case "$uri" in
- https://*) opts="--no-check-certificate";;
- esac
-
- mkdir -p "$SRCDEST"
- if [ -f "$SRCDEST/$d.part" ]; then
- msg "Partial download found. Trying to resume"
- opts="$opts -c"
- fi
- msg "Fetching $uri"
- wget $opts -O "$SRCDEST/$d.part" "$uri" \
- && mv "$SRCDEST/$d.part" "$SRCDEST/$d"
-}
-
-is_remote() {
- case "$1" in
- http://*|ftp://*|https://*)
- return 0;;
- esac
- return 1
-}
-
-default_fetch() {
- local s
- mkdir -p "$srcdir"
- for s in $source; do
- if is_remote "$s"; then
- uri_fetch "$s" || return 1
- ln -sf "$SRCDEST/${s##*/}" "$srcdir"/
- else
- ln -sf "$startdir/$s" "$srcdir/"
- fi
- done
-}
-
-fetch() {
- default_fetch
-}
-
-# unpack the sources
-default_unpack() {
- local u
- md5check || return 1
- mkdir -p "$srcdir"
- for u in $source; do
- local s="$SRCDEST/${u##*/}" # $(basename $s)
- case "$s" in
- *.tar.gz|*.tgz)
- msg "Unpacking $s..."
- tar -C "$srcdir" -zxf "$s" || return 1;;
- *.tar.bz2)
- msg "Unpacking $s..."
- tar -C "$srcdir" -jxf "$s" || return 1;;
- *.tar.lzma)
- msg "Unpacking $s..."
- unlzma -c "$s" | tar -C "$srcdir" -x \
- || return 1;;
- *.zip)
- msg "Unpacking $s..."
- unzip "$s" -d "$srcdir" || return 1;;
- esac
- done
-}
-
-unpack() {
- default_unpack
-}
-
-# cleanup source and package dir
-clean() {
- msg "Cleaning temporary build dirs..."
- rm -rf "$srcdir"
- rm -rf "$pkgbasedir"
-}
-
-# cleanup fetched sources
-cleancache() {
- local s
- for s in $source; do
- if is_remote "$s"; then
- msg "Cleaning downloaded ${s##*/}..."
- rm -f "$SRCDEST/${s##*/}"
- fi
- done
-}
-
-cleanpkg() {
- local i
- getpkgver || return 1
- msg "Cleaning built packages..."
- for i in $pkgname $subpackages; do
- local p="${i%:*}-$pkgver-r$pkgrel"
- rm -f "$PKGDEST/$p.apk" "$PKGDEST/$p.src.tar.gz" \
- "$apkcache"/$p.apk
- done
- # remove given packages from index
-}
-
-# clean all packages except current
-cleanoldpkg() {
- local i j
- getpkgver || return 1
- msg "Cleaning all packages except $pkgver-r$pkgrel..."
- for i in $pkgname $subpackages; do
- for j in "$PKGDEST"/${i%:*}-[0-9]*.apk; do
- [ "$j" != "$PKGDEST/${i%:*}-$pkgver-r$pkgrel.apk" ] \
- && rm -f "$j"
- done
- done
- return 0
-}
-
-mkusers() {
- local i
- for i in $pkgusers; do
- if ! getent passwd $i >/dev/null; then
- msg "Creating user $i"
- $SUDO adduser -D -H $i || return 1
- fi
- done
- for i in $pkggroups; do
- if ! getent group $i >/dev/null; then
- msg "Creating group $i"
- $SUDO addgroup $i || return 1
- fi
- done
-}
-
-
-runpart() {
- local part=$1
- [ -n "$DEBUG" ] && msg "$part"
- $part || die "$part failed"
-}
-
-# override those in your build script
-getpkgver() {
- # this func is supposed to be overridden by volatile packages
- if [ "$pkgver" = "volatile" ]; then
- error "Please provide a getpkgver() function in your APKBUILD"
- return 1
- fi
-}
-
-prepare() {
- :
-}
-
-build() {
- :
-}
-
-get_split_func() {
- # get the 'func' from "sub-pkg:func"
- local func=${1##*:}
-
- # get 'func' from "sub-pkg-func" if there was no :func
- [ "$func" = "$1" ] && func=${func##*-}
- echo $func
-}
-
-prepare_subpackages() {
- if [ -z "$subpackages" ]; then
- return 0
- fi
- local i
- cd "$startdir"
- for i in $subpackages; do
- local func=$(get_split_func $i)
- # call abuild recursively, setting subpkg{dir,name}
- msg "Running split function $func..."
- subpkgdir="$pkgbasedir/${i%:*}" subpkgname="${i%:*}" \
- $0 $func prepare_package || return 1
- done
-}
-
-prepare_metafiles() {
- getpkgver || return 1
- local name=${subpkgname:-$pkgname}
- [ -z "${name##* *}" ] && die "package name contains spaces"
- local dir=${subpkgdir:-$pkgdir}
- local pkg="$name-$pkgver-r$pkgrel.apk"
- local pkginfo="$controldir"/.PKGINFO
- local sub
-
- [ ! -d "$dir" ] && die "Missing $dir"
- cd "$dir"
- mkdir -p "$controldir"
- local builddate=$(date -u "+%s")
- local size=$(du -sk | awk '{print $1 * 1024}')
-
- echo "# Generated by $(basename $0) $abuild_ver" >"$pkginfo"
- if [ -n "$FAKEROOTKEY" ]; then
- echo "# using $($FAKEROOT -v)" >> "$pkginfo"
- fi
- echo "# $(date -u)" >> "$pkginfo"
- cat >> "$pkginfo" <<EOF
-pkgname = $name
-pkgver = $pkgver-r$pkgrel
-pkgdesc = $pkgdesc
-url = $url
-builddate = $builddate
-packager = ${PACKAGER:-"Unknown"}
-size = $size
-EOF
- local i deps
- deps="$depends"
- if [ "$pkgname" != "busybox" ] && ! depends_has busbox; then
- for i in $install ${triggers%%:*}; do
- if head -n 1 "$startdir/$i" | grep '^#!/bin/sh' >/dev/null ; then
- msg "Script found. busybox added as a dependency for $pkg"
- deps="$deps busybox"
- break
- fi
- done
- fi
-
- for i in $license; do
- echo "license = $i" >> "$pkginfo"
- done
- for i in $replaces; do
- echo "replaces = $i" >> "$pkginfo"
- done
- for i in $deps; do
- echo "depend = $i" >> "$pkginfo"
- done
- for i in $conflicts; do
- echo "conflict = $i" >> "$pkginfo"
- done
- for i in $provides; do
- echo "provides = $i" >> "$pkginfo"
- done
- for i in $backup; do
- echo "backup = $i" >> "$pkginfo"
- done
- if [ -n "$triggers" ]; then
- echo "triggers = ${triggers#*:}" >> "$pkginfo"
- fi
-
- local metafiles=".PKGINFO"
- for i in $install ${triggers%%:*}; do
- script=${i#$name}
- case "$script" in
- .pre-install|.post-install|.pre-upgrade|.post-upgrade|.pre-deinstall|.post-deinstall|.trigger)
- msg "Adding $script"
- ;;
- *) error "$script: Invalid install/trigger script"
- return 1
- ;;
- esac
- cp "$startdir/$i" "$controldir/$script" || return 1
- chmod +x "$controldir/$script"
- metafiles="$metafiles $script"
- done
- echo $metafiles | tr ' ' '\n' > "$controldir"/.metafiles
-}
-
-prepare_tracedeps() {
- local dir=${subpkgdir:-$pkgdir}
- options_has "!tracedeps" && return 0
- find -name '*.so' -o -name '*.so.[0-9]*' | sed 's:.*/::' \
- >"$controldir"/.provides-so
- scanelf -Rn "$dir" | awk -F "\ " '$1 == "ET_DYN" || $1 == "ET_EXEC" {print $2}' \
- | sed 's:,:\n:g' | sort | uniq \
- | while read i; do
- # only add files that are not self provided
- grep "^$i$" "$controldir"/.provides-so >/dev/null \
- || echo $i >> "$controldir"/.needs-so
- done
-}
-
-prepare_package() {
- msg "Preparing ${subpkgname:+sub}package ${subpkgname:-$pkgname}..."
- stripbin
- prepare_metafiles && prepare_tracedeps
-}
-
-pkginfo_val() {
- local key="$1"
- local file="$2"
- awk -F ' = ' "\$1 == \"$key\" {print \$2}" "$file"
-}
-
-trace_apk_deps() {
- local name="$1"
- local dir="$2"
- local i j found autodeps=
- msg "Tracing dependencies for $name..."
- # add pkgconfig if usr/lib/pkgconfig is found
- if [ -d "$pkgbasedir"/$name/usr/lib/pkgconfig ] \
- && ! grep -q '^depend = pkgconfig' "$dir"/.PKGINFO; then
- msg "Added pkgconfig as dependency"
- echo "depend = pkgconfig" >> "$dir"/.PKGINFO
- fi
- for i in $(cat "$dir"/.needs-so 2>/dev/null); do
- found=
- # first check if its provide by same apkbuild
- for j in "$dir"/../.control.*/.provides-so; do
- grep -w "$i" "$j" >/dev/null || continue
- found=${j%/.provides-so}
- found=${found##*/.control.}
- break
- done
- # check apk db if not provided by a subpackage
- if [ -z "$found" ]; then
- found=$(apk info -q -W /lib/$i /usr/lib/$i)
- fi
- if [ -z "$found" ]; then
- error "Could not find dependency for $i"
- return 1
- fi
- if grep -w "^depend = ${found}$" "$dir"/.PKGINFO >/dev/null ; then
- warning "You can remove '$found' from depends"
- continue
- fi
- list_has "$found" $autodeps || autodeps="$autodeps $found"
- msg "Added '$found' as dependency as it has $i"
- done
- [ -z "$autodeps" ] && return 0
- echo "# automatically detected:" >> "$dir"/.PKGINFO
- for i in $autodeps; do
- echo "depend = $i" >> "$dir"/.PKGINFO
- done
-}
-
-create_apks() {
- local file
- getpkgver || return 1
- for file in "$pkgbasedir"/.control.*/.PKGINFO; do
- local dir="${file%/.PKGINFO}"
- local name=$(pkginfo_val pkgname $file)
- local ver=$(pkginfo_val pkgver $file)
- local apk=$name-$ver.apk
- local datadir="$pkgbasedir"/$name
-
- trace_apk_deps "$name" "$dir" || return 1
- msg "Creating $apk..."
- (
- cd "$datadir"
- # data.tar.gz
- set -- *
- if [ "$1" = '*' ]; then
- touch .dummy
- set -- .dummy
- fi
- tar -c "$@" | abuild-tar --hash | gzip -9 >"$dir"/data.tar.gz
-
- # append the hash for data.tar.gz
- local sha256=$(sha256sum "$dir"/data.tar.gz | cut -f1 -d' ')
- echo "datahash = $sha256" >> "$dir"/.PKGINFO
-
- # control.tar.gz
- cd "$dir"
- tar -c $(cat "$dir"/.metafiles) | abuild-tar --cut \
- | gzip -9 > control.tar.gz
- abuild-sign -q control.tar.gz || exit 1
-
- # create the final apk
- cat control.tar.gz data.tar.gz > "$PKGDEST"/$apk
- )
- done
-}
-
-apkcache() {
- if ! apk_up2date || [ -n "$force" ]; then
- sanitycheck && builddeps && clean && fetch && unpack \
- && prepare && mkusers && rootpkg || return 1
- fi
-
- local apk
- mkdir -p "$apkcache" || return 1
- cd "$apkcache"
-
- # remove broken links
- for apk in *.apk; do
- if [ -L "$apk" ] && [ ! -f "$apk" ]; then
- rm -f "$apk"
- fi
- done
-
- # create links for this package
- for apk in $(listpkg); do
- ln -sf "$PKGDEST"/$apk "$apkcache"/$apk
- done
-
- msg "Updating the cached abuild repository index..."
- local sign=".SIGN.RSA.${SIGN_PUBLIC_KEY##*/}"
- local oldindex=
- if [ -f APKINDEX.tar.gz ]; then
- oldindex="--index APKINDEX.tar.gz"
- fi
- apk index $oldindex --output APKINDEX.tar.gz.unsigned \
- --description "$repo $(cd $startdir && git describe)" \
- *.apk || exit 1
- msg "Signing the index..."
- abuild-sign -q APKINDEX.tar.gz.unsigned || exit 1
- mv APKINDEX.tar.gz.unsigned APKINDEX.tar.gz
- chmod 644 APKINDEX.tar.gz
-}
-
-# predefined splitfunc doc
-default_doc() {
- depends="$depends_doc"
- install="$install_doc"
- triggers="$triggers_doc"
- local i
- for i in doc man info html sgml licenses gtk-doc; do
- if [ -d "$pkgdir/usr/share/$i" ]; then
- mkdir -p "$subpkgdir/usr/share"
- mv "$pkgdir/usr/share/$i" "$subpkgdir/usr/share/"
- fi
- done
-
- rm -f "$subpkgdir/usr/share/info/dir"
-
-# # compress info and man pages
-# find "$subpkgdir/usr/share" \( -name '*.info' -o -name '*.info-[1-9]' \
-# -o -name '*.[1-9]' \) -exec gzip {} \;
-
- # remove if empty, ignore error (not empty)
- rmdir "$pkgdir/usr/share" "$pkgdir/usr" 2>/dev/null
-
-# [ -d "$subpkgdir/usr/share/man" ] && depends="man"
- return 0
-}
-
-doc() {
- default_doc
-}
-
-# predefined splitfunc mod
-default_mod() {
- depends="$kernel $depends_mod"
- install="$install_mod"
- for i in firmware modules; do
- if [ -d "$pkgdir/lib/$i" ]; then
- rm -rf "$subpkgdir/lib"
- mkdir -p "$subpkgdir/lib"
- mv "$pkgdir/lib/$i" "$subpkgdir/lib"
- fi
- done
-}
-
-mod() {
- default_mod
-}
-
-# predefined splitfunc dev
-default_dev() {
- local i
- depends="$pkgname $depends_dev"
- install="$install_dev"
- triggers="$triggers_dev"
- for i in $origsubpackages; do
- [ "${i%:*}" = "$subpkgname" ] || depends="$depends ${i%:*}"
- done
-
- cd "$pkgdir" || return 0
- for i in usr/include usr/lib/pkgconfig usr/share/aclocal\
- usr/share/gettext usr/bin/*-config \
- $(find -name include -type d) \
- $(find usr/ -name '*.[acho]' -o -name '*.la' \
- 2>/dev/null); do
- if [ -e "$pkgdir/$i" ] || [ -L "$pkgdir/$i" ]; then
- d="$subpkgdir/${i%/*}" # dirname $i
- mkdir -p "$d"
- mv "$pkgdir/$i" "$d"
- rmdir "$pkgdir/${i%/*}" 2>/dev/null
- fi
- done
- return 0
-}
-
-dev() {
- default_dev
-}
-
-is_function() {
- type "$1" 2>&1 | head -n 1 | egrep -q "is a (shell )?function"
-}
-
-# build and package in fakeroot
-rootpkg() {
- local do_build=build
- cd "$startdir"
- if is_function package; then
- build || return 1
- do_build=package
- fi
- cd "$startdir"
- [ -n "$FAKEROOT" ] && msg "Entering fakeroot..."
- $FAKEROOT "$abuild_path" $do_build \
- prepare_subpackages \
- prepare_package \
- create_apks
-}
-
-srcpkg() {
- getpkgver || return 1
- local p="$pkgname-$pkgver-$pkgrel"
- local prefix="${startdir##*/}"
- local i files="$prefix/APKBUILD"
- for i in $source; do
- files="$files $prefix/${i##*/}"
- done
- mkdir -p "$PKGDEST"
- msg "Creating source package $p.src.tar.gz..."
- (cd .. && tar -zcf "$PKGDEST/$p.src.tar.gz" $files)
-}
-
-# check if package is up to date
-apk_up2date() {
- getpkgver || return 1
- local pkg="$PKGDEST/$pkgname-$pkgver-r$pkgrel.apk"
- local i s
- cd "$startdir"
- for i in $pkgname $subpackages; do
- [ -f "$PKGDEST/$pkgname-$pkgver-r$pkgrel.apk" ] || return 1
- done
- [ -n "$keep" ] && return 0
-
- for i in $source APKBUILD; do
- local s
- if is_remote "$i"; then
- s="$SRCDEST/${i##*/}" # $(basename $i)
- else
- s="$startdir/${i##*/}"
- fi
- if [ "$s" -nt "$pkg" ]; then
- return 1
- fi
- done
- return 0
-}
-
-cache_up2date() {
- local i apk
- getpkgver || return 1
- for i in $pkgname $subpackages; do
- apk="${i%:*}-$pkgver-r$pkgrel.apk"
- [ "$apkcache"/APKINDEX.tar.gz -nt "$apkcache"/$apk ] || return 1
- done
- return 0
-}
-
-up2date() {
- apk_up2date && cache_up2date
-}
-
-# source all APKBUILDs and output:
-# 1) origin of package
-# 2) all dependencies
-# the output is i in a format easy parseable for awk
-depparse_aports() {
- # lets run this in a subshell since we source all APKBUILD here
- (
- aportsdir=$(realpath ${APKBUILD%/APKBUILD}/../..)
- for i in $aportsdir/*/*/APKBUILD; do
- pkgname=
- subpackages=
- depends=
- makedepends=
- . $i
- dir=${i%/APKBUILD}
- deps=
- # filter out conflicts from deps and version info
- for j in $depends $makedepends; do
- case "$j" in
- !*) continue;;
- esac
- deps="$deps ${j%[<>=]*}"
- done
- for j in $pkgname $subpackages; do
- echo "o ${j%%:*} $dir"
- set -- $deps
- echo -n "d ${j%%:*} $1"
- shift
- while [ $# -gt 0 ]; do
- echo -n ",$1"
- shift
- done
- echo
- done
- done
- )
-}
-
-deptrace() {
- local deps= i=
- # strip versions from deps
- for i in "$@"; do
- deps="$deps ${i%[<>=]*}"
- done
- [ -z "$deps" ] && return 0
- ( depparse_aports
- if [ -z "$upgrade" ]; then
- # list installed pkgs and prefix with 'i '
- apk info -q | sort | sed 's/^/i /'
- fi
- ) | awk -v pkgs="$deps" '
-
- function depgraph(pkg, a, i) {
- if (visited[pkg])
- return 0;
- visited[pkg] = 1;
- split(deps[pkg], a, ",");
- for (i in a)
- depgraph(a[i]);
- print pkg ":" origin[pkg];
-
- }
-
- $1 == "i" { visited[$2] = 1 }
- $1 == "o" { origin[$2] = $3 }
- $1 == "d" { deps[$2] = $3 }
- END {
- split(pkgs, pkgarray);
- for (i in pkgarray)
- depgraph(pkgarray[i]);
- }
- '
-}
-
-# build and install dependencies
-builddeps() {
- local deps= alldeps= pkg= i= dir= ver= missing= installed_deps=
- local filtered_deps=
- [ -n "$nodeps" ] && return 0
- msg "Analyzing dependencies..."
- deps="$BUILD_BASE $makedepends"
-
- # add depends unless it is a subpackage
- for i in $depends; do
- subpackages_has ${i%[<>=]*} || deps="$deps $i"
- done
-
- installed_deps=$(apk info -e $deps)
- # find which deps are missing
- for i in $deps; do
- if [ "${i#\!}" != "$i" ]; then
- list_has ${i#\!} $installed_deps \
- && die "Conflicting package ${i#\!} is installed."
- elif ! deplist_has $i $installed_deps; then
- if [ -z "$install_deps" ] && [ -z "$recursive" ]; then
- die "Missing dependency $i. Use -r to autoinstall or -R to build"
- fi
- missing="$missing $i"
- fi
- done
-
- [ -z "$missing" ] && [ -z "$install_deps" ] && [ -z "$recursive" ] \
- && return 0
-
- uninstall_after=".makedepends-$pkgname $uninstall_after"
- if [ -n "$install_deps" ] && [ -z "$recursive" ]; then
- # make a --simluate run first to detect missing deps
- # apk-tools --virtual is no goot at reporting those.
- $SUDO apk add --repository "$apkcache" \
- --wait 30 \
- --simulate --quiet $deps || return 1
- $SUDO apk add --repository "$apkcache" \
- --wait 30 \
- --virtual .makedepends-$pkgname $deps \
- && return 0
- fi
-
- [ -z "$recursive" ] && return 1
-
- # find dependencies that are installed but missing in repo.
- for i in $deps; do
- local m=$(apk search --repository "$apkcache" ${i%[<>=]*})
- if [ -z "$m" ]; then
- missing="$missing $i"
- fi
- done
-
- for i in $(deptrace $missing); do
- # i = pkg:dir
- local dir=${i#*:}
- local pkg=${i%:*}
- msg "Entering $dir"
- cd "$dir" && $0 -k -r apkcache || return 1
- done
- $SUDO apk add -u --repository "$apkcache" \
- --wait 30 \
- --virtual .makedepends-$pkgname $deps
-}
-
-# replace the md5sums in the APKBUILD
-checksum() {
- local s files
- [ -z "$source" ] && return 0
- fetch
- msg "Updating the md5sums in APKBUILD..."
- for s in $source; do
- files="$files ${s##*/}"
- done
- md5sums="$(cd "$srcdir" && md5sum $files)" || die "md5sum failed"
- sed -i -e '/^md5sums="/,/"\$/d; /^md5sums=''/,/''\$/d' "$APKBUILD"
- echo "md5sums=\"$md5sums\"" >>"$APKBUILD"
-}
-
-stripbin() {
- local bin
- options_has "!strip" && return 0
- cd "${subpkgdir:-$pkgdir}" || return 1
- msg "Stripping binaries"
- scanelf --recursive --nobanner --etype "ET_DYN,ET_EXEC" . \
- | sed -e 's:^ET_DYN ::' -e 's:^ET_EXEC ::' \
- | xargs -r strip
-}
-
-# simply list target apks
-listpkg() {
- local i
- getpkgver || return 1
- for i in $pkgname $subpackages; do
- echo "${i%:*}-$pkgver-r$pkgrel.apk"
- done
-}
-
-source_has() {
- local i
- for i in $source; do
- [ "$1" = "${i##*/}" ] && return 0
- done
- return 1
-}
-
-subpackages_has() {
- local i
- for i in $subpackages; do
- [ "$1" = "${i%:*}" ] && return 0
- done
- return 1
-}
-
-list_has() {
- local needle="$1"
- local i
- shift
- for i in $@; do
- [ "$needle" = "$i" ] && return 0
- [ "$needle" = "!$i" ] && return 1
- done
- return 1
-}
-
-# same as list_has but we filter version info
-deplist_has() {
- local needle="$1"
- local i
- shift
- for i in $@; do
- i=${i%[<>=]*}
- [ "$needle" = "$i" ] && return 0
- [ "$needle" = "!$i" ] && return 1
- done
- return 1
-}
-
-options_has() {
- list_has "$1" $options
-}
-
-depends_has() {
- deplist_has "$1" $depends
-}
-
-makedepends_has() {
- deplist_has "$1" $makedepends
-}
-
-md5sums_has() {
- list_has "$1" $md5sums
-}
-
-install_has() {
- list_has "$1" $install
-}
-
-# install package after build
-post_add() {
- getpkgver || return 1
- local pkgf="$PKGDEST/$1-$pkgver-r$pkgrel.apk"
- local deps i
- if ! subpackages_has $1 && [ "$1" != "$pkgname" ]; then
- die "$1 is not built by this APKBUILD"
- fi
- # recursively install dependencies that are provided by this APKBUILD
- deps=$(apk index "$pkgf" 2>/dev/null | awk -F: '$1=="D" { print $2 }')
- for i in $deps; do
- if subpackages_has $i || [ "$i" = "$pkgname" ]; then
- post_add $i || return 1
- fi
- done
- $SUDO apk add --wait 30 -u "$pkgf" || die "Failed to install $1"
-}
-
-installdeps() {
- local deps i
- sudo apk add --wait 30 --repository "$apkcache" \
- --virtual .makedepends-$pkgname \
- $makedepends
-}
-
-uninstalldeps (){
- sudo apk del .makedepends-$pkgname
-}
-
-all() {
- if up2date && [ -z "$force" ]; then
- msg "Package is up to date"
- else
- apkcache
- fi
-}
-
-usage() {
- echo "$program $abuild_ver"
- echo "usage: $program [options] [-i PKG] [-P REPODEST] [-p PKGDEST]"
- echo " [-s SRCDEST] [cmd] ..."
- echo " $program [-c] -n PKGNAME[-PKGVER]"
- echo "Options:"
- echo " -d Disable dependency checking"
- echo " -f Force specified cmd, even if they are already done"
- echo " -F Force run as root"
- echo " -h Show this help"
- echo " -i Install PKG after successul build"
- echo " -k Keep built packages, even if APKBUILD or sources are newer"
- echo " -p Set package destination directory"
- echo " -P Set PKGDEST to REPODEST/<repo>, where repo is the parents dir name"
- echo " -q Quiet"
- echo " -r Install missing dependencies from system repository (using sudo)"
- echo " -R Recursively build and install missing dependencies (using sudo)"
- echo " -s Set source package destination directory"
- echo " -u Recursively build and upgrade all dependencies (using sudo)"
- echo ""
- echo "Commands:"
- echo " checksum Generate checksum to be included in APKBUILD"
- echo " fetch Fetch sources to \$SRCDEST and verify checksums"
- echo " sanitycheck Basic sanity check of APKBUILD"
- echo " md5check Check md5sums"
- echo " unpack Unpack sources to \$srcdir"
- echo " build Compile and install package into \$pkgdir"
- echo " listpkg List target packages"
- echo " package Create package in \$PKGDEST"
- echo " rootpkg Run '$0 build package' as fakeroot"
- echo " clean Remove temp build and install dirs"
- echo " cleanoldpkg Remove binary packages except current version"
- echo " cleanpkg Remove already built binary and source package"
- echo " cleancache Remove downloaded files from \$SRCDEST"
- echo " srcpkg Make a source package"
- echo " up2date Compare target and sources dates"
- echo " installdeps Install packages listed in makedepends and depends"
- echo " uninstalldeps Uninstall packages listed in makedepends and depends"
- echo ""
- exit 0
-}
-
-APKBUILD="${APKBUILD:-./APKBUILD}"
-unset force
-unset recursive
-while getopts "dfFhi:kinp:P:qrRs:u" opt; do
- case $opt in
- 'd') nodeps=1;;
- 'f') force=1;;
- 'F') forceroot=1;;
- 'h') usage;;
- 'i') install_after="$install_after $OPTARG";;
- 'k') keep=1;;
- 'n') die "Use newapkbuild to create new aports";;
- 'p') PKGDEST=$OPTARG;;
- 'P') REPODEST=$OPTARG;;
- 'q') quiet=1;;
- 'r') install_deps=1;;
- 'R') recursive=1;;
- 's') SRCDEST=$OPTARG;;
- 'u') upgrade=1
- recursive=1;;
- esac
-done
-shift $(( $OPTIND - 1 ))
-
-# check so we are not root
-if [ "$(whoami)" = "root" ] && [ -z "$FAKEROOTKEY" ]; then
- [ -z "$forceroot" ] && die "Do not run abuild as root"
- SUDO=
- FAKEROOT=
-fi
-
-# find startdir
-[ -f "$APKBUILD" ] || die "Could not find $APKBUILD (PWD=$PWD)"
-APKBUILD=$(readlink -f "$APKBUILD")
-
-startdir="${APKBUILD%/*}"
-srcdir=${srcdir:-"$startdir/src"}
-pkgbasedir=${pkgbasedir:-"$startdir/pkg"}
-pkgrel=0
-repo=${startdir%/*}
-repo=${repo##*/}
-
-SRCDEST=${SRCDEST:-$startdir}
-PKGDEST=${PKGDEST:-$startdir}
-
-cd "$startdir" || die
-. "$APKBUILD"
-
-# If REPODEST is set then it will override the PKGDEST
-if [ -n "$REPODEST" ]; then
- PKGDEST="$REPODEST/$repo"
-fi
-
-# If we are handling a sub package then reset subpackages and install
-if [ -n "$subpkgname" ]; then
- origsubpackages="$subpackages"
- subpackages=
- install=
-fi
-pkgdir="$pkgbasedir/$pkgname"
-controldir="$pkgbasedir"/.control.${subpkgname:-$pkgname}
-
-trap 'die "Aborted by user"' INT
-set_xterm_title "abuild: $pkgname"
-
-if [ -z "$1" ]; then
- set all
-fi
-
-while [ $# -gt 0 ]; do
- runpart $1
- shift
-done
-
-for i in $install_after; do
- post_add $i
-done
-
-cleanup
-
diff --git a/alpine-mini.packages b/alpine-mini.packages
index 07ddd59..b6dbf04 100644
--- a/alpine-mini.packages
+++ b/alpine-mini.packages
@@ -1,2 +1,6 @@
bkeymaps
alpine-base
+wpa_cupplicant
+wireless-tools
+linux-firmware
+openssl
diff --git a/alpine.mk b/alpine.mk
deleted file mode 100755
index 16c78a2..0000000
--- a/alpine.mk
+++ /dev/null
@@ -1,302 +0,0 @@
-#!/usr/bin/make -f
-
-PROFILE ?= alpine
-
--include $(PROFILE).conf.mk
-
-BUILD_DATE := $(shell date +%y%m%d)
-ALPINE_RELEASE ?= $(BUILD_DATE)
-ALPINE_NAME ?= alpine-test
-ALPINE_ARCH := x86
-DESTDIR ?= $(shell pwd)/isotmp.$(PROFILE)
-
-MKCRAMFS = mkcramfs
-SUDO = sudo
-
-ISO ?= $(ALPINE_NAME)-$(ALPINE_RELEASE)-$(ALPINE_ARCH).iso
-ISO_LINK ?= $(ALPINE_NAME).iso
-ISO_DIR := $(DESTDIR)/isofs
-ISO_PKGDIR := $(ISO_DIR)/apks
-
-APKS ?= $(shell sed 's/\#.*//; s/\*/\\*/g' $(PROFILE).packages)
-
-APK_OPTS := $(addprefix --repository ,$(APK_REPOS)) --keys-dir /etc/apk/keys
-
-find_apk_ver = $(shell apk search $(APK_OPTS) $(1) | sort | uniq)
-find_apk_file = $(addsuffix .apk,$(call find_apk_ver,$(1)))
-find_apk = $(addprefix $(ISO_PKGDIR)/,$(call find_apk_file,$(1)))
-
-# get apk does not support wildcards
-get_apk = $(addsuffix .apk,$(shell apk fetch --simulate $(APK_OPTS) $(1) 2>&1 | sed 's:^Downloading :$(ISO_PKGDIR)/:'))
-
-KERNEL_FLAVOR ?= grsec
-KERNEL_PKGNAME ?= linux-$(KERNEL_FLAVOR)
-KERNEL_NAME := $(KERNEL_FLAVOR)
-KERNEL_APK := $(call get_apk,$(KERNEL_PKGNAME))
-
-KERNEL := $(word 3,$(subst -, ,$(notdir $(KERNEL_APK))))-$(word 2,$(subst -, ,$(notdir $(KERNEL_APK))))
-
-ALPINEBASELAYOUT_APK := $(call find_apk,alpine-baselayout)
-UCLIBC_APK := $(call get_apk,uclibc)
-BUSYBOX_APK := $(call get_apk,busybox)
-APK_TOOLS_APK := $(call get_apk,apk-tools)
-STRACE_APK := $(call get_apk,strace)
-
-APKS_FILTER ?= | grep -v -- '-dev$$' | grep -v 'sources'
-
-APKS ?= '*'
-APK_FILES := $(call find_apk,$(APKS))
-
-all: isofs
-
-help:
- @echo "Alpine ISO builder"
- @echo
- @echo "Type 'make iso' to build $(ISO)"
- @echo
- @echo "I will use the following sources files:"
- @echo " 1. $(notdir $(KERNEL_APK)) (looks like $(KERNEL))"
- @echo " 2. $(notdir $(MOD_APKS))"
- @echo " 3. $(notdir $(ALPINEBASELAYOUT_APK))"
- @echo " 4. $(notdir $(UCLIBC_APK))"
- @echo " 5. $(notdir $(BUSYBOX_APK))"
-ifeq ($(APK_BIN),)
- @echo " 6. $(notdir $(APK_TOOLS_APK))"
-else
- @echo " 6. $(APK_BIN)"
-endif
- @echo
- @echo "ALPINE_NAME: $(ALPINE_NAME)"
- @echo "ALPINE_RELEASE: $(ALPINE_RELEASE)"
- @echo "KERNEL_FLAVOR: $(KERNEL_FLAVOR)"
- @echo "KERNEL: $(KERNEL)"
- @echo
-
-clean:
- rm -rf $(MODLOOP) $(MODLOOP_DIR) $(MODLOOP_DIRSTAMP) \
- $(INITFS) $(INITFS_DIRSTAMP) $(INITFS_DIR) \
- $(ISO_DIR) $(ISO_REPOS_DIRSTAMP)
-
-
-$(APK_FILES):
- @mkdir -p "$(dir $@)";\
- p="$(notdir $(basename $@))";\
- apk fetch $(APK_REPO) -R -v -o "$(dir $@)" $${p%-[0-9]*}
-# apk fetch $(APK_OPTS) -R -v -o "$(dir $@)" \
-# `apk search -q $(APK_OPTS) $(APKS) | sort | uniq`
-
-#
-# Modloop
-#
-MODLOOP := $(ISO_DIR)/boot/$(KERNEL_NAME).cmg
-MODLOOP_DIR := $(DESTDIR)/modloop
-MODLOOP_KERNELSTAMP := $(DESTDIR)/stamp.modloop.kernel
-MODLOOP_DIRSTAMP := $(DESTDIR)/stamp.modloop
-MODLOOP_EXTRA ?= $(addsuffix -$(KERNEL_FLAVOR), dahdi-linux iscsitarget xtables-addons)
-MODLOOP_PKGS = $(KERNEL_PKGNAME) $(MODLOOP_EXTRA)
-
-modloop: $(MODLOOP)
-
-$(MODLOOP_KERNELSTAMP):
- @echo "==> modloop: Unpacking kernel modules";
- @rm -rf $(MODLOOP_DIR)
- @mkdir -p $(MODLOOP_DIR)/lib/modules/
- @for i in $(MODLOOP_PKGS); do \
- apk fetch $(APK_OPTS) --stdout $$i \
- | tar -C $(MODLOOP_DIR) -xz; \
- done
- @cp $(MODLOOP_DIR)/usr/share/kernel/$(KERNEL_FLAVOR)/kernel.release $@
-
-MODLOOP_KERNEL_RELEASE = $(shell cat $(MODLOOP_KERNELSTAMP))
-
-$(MODLOOP_DIRSTAMP): $(MODLOOP_KERNELSTAMP)
- @rm -rf $(addprefix $(MODLOOP_DIR)/lib/modules/*/, source build)
- @depmod $(MODLOOP_KERNEL_RELEASE) -b $(MODLOOP_DIR)
- @touch $(MODLOOP_DIRSTAMP)
-
-$(MODLOOP): $(MODLOOP_DIRSTAMP)
- @echo "==> modloop: building image $(notdir $(MODLOOP))"
- @mkdir -p $(dir $(MODLOOP))
- @$(MKCRAMFS) $(MODLOOP_DIR)/lib $(MODLOOP)
-
-clean-modloop:
- @rm -rf $(MODLOOP_DIR) $(MODLOOP_DIRSTAMP) $(MODLOOP_PKGSTAMP) $(MODLOOP)
-
-#
-# Initramfs rules
-#
-
-# isolinux cannot handle - in filenames
-#INITFS_NAME := initramfs-$(MODLOOP_KERNEL_RELEASE)
-INITFS_NAME := $(KERNEL_FLAVOR).gz
-INITFS := $(ISO_DIR)/boot/$(INITFS_NAME)
-
-INITFS_DIR := $(DESTDIR)/initfs
-INITFS_TMP := $(DESTDIR)/tmp.initfs
-INITFS_DIRSTAMP := $(DESTDIR)/stamp.initfs
-INITFS_FEATURES := ata base bootchart cdrom cramfs ext3 floppy raid scsi usb
-INITFS_PKGS := $(MODLOOP_PKGS) alpine-base acct
-
-initfs: $(INITFS)
-
-$(INITFS_DIRSTAMP):
- @rm -rf $(INITFS_DIR) $(INITFS_TMP)
- @mkdir -p $(INITFS_DIR) $(INITFS_TMP)
- @for i in `apk fetch $(APK_OPTS) --simulate -R $(INITFS_PKGS) 2>&1\
- | sed 's:^Downloading ::; s:-[0-9].*::' | sort | uniq`; do \
- apk fetch $(APK_OPTS) --stdout $$i \
- | tar -C $(INITFS_DIR) -zx || exit 1; \
- done
- @cp -r /etc/apk/keys $(INITFS_DIR)/etc/apk/ || true
- @touch $@
-
-#$(INITFS): $(shell mkinitfs -F "$(INITFS_FEATURES)" -l $(KERNEL))
-$(INITFS): $(INITFS_DIRSTAMP) $(MODLOOP_DIRSTAMP)
- @mkinitfs -F "$(INITFS_FEATURES)" -t $(INITFS_TMP) \
- -b $(INITFS_DIR) -o $@ $(MODLOOP_KERNEL_RELEASE)
-
-clean-initfs:
- @rm -rf $(INITFS) $(INITFS_DIRSTAMP) $(INITFS_DIR)
-
-#
-# Vserver template rules
-#
-VSTEMPLATE := $(ISO_DIR)/vs-template.tar.bz2
-VSTEMPLATE_DIR := $(DESTDIR)/vs-template
-
-vstemplate: $(VSTEMPLATE)
- @echo "==> vstemplate: built $(VSTEMPLATE)"
-
-#must be run as root or in fakeroot
-$(VSTEMPLATE):
- @rm -rf "$(VSTEMPLATE_DIR)"
- @mkdir -p "$(VSTEMPLATE_DIR)"
- @apk add $(APK_OPTS) --initdb --root $(VSTEMPLATE_DIR) \
- alpine-base
- @cd $(VSTEMPLATE_DIR) && tar -jcf $@ *
-
-#
-# ISO rules
-#
-
-ISOLINUX_DIR := boot/isolinux
-ISOLINUX := $(ISO_DIR)/$(ISOLINUX_DIR)
-ISOLINUX_BIN := $(ISOLINUX)/isolinux.bin
-ISOLINUX_CFG := $(ISOLINUX)/isolinux.cfg
-SYSLINUX_CFG := $(ISO_DIR)/syslinux.cfg
-
-$(ISOLINUX_BIN):
- @echo "==> iso: install isolinux"
- @mkdir -p $(dir $(ISOLINUX_BIN))
- @if ! apk fetch $(APK_REPO) --stdout syslinux | tar -O -zx usr/share/syslinux/isolinux.bin > $@; then \
- rm -f $@ && exit 1;\
- fi
-
-$(ISOLINUX_CFG):
- @echo "==> iso: configure isolinux"
- @mkdir -p $(dir $(ISOLINUX_BIN))
- @echo "timeout 20" >$(ISOLINUX_CFG)
- @echo "prompt 1" >>$(ISOLINUX_CFG)
- @echo "default $(KERNEL_NAME)" >>$(ISOLINUX_CFG)
- @echo "label $(KERNEL_NAME)" >>$(ISOLINUX_CFG)
- @echo " kernel /boot/$(KERNEL_NAME)" >>$(ISOLINUX_CFG)
- @echo " append initrd=/boot/$(INITFS_NAME) alpine_dev=cdrom:iso9660 modules=loop,cramfs,sd-mod,usb-storage,floppy quiet" >>$(ISOLINUX_CFG)
-
-$(SYSLINUX_CFG): $(MODLOOP_DIRSTAMP)
- @echo "==> iso: configure syslinux"
- @echo "timeout 20" >$@
- @echo "prompt 1" >>$@
- @echo "default $(KERNEL_NAME)" >>$@
- @echo "label $(KERNEL_NAME)" >>$@
- @echo " kernel /boot/$(KERNEL_NAME)" >>$@
- @echo " append initrd=/boot/$(INITFS_NAME) alpine_dev=usbdisk:vfat modules=loop,cramfs,sd-mod,usb-storage quiet" >>$@
-
-clean-syslinux:
- @rm -f $(SYSLINUX_CFG) $(ISOLINUX_CFG) $(ISOLINUX_BIN)
-
-ISO_KERNEL := $(ISO_DIR)/boot/$(KERNEL_NAME)
-ISO_REPOS_DIRSTAMP := $(DESTDIR)/stamp.isorepos
-ISOFS_DIRSTAMP := $(DESTDIR)/stamp.isofs
-
-$(ISO_REPOS_DIRSTAMP): $(ISO_PKGDIR)/APKINDEX.tar.gz
- @touch $(ISO_PKGDIR)/.boot_repository
- @rm -f $(ISO_PKGDIR)/.SIGN.*
- @touch $@
-
-$(ISO_PKGDIR)/APKINDEX.tar.gz: $(APK_FILES)
- @echo "==> iso: generating repository index"
- @apk index --description "$(ALPINE_NAME) $(ALPINE_RELEASE)" \
- -o $@ $(ISO_PKGDIR)/*.apk
- @abuild-sign $@
-
-$(ISO_KERNEL): $(MODLOOP_DIRSTAMP)
- @echo "==> iso: install kernel $(KERNEL)"
- @mkdir -p $(dir $(ISO_KERNEL))
- @apk fetch $(APK_OPTS) --stdout $(KERNEL_PKGNAME) \
- | tar -C $(ISO_DIR) -xz boot
- @rm -f $(ISO_DIR)/boot/$(KERNEL_NAME)
- @ln -s vmlinuz-$(MODLOOP_KERNEL_RELEASE) $@
- @rm -rf $(ISO_DIR)/.[A-Z]* $(ISO_DIR)/.[a-z]* $(ISO_DIR)/lib
-
-$(ISOFS_DIRSTAMP): $(MODLOOP) $(INITFS) $(ISOLINUX_CFG) $(ISOLINUX_BIN) $(ISO_KERNEL) $(ISO_REPOS_DIRSTAMP) $(SYSLINUX_CFG)
- @echo "$(ALPINE_NAME)-$(ALPINE_RELEASE) $(BUILD_DATE)" \
- > $(ISO_DIR)/.alpine-release
- @touch $@
-
-$(ISO): $(ISOFS_DIRSTAMP)
- @echo "==> iso: building $(notdir $(ISO))"
- @genisoimage -o $(ISO) -l -J -R \
- -b $(ISOLINUX_DIR)/isolinux.bin \
- -c $(ISOLINUX_DIR)/boot.cat \
- -no-emul-boot \
- -boot-load-size 4 \
- -boot-info-table \
- -quiet \
- -follow-links \
- $(ISO_OPTS) \
- $(ISO_DIR)
- @ln -fs $@ $(ISO_LINK)
-
-isofs: $(ISOFS_DIRSTAMP)
-iso: $(ISO)
-
-#
-# SHA1 sum of ISO
-#
-ISO_SHA1 := $(ISO).sha1
-
-$(ISO_SHA1): $(ISO)
- @echo "==> Generating sha1 sum"
- @sha1sum $(ISO) > $@ || rm -f $@
-
-#
-# USB image
-#
-USBIMG := $(ALPINE_NAME)-$(ALPINE_RELEASE)-$(ALPINE_ARCH).img
-USBIMG_FREE ?= 8192
-USBIMG_SIZE = $(shell echo $$(( `du -s $(ISO_DIR) | awk '{print $$1}'` + $(USBIMG_FREE) )) )
-MBRPATH := /usr/share/syslinux/mbr.bin
-
-$(USBIMG): $(ISOFS_DIRSTAMP)
- @echo "==> Generating $@"
- @mformat -C -v 'ALPINE' -c 16 -h 64 -n 32 -i $(USBIMG) \
- -t $$(($(USBIMG_SIZE) / 1000)) ::
- @syslinux $(USBIMG)
- @mcopy -i $(USBIMG) $(ISO_DIR)/* $(ISO_DIR)/.[a-z]* ::
- @mcopy -i $(USBIMG) /dev/zero ::/zero 2>/dev/null || true
- @mdel -i $(USBIMG) ::/zero
-
-USBIMG_SHA1 := $(USBIMG).sha1
-$(USBIMG_SHA1): $(USBIMG)
- @echo "==> Generating sha1 sum"
- @sha1sum $(USBIMG) > $@ || rm -f $@
-
-$(ALPINE_NAME).img: $(USBIMG)
- @ln -sf $(USBIMG) $@
-
-img: $(ALPINE_NAME).img
-
-sha1: $(ISO_SHA1) $(USBIMG_SHA1)
-
-release: $(ISO_SHA1)
-
diff --git a/bootchartd b/bootchartd
deleted file mode 100755
index 43fdfe9..0000000
--- a/bootchartd
+++ /dev/null
@@ -1,198 +0,0 @@
-#!/bin/sh
-#
-# Bootchart logger script
-# Ziga Mahkovec <ziga.mahkovec@klika.si>
-#
-# Modified heavily for Alpine Linux bootcharting
-# Timo Teras <timo.teras@iki.fi>
-#
-# This script is used for data collection for the bootchart
-# boot performance visualization tool (http://www.bootchart.org).
-#
-# This script is tied to Alpine Init scripts and charts the
-# bootup procedure only.
-#
-
-PATH="/sbin:/bin:/usr/sbin:/usr/bin:$PATH"
-
-# Configuration for bootchartd, the bootchart logger script.
-TMPFS_SIZE=32m
-SAMPLE_PERIOD=0.2
-PROCESS_ACCOUNTING="yes"
-BOOTLOG_DEST=/var/log/bootchart.tgz
-LOGDIR=/bootchart
-EXIT_PROC="mingetty agetty rungetty getty fgetty"
-
-# Monitoring commands
-log_cmd_1="cat /proc/stat"
-log_target_1=proc_stat.log
-
-# /proc/diskstats is available in 2.6 kernels
-log_cmd_2="cat /proc/diskstats"
-log_target_2=proc_diskstats.log
-
-log_cmd_3="cat /proc/[1-9]*/stat 2>/dev/null"
-log_target_3=proc_ps.log
-
-# Uncomment this line for diskless stations
-#log_cmd_4="cat /proc/net/dev"
-#log_target_4=proc_netdev.log
-
-max_log=3
-
-do_logging()
-{
- # Enable process accounting if configured
- if [ "$PROCESS_ACCOUNTING" = "yes" ]; then
- [ -e kernel_pacct ] || : > kernel_pacct
- accton kernel_pacct
- fi
-
- # open file descriptors
- i=1
- while [ $i -le $max_log ]; do
- eval target=\"\$log_target_$i\"
- if [ -z "$target" ]; then
- max_log=$i
- break
- fi
-
- fd=$((2 + $i))
- eval exec $fd'>>$target'
- eval log_fd_$i=$fd
- i=$(($i + 1))
- done
-
- not_stop_logging=true
- while $not_stop_logging && \
- { ! pidof $EXIT_PROC >/dev/null; }; do
- if [ -r /proc/uptime ]; then
- # Write the time (in jiffies).
- read uptime < /proc/uptime
- uptime=${uptime%% [0-9]*}
- uptime=${uptime%.*}${uptime#*.}
-
- i=1
- while [ $i -le $max_log ]; do
- eval fd=\$log_fd_$i\; cmd=\$log_cmd_$i
-
- {
- echo $uptime
- # Log the command output
- eval $cmd
- echo
- } >&$fd
- i=$(($i + 1))
- done
- fi
-
- sleep $SAMPLE_PERIOD
- done
-
- # close file descriptors
- i=1
- while [ $i -le $max_log ]; do
- eval fd=\$log_fd_$i
- eval exec $fd'>&-'
- i=$(($i + 1))
- done
-
- [ -e kernel_pacct ] && accton
-}
-
-# Stop the boot logger. The lock file is removed to force the loggers in
-# background to exit. Some final log files are created and then all log files
-# from the tmpfs are packaged and stored in $BOOTLOG_DEST.
-finalize()
-{
- # Stop process accounting if configured
- local pacct=
- [ -e kernel_pacct ] && pacct=kernel_pacct
-
- # Write system information
- # Log some basic information about the system.
- (
- echo "version = $VERSION"
- echo "title = Boot chart for $( hostname | sed q ) ($( date ))"
- echo "system.uname = $( uname -srvm | sed q )"
- if [ -f /etc/alpine-release ]; then
- echo "system.release = $( sed q /etc/alpine-release )"
- elif [ -f /etc/gentoo-release ]; then
- echo "system.release = $( sed q /etc/gentoo-release )"
- elif [ -f /etc/SuSE-release ]; then
- echo "system.release = $( sed q /etc/SuSE-release )"
- elif [ -f /etc/debian_version ]; then
- echo "system.release = Debian GNU/$( uname -s ) $( cat /etc/debian_version )"
- elif [ -f /etc/frugalware-release ]; then
- echo "system.release = $( sed q /etc/frugalware-release )"
- elif [ -f /etc/pardus-release ]; then
- echo "system.release = $( sed q /etc/pardus-release )"
- else
- echo "system.release = $( sed 's/\\.//g;q' /etc/issue )"
- fi
-
- # Get CPU count
- local cpucount=$(grep -c '^processor' /proc/cpuinfo)
- if [ $cpucount -gt 1 -a -n "$(grep 'sibling.*2' /proc/cpuinfo)" ]; then
- # Hyper-Threading enabled
- cpucount=$(( $cpucount / 2 ))
- fi
- if grep -q '^model name' /proc/cpuinfo; then
- echo "system.cpu = $( grep '^model name' /proc/cpuinfo | sed q )"\
- "($cpucount)"
- else
- echo "system.cpu = $( grep '^cpu' /proc/cpuinfo | sed q )"\
- "($cpucount)"
- fi
-
- echo "system.kernel.options = $( sed q /proc/cmdline )"
- ) >> header
-
- # Package log files
- tar -zcf "$BOOTLOG_DEST" header $pacct *.log
- rm "$LOGDIR"/*
- rmdir "$LOGDIR"
-}
-
-case "$1" in
-start-initfs)
- NEWROOT="$2"
- (
- cleanup=true
- trap "not_stop_logging=false" USR1
- trap "cleanup=false; not_stop_logging=false" USR2
-
- mkdir "$LOGDIR"
- cd "$LOGDIR"
- do_logging
- if $cleanup; then
- sleep $SAMPLE_PERIOD
- finalize
- fi
- ) &
- echo $! > $LOGDIR/bootchart.pid
- ;;
-stop-initfs)
- NEWROOT="$2"
-
- cd "$LOGDIR"
- mkdir "$NEWROOT$LOGDIR"
- cp /sbin/bootchartd $NEWROOT/sbin
- PID=`cat bootchart.pid`
- kill -USR2 $PID
- wait $PID
- mv * "$NEWROOT$LOGDIR"
- ;;
-start-rootfs)
- (
- trap "not_stop_logging=false" USR1
- cd "$LOGDIR"
- do_logging
- finalize
- ) &
- shift
- exec "$@"
- ;;
-esac
-
-exit 0
diff --git a/buildrepo.in b/buildrepo.in
deleted file mode 100755
index c211789..0000000
--- a/buildrepo.in
+++ /dev/null
@@ -1,131 +0,0 @@
-#!/bin/sh
-
-program=${0##*/}
-
-aportsdir=${APORTSDIR:-$HOME/aports}
-repodir=${REPODIR:-$HOME/packages}
-
-
-usage() {
- echo "usage: $program [-a APORTSDIR] [-d REPODIR] [-hp] [-l LOGPREFIX ]"
- echo " [-r DEPREPO] REPOSITORY..."
-
- echo "options:"
- echo " -a Set the aports base dir to APORTSDIR instead of $aportsdir"
- echo " -d Set destination repository base dir to REPODIR instead of $repodir"
- echo " -h Show this help and exit"
- echo " -l Send build to logfile, prefixed by LOGPREFIX"
- echo " -p Purge obsolete packages from REPODIR after build"
- echo " -r Dependencies are found in DEPREPO"
- exit 1
-}
-
-
-listpackages() {
- cd "$aportsdir/$1"
- for i in */APKBUILD; do
- APKBUILD=$i abuild listpkg
- done
-}
-
-all_exist() {
- while [ $# -gt 0 ]; do
- [ -e "$1" ] || return 1
- shift 1
- done
- return 0
-}
-
-build() {
- local repo="$1" i needbuild
-
- cd "$aportsdir/$repo" || return 1
-
- # first we try copy everything possible and find out which we need
- # to rebuild. By doing this we might save us for rebuilding
- # needed when running 'abuild -R'
- for i in */APKBUILD; do
- export REPODEST="$repodir"
- cd "$aportsdir/$repo"/${i%/*} || return 1
- if abuild -k -q up2date 2>/dev/null; then
- continue
- fi
-
- # try link or copy the files if they are in the ports dir
- pkgs=$(abuild listpkg)
- if all_exist $pkgs; then
- echo ">>> Copying " $pkgs
- cp -p -l $pkgs "$repodir/$repo"/ 2>/dev/null \
- || cp -p $pkgs "$repodir/$repo"/ \
- || needbuild="$needbuild $i"
- else
- needbuild="$needbuild $i"
- fi
- done
-
- # build the postponed packages if any
- if [ -n "$needbuild" ]; then
- for i in $needbuild; do
- cd "$aportsdir/$repo"/${i%/*} || return 1
- abuild -k -R || return 1
- done
- fi
-
- # kill old packages in repo
- if [ -n "$dopurge" ]; then
- local tmp=$(mktemp /tmp/$program-XXXXXX)
- local purgefiles
- cd "$repodir/$1" || return 1
- trap 'rm -f "$tmp"; exit 1' INT
- ( listpackages "$1") >$tmp
- purge=$(ls *.apk 2>/dev/null | grep -v -w -f $tmp)
- if [ -n "$purge" ]; then
- rm -f $purge
- fi
- rm -f "$tmp"
- fi
-
- # generate the repository index
- echo ">>> Generating Index for $repo..."
- cd "$repodir/$repo"
- local deps
- for i in $deprepo; do
- deps="--repo $repodir/$i"
- done
- oldindex=
- if [ -f APKINDEX.tar.gz ]; then
- oldindex="--index APKINDEX.tar.gz"
- fi
- tmpindex=$(mktemp).tar.gz
- apk index $oldindex -o $tmpindex \
- --description "$repo $(cd $aportsdir && git describe)" \
- *.apk
- abuild-sign $tmpindex && mv $tmpindex APKINDEX.tar.gz
- chmod 644 APKINDEX.tar.gz
- rm -f tmp.*
-}
-
-while getopts "a:d:hl:pr:" opt; do
- case "$opt" in
- a) aportsdir=$OPTARG;;
- d) repodir=$OPTARG;;
- h) usage >&2;;
- l) logprefix=$OPTARG;;
- p) dopurge=1;;
- r) deprepo="$deprepo $OPTARG";;
- esac
-done
-shift $(($OPTIND - 1))
-
-[ $# -eq 0 ] && usage >&2
-
-while [ $# -gt 0 ]; do
- if [ -n "$logprefix" ]; then
- build $1 >$logprefix.$1.log 2>&1 || exit 1
- else
- build $1 || exit 1
- fi
- deprepo="$deprepo $1"
- shift
-done
-
diff --git a/devbuild.in b/devbuild.in
deleted file mode 100755
index 054d02d..0000000
--- a/devbuild.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/sh
-
-# This scripts will:
-# 1. create a dist package for current subproject
-# 2. update the APKBUILD and build the package
-# 3. build the alpine iso
-#
-# The following is assumed from the subproject:
-# * that PACKAGE and VERSION is set in Makefile or defined in a local
-# devbuild.conf file
-# * that 'make dist' will generate a valid dist package
-#
-
-program=${0##*/}
-
-# rebuild env. Those values can be overridden in either
-# /etc/devbuildrc or $HOME/.devbuildrc
-DISTFILES=/var/cache/distfiles
-APORTS_DIR=$HOME/aports
-ALPINE_DIR=$HOME/abuild
-
-# for the local project. Those values can be overridden by
-# a .devbuildrc in the subprojects dir
-PACKAGE=$(grep '^PACKAGE' Makefile | sed 's/.*=[[:blank:]]*//')
-VERSION=$(grep '^VERSION' Makefile | sed 's/.*=[[:blank:]]*//')
-SUFFIX=.tar.bz2
-REPO=core
-
-# let user override the above defaults
-for i in /etc/${program}rc $HOME/.${program}rc ./.${program}rc; do
- if [ -f $i ]; then
- . $i
- fi
-done
-
-# generate a new dist package
-tarball=${PACKAGE}-${VERSION}${SUFFIX}
-make dist || exit 1
-cp $tarball "$DISTFILES/" || exit 1
-
-# update the APKBUILD, in a subshell
-(
- cd $APORTS_DIR/$REPO/$PACKAGE || exit 1
- . ./APKBUILD
- if [ "$pkgver" = "$VERSION" ]; then
- pkgrel=$(( $pkgrel + 1 ))
- else
- pkgrel="0"
- fi
- sed -i -e " s/^pkgver=.*/pkgver=$VERSION/;
- s/^pkgrel=.*/pkgrel=$pkgrel/;
- /^md5sums=\"/,/\"\$/d" APKBUILD || exit 1
- export SRCDEST="$DISTFILES"
- abuild checksum
- abuild
- abuild cleanoldpkg
-) || exit 1
-
-# rebuild the iso
-cd "$ALPINE_DIR" && fakeroot ./mkalpine
-
diff --git a/functions.sh b/functions.sh
deleted file mode 100644
index 032a7e6..0000000
--- a/functions.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-
-#colors
-if [ -n "$USE_COLORS" ]; then
- NORMAL="\033[1;0m"
- STRONG="\033[1;1m"
- RED="\033[1;31m"
- GREEN="\033[1;32m"
- YELLOW="\033[1;33m"
- BLUE="\033[1;34m"
-fi
-
-
-# functions
-msg() {
- local prompt="$GREEN>>>${NORMAL}"
- local fake="${FAKEROOTKEY:+${BLUE}*${NORMAL}}"
- local name="${STRONG}${subpkgname:-$pkgname}${NORMAL}"
- [ -z "$quiet" ] && printf "${prompt} ${name}${fake}: $@\n" >&2
-}
-
-warning() {
- local prompt="${YELLOW}>>> WARNING:${NORMAL}"
- local fake="${FAKEROOTKEY:+${BLUE}*${NORMAL}}"
- local name="${STRONG}${subpkgname:-$pkgname}${NORMAL}"
- printf "${prompt} ${name}${fake}: $@\n" >&2
-}
-
-error() {
- local prompt="${RED}>>> ERROR:${NORMAL}"
- local fake="${FAKEROOTKEY:+${BLUE}*${NORMAL}}"
- local name="${STRONG}${subpkgname:-$pkgname}${NORMAL}"
- printf "${prompt} ${name}${fake}: $@\n" >&2
-}
-
diff --git a/initramfs-init b/initramfs-init
deleted file mode 100755
index a6bbe26..0000000
--- a/initramfs-init
+++ /dev/null
@@ -1,305 +0,0 @@
-#!/bin/busybox sh
-
-# this is the init script version
-VERSION=1.1
-NEWROOT=/newroot
-SINGLEMODE=no
-
-/bin/busybox --install -s
-
-# basic environment
-export PATH=/usr/bin:/bin:/usr/sbin:/sbin
-
-# needed devs
-[ -c /dev/null ] || mknod -m 666 /dev/null c 1 3
-
-# basic mounts
-mount -t proc -o noexec,nosuid,nodev proc /proc
-mount -t sysfs -o noexec,nosuid,nodev sysfs /sys
-
-# some helpers
-ebegin() {
- echo -n " * $*: "
-}
-eend() {
- local msg
- if [ "$1" = 0 ] || [ $# -lt 1 ] ; then
- echo "ok."
- else
- shift
- echo "failed. $*"
- echo "initramfs emergency recovery shell launched. Type 'exit' to continue boot"
- /bin/busybox sh
- fi
-}
-
-scan_drivers() {
- if [ "$AUTODETECT" != no ] ; then
- find /sys -name modalias | xargs sort -u | xargs modprobe -a 2> /dev/null
- fi
-}
-
-find_ovl() {
- local mnt="$1"
- local ovl
- local lines
-
- # look for apkovl's on mounted media
- ovl=$( ls -1 "$mnt"/*.apkovl.tar.gz* 2>/dev/null ) || return 1
- lines=$(echo "$ovl" | wc -l)
-
- if [ $lines -gt 1 ] ; then
- echo "ERROR: More than one apkovl file was found on $(basename $mnt). None will be read." >&2
- return 1
- fi
- echo "$ovl"
-}
-
-retry_mount() {
- # usb might need some time to settle so we retry a few times
- for i in $(seq 0 19); do
- mount $@ 2>&1 && return 0
- sleep 1
- done
- return 1
-}
-
-unpack_apkovl() {
- local ovl="$1"
- local dest="$2"
- local suffix=${ovl##*.}
- local i
- if [ "$suffix" = "gz" ]; then
- tar -C "$dest" -zxf "$ovl"
- return $?
- fi
-
- for i in $ALPINE_MNT/*/*/openssl-[0-9]*.apk $ALPINE_MNT/*/openssl-[0-9]*.apk; do
- [ -f "$i" ] && tar --numeric-owner -C / -zxf $i && break
- done
-
- if ! openssl list-cipher-commands | grep "^$suffix$" > /dev/null; then
- errstr="Cipher $suffix is not supported"
- return 1
- fi
- local count=0
- # beep
- echo -e "\007"
- while [ $count -lt 3 ]; do
- openssl enc -d -$suffix -in "$ovl" | tar --numeric-owner \
- -C "$dest" -zx 2>/dev/null && return 0
- count=$(( $count + 1 ))
- done
- return 1
-}
-
-# gotta start from somewhere :)
-echo "Alpine Init $VERSION"
-
-# read the kernel options
-for i in `cat /proc/cmdline` ; do
- case $i in
- s|single|1)
- SINGLEMODE=yes ;;
- modules=*)
- MODULES="`echo ${i#modules=} | tr ',' ' '`";;
- noautodetect)
- AUTODETECT=no;;
- *=*) eval KOPT_$i ;;
- *) eval KOPT_$i=yes ;;
- esac
-done
-
-# start bootcharting if wanted
-if [ -n "$KOPT_chart" ]; then
- ebegin "Starting bootchart logging"
- /sbin/bootchartd start-initfs "$NEWROOT"
- eend 0
-fi
-
-ALPINE_DEV=${KOPT_alpine_dev%%:*}
-ALPINE_DEV_FS=${KOPT_alpine_dev##*:}
-if [ "$ALPINE_DEV_FS" = "$ALPINE_DEV" ]; then
- unset ALPINE_DEV_FS
-fi
-ALPINE_MNT=/media/$ALPINE_DEV
-
-# hide kernel messages
-dmesg -n 1
-
-# setup /dev
-ebegin "Starting mdev"
-mount -t tmpfs -o exec,nosuid,mode=0755 mdev /dev
-ln -s sr0 /dev/cdrom
-echo "/sbin/mdev" > /proc/sys/kernel/hotplug
-mdev -s
-RC=$?
-[ -d /dev/pts ] || mkdir -m 755 /dev/pts
-[ -c /dev/ptmx ] || mknod -m 666 /dev/ptmx c 5 2
-mount -t devpts -o gid=5,mode=0620,noexec,nosuid devpts /dev/pts
-[ -d /dev/shm ] || mkdir /dev/shm
-mount -t tmpfs -o nodev,nosuid,noexec shm /dev/shm
-eend $RC
-
-# load available drivers to get access to modloop media
-ebegin "Loading boot drivers"
-[ "$MODULES" ] && modprobe -a $MODULES 2> /dev/null
-if [ -f /etc/modules ] ; then
- sed 's/\#.*//g' < /etc/modules |
- while read module args; do
- modprobe -q $module $args
- done
-fi
-scan_drivers
-scan_drivers
-eend 0
-
-# check if root=... was set
-if [ -n "$KOPT_root" ]; then
- if [ "$SINGLEMODE" = "yes" ]; then
- echo "Entering single mode. Type 'exit' to continue booting."
- sh
- fi
- case "$KOPT_root" in
- /dev/md*)
- mknod $KOPT_root b 9 ${KOPT_root#/dev/md}
- raidautorun "$KOPT_root"
- ;;
- esac
- ebegin "Mounting root"
- retry_mount $KOPT_root $NEWROOT 2>/dev/null
- eend $?
- cat /proc/mounts | while read DEV DIR TYPE OPTS ; do
- if [ "$DIR" != "/" -a "$DIR" != "$NEWROOT" -a -d "$DIR" ]; then
- mkdir -p $NEWROOT/$DIR
- mount -o move $DIR $NEWROOT/$DIR
- fi
- done
- sync
- exec /bin/busybox switch_root $NEWROOT $chart_init /sbin/init $KOPT_init_args
- echo "initramfs emergency recovery shell launched"
- exec /bin/busybox sh
-fi
-
-# locate boot media and mount it
-ebegin "Mounting boot media"
-mkdir -p $ALPINE_MNT
-if [ -n "$ALPINE_DEV_FS" ]; then
- mount_opts="-t $ALPINE_DEV_FS"
-fi
-
-retry_mount $mount_opts /dev/$ALPINE_DEV $ALPINE_MNT >/dev/null 2>&1
-eend $?
-
-ebegin "Mounting loopback device for kernel modules"
-modprobe loop
-if [ -n "$KOPT_modloop" ]; then
- modloop=$KOPT_modloop
-else
- modloop=$KOPT_BOOT_IMAGE.cmg
-fi
-mount -o loop,ro -t cramfs $ALPINE_MNT/$modloop /.modloop
-rc=$?
-if [ "$rc" = 0 ]; then
- rm -rf /lib/modules
- ln -sf /.modloop/modules /lib
-fi
-eend $?
-
-if [ -d $ALPINE_MNT/firmware ]; then
- ebegin "Copying firmware from $ALPINE_MNT/firmware"
- mkdir -p /lib
- cp -R -a $ALPINE_MNT/firmware /lib/
- eend $?
-fi
-
-mkdir -p /etc/apk
-for i in $ALPINE_MNT/*/APK_INDEX.gz $ALPINE_MNT/*/*/APK_INDEX.gz; do
- [ -r "$i" ] && echo ${i%/APK_INDEX.gz} >> /etc/apk/repositories
-done
-
-# early console?
-if [ "$SINGLEMODE" = "yes" ]; then
- echo "Entering single mode. Type 'exit' to continue booting."
- sh
-fi
-
-# more drivers
-ebegin "Loading hardware drivers"
-scan_drivers
-eend 0
-
-mount -t tmpfs tmpfs $NEWROOT
-
-# look for apkovl
-if dmesg | grep '^usb-storage: waiting' >/dev/null; then
- ebegin "Waiting for USB device to settle"
- while ! dmesg | grep 'usb-storage: device scan complete' >/dev/null; do
- sleep 1
- done
- eend 0
-fi
-for i in usb floppy cdrom; do
- mount /media/$i 2>/dev/null || continue
- ovl=$(find_ovl /media/$i)
- [ -f "$ovl" ] && break
- umount /media/$i 2>/dev/null
-done
-if ! [ -f "$ovl" ]; then
- ovl=$(find_ovl $ALPINE_MNT)
-fi
-
-if [ -f "$ovl" ]; then
- ebegin "Loading user settings from $ovl"
- unpack_apkovl "$ovl" $NEWROOT
- eend $? $errstr
- umount /media/$i 2>/dev/null &
- pkgs=$(sed 's/\#.*//' $NEWROOT/etc/lbu/packages.list 2>/dev/null)
-fi
-
-# install new root
-ebegin "Installing packages to root filesystem"
-if [ -n "$KOPT_chart" ]; then
- pkgs="$pkgs acct"
-fi
-apkflags="--initdb --quiet --progress --force"
-if [ -z "$KOPT_keep_apk_new" ]; then
- apkflags="$apkflags --clean-protected"
-fi
-apk add --root /newroot $apkflags $pkgs >/dev/null
-eend $?
-
-# copy alpine release info
-cp $ALPINE_MNT/.alpine-release $NEWROOT/
-ln -sf /.alpine-release $NEWROOT/etc/alpine-release
-
-# if there is no repositories file, then use the default
-if ! [ -f $NEWROOT/etc/apk/repositories ]; then
- cp /etc/apk/repositories $NEWROOT/etc/apk/repositories
-fi
-
-# setup bootchart for switch_root
-chart_init=""
-if [ -n "$KOPT_chart" ]; then
- /sbin/bootchartd stop-initfs "$NEWROOT"
- chart_init="/sbin/bootchartd start-rootfs"
-fi
-
-# switch over to new root
-cat /proc/mounts | while read DEV DIR TYPE OPTS ; do
- if [ "$DIR" != "/" -a "$DIR" != "$NEWROOT" -a -d "$DIR" ]; then
- mkdir -p $NEWROOT/$DIR
- mount -o move $DIR $NEWROOT/$DIR
- fi
-done
-ln -sf /.modloop/modules $NEWROOT/lib/modules
-sync
-
-echo ""
-if [ -x $NEWROOT/sbin/init ]; then
- exec /bin/busybox switch_root $NEWROOT $chart_init /sbin/init $KOPT_init_args
-fi
-
-echo "initramfs emergency recovery shell launched"
-exec /bin/busybox sh
-reboot
diff --git a/mkalpine.in b/mkalpine.in
deleted file mode 100755
index e31980a..0000000
--- a/mkalpine.in
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/sh
-
-# check if what we need is here
-needed="cramfs syslinux cdrkit"
-for i in $needed; do
- if ! apk info -e $i; then
- missing="$missing $i"
- fi
-done
-
-# try install the missing parts
-if [ -n "$missing" ]; then
- if ! sudo apk add $missing; then
- echo "Need $missing to build alpine" >&2
- exit 1
- fi
-fi
-
-# first look for alpine.mk in current dir. Fallback to /usr/share/abuild
-mk=./alpine.mk
-if ! [ -f $mk ]; then
- mk=/usr/share/abuild/alpine.mk
-fi
-
-make -f "$mk" APK_BIN= $@
-rc=$?
-
-# beep when done
-if [ $rc -eq 0 ]; then
- for i in $(seq 0 3); do
- echo -n -e "\007"
- sleep 0.2
- done
-fi
-
-# uninstall the stuff we installed
-[ -n "$missing" ] && sudo apk del $missing
-
-
-exit $?
diff --git a/mkinitram b/mkinitram
deleted file mode 100644
index 2ae21f8..0000000
--- a/mkinitram
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/bin/sh
-
-msg() {
- echo "==>" $@
-}
-
-die() {
- echo $@
- exit 1
-}
-
-unapk() {
- local dest="$1"
- shift
- while [ $# -gt 0 ]; do
- tar -C "$dest" -zxf "$1"
- shift
- done
- rm -f "$dest/.PKGINFO"
-}
-
-
-APKS=../aports/core/*/
-
-image=$PWD/image
-dest=$PWD/test.gz
-init=init
-
-
-kernel=$1
-# if no kernel specified, then guess...
-if [ -z "$kernel" ]; then
- kernel=$(ls /lib/modules 2>/dev/null | tail -n 1)
-fi
-
-if [ ! -d /lib/modules/$kernel ]; then
- die "modules dir /lib/modules/$kernel was not found"
-fi
-msg "mkinitram Using kernel $kernel"
-
-# create empty image dir
-
-rm -rf "$image"
-mkdir -p "$image/dev" "$image/etc/rcS.d"
-
-# unpack busybox and deps
-unapk $image $APKS/uclibc-[0-9]*.apk \
- $APKS/busybox-[0-9]*.apk \
- $APKS/alpine-baselayout-[0-9]*.apk \
- $APKS/apk-tools-[0-9]*.apk
-
-ln -sf /bin/busybox $image/init
-
-# create misc devs and enable boot scripts
-mknod $image/dev/null c 2 2
-ln -s ../init.d/mdev $image/etc/rcS.d/S10mdev
-ln -s ../init.d/hwdrivers $image/etc/rcS.d/S30hwdrivers
-ln -s ../init.d/modutils $image/etc/rcS.d/S40modutils
-ln -s ../init.d/modloop $image/etc/rcS.d/S50modloop
-ln -s ../init.d/hwdrivers $image/etc/rcS.d/S60hwdrivers
-
-mkdir $image/.modloop
-
-# load those extra drivers
-for i in ide-cd usb-storage ide-disk loop; do
- echo $i >> $image/etc/modules
-done
-
-
-# copy kernel modules
-kmods=$image/lib/modules/$kernel
-mkdir -p $kmods/kernel/drivers $kmods/kernel/fs
-
-for i in acpi ata block ide scsi cdrom usb message hid; do
- cp -LpR /lib/modules/$kernel/kernel/drivers/$i $kmods/kernel/drivers/
-done
-
-for i in isofs vfat nls ext2 cramfs '*.ko'; do
- cp -LpR /lib/modules/$kernel/kernel/fs/$i $kmods/kernel/fs/
-done
-cp -LpR /lib/modules/$kernel/kernel/lib $kmods/kernel/
-
-depmod $kernel -b $image
-
-
-# generate the image
-cd $image
-find . | cpio -o -H newc | gzip -9 > $dest
diff --git a/mkmodloop b/mkmodloop
deleted file mode 100644
index f85b628..0000000
--- a/mkmodloop
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-
-msg() {
- echo "==>" $@
-}
-
-die() {
- echo $@
- exit 1
-}
-
-image=$PWD/modloop
-dest=$PWD/modloop.cmg
-init=init
-
-
-kernel=$1
-# if no kernel specified, then guess...
-if [ -z "$kernel" ]; then
- kernel=$(ls /lib/modules 2>/dev/null | tail -n 1)
-fi
-
-if [ ! -d /lib/modules/$kernel ]; then
- die "modules dir /lib/modules/$kernel was not found"
-fi
-msg "Using kernel $kernel"
-
-
-rm -rf "$image"
-mkdir -p "$image/lib/modules"
-cp -alf /lib/modules/$kernel $image/lib/modules/
-
-depmod -b "$image" $kernel
-
-rm -f $image/lib/modules/$kernel/source $image/lib/modules/$kernel/build
-
-mkcramfs $image/lib $dest
diff --git a/newapkbuild.in b/newapkbuild.in
deleted file mode 100755
index 3fa0b87..0000000
--- a/newapkbuild.in
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/bin/sh
-
-# script to generate a new APKBUILD
-# Copyright (c) 2009 Natanael Copa <natanael.copa@gmail.com>
-#
-# Distributed under GPL-2
-#
-# Depends on: busybox utilities, fakeroot,
-#
-
-version=@VERSION@
-sysconfdir=@sysconfdir@
-datadir=@datadir@
-
-prog=${0##*/}
-
-error() {
- echo "$@" >&2
-}
-
-# create new aport from templates
-newaport() {
- local newname="$1"
- local pn=${newname%-[0-9]*}
- local pv
- if [ "$pn" != "$newname" ]; then
- pv=${newname#$pn-}
- fi
- if [ -e "$pn"/APKBUILD ] && [ -z "$force" ]; then
- error "$pn/APKBUILD already exist"
- return 1
- fi
- mkdir -p "$pn"
- cd "$pn"
- sed -e '1,/^\#*$/d' \
- -e "s/^\(# Contributor: \).*/\1$PACKAGER/" \
- -e "s/^\(# Maintainer: \).*/\1$PACKAGER/" \
- -e "s/^pkgname=.*/pkgname=$pn/" \
- -e "s/^pkgver=.*/pkgver=$pv/" \
- "$datadir"/sample.APKBUILD > APKBUILD || return 1
- #-e '1,/^\#$/d' \
- if [ -n "$cpinitd" ]; then
- cp "$datadir"/sample.initd $pn.initd
- cp "$datadir"/sample.confd $pn.confd
- cp "$datadir"/sample.pre-install $pn.pre-install
- cp "$datadir"/sample.post-install $pn.post-install
- sed -i -e "s/^install=.*/install=\"\$pkgname.pre-install \$pkgname.post-install\"/" \
- -e "s/^source=\"\(.*\)\"/source=\"\1\n\t$pn.initd\n\t$pn.confd\n\t\$install\n\t\"/" \
- APKBUILD
-
- fi
-}
-
-usage() {
- echo "$prog $version"
- echo "usage: $prog [-cfh] PKGNAME[-PKGVER]"
- echo "Options:"
- echo " -c Copy a sample init.d, conf.d and install script to new directory"
- echo " -f Force even if directory already exist"
- echo " -h Show this help"
- echo ""
- exit 0
-}
-
-while getopts "cfh" opt; do
- case $opt in
- 'c') cpinitd=1;;
- 'f') force=1;;
- 'h') usage;;
- esac
-done
-shift $(( $OPTIND - 1 ))
-
-while [ $# -gt 0 ]; do
- newaport $1 || exit 1
- shift
-done
-
diff --git a/sample.APKBUILD b/sample.APKBUILD
deleted file mode 100644
index 1754973..0000000
--- a/sample.APKBUILD
+++ /dev/null
@@ -1,49 +0,0 @@
-# This is an example APKBUILD file. Use this as a start to creating your own,
-# and remove these comments.
-# NOTE: Please fill out the license field for your package! If it is unknown,
-# then please put 'unknown'.
-
-# Contributor: Your Name <youremail@domain.com>
-# Maintainer: Your Name <youremail@domain.com>
-pkgname=NAME
-pkgver=VERSION
-pkgrel=0
-pkgdesc=""
-url=""
-license="GPL"
-depends=
-makedepends=
-install=
-subpackages="$pkgname-dev $pkgname-doc"
-source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz"
-
-# append extra dependencies to -dev subpackage
-# remove if not used.
-# depends_dev="somepackage-dev"
-
-_builddir="$srcdir"/$pkgname-$pkgver
-
-prepare() {
- cd "$_builddir"
- # apply patches here
-}
-
-build() {
- cd "$_builddir"
- ./configure --prefix=/usr \
- --sysconfdir=/etc \
- --mandir=/usr/share/man \
- --infodir=/usr/share/info
- make || return 1
-}
-
-package() {
- cd "$_builddir"
- make DESTDIR="$pkgdir" install
-
- # remove the 2 lines below (and this) if there is no init.d script
- # install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
- # install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
-}
-
-md5sums="" #generate with 'abuild checksum'
diff --git a/sample.confd b/sample.confd
deleted file mode 100644
index 486252b..0000000
--- a/sample.confd
+++ /dev/null
@@ -1,7 +0,0 @@
-# Sample conf.d file for alpine linux
-
-#
-# Specify daemon options here.
-#
-
-sample_opts=""
diff --git a/sample.initd b/sample.initd
deleted file mode 100644
index a034601..0000000
--- a/sample.initd
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/sbin/runscript
-
-# Sample init.d file for alpine linux.
-
-name=
-daemon=/usr/sbin/$name
-
-depend() {
- need net
- after firewall
-}
-
-start() {
- ebegin "Starting ${name}"
- start-stop-daemon --start --quiet \
- --pidfile /var/run/${name}.pid \
- --chuid ${sample_user}:${sample_group} \
- --exec ${daemon} -- ${sample_opts}
- eend $?
-}
-
-stop() {
- ebegin "Stopping ${name}"
- start-stop-daemon --stop --quiet \
- --pidfile /var/run/$name.pid \
- --exec ${daemon}
- eend $?
-}
-
diff --git a/sample.post-install b/sample.post-install
deleted file mode 100644
index 0586fcd..0000000
--- a/sample.post-install
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-# add something which happends after install
-
diff --git a/sample.pre-install b/sample.pre-install
deleted file mode 100644
index 46079e0..0000000
--- a/sample.pre-install
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-# add something which happends before install
-