Skip to content

Commit c266c4c

Browse files
committed
Merge branch 'master' of github.com:void-linux/void-mklive into new-mklive
2 parents 46e4f1b + 011f3f5 commit c266c4c

File tree

9 files changed

+71
-19
lines changed

9 files changed

+71
-19
lines changed

build-x86-images.sh.in

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,48 +43,48 @@ readonly LXQT_PKGS="$X_PKGS lxdm lxqt gvfs-afc gvfs-mtp gvfs-smb udisks2 qupzill
4343

4444
if [ -z "$IMAGE" -o "$IMAGE" = base ]; then
4545
if [ ! -e $BASE_IMG ]; then
46-
./mklive.sh -a $ARCH -o $BASE_IMG -p "$BASE_PKGS" ${REPO} $@
46+
./mklive.sh -a $ARCH -o $BASE_IMG -p "$BASE_PKGS" ${REPO} "$@"
4747
fi
4848
fi
4949
if [ -z "$IMAGE" -o "$IMAGE" = e ]; then
5050
if [ ! -e $E_IMG ]; then
51-
./mklive.sh -a $ARCH -o $E_IMG -p "$E_PKGS" ${REPO} $@
51+
./mklive.sh -a $ARCH -o $E_IMG -p "$E_PKGS" ${REPO} "$@"
5252
fi
5353
fi
5454
if [ -z "$IMAGE" -o "$IMAGE" = xfce ]; then
5555
if [ ! -e $XFCE_IMG ]; then
56-
./mklive.sh -a $ARCH -o $XFCE_IMG -p "$XFCE_PKGS" ${REPO} $@
56+
./mklive.sh -a $ARCH -o $XFCE_IMG -p "$XFCE_PKGS" ${REPO} "$@"
5757
fi
5858
fi
5959
if [ -z "$IMAGE" -o "$IMAGE" = mate ]; then
6060
if [ ! -e $MATE_IMG ]; then
61-
./mklive.sh -a $ARCH -o $MATE_IMG -p "$MATE_PKGS" ${REPO} $@
61+
./mklive.sh -a $ARCH -o $MATE_IMG -p "$MATE_PKGS" ${REPO} "$@"
6262
fi
6363
fi
6464
if [ -z "$IMAGE" -o "$IMAGE" = cinnamon ]; then
6565
if [ ! -e $CINNAMON_IMG ]; then
66-
./mklive.sh -a $ARCH -o $CINNAMON_IMG -p "$CINNAMON_PKGS" ${REPO} $@
66+
./mklive.sh -a $ARCH -o $CINNAMON_IMG -p "$CINNAMON_PKGS" ${REPO} "$@"
6767
fi
6868
fi
6969

7070
if [ -z "$IMAGE" -o "$IMAGE" = gnome ]; then
7171
if [ ! -e $GNOME_IMG ]; then
72-
./mklive.sh -a $ARCH -o $GNOME_IMG -p "$GNOME_PKGS" ${REPO} $@
72+
./mklive.sh -a $ARCH -o $GNOME_IMG -p "$GNOME_PKGS" ${REPO} "$@"
7373
fi
7474
fi
7575

7676
if [ -z "$IMAGE" -o "$IMAGE" = lxde ]; then
7777
if [ ! -e $LXDE_IMG ]; then
78-
./mklive.sh -a $ARCH -o $LXDE_IMG -p "$LXDE_PKGS" ${REPO} $@
78+
./mklive.sh -a $ARCH -o $LXDE_IMG -p "$LXDE_PKGS" ${REPO} "$@"
7979
fi
8080
fi
8181
if [ -z "$IMAGE" -o "$IMAGE" = lxqt ]; then
8282
if [ ! -e $LXQT_IMG ]; then
83-
./mklive.sh -a $ARCH -o $LXQT_IMG -p "$LXQT_PKGS" ${REPO} $@
83+
./mklive.sh -a $ARCH -o $LXQT_IMG -p "$LXQT_PKGS" ${REPO} "$@"
8484
fi
8585
fi
8686
if [ "$IMAGE" = kde ]; then
8787
if [ ! -e $KDE_IMG ]; then
88-
./mklive.sh -a $ARCH -o $KDE_IMG -p "$KDE_PKGS" ${REPO} $@
88+
./mklive.sh -a $ARCH -o $KDE_IMG -p "$KDE_PKGS" ${REPO} "$@"
8989
fi
9090
fi

