diff --git a/boot/arm/beagleboard-xm/MLO b/boot/arm/beagleboard-xm/MLO new file mode 100644 index 0000000..e3e6baf Binary files /dev/null and b/boot/arm/beagleboard-xm/MLO differ diff --git a/boot/arm/beagleboard-xm/u-boot.img b/boot/arm/beagleboard-xm/u-boot.img new file mode 100644 index 0000000..96baded Binary files /dev/null and b/boot/arm/beagleboard-xm/u-boot.img differ diff --git a/boot/arm/beagleboard-xm/uEnv.txt b/boot/arm/beagleboard-xm/uEnv.txt new file mode 100644 index 0000000..2a347ec --- /dev/null +++ b/boot/arm/beagleboard-xm/uEnv.txt @@ -0,0 +1 @@ +optargs=run_hardware_tests quiet earlyprintk=serial,uart1,115200 diff --git a/molecules/beagleboard-xm.common b/molecules/beagleboard-xm.common new file mode 100644 index 0000000..c3cd2a2 --- /dev/null +++ b/molecules/beagleboard-xm.common @@ -0,0 +1,8 @@ +# List of packages to add on the BeagleBoard xM +packages_to_add: + lxde-base/lxdm, + x11-base/xorg-server, + x11-drivers/xf86-video-omapfb + +# List of packages to remove from the BeagleBoard xM image +packages_to_remove: diff --git a/molecules/sabayon-arm-beagleboard-xm-16G.spec b/molecules/sabayon-arm-beagleboard-xm-16G.spec new file mode 100644 index 0000000..84266db --- /dev/null +++ b/molecules/sabayon-arm-beagleboard-xm-16G.spec @@ -0,0 +1,24 @@ +%import /sabayon/molecules/arm-base.common +%import /sabayon/molecules/beagleboard-xm.common + +# Release desc (the actual release description) +release_desc: armv7a BeagleBoard xM + +# Release Version (used to generate release_file) +release_version: 8 + +# Specify image file name (image file name will be automatically +# produced otherwise) +image_name: Sabayon_Linux_8_armv7a_BeagleBoard_Base_16GB.img + +# Specify the image file size in Megabytes. This is mandatory. +# To avoid runtime failure, make sure the image is large enough to fit your +# chroot data. +image_mb: 16000 + +# Path to boot partition data (MLO, u-boot.img etc) +source_boot_directory: /sabayon/boot/arm/beagleboard-xm + +# External script that will generate the image file. +# The same can be copied onto a MMC by using dd +image_generator_script: /sabayon/scripts/beagleboard_xm_image_generator_script.sh diff --git a/molecules/sabayon-arm-beagleboard-xm-4G.spec b/molecules/sabayon-arm-beagleboard-xm-4G.spec new file mode 100644 index 0000000..db639ba --- /dev/null +++ b/molecules/sabayon-arm-beagleboard-xm-4G.spec @@ -0,0 +1,24 @@ +%import /sabayon/molecules/arm-base.common +%import /sabayon/molecules/beagleboard-xm.common + +# Release desc (the actual release description) +release_desc: armv7a BeagleBoard xM + +# Release Version (used to generate release_file) +release_version: 8 + +# Specify image file name (image file name will be automatically +# produced otherwise) +image_name: Sabayon_Linux_8_armv7a_BeagleBoard_Base_16GB.img + +# Specify the image file size in Megabytes. This is mandatory. +# To avoid runtime failure, make sure the image is large enough to fit your +# chroot data. +image_mb: 3800 + +# Path to boot partition data (MLO, u-boot.img etc) +source_boot_directory: /sabayon/boot/arm/beagleboard-xm + +# External script that will generate the image file. +# The same can be copied onto a MMC by using dd +image_generator_script: /sabayon/scripts/beagleboard_xm_image_generator_script.sh diff --git a/molecules/sabayon-arm-beagleboard-xm-8G.spec b/molecules/sabayon-arm-beagleboard-xm-8G.spec new file mode 100644 index 0000000..8372aec --- /dev/null +++ b/molecules/sabayon-arm-beagleboard-xm-8G.spec @@ -0,0 +1,24 @@ +%import /sabayon/molecules/arm-base.common +%import /sabayon/molecules/beagleboard-xm.common + +# Release desc (the actual release description) +release_desc: armv7a BeagleBoard xM + +# Release Version (used to generate release_file) +release_version: 8 + +# Specify image file name (image file name will be automatically +# produced otherwise) +image_name: Sabayon_Linux_8_armv7a_BeagleBoard_Base_16GB.img + +# Specify the image file size in Megabytes. This is mandatory. +# To avoid runtime failure, make sure the image is large enough to fit your +# chroot data. +image_mb: 7800 + +# Path to boot partition data (MLO, u-boot.img etc) +source_boot_directory: /sabayon/boot/arm/beagleboard-xm + +# External script that will generate the image file. +# The same can be copied onto a MMC by using dd +image_generator_script: /sabayon/scripts/beagleboard_xm_image_generator_script.sh diff --git a/scripts/beagleboard_xm_image_generator_script.sh b/scripts/beagleboard_xm_image_generator_script.sh new file mode 100755 index 0000000..6af35dc --- /dev/null +++ b/scripts/beagleboard_xm_image_generator_script.sh @@ -0,0 +1,4 @@ +#!/bin/sh +# rootfs and bootfs tarball is generated by beaglebone image +export MAKE_TARBALL="0" +exec /sabayon/scripts/mkloopcard.sh /sabayon/scripts/mkloopcard_beagleboard_chroot_hook.sh "$@" diff --git a/scripts/mkloopcard.sh b/scripts/mkloopcard.sh index d8a900e..3efd560 100755 --- a/scripts/mkloopcard.sh +++ b/scripts/mkloopcard.sh @@ -2,6 +2,9 @@ # (c) Copyright 2012 Fabio Erculiani # Licensed under terms of GPLv2 +env-update +. /etc/profile + export LC_ALL=C # Expected env variables: @@ -13,6 +16,8 @@ export LC_ALL=C # RELEASE_FILE # IMAGE_NAME # DESTINATION_IMAGE_DIR +# PACKAGES_TO_ADD +# PACKAGES_TO_REMOVE if [ ${#} -ne 5 ]; then echo "usage: ${0} " @@ -135,6 +140,18 @@ mount "${ext_part}" "${tmp_dir}" rsync -a -H -A -X --delete-during "${CHROOT_DIR}"/ "${tmp_dir}"/ --exclude "/proc/*" --exclude "/sys/*" \ --exclude "/dev/pts/*" --exclude "/dev/shm/*" || exit 1 +# execute PACKAGES_TO_ADD and PACKAGES_TO_REMOVE +export ETP_NONINTERACTIVE=1 +if [ -n "${PACKAGES_TO_ADD}" ]; then + add_cmd="equo install ${PACKAGES_TO_ADD}" + chroot "${tmp_dir}" ${add_cmd} || exit 1 +fi +if [ -n "${PACKAGES_TO_REMOVE}" ]; then + rem_cmd="equo remove ${PACKAGES_TO_REMOVE}" + chroot "${tmp_dir}" ${rem_cmd} || exit 1 +fi + + # execute CHROOT_SCRIPT hook inside chroot chroot_script_name=$(basename "${CHROOT_SCRIPT}") target_chroot_script="${tmp_dir}"/"${chroot_script_name}" diff --git a/scripts/mkloopcard_beagleboard_xm_chroot_hook.sh b/scripts/mkloopcard_beagleboard_xm_chroot_hook.sh new file mode 100755 index 0000000..625e137 --- /dev/null +++ b/scripts/mkloopcard_beagleboard_xm_chroot_hook.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# This script is executed inside the image chroot before packing up. +# Architecture/platform specific code goes here, like kernel install +# and configuration + +env-update +. /etc/profile + +# enable sshd by default +rc-update add sshd default + +# TODO: error out here when linux-beaglebone is there +# "equo update" is done by inner_source_chroot_update script +# which directive is appended by iso_build.sh script +equo install sys-kernel/linux-beagle + +eselect uimage set 1 + +# setup root password to... root! +echo root:root | chpasswd +# cleaning up deps +rc-update --update + +# setup serial console +sed -i "s;s0:.*;s0:12345:respawn:/sbin/agetty 115200 ttyO2 vt100;" /etc/inittab || exit 1 + +exit 0 +