Verified Commit 0aff91dc authored by A. Wilcox's avatar A. Wilcox 🦊
Browse files

Make build-cd fully architecture independent

parent bc60e4be
......@@ -86,8 +86,10 @@ while [ -n "$1" ]; do
shift
done
set -a
declare -r ARCH=${MY_ARCH:-$def_arch}
declare -r LDARCH=${LDARCH:-$ARCH}
set +a
ensure_commands
......@@ -122,19 +124,19 @@ declare -r PACKAGES="
pciutils libusb1 usbutils \
strace \
hdparm \
dmidecode \
less \
bzip2 \
netifrc netifrc-doc netifrc-openrc \
diskdev_cmds exfat-utils hfsutils mtools \
efibootmgr elilo mactel-boot syslinux
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
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
......@@ -214,7 +216,8 @@ cat >squashroot-$ARCH/etc/shells <<- SHELLS
SHELLS
cat >squashroot-$ARCH/etc/resolv.conf <<- RESOLVE
nameserver 8.8.8.8
nameserver 84.200.69.80
nameserver 2001:1608:10:25::1c04:b12f
RESOLVE
cat >squashroot-$ARCH/etc/apk/repositories <<-REPOS
......@@ -302,22 +305,12 @@ printf '\033[01;32m * \033[37mAdding kernel...\033[00;39m\n'
cp squashroot-$ARCH/boot/vmlinuz* cdroot-$ARCH/bzImage
printf '\033[01;32m * \033[37mInstalling ISOLINUX...\033[00;39m\n'
mkdir cdroot-$ARCH/isolinux
cat >cdroot-$ARCH/isolinux/isolinux.cfg <<BOOTCFG
prompt 1
default adelie
label adelie
kernel /bzImage
append initrd=/initrd
BOOTCFG
cp /usr/share/syslinux/isolinux-debug.bin cdroot-$ARCH/isolinux/isolinux.bin
cp /usr/share/syslinux/ldlinux.c32 cdroot-$ARCH/isolinux/
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'
mkisofs -o adelie-${DO_FULL:-live}-$ARCH-1.0-ALPHA2-$(date +%Y%m%d).iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -joliet -rational-rock -V "Adélie 1.0a2 $ARCH" cdroot-$ARCH
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
-b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table
-b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table
dmidecode
syslinux
dmidecode
efibootmgr
elilo
mactel-boot
syslinux
printf '\033[01;32m * \033[37mInstalling ISOLINUX...\033[00;39m\n'
mkdir cdroot-$ARCH/isolinux
cat >cdroot-$ARCH/isolinux/isolinux.cfg <<BOOTCFG
prompt 1
default adelie
label adelie
kernel /bzImage
append initrd=/initrd
BOOTCFG
cp /usr/share/syslinux/isolinux-debug.bin cdroot-$ARCH/isolinux/isolinux.bin
cp /usr/share/syslinux/ldlinux.c32 cdroot-$ARCH/isolinux/
printf '\033[01;32m * \033[37mInstalling ISOLINUX...\033[00;39m\n'
mkdir cdroot-$ARCH/isolinux
cat >cdroot-$ARCH/isolinux/isolinux.cfg <<BOOTCFG
prompt 1
default adelie
label adelie
kernel /bzImage
append initrd=/initrd
BOOTCFG
cp /usr/share/syslinux/isolinux-debug.bin cdroot-$ARCH/isolinux/isolinux.bin
cp /usr/share/syslinux/ldlinux.c32 cdroot-$ARCH/isolinux/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment