From 7d91fab5a0831d9aeaacca6595b7462fd50568d2 Mon Sep 17 00:00:00 2001 From: parazyd Date: Sat, 16 Apr 2016 03:40:11 +0200 Subject: [PATCH] making way for other distros --- README.md | 9 ++++++--- arm/init-arm | 13 +++++++------ arm/{common => profiles/common-devuan} | 25 ++++++++++++++++++++++++- arm/scripts/bananapi.sh | 2 -- arm/scripts/chromebook-acer.sh | 2 -- arm/scripts/cubieboard2.sh | 2 -- arm/scripts/raspberry-pi-2.sh | 2 -- config | 20 +++----------------- 8 files changed, 40 insertions(+), 35 deletions(-) rename arm/{common => profiles/common-devuan} (95%) diff --git a/README.md b/README.md index db84e93..203e576 100644 --- a/README.md +++ b/README.md @@ -41,13 +41,16 @@ then step inside the sdk, "source" it: ; source sdk ``` -Now is the time you choose the device you want to build the image for. Currently -you can choose one of the following: +Now is the time you choose the device and OS you want to build the image for. Currently +you can choose these distros: +* `devuan` +and one of the following devices: * `raspi2` * `bananapi` * `cubieboard2` +* `chromeacer` ``` -; init-arm raspi2 +; init devuan raspi2 ``` Once initialized, you will get further instructions. diff --git a/arm/init-arm b/arm/init-arm index 3099d41..d154f1a 100644 --- a/arm/init-arm +++ b/arm/init-arm @@ -19,12 +19,13 @@ # 675 Mass Ave, Cambridge, MA 02139, USA. # -init-arm() { - fn init-arm $* - armdev="$1" - req=(armdev) +init() { + fn init $* + distro="$1" + armdev="$2" + req=(distro armdev) ckreq || { - error "No ARM device specified" + error "No distro or device specified" return 1 } @@ -38,6 +39,6 @@ init-arm() { arm_build_device=${arm_map[$armdev]} - common="$R/arm/common" + common="$R/arm/profiles/common-${distro}" source ${arm_build_device} } diff --git a/arm/common b/arm/profiles/common-devuan similarity index 95% rename from arm/common rename to arm/profiles/common-devuan index 091b530..c0220ba 100644 --- a/arm/common +++ b/arm/profiles/common-devuan @@ -20,9 +20,25 @@ # # Common functions for builds +# -- settings -- +os=devuan +release=jessie +section=main +version=alpha4 +mirror=http://packages.devuan.org/merged + +core_packages=(debian-keyring devuan-keyring) +core_packages+=(git-core binutils ca-certificates initramfs-tools u-boot-tools) +core_packages+=(locales console-common less nano git curl) + +base_packages=(bzip2 dialog apt-utils fakeroot e2fsprogs parted) + +system_packages=(sysvinit ssh) + writebase="$strapdir" command -v dcfldd >/dev/null && DD=`command -v dcfldd` DD=${DD:-/bin/dd} +# -- end settings -- write-hostname() { fn write-hostname @@ -344,12 +360,16 @@ ${device_name}-pack-image() { } get-kernel-firmware() { + fn get-kernel-firmware + [[ -d $R/tmp/firmware ]] || git clone \ https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git $R/tmp/firmware rm -rf $R/tmp/firmware/.git } clean-kernel-leftovers() { + fn clean-kernel-leftovers + notice "Cleaning up from kernel build..." sudo rm -r ${strapdir}/usr/src/kernel sudo rm ${strapdir}/usr/src/${device_name}.config @@ -363,8 +383,9 @@ clean-kernel-leftovers() { } copy-kernel-config() { - cd ${strapdir}/usr/src/kernel + fn copy-kernel-config + cd ${strapdir}/usr/src/kernel cp -v ${workdir}/../kernel-configs/${device_name}.config .config sudo cp -v ${workdir}/../kernel-configs/${device_name}.config ../${device_name}.config @@ -373,6 +394,7 @@ copy-kernel-config() { } make-kernel-modules() { + fn make-kernel-modules [[ -d ${strapdir}/lib/modules ]] || sudo mkdir -p ${strapdir}/lib/modules [[ -d ${strapdir}/lib/firmware ]] || sudo mkdir -p ${strapdir}/lib/firmware sudo chown -R $USER ${strapdir}/lib/modules @@ -385,6 +407,7 @@ make-kernel-modules() { } copy-zram() { + fn copy-zram notice "Installing zram init" sudo cp ${workdir}/../extra/zram ${strapdir}/etc/init.d/zram sudo chmod +x ${strapdir}/etc/init.d/zram diff --git a/arm/scripts/bananapi.sh b/arm/scripts/bananapi.sh index 127c656..e243cf4 100755 --- a/arm/scripts/bananapi.sh +++ b/arm/scripts/bananapi.sh @@ -29,8 +29,6 @@ extra_packages=() # Ones below should not need changing workdir="$R/arm/${device_name}-build" strapdir="${workdir}/${os}-${arch}" -qemu_bin="/usr/bin/qemu-arm-static" # Devuan -#qemu_bin="/usr/bin/qemu-arm" # Gentoo parted_boot=(fat32 2048s 264191s) parted_root=(ext4 264192s 100%) inittab="T1:12345:respawn:/sbin/agetty -L ttyS0 115200 vt100" diff --git a/arm/scripts/chromebook-acer.sh b/arm/scripts/chromebook-acer.sh index 45745c2..755c065 100755 --- a/arm/scripts/chromebook-acer.sh +++ b/arm/scripts/chromebook-acer.sh @@ -31,8 +31,6 @@ extra_packages+=(laptop-mode-tools usbutils sudo vim) # Ones below should not need changing workdir="$R/arm/${device_name}-build" strapdir="${workdir}/${os}-${arch}" -qemu_bin="/usr/bin/qemu-arm-static" # Devuan -#qemu_bin="/usr/bin/qemu-arm" # Gentoo gpt=1 #parted_boot=(fat32 2048s 264191s) #parted_root=(ext4 264192s 100%) diff --git a/arm/scripts/cubieboard2.sh b/arm/scripts/cubieboard2.sh index 10047ca..595daa7 100755 --- a/arm/scripts/cubieboard2.sh +++ b/arm/scripts/cubieboard2.sh @@ -29,8 +29,6 @@ extra_packages=() # Ones below should not need changing workdir="$R/arm/${device_name}-build" strapdir="${workdir}/${os}-${arch}" -qemu_bin="/usr/bin/qemu-arm-static" # Devuan -#qemu_bin="/usr/bin/qemu-arm" # Gentoo parted_boot=(fat32 2048s 264191s) parted_root=(ext4 264192s 100%) inittab="T1:12345:respawn:/sbin/agetty -L ttyS0 115200 vt100" diff --git a/arm/scripts/raspberry-pi-2.sh b/arm/scripts/raspberry-pi-2.sh index 75648cf..5c86f19 100755 --- a/arm/scripts/raspberry-pi-2.sh +++ b/arm/scripts/raspberry-pi-2.sh @@ -29,8 +29,6 @@ extra_packages=(wpasupplicant ntpdate) # Ones below should not need changing workdir="$R/arm/${armdev}-build" strapdir="${workdir}/${os}-${arch}" -qemu_bin="/usr/bin/qemu-arm-static" # Devuan, install qemu-user-static -#qemu_bin="/usr/bin/qemu-arm" # Gentoo, compile with USE=static-user #enable_qemu_wrapper=1 # Uncomment this to enable qemu-wrapper (consult the readme) parted_boot=(fat32 0 64) parted_root=(ext4 64 -1) diff --git a/config b/config index b7c888f..0dcd805 100644 --- a/config +++ b/config @@ -2,16 +2,7 @@ # ARM SDK configuration # safe to leave untouched - -# syntax: variable=value -# (no spaces before and after the equal sign) - -os=devuan -release=jessie -section=main -version=alpha4 -mirror=http://packages.devuan.org/merged - +# # add here the info of the toolchain you are using # custom toolchain compiler="arm-linux-gnueabihf-" @@ -20,10 +11,5 @@ export PATH="$PATH:/sbin:$R/toolchains/gcc-arm-linux-gnueabihf-4.7/bin" #compiler="arm-none-eabi-" #export PATH="$PATH:/sbin" -core_packages=(debian-keyring devuan-keyring) -core_packages+=(git-core binutils ca-certificates initramfs-tools u-boot-tools) -core_packages+=(locales console-common less nano git curl) - -base_packages=(bzip2 dialog apt-utils fakeroot e2fsprogs parted) - -system_packages=(sysvinit ssh) +qemu_bin="/usr/bin/qemu-arm-static" # Devuan +#qemu_bin="/usr/bin/qemu-arm" # Gentoo