diff --git a/Makefile b/Makefile index e17e85e..649ecfd 100644 --- a/Makefile +++ b/Makefile @@ -3,10 +3,10 @@ SHELL=/bin/bash T_LIVE_ARCHS=i686 x86_64{,-musl} -T_PLATFORMS=rpi-{armv{6,7}l,aarch64}{,-musl} beaglebone{,-musl} cubieboard2{,-musl} odroid-c2{,-musl} GCP{,-musl} pinebookpro{,-musl} +T_PLATFORMS=rpi-{armv{6,7}l,aarch64}{,-musl} GCP{,-musl} pinebookpro{,-musl} T_ARCHS=i686 x86_64{,-musl} armv{6,7}l{,-musl} aarch64{,-musl} -T_SBC_IMGS=rpi-{armv{6,7}l,aarch64}{,-musl} beaglebone{,-musl} cubieboard2{,-musl} odroid-c2{,-musl} pinebookpro{,-musl} +T_SBC_IMGS=rpi-{armv{6,7}l,aarch64}{,-musl} pinebookpro{,-musl} T_CLOUD_IMGS=GCP{,-musl} T_PXE_ARCHS=x86_64{,-musl} diff --git a/lib.sh b/lib.sh index 899614c..5b9a721 100755 --- a/lib.sh +++ b/lib.sh @@ -288,15 +288,9 @@ set_target_arch_from_platform() { # the target architecture, but don't necessarily need to know it # internally (i.e. only run_cmd_chroot). case "$PLATFORM" in - bananapi*) XBPS_TARGET_ARCH="armv7l";; - beaglebone*) XBPS_TARGET_ARCH="armv7l";; - cubieboard2*|cubietruck*) XBPS_TARGET_ARCH="armv7l";; - odroid-u2*) XBPS_TARGET_ARCH="armv7l";; - odroid-c2*) XBPS_TARGET_ARCH="aarch64";; rpi-aarch64*) XBPS_TARGET_ARCH="aarch64";; rpi-armv7l*) XBPS_TARGET_ARCH="armv7l";; rpi-armv6l*) XBPS_TARGET_ARCH="armv6l";; - ci20*) XBPS_TARGET_ARCH="mipsel";; i686*) XBPS_TARGET_ARCH="i686";; x86_64*) XBPS_TARGET_ARCH="x86_64";; GCP*) XBPS_TARGET_ARCH="x86_64";; diff --git a/mkimage.sh b/mkimage.sh index a1565aa..bb784e1 100755 --- a/mkimage.sh +++ b/mkimage.sh @@ -117,7 +117,7 @@ PLATFORM="${PLATFORM%-PLATFORMFS*}" # Be absolutely certain the platform is supported before continuing case "$PLATFORM" in - bananapi|beaglebone|cubieboard2|cubietruck|odroid-c2|odroid-u2|rpi-armv6l|rpi-armv7l|rpi-aarch64|GCP|pinebookpro|pinephone|rock64|*-musl);; + rpi-armv6l|rpi-armv7l|rpi-aarch64|GCP|pinebookpro|pinephone|rock64|*-musl);; *) die "The $PLATFORM is not supported, exiting..." esac @@ -172,83 +172,55 @@ if [ "$BOOT_FSTYPE" = "vfat" ]; then _args="-I -F16" fi +# These platforms use a partition layout with a small boot +# partition (64M by default) and the rest of the space as the +# root filesystem. This is the generally preferred disk +# layout for new platforms. case "$PLATFORM" in - cubieboard2|cubietruck|ci20*|odroid-c2*) - # These platforms use a single partition for the entire filesystem. - sfdisk "${FILENAME}" <<_EOF -label: dos -2048,,L -_EOF - LOOPDEV=$(losetup --show --find --partscan "$FILENAME") - mkfs.${ROOT_FSTYPE} -O '^64bit,^extra_isize,^has_journal' "${LOOPDEV}p1" >/dev/null 2>&1 - mount "${LOOPDEV}p1" "$ROOTFS" - ROOT_UUID=$(blkid -o value -s UUID "${LOOPDEV}p1") - ;; - *) - # These platforms use a partition layout with a small boot - # partition (64M by default) and the rest of the space as the - # root filesystem. This is the generally preferred disk - # layout for new platforms. - case "$PLATFORM" in - pinebookpro*|rock64*) - # rk33xx devices use GPT and need more space reserved - sfdisk "$FILENAME" <<_EOF + pinebookpro*|rock64*) + # rk33xx devices use GPT and need more space reserved + sfdisk "$FILENAME" <<_EOF label: gpt unit: sectors first-lba: 32768 name=BootFS, size=${BOOT_FSSIZE}, type=L, bootable, attrs="LegacyBIOSBootable" name=RootFS, type=L _EOF - ;; - *) - # The rest use MBR and need less space reserved - sfdisk "${FILENAME}" <<_EOF + ;; + *) + # The rest use MBR and need less space reserved + sfdisk "${FILENAME}" <<_EOF label: dos 2048,${BOOT_FSSIZE},b,* ,+,L _EOF - ;; - esac - LOOPDEV=$(losetup --show --find --partscan "$FILENAME") - # Normally we need to quote to prevent argument splitting, but - # we explicitly want argument splitting here. - # shellcheck disable=SC2086 - mkfs.${BOOT_FSTYPE} $_args "${LOOPDEV}p1" >/dev/null - case "$ROOT_FSTYPE" in - # Because the images produced by this script are generally - # either on single board computers using flash memory or - # in cloud environments that already provide disk - # durability, we shut off the journal for ext filesystems. - # For flash memory this greatly extends the life of the - # memory and for cloud images this lowers the overhead by - # a small amount. - ext[34]) disable_journal="-O ^has_journal";; - esac - mkfs.${ROOT_FSTYPE} ${disable_journal:+"$disable_journal"} "${LOOPDEV}p2" >/dev/null 2>&1 - mount "${LOOPDEV}p2" "$ROOTFS" - mkdir -p "${ROOTFS}/boot" - mount "${LOOPDEV}p1" "${ROOTFS}/boot" - BOOT_UUID=$(blkid -o value -s UUID "${LOOPDEV}p1") - ROOT_UUID=$(blkid -o value -s UUID "${LOOPDEV}p2") - ROOT_PARTUUID=$(blkid -o value -s PARTUUID "${LOOPDEV}p2") - ;; + ;; esac +LOOPDEV=$(losetup --show --find --partscan "$FILENAME") +# Normally we need to quote to prevent argument splitting, but +# we explicitly want argument splitting here. +# shellcheck disable=SC2086 +mkfs.${BOOT_FSTYPE} $_args "${LOOPDEV}p1" >/dev/null +case "$ROOT_FSTYPE" in + # Because the images produced by this script are generally + # either on single board computers using flash memory or + # in cloud environments that already provide disk + # durability, we shut off the journal for ext filesystems. + # For flash memory this greatly extends the life of the + # memory and for cloud images this lowers the overhead by + # a small amount. + ext[34]) disable_journal="-O ^has_journal";; +esac +mkfs.${ROOT_FSTYPE} ${disable_journal:+"$disable_journal"} "${LOOPDEV}p2" >/dev/null 2>&1 +mount "${LOOPDEV}p2" "$ROOTFS" +mkdir -p "${ROOTFS}/boot" +mount "${LOOPDEV}p1" "${ROOTFS}/boot" +BOOT_UUID=$(blkid -o value -s UUID "${LOOPDEV}p1") +ROOT_UUID=$(blkid -o value -s UUID "${LOOPDEV}p2") +ROOT_PARTUUID=$(blkid -o value -s PARTUUID "${LOOPDEV}p2") # This step unpacks the platformfs tarball made by mkplatformfs.sh. info_msg "Unpacking rootfs tarball ..." -if [ "$PLATFORM" = "beaglebone" ]; then - # The beaglebone requires some special extra handling. The MLO - # program is a special first stage boot loader that brings up - # enough of the processor to then load u-boot which loads the rest - # of the system. The noauto option also prevents /boot from being - # mounted during system startup. - fstab_args=",noauto" - tar xfp "$ROOTFS_TARBALL" -C "$ROOTFS" ./boot/MLO - tar xfp "$ROOTFS_TARBALL" -C "$ROOTFS" ./boot/u-boot.img - touch "$ROOTFS/boot/uEnv.txt" - umount "$ROOTFS/boot" -fi - # In the general case, its enough to just unpack the ROOTFS_TARBALL # onto the ROOTFS. This will get a system that is ready to boot, save # for the bootloader which is handled later. @@ -284,24 +256,6 @@ sed -i "${ROOTFS}/etc/ssh/sshd_config" -e 's|^#\(PermitRootLogin\) .*|\1 yes|g' # can be found. info_msg "Configuring image for platform $PLATFORM" case "$PLATFORM" in -bananapi*|cubieboard2*|cubietruck*) - dd if="${ROOTFS}/boot/u-boot-sunxi-with-spl.bin" of="${LOOPDEV}" bs=1024 seek=8 >/dev/null 2>&1 - ;; -odroid-c2*) - dd if="${ROOTFS}/boot/bl1.bin.hardkernel" of="${LOOPDEV}" bs=1 count=442 >/dev/null 2>&1 - dd if="${ROOTFS}/boot/bl1.bin.hardkernel" of="${LOOPDEV}" bs=512 skip=1 seek=1 >/dev/null 2>&1 - dd if="${ROOTFS}/boot/u-boot.bin" of="${LOOPDEV}" bs=512 seek=97 >/dev/null 2>&1 - ;; -odroid-u2*) - dd if="${ROOTFS}/boot/E4412_S.bl1.HardKernel.bin" of="${LOOPDEV}" seek=1 >/dev/null 2>&1 - dd if="${ROOTFS}/boot/bl2.signed.bin" of="${LOOPDEV}" seek=31 >/dev/null 2>&1 - dd if="${ROOTFS}/boot/u-boot.bin" of="${LOOPDEV}" seek=63 >/dev/null 2>&1 - dd if="${ROOTFS}/boot/E4412_S.tzsw.signed.bin" of="${LOOPDEV}" seek=2111 >/dev/null 2>&1 - ;; -ci20*) - dd if="${ROOTFS}/boot/u-boot-spl.bin" of="${LOOPDEV}" obs=512 seek=1 >/dev/null 2>&1 - dd if="${ROOTFS}/boot/u-boot.img" of="${LOOPDEV}" obs=1K seek=14 >/dev/null 2>&1 - ;; rock64*) rk33xx_flash_uboot "${ROOTFS}/usr/lib/rock64-uboot" "$LOOPDEV" # populate the extlinux.conf file diff --git a/mkplatformfs.sh b/mkplatformfs.sh index 397085e..6e14299 100755 --- a/mkplatformfs.sh +++ b/mkplatformfs.sh @@ -48,9 +48,8 @@ usage() { cat <<_EOF Usage: $PROGNAME [options] -Supported platforms: i686, x86_64, GCP, bananapi, beaglebone, - cubieboard2, cubietruck, odroid-c2, odroid-u2, - rpi-armv6l, rpi-armv7l, rpi-aarch64, ci20, +Supported platforms: i686, x86_64, GCP, + rpi-armv6l, rpi-armv7l, rpi-aarch64, pinebookpro, pinephone, rock64 Options @@ -112,13 +111,7 @@ check_tools # noarch though, so we strip off the -musl extention if it was # provided. case "$PLATFORM" in - bananapi*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;; - beaglebone*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;; - cubieboard2*|cubietruck*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;; - odroid-u2*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;; - odroid-c2*) PKGS="$BASEPKG ${PLATFORM%-musl}-base" ;; rpi*) PKGS="$BASEPKG rpi-base" ;; - ci20*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;; i686*) PKGS="$BASEPKG" ;; x86_64*) PKGS="$BASEPKG" ;; GCP*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;;