From c65cefd5af4d3c5ca06f9db3e39af0657348b825 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Sun, 9 Dec 2012 11:27:58 +0000 Subject: [PATCH] update image build scripts --- .gitignore | 5 +- boot/arm/buffalo_ls_chlv2/README.txt | 83 ++++++++ iso_rsync/.keep | 0 molecules/buffalo_kb_pro.common | 1 + molecules/buffalo_ls_chlv2.common | 25 +++ molecules/buffalo_ls_pro_live.common | 1 + molecules/buffalo_ls_xhl.common | 1 + .../sablink-armel-buffalo_ls_chlv2-20G.spec | 24 +++ ...sablink-armel-buffalo_ls_pro_live-20G.spec | 4 +- ...buffalo_ls_chlv2_image_generator_script.sh | 9 + scripts/iso_build.sh | 199 +++--------------- scripts/mkloopgptdisk.sh | 2 +- ...kloopgptdisk_buffalo_kb_pro_chroot_hook.sh | 6 +- ...oopgptdisk_buffalo_ls_chlv2_chroot_hook.sh | 105 +++++++++ ...gptdisk_buffalo_ls_pro_live_chroot_hook.sh | 6 +- ...kloopgptdisk_buffalo_ls_xhl_chroot_hook.sh | 3 +- 16 files changed, 295 insertions(+), 179 deletions(-) create mode 100644 boot/arm/buffalo_ls_chlv2/README.txt delete mode 100644 iso_rsync/.keep create mode 100644 molecules/buffalo_ls_chlv2.common create mode 100644 molecules/sablink-armel-buffalo_ls_chlv2-20G.spec create mode 100755 scripts/buffalo_ls_chlv2_image_generator_script.sh create mode 100755 scripts/mkloopgptdisk_buffalo_ls_chlv2_chroot_hook.sh diff --git a/.gitignore b/.gitignore index 60d241c..85e02e8 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,7 @@ livecd/* pkgcache/* sources/* iso_rsync/* -images/* \ No newline at end of file +images/* +images_ftpsync/* +*.sablink.n-c.org +DO_PUSH \ No newline at end of file diff --git a/boot/arm/buffalo_ls_chlv2/README.txt b/boot/arm/buffalo_ls_chlv2/README.txt new file mode 100644 index 0000000..09936ef --- /dev/null +++ b/boot/arm/buffalo_ls_chlv2/README.txt @@ -0,0 +1,83 @@ +Hi, welcome to Sabayon for the BeagleBoard xM. + +First of all, you may want to install the image into a new SDHC card. +Make sure to have enough space for it, for example, if you downloaded +the 4GB version, make sure you're using a 4GB SDHC stick. + +Other requirements: +------------------- + + - a Linux distro to copy the image to the SDHC + - a SDHC reader + - a root shell on the Linux distro + + +How to burn the image: +---------------------- + +Insert the SDHC memory into your reader (make sure that the LOCK +switch is turned off). After a few seconds, type: + + # dmesg | tail -n 10 + +In the last kernel message lines you will be able to read the +actual device name, might be something like "sdc" or in general +"sdX" where X is just a letter. +Make sure to see the same device name inside /dev directory. + +Once you got the name, just dump the image into that, in this +example, we assume that the device is /dev/sdc and the image +name is "Sabayon_Linux_8_armv7a_BeagleBoard_xM_4GB.img". +Do this as root! + + # xzcat Sabayon_Linux_8_armv7a_BeagleBoard_xM_4GB.img > /dev/sdd + +Once it is done, check for any error using: + + # dmesg | tail -n 10 + +And if it's all good, type: + + # sync; sync; sync + +To make sure everything has been flushed to the device. + +At this point, extract your SDHC and place it into the BeagleBoard xM. +You're set! + + +How to change keyboard mapping: +------------------------------- + +Our images come with "keyboard-setup", a shell too that lets you easily +do this, just type: + + # keyboard-setup "" all + +Then reboot! + + +How to change language: +----------------------- + +Open /etc/locale.gen and add your locale (you can find a full list +at: /usr/share/i18n/SUPPORTED). +Make sure to add UTF-8 locales, this is what we support. +Once you've added your line, just type: + + # language-setup "" system + +Then reboot! + + +You want to know more? +---------------------- +Just go to http://www.sabayon.org and to http://wiki.sabayon.org +and search for "BeagleBoard". +We're full of guides. + + +Contact +------- +Just mail us at website@sabayon.org if you need any help or register +to our mailing list at http://lists.sabayon.org/cgi-bin/mailman/listinfo/devel diff --git a/iso_rsync/.keep b/iso_rsync/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/molecules/buffalo_kb_pro.common b/molecules/buffalo_kb_pro.common index bdbc5f3..47c11e1 100644 --- a/molecules/buffalo_kb_pro.common +++ b/molecules/buffalo_kb_pro.common @@ -22,3 +22,4 @@ packages_to_add: # List of packages to remove from the Buffalo/Revogear KuroBox Pro packages_to_remove: + sys-devel/gcc \ No newline at end of file diff --git a/molecules/buffalo_ls_chlv2.common b/molecules/buffalo_ls_chlv2.common new file mode 100644 index 0000000..f8dfeac --- /dev/null +++ b/molecules/buffalo_ls_chlv2.common @@ -0,0 +1,25 @@ +# List of packages to add on the Buffalo Linkstation CHLv2 +packages_to_add: + app-admin/eselect-uimage, + app-admin/syslog-ng, + app-admin/sudo, + app-misc/sablink-core, + media-fonts/ttf-bitstream-vera, + media-fonts/dejavu, + media-fonts/corefonts, + net-misc/ntp, + sys-apps/keyboard-configuration-helpers, + sys-apps/language-configuration-helpers, + sys-apps/blstools, + sys-apps/gptfdisk, + sys-auth/consolekit, + sys-block/parted, + sys-fs/btrfs-progs, + sys-fs/ntfs3g, + sys-fs/jfsutils, + sys-kernel/linux-buffalo_ls_chlv2, + sys-process/vixie-cron + +# List of packages to remove from the Buffalo Linkstation CHLv2 +packages_to_remove: + sys-devel/gcc \ No newline at end of file diff --git a/molecules/buffalo_ls_pro_live.common b/molecules/buffalo_ls_pro_live.common index fd31278..474e4a9 100644 --- a/molecules/buffalo_ls_pro_live.common +++ b/molecules/buffalo_ls_pro_live.common @@ -22,3 +22,4 @@ packages_to_add: # List of packages to remove from the Buffalo Linkstation Pro/live packages_to_remove: + sys-devel/gcc \ No newline at end of file diff --git a/molecules/buffalo_ls_xhl.common b/molecules/buffalo_ls_xhl.common index 7fc5871..52d493b 100644 --- a/molecules/buffalo_ls_xhl.common +++ b/molecules/buffalo_ls_xhl.common @@ -22,3 +22,4 @@ packages_to_add: # List of packages to remove from the Buffalo Linkstation XHL packages_to_remove: + sys-devel/gcc \ No newline at end of file diff --git a/molecules/sablink-armel-buffalo_ls_chlv2-20G.spec b/molecules/sablink-armel-buffalo_ls_chlv2-20G.spec new file mode 100644 index 0000000..36b97cc --- /dev/null +++ b/molecules/sablink-armel-buffalo_ls_chlv2-20G.spec @@ -0,0 +1,24 @@ +%env %import ${SABAYON_MOLECULE_HOME:-/sabayon}/molecules/armel-base.common +%env %import ${SABAYON_MOLECULE_HOME:-/sabayon}/molecules/buffalo_ls_chlv2.common + +# Release desc (the actual release description) +release_desc: armelv5tel Buffalo Linkstation CHL V2 + +# Release Version (used to generate release_file) +release_version: 0 + +# Specify image file name (image file name will be automatically +# produced otherwise) +image_name: SabLink_Linux_0_armelv5tel_buffalo_ls_chlv2_20GB.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: 20000 + +# Path to boot partition data (MLO, u-boot.img etc) +%env source_boot_directory: ${SABAYON_MOLECULE_HOME:-/sabayon}/boot/arm/buffalo_ls_chlv2 + +# External script that will generate the image file. +# The same can be copied onto a MMC by using dd +%env image_generator_script: ${SABAYON_MOLECULE_HOME:-/sabayon}/scripts/buffalo_ls_chlv2_image_generator_script.sh diff --git a/molecules/sablink-armel-buffalo_ls_pro_live-20G.spec b/molecules/sablink-armel-buffalo_ls_pro_live-20G.spec index bb5b2fc..f87c219 100644 --- a/molecules/sablink-armel-buffalo_ls_pro_live-20G.spec +++ b/molecules/sablink-armel-buffalo_ls_pro_live-20G.spec @@ -2,14 +2,14 @@ %env %import ${SABAYON_MOLECULE_HOME:-/sabayon}/molecules/buffalo_ls_pro_live.common # Release desc (the actual release description) -release_desc: armelv5tel Buffalo Linkstation Pro +release_desc: armelv5tel Buffalo Linkstation Pro/Live # Release Version (used to generate release_file) release_version: 0 # Specify image file name (image file name will be automatically # produced otherwise) -image_name: SabLink_Linux_0_armelv5tel_buffalo_ls_pro_20GB.img +image_name: SabLink_Linux_0_armelv5tel_buffalo_ls_pro_live_20GB.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 diff --git a/scripts/buffalo_ls_chlv2_image_generator_script.sh b/scripts/buffalo_ls_chlv2_image_generator_script.sh new file mode 100755 index 0000000..441d9e0 --- /dev/null +++ b/scripts/buffalo_ls_chlv2_image_generator_script.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# Path to molecules.git dir +SABAYON_MOLECULE_HOME="${SABAYON_MOLECULE_HOME:-/sabayon}" +export SABAYON_MOLECULE_HOME + +# rootfs and bootfs tarball is generated by beaglebone image +export MAKE_TARBALL="0" +exec "${SABAYON_MOLECULE_HOME}"/scripts/mkloopgptdisk.sh "${SABAYON_MOLECULE_HOME}"/scripts/mkloopgptdisk_buffalo_ls_xhl_chroot_hook.sh "$@" diff --git a/scripts/iso_build.sh b/scripts/iso_build.sh index d0b336e..293d9a5 100755 --- a/scripts/iso_build.sh +++ b/scripts/iso_build.sh @@ -81,108 +81,22 @@ REMASTER_TAR_SPECS_TAR=() if [ "${ACTION}" = "weekly" ] || [ "${ACTION}" = "daily" ]; then - # Daily molecules - SOURCE_SPECS+=( - "sabayon-x86-spinbase.spec" - "sabayon-amd64-spinbase.spec" - ) - SOURCE_SPECS_ISO+=( - "Sabayon_Linux_SpinBase_DAILY_x86.iso" - "Sabayon_Linux_SpinBase_DAILY_amd64.iso" - ) - REMASTER_SPECS+=( - "sabayon-amd64-gnome.spec" - "sabayon-x86-gnome.spec" - "sabayon-amd64-kde.spec" - "sabayon-x86-kde.spec" - "sabayon-amd64-mate.spec" - "sabayon-x86-mate.spec" - "sabayon-amd64-lxde.spec" - "sabayon-x86-lxde.spec" - "sabayon-amd64-xfce.spec" - "sabayon-x86-xfce.spec" - "sabayon-amd64-e17.spec" - "sabayon-x86-e17.spec" - "sabayon-amd64-corecdx.spec" - "sabayon-x86-corecdx.spec" - "sabayon-amd64-serverbase.spec" - "sabayon-x86-serverbase.spec" - "sabayon-amd64-hardenedserver.spec" - "sabayon-x86-hardenedserver.spec" - ) - REMASTER_SPECS_ISO+=( - "Sabayon_Linux_DAILY_amd64_G.iso" - "Sabayon_Linux_DAILY_x86_G.iso" - "Sabayon_Linux_DAILY_amd64_K.iso" - "Sabayon_Linux_DAILY_x86_K.iso" - "Sabayon_Linux_DAILY_amd64_MATE.iso" - "Sabayon_Linux_DAILY_x86_MATE.iso" - "Sabayon_Linux_DAILY_amd64_LXDE.iso" - "Sabayon_Linux_DAILY_x86_LXDE.iso" - "Sabayon_Linux_DAILY_amd64_Xfce.iso" - "Sabayon_Linux_DAILY_x86_Xfce.iso" - "Sabayon_Linux_DAILY_amd64_E17.iso" - "Sabayon_Linux_DAILY_x86_E17.iso" - "Sabayon_Linux_CoreCDX_DAILY_amd64.iso" - "Sabayon_Linux_CoreCDX_DAILY_x86.iso" - "Sabayon_Linux_ServerBase_DAILY_amd64.iso" - "Sabayon_Linux_ServerBase_DAILY_x86.iso" - "Sabayon_Linux_HardenedServer_DAILY_amd64.iso" - "Sabayon_Linux_HardenedServer_DAILY_x86.iso" - ) - - # Weekly molecules if [ "${ACTION}" = "weekly" ]; then ARM_SOURCE_SPECS+=( - "sabayon-arm-beaglebone-base-2G.spec" - "sabayon-arm-beaglebone-base-4G.spec" - "sabayon-arm-beagleboard-xm-4G.spec" - "sabayon-arm-beagleboard-xm-8G.spec" - "sabayon-arm-pandaboard-4G.spec" - "sabayon-arm-pandaboard-8G.spec" - "sabayon-arm-efikamx-base-4G.spec" + "sablink-armel-buffalo_kb_pro-20G.spec" + "sablink-armel-buffalo_ls_chlv2-20G.spec" + "sablink-armel-buffalo_ls_pro_live-20G.spec" + "sablink-armel-buffalo_ls_xhl-20G.spec" ) ARM_SOURCE_SPECS_IMG+=( - "Sabayon_Linux_DAILY_armv7a_BeagleBone_Base_2GB.img" - "Sabayon_Linux_DAILY_armv7a_BeagleBone_Base_4GB.img" - "Sabayon_Linux_DAILY_armv7a_BeagleBoard_xM_4GB.img" - "Sabayon_Linux_DAILY_armv7a_BeagleBoard_xM_8GB.img" - "Sabayon_Linux_DAILY_armv7a_PandaBoard_4GB.img" - "Sabayon_Linux_DAILY_armv7a_PandaBoard_8GB.img" - "Sabayon_Linux_DAILY_armv7a_EfikaMX_Base_4GB.img" - ) - REMASTER_SPECS+=( - "sabayon-amd64-xfceforensic.spec" - "sabayon-x86-xfceforensic.spec" - ) - REMASTER_SPECS_ISO+=( - "Sabayon_Linux_DAILY_amd64_ForensicsXfce.iso" - "Sabayon_Linux_DAILY_x86_ForensicsXfce.iso" - ) - REMASTER_TAR_SPECS+=( - "sabayon-x86-spinbase-openvz-template.spec" - "sabayon-amd64-spinbase-openvz-template.spec" - "sabayon-x86-spinbase-amazon-ebs-image.spec" - "sabayon-amd64-spinbase-amazon-ebs-image.spec" - ) - REMASTER_TAR_SPECS_TAR+=( - "Sabayon_Linux_SpinBase_DAILY_x86_openvz.tar.gz" - "Sabayon_Linux_SpinBase_DAILY_amd64_openvz.tar.gz" - "Sabayon_Linux_SpinBase_DAILY_x86_Amazon_EBS_ext4_filesystem_image.tar.gz" - "Sabayon_Linux_SpinBase_DAILY_amd64_Amazon_EBS_ext4_filesystem_image.tar.gz" + "SabLink_Linux_0_armelv5tel_buffalo_kb_pro_20GB.img" + "SabLink_Linux_0_armelv5tel_buffalo_ls_pro_live_20GB.img" + "SabLink_Linux_0_armelv5tel_buffalo_ls_xhl_20GB.img" + "SabLink_Linux_0_armelv5tel_buffalo_ls_chlv2_20GB.img" ) fi -elif [ "${ACTION}" = "dailybase" ]; then - SOURCE_SPECS=( - "sabayon-x86-spinbase.spec" - "sabayon-amd64-spinbase.spec" - ) - SOURCE_SPECS_ISO=( - "Sabayon_Linux_SpinBase_DAILY_x86.iso" - "Sabayon_Linux_SpinBase_DAILY_amd64.iso" - ) fi [[ -d "/var/log/molecule" ]] || mkdir -p /var/log/molecule @@ -196,20 +110,22 @@ cleanup_on_exit() { } trap "cleanup_on_exit" EXIT INT TERM -move_to_pkg_sabayon_org() { +move_to_pkg_sablink_org() { if [ -n "${DO_PUSH}" ] || [ -f "${SABAYON_MOLECULE_HOME}"/DO_PUSH ]; then rm -f "${SABAYON_MOLECULE_HOME}"/DO_PUSH local executed= for ((i=0; i < 5; i++)); do - rsync -av --partial --delete-excluded "${SABAYON_MOLECULE_HOME}"/iso_rsync/*DAILY* \ - entropy@pkg.sabayon.org:/sabayon/rsync/rsync.sabayon.org/iso/daily \ - || { sleep 10; continue; } - rsync -av --partial --delete-excluded "${SABAYON_MOLECULE_HOME}"/scripts/gen_html \ - entropy@pkg.sabayon.org:/sabayon/rsync/iso_html_generator \ - || { sleep 10; continue; } - ssh entropy@pkg.sabayon.org \ - /sabayon/rsync/iso_html_generator/gen_html/gen.sh \ - || { sleep 10; continue; } +# rsync -av --partial --delete-excluded "${SABAYON_MOLECULE_HOME}"/images_ftpsync/*DAILY* \ +# entropy@pkg.sabayon.org:/sabayon/rsync/rsync.sabayon.org/iso/daily \ +# || { sleep 10; continue; } +# rsync -av --partial --delete-excluded "${SABAYON_MOLECULE_HOME}"/scripts/gen_html \ +# entropy@pkg.sabayon.org:/sabayon/rsync/iso_html_generator \ +# || { sleep 10; continue; } +# ssh entropy@pkg.sabayon.org \ +# /sabayon/rsync/iso_html_generator/gen_html/gen.sh \ +# || { sleep 10; continue; } + ftpsync "${SABAYON_MOLECULE_HOME}"/images_ftpsync/ ΒΈ + ftp://sablink:`cat ${SABAYON_MOLECULE_HOME}"/pkgs.sablink.n-c.org`@pkgs.sablink.nas-central.org/images executed=1 break done @@ -219,7 +135,7 @@ move_to_pkg_sabayon_org() { return 0 } -build_sabayon() { +build_sablink() { if [ -z "${DRY_RUN}" ]; then DAILY_TMPDIR=$(mktemp -d --suffix=.iso_build.sh --tmpdir=/tmp) @@ -227,23 +143,6 @@ build_sabayon() { DAILY_TMPDIR_REMASTER="${DAILY_TMPDIR}/remaster" mkdir "${DAILY_TMPDIR_REMASTER}" || return 1 - local source_specs="" - for i in ${!SOURCE_SPECS[@]} - do - src="${SABAYON_MOLECULE_HOME}/molecules/${SOURCE_SPECS[i]}" - dst="${DAILY_TMPDIR}/${SOURCE_SPECS[i]}" - cp "${src}" "${dst}" -p || return 1 - echo >> "${dst}" - echo "inner_source_chroot_script: ${SABAYON_MOLECULE_HOME}/scripts/inner_source_chroot_update.sh" >> "${dst}" - # tweak iso image name - sed -i "s/^#.*destination_iso_image_name/destination_iso_image_name:/" "${dst}" || return 1 - sed -i "s/destination_iso_image_name.*/destination_iso_image_name: ${SOURCE_SPECS_ISO[i]}/" "${dst}" || return 1 - # tweak release version - sed -i "s/release_version.*/release_version: ${CUR_DATE}/" "${dst}" || return 1 - echo "${dst}: iso: ${SOURCE_SPECS_ISO[i]} date: ${CUR_DATE}" - source_specs+="${dst} " - done - local arm_source_specs="" for i in ${!ARM_SOURCE_SPECS[@]} do @@ -261,35 +160,6 @@ build_sabayon() { arm_source_specs+="${dst} " done - local remaster_specs="" - for i in ${!REMASTER_SPECS[@]} - do - src="${SABAYON_MOLECULE_HOME}/molecules/${REMASTER_SPECS[i]}" - dst="${DAILY_TMPDIR_REMASTER}/${REMASTER_SPECS[i]}" - cp "${src}" "${dst}" -p || return 1 - # tweak iso image name - sed -i "s/^#.*destination_iso_image_name/destination_iso_image_name:/" "${dst}" || return 1 - sed -i "s/destination_iso_image_name.*/destination_iso_image_name: ${REMASTER_SPECS_ISO[i]}/" "${dst}" || return 1 - # tweak release version - sed -i "s/release_version.*/release_version: ${CUR_DATE}/" "${dst}" || return 1 - echo "${dst}: iso: ${REMASTER_SPECS_ISO[i]} date: ${CUR_DATE}" - remaster_specs+="${dst} " - done - - for i in ${!REMASTER_TAR_SPECS[@]} - do - src="${SABAYON_MOLECULE_HOME}/molecules/${REMASTER_TAR_SPECS[i]}" - dst="${DAILY_TMPDIR_REMASTER}/${REMASTER_TAR_SPECS[i]}" - cp "${src}" "${dst}" -p || return 1 - # tweak tar name - sed -i "s/^#.*tar_name/tar_name:/" "${dst}" || return 1 - sed -i "s/tar_name.*/tar_name: ${REMASTER_TAR_SPECS_TAR[i]}/" "${dst}" || return 1 - # tweak release version - sed -i "s/release_version.*/release_version: ${CUR_DATE}/" "${dst}" || return 1 - echo "${dst}: tar: ${REMASTER_TAR_SPECS_TAR[i]} date: ${CUR_DATE}" - remaster_specs+="${dst} " - done - local done_images=0 local done_something=0 if [ -n "${arm_source_specs}" ]; then @@ -297,27 +167,18 @@ build_sabayon() { done_something=1 done_images=1 fi - if [ -n "${source_specs}" ]; then - molecule --nocolor ${source_specs} || return 1 - done_something=1 - fi - if [ -n "${remaster_specs}" ]; then - molecule --nocolor ${remaster_specs} || return 1 - done_something=1 - fi # package phases keep loading dbus, let's kill pids back ps ax | grep -- "/usr/bin/dbus-daemon --fork .* --session" | awk '{ print $1 }' | xargs kill 2> /dev/null if [ "${done_something}" = "1" ]; then if [ "${done_images}" = "1" ]; then - cp -p "${SABAYON_MOLECULE_HOME}"/images/*DAILY* "${SABAYON_MOLECULE_HOME}"/iso_rsync/ || return 1 - fi - cp -p "${SABAYON_MOLECULE_HOME}"/iso/*DAILY* "${SABAYON_MOLECULE_HOME}"/iso_rsync/ || return 1 - date > "${SABAYON_MOLECULE_HOME}"/iso_rsync/RELEASE_DATE_DAILY - if [ "${MAKE_TORRENTS}" != "0" ]; then - "${SABAYON_MOLECULE_HOME}"/scripts/make_torrents.sh || return 1 + cp -p "${SABAYON_MOLECULE_HOME}"/images/* "${SABAYON_MOLECULE_HOME}"/images_ftpsync/ || return 1 fi + date > "${SABAYON_MOLECULE_HOME}"/images_ftpsync/RELEASE_DATE_DAILY +# if [ "${MAKE_TORRENTS}" != "0" ]; then +# "${SABAYON_MOLECULE_HOME}"/scripts/make_torrents.sh || return 1 +# fi fi fi return 0 @@ -336,18 +197,18 @@ Sun" | /bin/mail -s "ISO build script failure" root out="0" if [ -n "${DO_STDOUT}" ]; then - build_sabayon + build_sablink out=${?} if [ "${out}" = "0" ]; then - move_to_pkg_sabayon_org + move_to_pkg_sablink_org out=${?} fi else log_file="/var/log/molecule/autobuild-${CUR_DATE}-${$}.log" - build_sabayon &> "${log_file}" + build_sablink &> "${log_file}" out=${?} if [ "${out}" = "0" ]; then - move_to_pkg_sabayon_org &>> "${log_file}" + move_to_pkg_sablink_org &>> "${log_file}" out=${?} fi if [ "${out}" != "0" ]; then diff --git a/scripts/mkloopgptdisk.sh b/scripts/mkloopgptdisk.sh index 033d96a..b979be3 100755 --- a/scripts/mkloopgptdisk.sh +++ b/scripts/mkloopgptdisk.sh @@ -44,7 +44,7 @@ BOOT_PART_TYPE="${BOOT_PART_TYPE:-ext2}" BOOT_PART_TYPE_GPT="${BOOT_PART_TYPE_GPT:-8300}" BOOT_PART_MKFS_ARGS="${BOOT_PART_MKFS_ARGS:--L Boot -I 128}" # Root partition type -ROOT_PART_TYPE="${ROOT_PART_TYPE:-ext4}" +ROOT_PART_TYPE="${ROOT_PART_TYPE:-btrfs}" ROOT_PART_MKFS_ARGS="${ROOT_PART_MKFS_ARGS:--L SabLink}" # Swap partiton arguments SWAP_PART_MKFS_ARGS="${SWAP_PART_MKFS_ARGS:--L Swap}" diff --git a/scripts/mkloopgptdisk_buffalo_kb_pro_chroot_hook.sh b/scripts/mkloopgptdisk_buffalo_kb_pro_chroot_hook.sh index 243c744..0e198d3 100755 --- a/scripts/mkloopgptdisk_buffalo_kb_pro_chroot_hook.sh +++ b/scripts/mkloopgptdisk_buffalo_kb_pro_chroot_hook.sh @@ -15,7 +15,9 @@ setup_boot() { # Linkstation Pro/Live Deamon rc-update add micro-evtd-boot boot rc-update add micro-evtd default - rc-update add vixie-cron boot + # add ntp service + rc-update add ntp-client default + rc-update add ntpd default # enable dbus, of course, and also NetworkManager rc-update add dbus boot @@ -87,7 +89,7 @@ setup_fallback_network() { } setup_fstab() { - sed -e "s!/BOOT!/sda1!g" -e "s!/ROOT!/sda2!g" -e "s!SWAP!sda3!g" -e "s!ext3!ext4!g" -i /etc/fstab + sed -e "s!/BOOT!/sda1!g" -e "s!/ROOT!/sda2!g" -e "s!SWAP!sda3!g" -e "s!ext3!btrfs!g" -i /etc/fstab } setup_layman() { diff --git a/scripts/mkloopgptdisk_buffalo_ls_chlv2_chroot_hook.sh b/scripts/mkloopgptdisk_buffalo_ls_chlv2_chroot_hook.sh new file mode 100755 index 0000000..a6105fd --- /dev/null +++ b/scripts/mkloopgptdisk_buffalo_ls_chlv2_chroot_hook.sh @@ -0,0 +1,105 @@ +#!/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 + +setup_boot() { + # enable sshd by default + rc-update add sshd default + # enable logger by default + rc-update add syslog-ng boot + rc-update add vixie-cron boot + # Linkstation Pro/Live Deamon + rc-update add ntp-client default + rc-update add ntpd default + # enable dbus, of course, and also NetworkManager + rc-update add dbus boot + + # we are on eth1 in the ls xhl/chl2 so create the init.d link + ln -sf net.lo /etc/init.d/net.eth1 + rc-update add net.eth1 default + + # select the first available kernel + eselect uimage set 1 + + # cleaning up deps + rc-update --update +} + +setup_startup_caches() { + mount -t proc proc /proc + /lib/rc/bin/rc-depend -u + # Generate openrc cache + [[ -d "/lib/rc/init.d" ]] && touch /lib/rc/init.d/softlevel + [[ -d "/run/openrc" ]] && touch /run/openrc/softlevel + /etc/init.d/savecache start + /etc/init.d/savecache zap + ldconfig + ldconfig + umount /proc +} + + +setup_users() { + # setup root password to... root! + echo root:sablink | chpasswd +} + +setup_serial() { + # setup serial login + sed -i "s:^s0.*::" /etc/inittab + echo "s0:12345:respawn:/sbin/agetty 115200 ttyS0 vt100" >> /etc/inittab +} + +setup_fallback_network() { + # setup fallback network + echo "" >> /etc/conf.d/net + echo "" >> /etc/conf.d/net + echo "# Sablink Core Network Config" >> /etc/conf.d/net + echo "#" >> /etc/conf.d/net + echo "# DHCP IP / route configuration, with fallback to a static IP / route" >> /etc/conf.d/net + echo "#" >> /etc/conf.d/net + echo "" >> /etc/conf.d/net + echo "config_eth1=\"dhcp\"" >> /etc/conf.d/net + echo "fallback_eth1=\"192.168.178.103 netmask 255.255.255.0 broadcast 192.168.178.255\"" >> /etc/conf.d/net + echo "fallback_route_eth1=\"default via 192.168.178.1\"" >> /etc/conf.d/net + echo "" >> /etc/conf.d/net + echo "" >> /etc/conf.d/net + echo "#" >> /etc/conf.d/net + echo "# pure static IP / route configuration, should the above not work even with fallback.." >> /etc/conf.d/net + echo "# (in that case, comment the whole DHCP section and uncomment this one)" >> /etc/conf.d/net + echo "#" >> /etc/conf.d/net + echo "" >> /etc/conf.d/net + echo "#config_eth1=\"192.168.11.3 netmask 255.255.255.0 broadcast 192.168.11.255\"" >> /etc/conf.d/net + echo "#routes_eth1=\"default via 192.168.11.1\"" >> /etc/conf.d/net + echo "" >> /etc/conf.d/net + echo "" >> /etc/conf.d/net + echo "" >> /etc/conf.d/net + echo "#" >> /etc/conf.d/net + echo "# DNS configuration" >> /etc/conf.d/net + echo "#" >> /etc/conf.d/net + echo "" >> /etc/conf.d/net + echo "dns_servers_eth1=\"192.168.178.1\"" >> /etc/conf.d/net +} + +setup_fstab() { + sed -e "s!/BOOT!/sda1!g" -e "s!/ROOT!/sda2!g" -e "s!SWAP!sda3!g" -e "s!ext3!btrfs!g" -i /etc/fstab +} + +setup_layman() { + sed -e "s!/source!/#source!g" -i /etc/make.conf +} + +setup_users +setup_boot +setup_serial +setup_startup_caches +setup_fallback_network +setup_fstab +setup_layman + +exit 0 + diff --git a/scripts/mkloopgptdisk_buffalo_ls_pro_live_chroot_hook.sh b/scripts/mkloopgptdisk_buffalo_ls_pro_live_chroot_hook.sh index 243c744..168284b 100755 --- a/scripts/mkloopgptdisk_buffalo_ls_pro_live_chroot_hook.sh +++ b/scripts/mkloopgptdisk_buffalo_ls_pro_live_chroot_hook.sh @@ -15,7 +15,9 @@ setup_boot() { # Linkstation Pro/Live Deamon rc-update add micro-evtd-boot boot rc-update add micro-evtd default - rc-update add vixie-cron boot + # add ntp sercice + rc-update add ntp-client default + rc-update add ntpd default # enable dbus, of course, and also NetworkManager rc-update add dbus boot @@ -87,7 +89,7 @@ setup_fallback_network() { } setup_fstab() { - sed -e "s!/BOOT!/sda1!g" -e "s!/ROOT!/sda2!g" -e "s!SWAP!sda3!g" -e "s!ext3!ext4!g" -i /etc/fstab + sed -e "s!/BOOT!/sda1!g" -e "s!/ROOT!/sda2!g" -e "s!SWAP!sda3!g" -e "s!ext3!btrfs!g" -i /etc/fstab } setup_layman() { diff --git a/scripts/mkloopgptdisk_buffalo_ls_xhl_chroot_hook.sh b/scripts/mkloopgptdisk_buffalo_ls_xhl_chroot_hook.sh index d1fce6f..a6105fd 100755 --- a/scripts/mkloopgptdisk_buffalo_ls_xhl_chroot_hook.sh +++ b/scripts/mkloopgptdisk_buffalo_ls_xhl_chroot_hook.sh @@ -15,7 +15,6 @@ setup_boot() { # Linkstation Pro/Live Deamon rc-update add ntp-client default rc-update add ntpd default - rc-update add vixie-cron boot # enable dbus, of course, and also NetworkManager rc-update add dbus boot @@ -87,7 +86,7 @@ setup_fallback_network() { } setup_fstab() { - sed -e "s!/BOOT!/sda1!g" -e "s!/ROOT!/sda2!g" -e "s!SWAP!sda3!g" -e "s!ext3!ext4!g" -i /etc/fstab + sed -e "s!/BOOT!/sda1!g" -e "s!/ROOT!/sda2!g" -e "s!SWAP!sda3!g" -e "s!ext3!btrfs!g" -i /etc/fstab } setup_layman() {