data/void-vpkgs.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ virtualpkg=cron-daemon:dcron
55
virtualpkg=editor:nvi
66
virtualpkg=man:openbsd-man
77
virtualpkg=ntp-daemon:openntpd
8-
virtualpkg=openssl:libressl-openssl
98
virtualpkg=shell:dash
109
virtualpkg=smtp-server:opensmtpd

dracut/vmklive/getty-serial.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3+
# ex: ts=8 sw=4 sts=4 et filetype=sh
4+
5+
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
6+
7+
CONSOLE=$(getarg console)
8+
case "$CONSOLE" in
9+
*ttyS0*)
10+
ln -s /etc/sv/agetty-ttyS0 ${NEWROOT}/etc/runit/runsvdir/default/
11+
;;
12+
*hvc0*)
13+
ln -s /etc/sv/agetty-hvc0 ${NEWROOT}/etc/runit/runsvdir/default/
14+
;;
15+
*hvsi0*)
16+
ln -s /etc/sv/agetty-hvsi0 ${NEWROOT}/etc/runit/runsvdir/default/
17+
;;
18+
esac

dracut/vmklive/module-setup.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ install() {
2525

2626
inst_hook pre-pivot 01 "$moddir/adduser.sh"
2727
inst_hook pre-pivot 02 "$moddir/display-manager-autologin.sh"
28+
inst_hook pre-pivot 02 "$moddir/getty-serial.sh"
2829
inst_hook pre-pivot 03 "$moddir/locale.sh"
2930
inst_hook pre-pivot 04 "$moddir/services.sh"
3031
}

dracut/vmklive/services.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ done
2222
for f in $SERVICEDIR/*; do
2323
_service=${f##*/}
2424
case "${_service}" in
25-
agetty-console|agetty-generic|agetty-serial|agetty-tty[SAU]*|sulogin|dhcpcd-*|iptables|ip6tables|wpa_supplicant|pulseaudio|lvmetad|dmeventd|mdadm) ;; # ignored
25+
agetty-console|agetty-generic|agetty-serial|agetty-tty[SAU]*|agetty-hv*|sulogin|dhcpcd-*|iptables|ip6tables|wpa_supplicant|pulseaudio|lvmetad|dmeventd|mdadm) ;; # ignored
2626
dhcpcd) [ -n "$dhcpcd" ] && ln -sf ${f##$NEWROOT} $NEWROOT/etc/runit/runsvdir/default/;;
2727
*) ln -sf ${f##$NEWROOT} $NEWROOT/etc/runit/runsvdir/default/;;
2828
esac

lib.sh.in

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,33 @@
66
readonly LIBTOOLS="cp echo cat printf which mountpoint mount umount modprobe"
77
readonly HOSTARCH=$(xbps-uhelper arch)
88

9+
is_target_native() {
10+
# Because checking whether the target is runnable is ugly, stuff
11+
# it into a single function. That makes it easy to check anywhere.
12+
local target_arch
13+
14+
target_arch="$1"
15+
# this will cover most
16+
if [ "${target_arch%-musl}" = "${HOSTARCH%-musl}" ]; then
17+
return 0
18+
fi
19+
20+
case "$HOSTARCH" in
21+
# ppc64le has no 32-bit variant, only runs its own stuff
22+
ppc64le*) return 1 ;;
23+
# x86_64 also runs i686
24+
x86_64*) test -z "${target_arch##*86*}" ;;
25+
# aarch64 also runs armv*
26+
aarch64*) test -z "${target_arch##armv*}" ;;
27+
# bigendian ppc64 also runs ppc
28+
ppc64*) test "${target_arch%-musl}" = "ppc" ;;
29+
# anything else is just their own
30+
*) return 1 ;;
31+
esac
32+
33+
return $?
34+
}
35+
936
info_msg() {
1037
# This function handles the printing that is bold within all
1138
# scripts. This is a convenience function so that the rather ugly
@@ -80,9 +107,7 @@ umount_pseudofs() {
80107

81108
run_cmd_target() {
82109
info_msg "Running $* for target $XBPS_TARGET_ARCH ..."
83-
if [ "$XBPS_TARGET_ARCH" = "${HOSTARCH}" ] ||
84-
[ -z "${XBPS_TARGET_ARCH##*86*}" ] &&
85-
[ -z "${HOSTARCH##*86*}" ] ; then
110+
if is_target_native "$XBPS_TARGET_ARCH"; then
86111
# This is being run on the same architecture as the host,
87112
# therefore we should set XBPS_ARCH.
88113
if ! eval XBPS_ARCH="$XBPS_TARGET_ARCH" "$@" ; then
@@ -270,6 +295,7 @@ set_target_arch_from_platform() {
270295
x86_64*) XBPS_TARGET_ARCH="x86_64";;
271296
GCP*) XBPS_TARGET_ARCH="x86_64";;
272297
pinebookpro*) XBPS_TARGET_ARCH="aarch64";;
298+
pinephone*) XBPS_TARGET_ARCH="aarch64";;
273299
*) die "$PROGNAME: Unable to compute target architecture from platform";;
274300
esac
275301

