diff options
Diffstat (limited to 'adelie-build-cd')
-rwxr-xr-x | adelie-build-cd | 93 |
1 files changed, 53 insertions, 40 deletions
diff --git a/adelie-build-cd b/adelie-build-cd index aa2464a..465bd02 100755 --- a/adelie-build-cd +++ b/adelie-build-cd @@ -33,37 +33,37 @@ fatal() { ensure_commands() { if ! type apk>/dev/null 2>/dev/null; then - fatal - printf 'You must have apk installed. On Gentoo, see sys-devel/apk-tools.\n' - exit -1 + fatal + printf 'You must have apk installed. On Gentoo, see sys-devel/apk-tools.\n' + exit -1 fi if ! type cpio>/dev/null 2>/dev/null; then - fatal - printf 'You must have cpio installed. On Gentoo, see app-arch/cpio.\n' - exit -1 + fatal + printf 'You must have cpio installed. On Gentoo, see app-arch/cpio.\n' + exit -1 fi if ! type mksquashfs>/dev/null 2>/dev/null; then - fatal - printf 'You must have mksquashfs installed. On Gentoo, see sys-fs/squashfs-tools.\n' - exit -1 + fatal + printf 'You must have mksquashfs installed. On Gentoo, see sys-fs/squashfs-tools.\n' + exit -1 fi if ! type xorriso>/dev/null 2>/dev/null; then - fatal - printf 'You must have xorriso installed:\n\n' + fatal + printf 'You must have xorriso installed:\n\n' printf '* cdrkit (Alpine, Gentoo) will not generate a usable PPC ISO.\n' printf '* wodim (Debian) will not generate a usable PPC64 ISO.\n' printf '* cdrtools (Schily) will overrun the PPC64 ISO and write junk to grubcore.img.\n' printf '\nSorry, but xorriso really is required.\n' - exit -1 + exit -1 fi } usage() { - printf 'usage: %s [-a ARCH] [-f|--full] [-p|--phase PHASE] [-v VERSION] [--help]\n\n' $PROGNAME + printf 'usage: %s [-a ARCH] [-f|--full] [-k|--kind KIND] [-p|--phase PHASE] [-v VERSION] [--help]\n\n' $PROGNAME printf 'Create an Adélie Linux CD image (.ISO) using the specified parameters.\n\n' printf 'Default ARCH: %s\n' $def_arch printf 'Default VERSION: %s\n' $def_ver @@ -73,38 +73,43 @@ usage() { while [ -n "$1" ]; do case $1 in - -a | --arch) - shift - declare -r MY_ARCH=$1 - ;; - -h | --help) - usage - exit - ;; - -f | --full) - declare -r DO_FULL=full - ;; - -p | --phase) - shift - declare -r MY_PHASE=$1 - ;; - -s | --sign) - declare -r SIGN=yes - ;; - -v | --version) - shift - declare -r MY_VER=$1 - ;; - *) - usage >&2 - exit -1 - ;; + -a | --arch) + shift + declare -r MY_ARCH=$1 + ;; + -h | --help) + usage + exit + ;; + -f | --full) + declare -r DO_FULL=full + ;; + -k | --kind) + shift + declare -r MY_KIND=$1 + ;; + -p | --phase) + shift + declare -r MY_PHASE=$1 + ;; + -s | --sign) + declare -r SIGN=yes + ;; + -v | --version) + shift + declare -r MY_VER=$1 + ;; + *) + usage >&2 + exit -1 + ;; esac shift done set -a declare -r ARCH=${MY_ARCH:-$def_arch} +declare -r KIND=${MY_KIND:-live} declare -r LDARCH=${LDARCH:-$ARCH} declare -r PHASE=${MY_PHASE:-all} declare -r VERSION=${MY_VER:-$def_ver} @@ -140,6 +145,7 @@ install_pkgs() { declare -r PACKAGES=$(cat packages 2>/dev/null || fatal 'No core packages specified') declare -r ARCH_PKGS=$(cat packages-$ARCH 2>/dev/null || echo '') + declare -r KIND_PKGS=$(cat packages-$KIND 2>/dev/null || echo '') mkdir -p squashroot-$ARCH/etc/apk/keys cp 'packages@adelielinux.org.pub' squashroot-$ARCH/etc/apk/keys/ @@ -151,7 +157,7 @@ install_pkgs() { apk --arch $ARCH \ -X "$URL/system/$EXTRA_MIRROR" \ -X "$URL/user/$EXTRA_MIRROR" \ - -U --root squashroot-$ARCH --initdb add $PACKAGES $ARCH_PKGS + -U --root squashroot-$ARCH --initdb add $PACKAGES $ARCH_PKGS $KIND_PKGS } make_structure() { @@ -177,6 +183,13 @@ make_structure() { squashroot-$ARCH/etc/runlevels/boot/$bootservice done + if [ -f services-$KIND ]; then + for service in $(cat services-$KIND 2>/dev/null || echo ''); do + ln -s /etc/init.d/$service \ + sqaushroot-$ARCH/etc/runlevels/default/$service + done + fi + cat >squashroot-$ARCH/etc/fstab <<- FSTAB # Welcome to Adélie Linux. # This fstab(5) is for the live media only. Do not edit or use for your installation. |