mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-01-24 08:14:21 +00:00
alpine.mk, initramfs: show alpine release
Read the version from .alpine-release on media. Also display the init script version.
This commit is contained in:
parent
b4aafba38f
commit
81f8737a6a
9
alpine.mk
Normal file → Executable file
9
alpine.mk
Normal file → Executable file
@ -2,10 +2,14 @@
|
|||||||
|
|
||||||
-include alpine.conf.mk
|
-include alpine.conf.mk
|
||||||
|
|
||||||
ISO ?= alpine-test.iso
|
BUILD_DATE := $(shell date +%y%m%d)
|
||||||
|
ALPINE_RELEASE ?= $(BUILD_DATE)
|
||||||
|
ALPINE_NAME ?= alpine-test
|
||||||
DESTDIR ?= $(shell pwd)/isotmp
|
DESTDIR ?= $(shell pwd)/isotmp
|
||||||
APKDIRS ?= ../aports/core/*/
|
APKDIRS ?= ../aports/core/*/
|
||||||
|
|
||||||
|
ISO ?= $(ALPINE_NAME)-$(ALPINE_RELEASE).iso
|
||||||
|
ISO_LINK ?= $(ALPINE_NAME).iso
|
||||||
ISO_DIR := $(DESTDIR)/isofs
|
ISO_DIR := $(DESTDIR)/isofs
|
||||||
|
|
||||||
find_apk = $(firstword $(wildcard $(addprefix $(APKDIRS),$(1)-[0-9]*.apk)))
|
find_apk = $(firstword $(wildcard $(addprefix $(APKDIRS),$(1)-[0-9]*.apk)))
|
||||||
@ -186,6 +190,8 @@ $(ISO_KERNEL): $(KERNEL_APK)
|
|||||||
|
|
||||||
$(ISO): $(MODLOOP) $(INITFS) $(ISOLINUX_CFG) $(ISOLINUX_BIN) $(ISO_KERNEL) $(ISO_APKS)
|
$(ISO): $(MODLOOP) $(INITFS) $(ISOLINUX_CFG) $(ISOLINUX_BIN) $(ISO_KERNEL) $(ISO_APKS)
|
||||||
@echo "==> iso: building $(notdir $(ISO))"
|
@echo "==> iso: building $(notdir $(ISO))"
|
||||||
|
@echo "$(ALPINE_NAME)-$(ALPINE_RELEASE) $(BUILD_DATE)" \
|
||||||
|
> $(ISO_DIR)/.alpine-release
|
||||||
@genisoimage -o $(ISO) -l -J -R \
|
@genisoimage -o $(ISO) -l -J -R \
|
||||||
-b isolinux/isolinux.bin \
|
-b isolinux/isolinux.bin \
|
||||||
-c isolinux/boot.cat \
|
-c isolinux/boot.cat \
|
||||||
@ -194,4 +200,5 @@ $(ISO): $(MODLOOP) $(INITFS) $(ISOLINUX_CFG) $(ISOLINUX_BIN) $(ISO_KERNEL) $(ISO
|
|||||||
-boot-info-table \
|
-boot-info-table \
|
||||||
-quiet \
|
-quiet \
|
||||||
$(ISO_DIR)
|
$(ISO_DIR)
|
||||||
|
@ln -fs $@ $(ISO_LINK)
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
VERSION=1.9.1-pre0
|
# this is the init script version
|
||||||
|
VERSION=1.0
|
||||||
NEWROOT=/newroot
|
NEWROOT=/newroot
|
||||||
SINGLEMODE=no
|
SINGLEMODE=no
|
||||||
|
|
||||||
@ -53,7 +54,7 @@ find_ovl() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# gotta start from somewhere :)
|
# gotta start from somewhere :)
|
||||||
echo "Starting Alpine $VERSION"
|
echo "Alpine Init $VERSION"
|
||||||
|
|
||||||
# read the kernel options
|
# read the kernel options
|
||||||
for i in `cat /proc/cmdline` ; do
|
for i in `cat /proc/cmdline` ; do
|
||||||
@ -152,10 +153,14 @@ fi
|
|||||||
|
|
||||||
# install new root
|
# install new root
|
||||||
ebegin "Installing packages to root filesystem"
|
ebegin "Installing packages to root filesystem"
|
||||||
apk add --root /newroot --repository /media/cdrom/apks \
|
apk add --root /newroot --repository /media/$ALPINE_DEV/apks \
|
||||||
--initdb --quiet --progress $pkgs
|
--initdb --quiet --progress $pkgs
|
||||||
eend $?
|
eend $?
|
||||||
|
|
||||||
|
# copy alpine release info
|
||||||
|
cp /media/$ALPINE_DEV/.alpine-release $NEWROOT/
|
||||||
|
ln -sf /.alpine-release $NEWROOT/etc/alpine-release
|
||||||
|
|
||||||
# switch over to new root
|
# switch over to new root
|
||||||
cat /proc/mounts | while read DEV DIR TYPE OPTS ; do
|
cat /proc/mounts | while read DEV DIR TYPE OPTS ; do
|
||||||
if [ "$DIR" != "/" -a "$DIR" != "$NEWROOT" -a -d "$DIR" ]; then
|
if [ "$DIR" != "/" -a "$DIR" != "$NEWROOT" -a -d "$DIR" ]; then
|
||||||
@ -167,6 +172,7 @@ sync
|
|||||||
|
|
||||||
ln -sf /.modloop/modules $NEWROOT/lib/modules
|
ln -sf /.modloop/modules $NEWROOT/lib/modules
|
||||||
|
|
||||||
|
echo -e "\nStarting $(cut -f1 $NEWROOT/.alpine-release)"
|
||||||
if [ -x $NEWROOT/sbin/init ]; then
|
if [ -x $NEWROOT/sbin/init ]; then
|
||||||
exec /bin/busybox switch_root $NEWROOT /sbin/init $KOPT_init_args
|
exec /bin/busybox switch_root $NEWROOT /sbin/init $KOPT_init_args
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user