diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2017-01-29 14:01:52 -0600 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2017-01-29 14:02:14 -0600 |
commit | 96a0e248ba150a60703ca8dc2c411f249b1f867b (patch) | |
tree | 233fc3db059d8d513ec8a068396ea257aeaad374 | |
parent | 2a7982735068e10a26bc1b0638b5f6c5b674eff2 (diff) | |
download | image-96a0e248ba150a60703ca8dc2c411f249b1f867b.tar.gz image-96a0e248ba150a60703ca8dc2c411f249b1f867b.tar.bz2 image-96a0e248ba150a60703ca8dc2c411f249b1f867b.tar.xz image-96a0e248ba150a60703ca8dc2c411f249b1f867b.zip |
Significantly refactor build-cd script, and add a man page woo
-rwxr-xr-x | adelie-build-cd | 350 | ||||
-rw-r--r-- | adelie-build-cd.8 | 161 | ||||
-rwxr-xr-x | build-cd | 315 | ||||
-rw-r--r-- | iso-params-ppc | 1 | ||||
-rw-r--r-- | mapping-ppc | 4 | ||||
-rw-r--r-- | packages-ppc | 3 | ||||
-rw-r--r-- | packages-x86 | 1 | ||||
-rw-r--r-- | packages-x86_64 | 1 | ||||
-rw-r--r-- | post-ppc.sh | 4 |
9 files changed, 525 insertions, 315 deletions
diff --git a/adelie-build-cd b/adelie-build-cd new file mode 100755 index 0000000..0a7ee3d --- /dev/null +++ b/adelie-build-cd @@ -0,0 +1,350 @@ +#!/bin/sh + +def_arch=$(uname -m) +declare -r PROGNAME=$(basename $0) + + +warn() { + printf '>>> ' + printf '\033[01;33mWARNING\033[00;39m ' + printf '>>> ' + printf '\033[01;33mWARNING\033[00;39m ' + printf '>>> ' + printf '\033[01;33mWARNING\033[00;39m ' + printf '>>> ' + printf '\033[01;33mWARNING\033[00;39m ' + printf '>>>\n' +} + + +fatal() { + printf '>>> ' + printf '\033[01;31mERROR\033[00;39m ' + printf '>>> ' + printf '\033[01;31mERROR\033[00;39m ' + printf '>>> ' + printf '\033[01;31mERROR\033[00;39m ' + printf '>>> ' + printf '\033[01;31mERROR\033[00;39m ' + printf '>>>\n' +} + + +ensure_commands() { + if ! type apk>/dev/null; then + fatal + printf 'You must have apk installed. On Gentoo, see sys-devel/apk-tools.\n' + exit -1 + fi + + if ! type cpio>/dev/null; then + fatal + printf 'You must have cpio installed. On Gentoo, see app-arch/cpio.\n' + exit -1 + fi + + if ! type mksquashfs>/dev/null; then + fatal + printf 'You must have mksquashfs installed. On Gentoo, see sys-fs/squashfs-tools.\n' + exit -1 + fi + + if ! type mkisofs>/dev/null; then + fatal + printf 'You must have mkisofs installed. Try cdrtools or cdrkit.\n' + exit -1 + fi +} + + +usage() { + printf 'usage: %s [-a ARCH] [-f|--full] [-p|--phase PHASE] [--help]\n\n' $PROGNAME + printf 'Create an Adélie Linux CD image (.ISO) using the specified parameters.\n' + printf 'Default ARCH: %s\n' $def_arch + printf 'Valid phases: clean install initrd iso all\n' +} + + +while [ -n "$1" ]; do + case $1 in + -a | --arch) + shift + declare -r MY_ARCH=$1 + ;; + -h | --help) + usage + exit + ;; + -f | --full) + shift + declare -r DO_FULL=full + ;; + -p | --phase) + shift + declare -r PHASE=$1 + ;; + *) + usage >&2 + exit -1 + ;; + esac + shift +done + +set -a +declare -r ARCH=${MY_ARCH:-$def_arch} +declare -r LDARCH=${LDARCH:-$ARCH} +declare -r PHASE=${PHASE:-all} +set +a + +ensure_commands + +header() { + printf '\033[01;32m * \033[37m%s\033[00;39m\n' "$1" +} + +header 'Adélie Linux CD Creation Tool' +printf '\n' + +clean_dirs() { + warn + printf 'This will erase all files at the directories %s/cdroot-%s\n' `pwd` $ARCH + printf '%s/initrd-%s and %s/squashroot-%s.\n\n' `pwd` $ARCH `pwd` $ARCH + printf 'When you are ready, press RETURN. To cancel, press Ctrl-C.\n' + read + + rm -rf cdroot-$ARCH + rm -rf initrd-$ARCH + rm -rf squashroot-$ARCH + mkdir cdroot-$ARCH + mkdir initrd-$ARCH + mkdir squashroot-$ARCH +} + +install_pkgs() { + header "Installing base system to squash root..." + + declare -r PACKAGES=" + shadow \ + libffi \ + adelie-base \ + bash \ + openrc openrc-openrc \ + hwids eudev udev-init-scripts-openrc \ + parted \ + lvm2-openrc \ + easy-kernel easy-kernel-modules easy-kernel-firmware genkernel \ + dhcpcd net-tools bind-tools s6-dns \ + ca-certificates \ + rfkill wireless-tools wpa_supplicant \ + pciutils libusb1 usbutils \ + hdparm \ + less \ + bzip2 \ + netifrc netifrc-doc netifrc-openrc \ + diskdev_cmds hfsutils mtools + dropbear dropbear-openrc openssh openssh-openrc + " + + declare -r ARCH_PKGS=$(cat packages-$ARCH 2>/dev/null || echo '') + + mkdir -p squashroot-$ARCH/etc/apk/keys + cp 'packages@adelielinux.org.pub' squashroot-$ARCH/etc/apk/keys/ + apk --arch $ARCH -X "https://distfiles.adelielinux.org/adelie/1.0-alpha/$EXTRA_MIRROR" -U --root squashroot-$ARCH --initdb add $PACKAGES $ARCH_PKGS +} + +make_structure() { + mkdir -p squashroot-$ARCH/home/live + mkdir squashroot-$ARCH/target + mkdir -p squashroot-$ARCH/media/live + ln -s /bin/bash squashroot-$ARCH/bin/sh + + echo 'hostname="adelie"' > squashroot-$ARCH/etc/conf.d/hostname + echo 'mtab_is_file=no' > squashroot-$ARCH/etc/conf.d/mtab + + cp -RPp squashroot-$ARCH/usr/share/openrc/runlevels squashroot-$ARCH/etc/runlevels + ln -s /etc/init.d/udev squashroot-$ARCH/etc/runlevels/sysinit/udev + ln -s /etc/init.d/udev-trigger squashroot-$ARCH/etc/runlevels/sysinit/udev-trigger + ln -s /etc/init.d/lvmetad squashroot-$ARCH/etc/runlevels/sysinit/lvmetad + + 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. + + tmpfs /tmp tmpfs defaults 0 1 + tmpfs /var/log tmpfs size=8m 0 1 + tmpfs /root tmpfs size=16m 0 1 + tmpfs /home/live tmpfs size=16m 0 1 + proc /proc proc defaults 0 1 + FSTAB + + cat >squashroot-$ARCH/etc/passwd <<- PASSWD + root:x:0:0:Charlie Root:/root:/bin/bash + man:x:13:15:man-db:/usr/share/man:/sbin/nologin + sshd:x:22:22:SSH daemon:/var/empty:/sbin/nologin + at:x:25:25:at:/var/spool/at/atjobs:/sbin/nologin + fcron:x:101:206:fcron:/dev/null:/sbin/nologin + messagebus:x:103:203:DBus unprivileged user:/dev/null:/sbin/nologin + polkit:x:104:202:PolicyKit unprivileged user:/dev/null:/sbin/nologin + rtkit:x:105:200:RTKit unprivileged user:/dev/null:/sbin/nologin + postfix:x:207:207:postfix:/var/spool/postfix:/sbin/nologin + live:x:1000:1000:Live User:/home/live:/bin/bash + PASSWD + + cat >squashroot-$ARCH/etc/group <<- GROUP + root:x:0: + tty:x:5: + wheel:x:10:live + mail:x:12:postfix + uucp:x:14: + cron:x:16: + audio:x:18: + sshd:x:22: + at:x:25: + rtkit:x:200: + plugdev:x:201: + polkitd:x:202: + messagebus:x:203: + input:x:205: + fcron:x:206: + postfix:x:207: + postdrop:x:208: + postmaster:x:249: + utmp:x:406: + live:x:1000: + GROUP + + cat >squashroot-$ARCH/etc/shadow <<- SHADOW + root:::::::: + man:::::::: + sshd:::::::: + at:::::::: + fcron:::::::: + messagebus:::::::: + polkit:::::::: + rtkit:::::::: + postfix:::::::: + live:::::::: + SHADOW + + cat >squashroot-$ARCH/etc/shells <<- SHELLS + /bin/bash + /bin/zsh + SHELLS + + cat >squashroot-$ARCH/etc/resolv.conf <<- RESOLVE + nameserver 84.200.69.80 + nameserver 2001:1608:10:25::1c04:b12f + RESOLVE + + cat >squashroot-$ARCH/etc/apk/repositories <<-REPOS + https://distfiles.adelielinux.org/adelie/1.0-alpha/$EXTRA_MIRROR + REPOS + + cat >squashroot-$ARCH/etc/issue <<-ISSUE + Welcome to Adélie Linux! + You may log in as 'root' to install, or 'live' to play around. + + Have fun. + + ISSUE + + chmod 600 squashroot-$ARCH/etc/shadow + + if test -n "${DO_FULL+full}"; then + declare -r PACKAGES_DIR=squashroot-$ARCH/packages/$ARCH + mkdir -p $PACKAGES_DIR + apk --arch $ARCH --root squashroot-$ARCH fetch -o $PACKAGES_DIR $(apk --root squashroot-$ARCH info) + if test -n "${SIGNING_KEY+use_key}"; then + apk index -o .tmp.APKINDEX.unsigned.tar.gz $PACKAGES_DIR/*.apk + openssl dgst -sha256 -sign $SIGNING_KEY -out .SIGN.RSA.packages\@adelielinux.org.pub .tmp.APKINDEX.unsigned.tar.gz + tar cf .tmp.signature.tar .SIGN.RSA.packages\@adelielinux.org.pub + cat .tmp.signature.tar | abuild-tar --cut | gzip -9 > .tmp.signature.tar.gz + cat .tmp.signature.tar.gz .tmp.APKINDEX.unsigned.tar.gz > .tmp.APKINDEX.tar.gz + rm .tmp.APKINDEX.unsigned.tar.gz .tmp.signature.tar.gz .tmp.signature.tar .SIGN.RSA.packages\@adelielinux.org.pub + mv .tmp.APKINDEX.tar.gz $PACKAGES_DIR/APKINDEX.tar.gz + fi + fi + + cp AdelieTux.icns cdroot-$ARCH/.VolumeIcon.icns +} + +squash_it() { + header 'Creating compressed file system image...' + + mksquashfs squashroot-$ARCH cdroot-$ARCH/adelie.squashfs +} + +make_initrd() { + header 'Creating initrd structure...' + + # mount points + mkdir initrd-$ARCH/dev + mkdir initrd-$ARCH/media + mkdir initrd-$ARCH/newroot + mkdir initrd-$ARCH/proc + mkdir initrd-$ARCH/sys + + # manual /dev nodes for initial udev startup + mknod -m 600 initrd-$ARCH/dev/console c 5 1 + mknod -m 666 initrd-$ARCH/dev/null c 1 3 + mknod -m 666 initrd-$ARCH/dev/ptmx c 5 2 + mknod -m 666 initrd-$ARCH/dev/random c 1 8 + mknod -m 666 initrd-$ARCH/dev/tty c 5 0 + mknod -m 620 initrd-$ARCH/dev/tty1 c 4 1 + mknod -m 666 initrd-$ARCH/dev/urandom c 1 9 + mknod -m 666 initrd-$ARCH/dev/zero c 1 5 + + # base + mkdir initrd-$ARCH/lib + cp squashroot-$ARCH/usr/lib/libc.so initrd-$ARCH/lib/ld-musl-$LDARCH.so.1 + cp squashroot-$ARCH/lib/libblkid.so.1 initrd-$ARCH/lib/ + cp squashroot-$ARCH/lib/libuuid.so.1 initrd-$ARCH/lib/ + + # udev + mkdir -p initrd-$ARCH/etc/udev + mkdir initrd-$ARCH/run + mkdir initrd-$ARCH/sbin + cp squashroot-$ARCH/bin/udevadm initrd-$ARCH/sbin/ + cp squashroot-$ARCH/sbin/udevd initrd-$ARCH/sbin/ + cp squashroot-$ARCH/lib/libkmod.so.2 initrd-$ARCH/lib/ + cp squashroot-$ARCH/lib/libudev.so.1 initrd-$ARCH/lib/ + cp squashroot-$ARCH/etc/udev/hwdb.bin initrd-$ARCH/etc/udev/ + + # init + cp cdinit-$ARCH initrd-$ARCH/init + + header 'Compressing initrd...' + + pushd initrd-$ARCH + find . | cpio -H newc -o > ../cdroot-$ARCH/initrd + popd + gzip -9 cdroot-$ARCH/initrd + mv cdroot-$ARCH/initrd.gz cdroot-$ARCH/initrd +} + +prepare_cdroot() { + header 'Adding kernel...' + + cp squashroot-$ARCH/boot/vmlinu* cdroot-$ARCH/bzImage + + if test -f post-$ARCH.sh; then + header 'Running architecture-specific scripts...' + sh post-$ARCH.sh + fi +} + +create_iso() { + header 'Creating the CD...' + + declare -r CD_PARAMS=$(cat iso-params-$ARCH) + mkisofs -o adelie-${DO_FULL:-live}-$ARCH-1.0-ALPHA2-$(date +%Y%m%d).iso -joliet -rational-rock -V "Adelie 1.0a2 $ARCH" ${CD_PARAMS} cdroot-$ARCH +} + +#clean_dirs +#install_pkgs +#make_structure +#squash_it +#make_initrd +prepare_cdroot +create_iso diff --git a/adelie-build-cd.8 b/adelie-build-cd.8 new file mode 100644 index 0000000..a56d019 --- /dev/null +++ b/adelie-build-cd.8 @@ -0,0 +1,161 @@ +.Dd January 29, 2017 +.Dt ADELIE-BUILD-CD 8 SMM +.Os "Adélie Linux" + + +.Sh NAME +.Nm adelie-build-cd +.Nd create an Adélie Linux live CD image or install media + + +.Sh SYNOPSIS +.Nm +.Op Fl a Ar ARCH +.Op Fl f +.Op Fl p Ar PHASE + + +.Sh DESCRIPTION +.Nm +creates a live CD image or installer CD image for Adélie Linux using +.Xr apk 8 +and +.Xr mkisofs 8 . + +.Bl -tag -width "-p PHASE" -offset indent -compact +.It Fl a Ar ARCH +You may specify any architecture available in the Adélie repository for +.Ar ARCH ; +however, some architectures may require you to have additional utilities +present on your system to be made bootable. Specifically, x86 and x86_64 +require +.Xr syslinux 1 +to be installed. This defaults to the currently running system's architecture +as reported by +.Xr uname 1 . +.It Fl f +Specifies that a full installation image should be created, including a +.Pa packages/ +directory containing .apk files that can be used for an offline install. If +this flag is not specified, a live image will be created instead. +.It Fl p Ar PHASE +Specifies the phase of image creation to make as specified in the +.Sy Phases +section. +.El + + +.Ss Phases + +The +.Nm +utility defines the following phases for +.Fl p , +which can be run independently, or can be run in order by specifying the special +.Sy all +phase. + +.Bl -tag -width "install" -offset indent -compact +.It clean +Erase all temporary files. Typically required for predictable build results. +.It install +Install packages to the squash root. If +.Fl f +is specified, additionally create the package root and copy .apk files to it. +.It initrd +Generate the initrd contents in the initrd root, and create the initrd file +from it. +.It iso +Run +.Xr mksquashfs 1 +on the squash root, copy the kernel to the CD root, run any +architecture-specific scripts necessary to make the CD bootable, and then run +.Xr mkisofs 8 +to create the .ISO file. +.It all +Run all of the above phases in the above order. This is the default if +.Fl p +is not specified. +.El + + +.Sh ENVIRONMENT + +.Bl -tag -width "EXTRA_MIRROR" -offset indent -compact +.It Ev Sy LDARCH +If the musl ld library file is different from the apk arch (such as ppc vs +ld-musl-powerpc.so.1), you may specify the name of the ld architecture as +.Ev LDARCH . +.It Ev Sy EXTRA_MIRROR +For architectures that have subarchitectures (such as x86 with i486 and i525), +you may specify the extra mirror directory to use as +.Ev EXTRA_MIRROR . +.It Ev Sy SIGNING_KEY +If you specify +.Fl f +you may sign the created package index by pointing to your private key in +.Ev SIGNING_KEY . +.El + + +.Sh FILES + +.Bl -ohang -width "iso-params-$ARCH" -offset indent -compact +.It Pa iso-params-$ARCH +A list of additional parameters to provide to +.Xr mkisofs 8 +when generating the ISO image for the specified architecture. This is used to +specify the correct layout for bootable discs on that architecture. +.Pp +.It Pa packages-$ARCH +A list of architecture-specific packages to install on the created media, in +addition to the default packages installed on every architecture. This is +typically used for bootloaders and firmware manipulation packages. It can also +be used to provide further debugging tools (such as +.Xr gdb 1 +or +.Xr strace 1 +and so on) on architectures that are still experimental. +.Pp +.It Pa post-$ARCH.sh +If this file exists and is executable, it will be run just before +.Xr mkisofs 8 +to do any final preparation to the disc root before creating the image. +.El + + +.Sh EXAMPLES + +adelie-build-cd -a x86_64 +.Pp +LDARCH=powerpc adelie-build-cd -a ppc +.Pp +EXTRA_MIRROR=i525 LDARCH=i386 SIGNING_KEY=/etc/portage/adelie.key ./build-cd -a x86 + + +.Sh SEE ALSO + +.Xr mksquashfs 1 , +.Xr apk 8 , +.Xr mkisofs 8 . + + +.Sh HISTORY + +The +.Nm +command first appeared during the 1.0 ALPHA1 phase. It is written in portable +.St -p1003.2a-92 +shell language. Any deviation from the standard should be considered a bug. + + +.Sh AUTHORS + +.An A. Wilcox +.Aq awilfox@adelielinux.org + + +.Sh BUGS + +There is no way to specify packages that should only be included on a full disc +or live disc. All disc types have the same packages installed. diff --git a/build-cd b/build-cd deleted file mode 100755 index b2e6e5f..0000000 --- a/build-cd +++ /dev/null @@ -1,315 +0,0 @@ -#!/bin/sh - -def_arch=$(uname -m) -declare -r PROGNAME=$(basename $0) - - -warn() { - printf '>>> ' - printf '\033[01;33mWARNING\033[00;39m ' - printf '>>> ' - printf '\033[01;33mWARNING\033[00;39m ' - printf '>>> ' - printf '\033[01;33mWARNING\033[00;39m ' - printf '>>> ' - printf '\033[01;33mWARNING\033[00;39m ' - printf '>>>\n' -} - - -fatal() { - printf '>>> ' - printf '\033[01;31mERROR\033[00;39m ' - printf '>>> ' - printf '\033[01;31mERROR\033[00;39m ' - printf '>>> ' - printf '\033[01;31mERROR\033[00;39m ' - printf '>>> ' - printf '\033[01;31mERROR\033[00;39m ' - printf '>>>\n' -} - - -ensure_commands() { - if ! type apk>/dev/null; then - fatal - printf 'You must have apk installed. On Gentoo, see sys-devel/apk-tools.\n' - exit -1 - fi - - if ! type cpio>/dev/null; then - fatal - printf 'You must have cpio installed. On Gentoo, see app-arch/cpio.\n' - exit -1 - fi - - if ! type mksquashfs>/dev/null; then - fatal - printf 'You must have mksquashfs installed. On Gentoo, see sys-fs/squashfs-tools.\n' - exit -1 - fi - - if ! type mkisofs>/dev/null; then - fatal - printf 'You must have mkisofs installed. Try cdrtools or cdrkit.\n' - exit -1 - fi -} - - -usage() { - printf 'usage: %s [-a ARCH] [-f|--full] [--help]\n\n' $PROGNAME - printf 'Create an Adélie Linux CD image (.ISO) using the specified parameters.\n' - printf 'Default ARCH: %s\n' $def_arch -} - - -while [ -n "$1" ]; do - case $1 in - -a | --arch) - shift - declare -r MY_ARCH=$1 - ;; - -h | --help) - usage - exit - ;; - -f | --full) - shift - declare -r DO_FULL=full - ;; - *) - usage >&2 - exit -1 - ;; - esac - shift -done - -set -a -declare -r ARCH=${MY_ARCH:-$def_arch} -declare -r LDARCH=${LDARCH:-$ARCH} -set +a - -ensure_commands - -warn -printf 'This will erase all files at the directories %s/cdroot-%s\n' `pwd` $ARCH -printf '%s/initrd-%s and %s/squashroot-%s.\n\n' `pwd` $ARCH `pwd` $ARCH -printf 'When you are ready, press RETURN. To cancel, press Ctrl-C.\n' -read - -printf '\033[01;32m * \033[37mAdélie Linux CD Creation Tool\033[00;39m\n\n' - -rm -rf cdroot-$ARCH -rm -rf initrd-$ARCH -rm -rf squashroot-$ARCH -mkdir cdroot-$ARCH -mkdir initrd-$ARCH -mkdir squashroot-$ARCH - -declare -r PACKAGES=" - shadow \ - libffi \ - adelie-base \ - bash \ - openrc openrc-openrc \ - hwids eudev udev-init-scripts-openrc \ - parted \ - lvm2-openrc \ - easy-kernel easy-kernel-modules easy-kernel-firmware genkernel \ - dhcpcd net-tools \ - ca-certificates \ - rfkill wireless-tools wpa_supplicant \ - pciutils libusb1 usbutils \ - hdparm \ - less \ - bzip2 \ - netifrc netifrc-doc netifrc-openrc \ - diskdev_cmds exfat-utils hfsutils mtools -" - -declare -r ARCH_PKGS=$(cat packages-$ARCH 2>/dev/null || echo '') - -printf '\033[01;32m * \033[37mInstalling base system to squash root...\033[00;39m\n' - -mkdir -p squashroot-$ARCH/etc/apk/keys -cp 'packages@adelielinux.org.pub' squashroot-$ARCH/etc/apk/keys/ -apk --arch $ARCH -X "https://distfiles.adelielinux.org/adelie/1.0-alpha/$EXTRA_MIRROR" -U --root squashroot-$ARCH --initdb add $PACKAGES $ARCH_PKGS -mkdir -p squashroot-$ARCH/home/live -mkdir squashroot-$ARCH/target -mkdir -p squashroot-$ARCH/media/live -ln -s /bin/bash squashroot-$ARCH/bin/sh - -echo 'hostname="adelie"' > squashroot-$ARCH/etc/conf.d/hostname -echo 'mtab_is_file=no' > squashroot-$ARCH/etc/conf.d/mtab - -cp -RPp squashroot-$ARCH/usr/share/openrc/runlevels squashroot-$ARCH/etc/runlevels -ln -s /etc/init.d/udev squashroot-$ARCH/etc/runlevels/sysinit/udev -ln -s /etc/init.d/udev-trigger squashroot-$ARCH/etc/runlevels/sysinit/udev-trigger -ln -s /etc/init.d/lvmetad squashroot-$ARCH/etc/runlevels/sysinit/lvmetad - -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. - - tmpfs /tmp tmpfs defaults 0 1 - tmpfs /var/log tmpfs size=8m 0 1 - tmpfs /root tmpfs size=16m 0 1 - tmpfs /home/live tmpfs size=16m 0 1 - proc /proc proc defaults 0 1 -FSTAB - -cat >squashroot-$ARCH/etc/passwd <<- PASSWD - root:x:0:0:Charlie Root:/root:/bin/bash - man:x:13:15:man-db:/usr/share/man:/sbin/nologin - sshd:x:22:22:SSH daemon:/var/empty:/sbin/nologin - at:x:25:25:at:/var/spool/at/atjobs:/sbin/nologin - fcron:x:101:206:fcron:/dev/null:/sbin/nologin - messagebus:x:103:203:DBus unprivileged user:/dev/null:/sbin/nologin - polkit:x:104:202:PolicyKit unprivileged user:/dev/null:/sbin/nologin - rtkit:x:105:200:RTKit unprivileged user:/dev/null:/sbin/nologin - postfix:x:207:207:postfix:/var/spool/postfix:/sbin/nologin - live:x:1000:1000:Live User:/home/live:/bin/bash -PASSWD - -cat >squashroot-$ARCH/etc/group <<- GROUP - root:x:0: - tty:x:5: - wheel:x:10:live - mail:x:12:postfix - uucp:x:14: - cron:x:16: - audio:x:18: - sshd:x:22: - at:x:25: - rtkit:x:200: - plugdev:x:201: - polkitd:x:202: - messagebus:x:203: - input:x:205: - fcron:x:206: - postfix:x:207: - postdrop:x:208: - postmaster:x:249: - utmp:x:406: - live:x:1000: -GROUP - -cat >squashroot-$ARCH/etc/shadow <<- SHADOW - root:::::::: - man:::::::: - sshd:::::::: - at:::::::: - fcron:::::::: - messagebus:::::::: - polkit:::::::: - rtkit:::::::: - postfix:::::::: - live:::::::: -SHADOW - -cat >squashroot-$ARCH/etc/shells <<- SHELLS - /bin/bash - /bin/zsh -SHELLS - -cat >squashroot-$ARCH/etc/resolv.conf <<- RESOLVE - nameserver 84.200.69.80 - nameserver 2001:1608:10:25::1c04:b12f -RESOLVE - -cat >squashroot-$ARCH/etc/apk/repositories <<-REPOS - https://distfiles.adelielinux.org/adelie/1.0-alpha/$EXTRA_MIRROR -REPOS - -cat >squashroot-$ARCH/etc/issue <<-ISSUE - Welcome to Adélie Linux! - You may log in as 'root' to install, or 'live' to play around. - - Have fun. - -ISSUE - -chmod 600 squashroot-$ARCH/etc/shadow - -if test -n "${DO_FULL+full}"; then - declare -r PACKAGES_DIR=squashroot-$ARCH/packages/$ARCH - mkdir -p $PACKAGES_DIR - apk --arch $ARCH --root squashroot-$ARCH fetch -o $PACKAGES_DIR $(apk --root squashroot-$ARCH info) - if test -n "${SIGNING_KEY+use_key}"; then - apk index -o .tmp.APKINDEX.unsigned.tar.gz $PACKAGES_DIR/*.apk - openssl dgst -sha256 -sign $SIGNING_KEY -out .SIGN.RSA.packages\@adelielinux.org.pub .tmp.APKINDEX.unsigned.tar.gz - tar cf .tmp.signature.tar .SIGN.RSA.packages\@adelielinux.org.pub - cat .tmp.signature.tar | abuild-tar --cut | gzip -9 > .tmp.signature.tar.gz - cat .tmp.signature.tar.gz .tmp.APKINDEX.unsigned.tar.gz > .tmp.APKINDEX.tar.gz - rm .tmp.APKINDEX.unsigned.tar.gz .tmp.signature.tar.gz .tmp.signature.tar .SIGN.RSA.packages\@adelielinux.org.pub - mv .tmp.APKINDEX.tar.gz $PACKAGES_DIR/APKINDEX.tar.gz - fi -fi - -printf '\033[01;32m * \033[37mCreating compressed file system image...\033[00;39m\n' - -mksquashfs squashroot-$ARCH cdroot-$ARCH/adelie.squashfs - -printf '\033[01;32m * \033[37mCreating initrd structure...\033[00;39m\n' - -# mount points -mkdir initrd-$ARCH/dev -mkdir initrd-$ARCH/media -mkdir initrd-$ARCH/newroot -mkdir initrd-$ARCH/proc -mkdir initrd-$ARCH/sys - -# manual /dev nodes for initial udev startup -mknod -m 600 initrd-$ARCH/dev/console c 5 1 -mknod -m 666 initrd-$ARCH/dev/null c 1 3 -mknod -m 666 initrd-$ARCH/dev/ptmx c 5 2 -mknod -m 666 initrd-$ARCH/dev/random c 1 8 -mknod -m 666 initrd-$ARCH/dev/tty c 5 0 -mknod -m 620 initrd-$ARCH/dev/tty1 c 4 1 -mknod -m 666 initrd-$ARCH/dev/urandom c 1 9 -mknod -m 666 initrd-$ARCH/dev/zero c 1 5 - -# base -mkdir initrd-$ARCH/lib -cp squashroot-$ARCH/usr/lib/libc.so initrd-$ARCH/lib/ld-musl-$LDARCH.so.1 -cp squashroot-$ARCH/lib/libblkid.so.1 initrd-$ARCH/lib/ -cp squashroot-$ARCH/lib/libuuid.so.1 initrd-$ARCH/lib/ - -# udev -mkdir -p initrd-$ARCH/etc/udev -mkdir initrd-$ARCH/run -mkdir initrd-$ARCH/sbin -cp squashroot-$ARCH/bin/udevadm initrd-$ARCH/sbin/ -cp squashroot-$ARCH/sbin/udevd initrd-$ARCH/sbin/ -cp squashroot-$ARCH/lib/libkmod.so.2 initrd-$ARCH/lib/ -cp squashroot-$ARCH/lib/libudev.so.1 initrd-$ARCH/lib/ -cp squashroot-$ARCH/etc/udev/hwdb.bin initrd-$ARCH/etc/udev/ - -# init -cp cdinit-$ARCH initrd-$ARCH/init - -cp AdelieTux.icns cdroot-$ARCH/.VolumeIcon.icns - -printf '\033[01;32m * \033[37mCompressing initrd...\033[00;39m\n' - -pushd initrd-$ARCH -find . | cpio -H newc -o > ../cdroot-$ARCH/initrd -popd -gzip -9 cdroot-$ARCH/initrd -mv cdroot-$ARCH/initrd.gz cdroot-$ARCH/initrd - -printf '\033[01;32m * \033[37mAdding kernel...\033[00;39m\n' - -cp squashroot-$ARCH/boot/vmlinuz* cdroot-$ARCH/bzImage - -if test -f post-$ARCH.sh; then - printf '\033]01;32m * \033]37mRunning architecture-specific scripts...\033[00;39m\n' - sh post-$ARCH.sh -fi - -printf '\033[01;32m * \033[37mCreating the CD...\033[00;39m\n' - -declare -r CD_PARAMS=$(cat iso-params-$ARCH) -mkisofs -o adelie-${DO_FULL:-live}-$ARCH-1.0-ALPHA2-$(date +%Y%m%d).iso ${CD_PARAMS} -joliet -rational-rock -V "Adélie 1.0a2 $ARCH" cdroot-$ARCH diff --git a/iso-params-ppc b/iso-params-ppc new file mode 100644 index 0000000..757041f --- /dev/null +++ b/iso-params-ppc @@ -0,0 +1 @@ +-hfs -hfs-volid Adelie_1.0a2 -part -no-desktop -map mapping-ppc -chrp-boot -prep-boot -hfs-bless cdroot-ppc/boot diff --git a/mapping-ppc b/mapping-ppc new file mode 100644 index 0000000..4c945c4 --- /dev/null +++ b/mapping-ppc @@ -0,0 +1,4 @@ +# EXTN XLate CREATOR TYPE Comment +.b Raw 'chrp' 'tbxi' "Macintosh Toolbox ROM file" +.squashfs Raw 'UNIX' 'UNIX' "Linux Root File System" +* Raw '????' '????' "Unknown" diff --git a/packages-ppc b/packages-ppc new file mode 100644 index 0000000..cc001c1 --- /dev/null +++ b/packages-ppc @@ -0,0 +1,3 @@ +grub2 +hfsplusutils +mac-fdisk diff --git a/packages-x86 b/packages-x86 index 5b6da92..017b7e9 100644 --- a/packages-x86 +++ b/packages-x86 @@ -1,3 +1,4 @@ dmidecode +exfat-utils strace syslinux diff --git a/packages-x86_64 b/packages-x86_64 index 1b175af..41ae1b9 100644 --- a/packages-x86_64 +++ b/packages-x86_64 @@ -1,6 +1,7 @@ dmidecode efibootmgr elilo +exfat-utils mactel-boot strace syslinux diff --git a/post-ppc.sh b/post-ppc.sh new file mode 100644 index 0000000..33e7cbe --- /dev/null +++ b/post-ppc.sh @@ -0,0 +1,4 @@ +mkdir -p cdroot-ppc/boot +curl "https://distfiles.adelielinux.org/adelie/1.0-alpha/ppc/grubcore.img" > cdroot-ppc/boot/grubcore.img +curl "https://distfiles.adelielinux.org/adelie/1.0-alpha/ppc/ofboot.b" > cdroot-ppc/boot/ofboot.b +cp cdroot-ppc/boot/ofboot.b cdroot-ppc/boot/bootinfo.txt |