mkimage.sh.in

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ fi
143143

144144
# Be absolutely certain the platform is supported before continuing
145145
case "$PLATFORM" in
146-
bananapi|beaglebone|cubieboard2|cubietruck|odroid-c2|odroid-u2|rpi|rpi2|rpi3|GCP|pinebookpro|*-musl);;
146+
bananapi|beaglebone|cubieboard2|cubietruck|odroid-c2|odroid-u2|rpi|rpi2|rpi3|GCP|pinebookpro|pinephone|*-musl);;
147147
*) die "The $PLATFORM is not supported, exiting..."
148148
esac
149149

@@ -219,6 +219,7 @@ _EOF
219219
mount "${LOOPDEV}p1" "${ROOTFS}/boot"
220220
BOOT_UUID=$(blkid -o value -s UUID "${LOOPDEV}p1")
221221
ROOT_UUID=$(blkid -o value -s UUID "${LOOPDEV}p2")
222+
ROOT_PARTUUID=$(blkid -o value -s PARTUUID "${LOOPDEV}p2")
222223
;;
223224
esac
224225

@@ -296,6 +297,12 @@ pinebookpro*)
296297
run_cmd_chroot "${ROOTFS}" "xbps-reconfigure -f pinebookpro-kernel"
297298
cleanup_chroot
298299
;;
300+
pinephone*)
301+
sed -i "s/CMDLINE=\"\(.*\)\"\$/CMDLINE=\"\1 root=PARTUUID=${ROOT_PARTUUID}\"/" "${ROOTFS}/etc/default/pinephone-uboot-config"
302+
dd if="${ROOTFS}/boot/u-boot-sunxi-with-spl.bin" of="${LOOPDEV}" bs=1024 seek=8 conv=notrunc,fsync >/dev/null 2>&1
303+
run_cmd_chroot "${ROOTFS}" "xbps-reconfigure -f pinephone-kernel"
304+
cleanup_chroot
305+
;;
299306
GCP*)
300307
# Google Cloud Platform image configuration for Google Cloud
301308
# Engine. The steps below are built in reference to the

mkplatformfs.sh.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Usage: $PROGNAME [options] <platform> <base-tarball>
5151
Supported platforms: i686, x86_64, GCP, bananapi, beaglebone,
5252
cubieboard2, cubietruck, odroid-c2, odroid-u2,
5353
rpi, rpi2 (armv7), rpi3 (aarch64), ci20,
54-
pinebookpro
54+
pinebookpro, pinephone
5555
5656
Options
5757
-b <syspkg> Set an alternative base-system package (defaults to base-system)
@@ -125,6 +125,7 @@ case "$PLATFORM" in
125125
x86_64*) PKGS="$BASEPKG" ;;
126126
GCP*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;;
127127
pinebookpro*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;;
128+
pinephone*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;;
128129
*) die "$PROGNAME: invalid platform!";;
129130
esac
130131

mkrootfs.sh.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,9 @@ info_msg "Reconfiguring packages for ${XBPS_TARGET_ARCH} ..."
168168
# This step sets up enough of the base-files that the chroot will work
169169
# and they can be reconfigured natively. Without this step there
170170
# isn't enough configured for ld to work. This step runs as the host
171-
# architecture, but on x86 some special extra steps have to be taken
172-
# to make this work.
173-
if [ -z "${XBPS_TARGET_ARCH##*86*}" ] && [ -z "${HOSTARCH##*86*}" ] ; then
171+
# architecture, but we may need to set up XBPS_ARCH for the target
172+
# architecture (but only when compatible).
173+
if is_target_native "$XBPS_TARGET_ARCH"; then
174174
run_cmd_target "xbps-reconfigure --rootdir $ROOTFS base-files"
175175
else
176176
run_cmd "xbps-reconfigure --rootdir $ROOTFS base-files"

0 commit comments

Comments
 (0)