Move more files to the packages directory

This commit is contained in:
zador-blood-stained
2017-07-23 15:05:16 +03:00
parent ac59500233
commit a77418ff57
49 changed files with 94 additions and 133 deletions

View File

@@ -200,7 +200,7 @@ n=0
for line in "${buildlist[@]}"; do
unset LINUXFAMILY LINUXCONFIG KERNELDIR KERNELSOURCE KERNELBRANCH BOOTDIR BOOTSOURCE BOOTBRANCH ARCH UBOOT_USE_GCC KERNEL_USE_GCC \
CPUMIN CPUMAX UBOOT_VER KERNEL_VER GOVERNOR BOOTSIZE BOOTFS_TYPE UBOOT_TOOLCHAIN KERNEL_TOOLCHAIN PACKAGE_LIST_EXCLUDE KERNEL_IMAGE_TYPE \
write_uboot_platform family_tweaks setup_write_uboot_platform BOOTSCRIPT UBOOT_TARGET_MAP LOCALVERSION UBOOT_COMPILER KERNEL_COMPILER \
write_uboot_platform family_tweaks family_tweaks_bsp setup_write_uboot_platform BOOTSCRIPT UBOOT_TARGET_MAP LOCALVERSION UBOOT_COMPILER KERNEL_COMPILER \
MODULES MODULES_NEXT MODULES_DEV INITRD_ARCH HAS_UUID_SUPPORT BOOTENV_FILE BOOTDELAY MODULES_BLACKLIST MODULES_BLACKLIST_NEXT \
MODULES_BLACKLIST_DEV MOUNT SDCARD BOOTPATCHDIR KERNELPATCHDIR buildtext RELEASE IMAGE_TYPE OVERLAY_PREFIX ASOUND_STATE

View File

@@ -64,11 +64,14 @@ family_tweaks()
sed -e 's/DEVICE=""/DEVICE="\/dev\/lirc0"/g' -i $CACHEDIR/$SDCARD/etc/lirc/hardware.conf
sed -e 's/DRIVER="UNCONFIGURED"/DRIVER="default"/g' -i $CACHEDIR/$SDCARD/etc/lirc/hardware.conf
cp $SRC/lib/config/lirc.conf.cubox-i $CACHEDIR/$SDCARD/etc/lirc/lircd.conf
install -m 755 $SRC/lib/bin/brcm_patchram_plus_cubox $CACHEDIR/$SDCARD/usr/local/bin/brcm_patchram_plus
cp $SRC/lib/scripts/brcm4330 $CACHEDIR/$SDCARD/etc/default
install -m 755 $SRC/lib/scripts/brcm4330-patch $CACHEDIR/$SDCARD/etc/init.d/brcm4330-patch
# TODO: Fix the workaround in firstrun?
#chroot $CACHEDIR/$SDCARD /bin/bash -c "LC_ALL=C LANG=C update-rc.d brcm4330-patch defaults>> /dev/null"
if [[ $BRANCH == next && -f $CACHEDIR/$SDCARD/boot/boot.cmd ]]; then
sed -e 's/console=tty1 //g' -i $CACHEDIR/$SDCARD/boot/boot.cmd
fi
}
family_tweaks_bsp()
{
install -m 755 $SRC/lib/packages/bsp/cubox/brcm_patchram_plus $destination/usr/bin/brcm_patchram_plus
cp $SRC/lib/packages/bsp/cubox/brcm4330 $destination/etc/default/
# TODO: replace by a systemd service
install -m 755 $SRC/lib/packages/bsp/cubox/brcm4330-patch $destination/etc/init.d/brcm4330-patch
}

View File

@@ -1,47 +0,0 @@
BOOTSOURCE='https://github.com/hardkernel/u-boot.git'
BOOTBRANCH='branch:odroidc-v2011.03'
BOOTDIR='u-boot-odroidc1'
BOOTPATCHDIR='u-boot-odroidc1'
UBOOT_USE_GCC='< 4.9'
BOOTSCRIPT='boot-odroid-c1.ini:boot.ini'
UBOOT_TARGET_MAP=';;sd_fuse/bl1.bin.hardkernel sd_fuse/u-boot.bin'
HAS_UUID_SUPPORT=yes
KERNEL_IMAGE_TYPE=uImage
case $BRANCH in
default)
KERNELSOURCE='https://github.com/hardkernel/linux'
KERNELBRANCH='branch:odroidc-3.10.y'
KERNELDIR='linux-odroidc1'
KERNEL_USE_GCC='< 4.9'
;;
next)
KERNELSOURCE='https://github.com/tobetter/linux'
KERNELBRANCH='branch:odroidxu4-v4.2'
KERNELDIR='linux-odroidxu-next'
;;
esac
CPUMIN=504000
CPUMAX=1632000
GOVERNOR=interactive
write_uboot_platform()
{
dd if=$1/bl1.bin.hardkernel of=$2 bs=1 count=442 conv=fsync > /dev/null 2>&1
dd if=$1/bl1.bin.hardkernel of=$2 bs=512 skip=1 seek=1 conv=fsync > /dev/null 2>&1
dd if=$1/u-boot.bin of=$2 bs=512 seek=64 conv=fsync > /dev/null 2>&1
dd if=/dev/zero of=$2 seek=1024 count=32 bs=512 conv=fsync > /dev/null 2>&1
}
family_tweaks()
{
install -m 755 $SRC/lib/scripts/c1_init.sh $CACHEDIR/$SDCARD/etc/
sed -e 's/exit 0//g' -i $CACHEDIR/$SDCARD/etc/rc.local
echo "/etc/c1_init.sh" >> $CACHEDIR/$SDCARD/etc/rc.local
echo "exit 0" >> $CACHEDIR/$SDCARD/etc/rc.local
}

View File

@@ -6,7 +6,7 @@ case $BOARD in
nanopik2)
BOOTSCRIPT="boot-meson64.cmd:boot.cmd"
# we use binary uboot until compiler troubles are solved. u-boot.bin is the only need file
UBOOT_TARGET_MAP="u-boot-dtb.img;;$SRC/lib/bin/nanopi-k2/u-boot.bin u-boot-dtb.img"
UBOOT_TARGET_MAP="u-boot-dtb.img;;$SRC/lib/packages/blobs/meson/nanopi-k2-u-boot.bin:u-boot.bin u-boot-dtb.img"
HAS_UUID_SUPPORT=yes
;;
esac

View File

@@ -39,23 +39,12 @@ write_uboot_platform()
family_tweaks()
{
install -m 755 $SRC/lib/scripts/c1_init.sh $CACHEDIR/$SDCARD/usr/local/bin
# systemd service for c1_init.sh
cat <<-EOF > $CACHEDIR/$SDCARD/etc/systemd/system/odroid-c1-hdmi.service
[Unit]
Description=Odroid C1 HDMI init
DefaultDependencies=no
Wants=rsyslog.service systemd-journald.service
Before=syslog.target sysinit.target
After=local-fs.target
[Service]
Type=oneshot
ExecStart=/usr/local/bin/c1_init.sh
RemainAfterExit=no
[Install]
WantedBy=sysinit.target
EOF
# enable service installed from BSP
chroot $CACHEDIR/$SDCARD /bin/bash -c "systemctl --no-reload enable odroid-c1-hdmi.service >/dev/null 2>&1"
}
family_tweaks_bsp()
{
install -m 755 $SRC/lib/packages/bsp/odroid/c1_init.sh $destination/usr/lib/armbian/c1_init.sh
cp $SRC/lib/packages/bsp/odroid/odroid-c1-hdmi.service $destination/lib/systemd/system/
}

View File

@@ -55,23 +55,12 @@ family_tweaks()
sed -i 's/LIRCD_ARGS=.*/LIRCD_ARGS="--uinput"/' $CACHEDIR/$SDCARD/etc/lirc/hardware.conf
cp $SRC/lib/config/lirc.conf.odroidc2 $CACHEDIR/$SDCARD/etc/lirc/lircd.conf
install -m 755 $SRC/lib/scripts/c2_init.sh $CACHEDIR/$SDCARD/usr/local/bin
# systemd service for c1_init.sh
cat <<-EOF > $CACHEDIR/$SDCARD/etc/systemd/system/odroid-c2-hdmi.service
[Unit]
Description=Odroid C2 HDMI init
DefaultDependencies=no
Wants=rsyslog.service systemd-journald.service
Before=syslog.target sysinit.target
After=local-fs.target
[Service]
Type=oneshot
ExecStart=/usr/local/bin/c2_init.sh
RemainAfterExit=no
[Install]
WantedBy=sysinit.target
EOF
# enable service installed from BSP
chroot $CACHEDIR/$SDCARD /bin/bash -c "systemctl --no-reload enable odroid-c2-hdmi.service >/dev/null 2>&1"
}
family_tweaks_bsp()
{
install -m 755 $SRC/lib/packages/bsp/odroid/c2_init.sh $destination/usr/lib/armbian/c2_init.sh
cp $SRC/lib/packages/bsp/odroid/odroid-c2-hdmi.service $destination/lib/systemd/system/
}

View File

@@ -32,5 +32,5 @@ write_uboot_platform()
family_tweaks()
{
cp $SRC/lib/bin/rda8810_modem.bin $CACHEDIR/$SDCARD/boot/modem.bin
cp $SRC/lib/packages/blobs/rda/rda8810_modem.bin $CACHEDIR/$SDCARD/boot/modem.bin
}

View File

@@ -1,6 +1,6 @@
BOOTSCRIPT="boot-rockchip.cmd:boot.cmd"
BOOTENV_FILE='rockchip-default.txt'
UBOOT_TARGET_MAP=";;$SRC/lib/bin/rk3288_boot.bin u-boot-dtb.bin spl/u-boot-spl-dtb.bin"
UBOOT_TARGET_MAP=";;$SRC/lib/packages/blobs/rockchip/rk3288_boot.bin u-boot-dtb.bin spl/u-boot-spl-dtb.bin"
UBOOT_USE_GCC='> 6.0'

View File

@@ -14,7 +14,7 @@ case $BOARD in
BOOTSOURCE='https://github.com/LeMaker/u-boot-actions'
BOOTBRANCH='branch:s500-master'
BOOTDIR='u-boot-s500'
UBOOT_TARGET_MAP="u-boot-dtb.img;;$SRC/lib/bin/s500-bootloader-guitar.bin u-boot-dtb.img"
UBOOT_TARGET_MAP="u-boot-dtb.img;;$SRC/lib/packages/blobs/s500/s500-bootloader-guitar.bin u-boot-dtb.img"
SERIALCON=ttyS3
;;
@@ -23,7 +23,7 @@ case $BOARD in
BOOTBRANCH='branch:merge-20160113'
BOOTDIR='u-boot-roseapple'
BOOTPATCHDIR='u-boot-roseapple'
UBOOT_TARGET_MAP="u-boot-dtb.img;;$SRC/lib/bin/s500-bootloader-roseapple.bin u-boot-dtb.img"
UBOOT_TARGET_MAP="u-boot-dtb.img;;$SRC/lib/packages/blobs/s500/s500-bootloader-roseapple.bin u-boot-dtb.img"
SERIALCON=ttyS2
;;
esac

View File

@@ -55,33 +55,35 @@ write_uboot_platform()
family_tweaks()
{
if [[ $BRANCH == default ]]; then
# Bluetooth
install -m 755 $SRC/lib/bin/rtk_hciattach $CACHEDIR/$SDCARD/usr/local/bin
install -m 644 $SRC/lib/scripts/services/pinebook-bluetooth.service $CACHEDIR/$SDCARD/etc/systemd/system/
chroot $CACHEDIR/$SDCARD /bin/bash -c "systemctl --no-reload enable pinebook-bluetooth.service>/dev/null 2>&1"
# Wi-Fi: mask 2nd interface, disabled powermanagement
echo -e "options 8723bs if2name=p2p0 rtw_power_mgnt=0\noptions 8723cs if2name=p2p0 rtw_power_mgnt=0" \
>$CACHEDIR/$SDCARD/etc/modprobe.d/wifi-rt8723-pine64.conf
# Copy battery logos
[ -d "$CACHEDIR/$SDCARD/boot/bat" ] || mkdir -p -m 755 "$CACHEDIR/$SDCARD/boot/bat"
for batlogo in low_pwr.bmp bempty.bmp battery_charge.bmp ; do
cp "$SRC/lib/bin/icons/pinebook-a64_$batlogo" "$CACHEDIR/$SDCARD/boot/bat/$batlogo"
done
# boot logo and touchpad settings
mkdir -p $CACHEDIR/$SDCARD/boot/bat
if [[ $BOARD == pinebook-a64 ]]; then
cp "$SRC/lib/bin/icons/pinebook-a64_bootlogo.bmp" "$CACHEDIR/$SDCARD/boot/bootlogo.bmp"
cp "$SRC/lib/config/50-pine64-pinebook-touchpad.conf" "$CACHEDIR/$SDCARD/etc/X11/xorg.conf.d/50-pine64-pinebook-touchpad.conf"
cp -R $SRC/lib/packages/blobs/pinebook/* $CACHEDIR/$SDCARD/boot/
# enable services installed from BSP
chroot $CACHEDIR/$SDCARD /bin/bash -c "systemctl --no-reload enable pinebook-bluetooth.service pinebook-enable-sound.service \
pinebook-store-sound-on-suspend.service pinebook-restore-sound-after-resume.service >/dev/null 2>&1"
cp $SRC/lib/config/50-pine64-pinebook-touchpad.conf $CACHEDIR/$SDCARD/etc/X11/xorg.conf.d/50-pine64-pinebook-touchpad.conf
fi
# power manager
[[ $BUILD_DESKTOP == yes && $BOARD == pinebook-a64 ]] && chroot $CACHEDIR/$SDCARD /bin/bash -c "apt-get -qq -y install xfce4-power-manager >/dev/null 2>&1"
# suspend resume audio fix for Pinebook
install -m 644 $SRC/lib/scripts/services/pinebook-store-sound-on-suspend.service $CACHEDIR/$SDCARD/etc/systemd/system/
install -m 644 $SRC/lib/scripts/services/pinebook-restore-sound-after-resume.service $CACHEDIR/$SDCARD/etc/systemd/system/
chroot $CACHEDIR/$SDCARD /bin/bash -c "systemctl enable pinebook-store-sound-on-suspend.service"
chroot $CACHEDIR/$SDCARD /bin/bash -c "systemctl enable pinebook-restore-sound-after-resume.service"
fi
if [[ $BRANCH == dev && $BOARD == pine64so ]]; then
echo "mmc0-broken-cd=on" >> $CACHEDIR/$SDCARD/boot/armbianEnv.txt
fi
}
family_tweaks_bsp()
{
if [[ $BRANCH == default && $BOARD == pinebook-a64 ]]; then
# Bluetooth
install -m 755 $SRC/lib/packages/bsp/pinebook/rtk_hciattach $destination/usr/bin
cp $SRC/lib/packages/bsp/pinebook/pinebook-bluetooth.service $destination/lib/systemd/system/
# sound/serial console switch on some Pinebook revisions
cp $SRC/lib/packages/bsp/pinebook/pinebook-enable-sound.service $destination/lib/systemd/system/
# suspend resume audio fix for Pinebook
cp $SRC/lib/packages/bsp/pinebook/pinebook-store-sound-on-suspend.service $destination/lib/systemd/system/
cp $SRC/lib/packages/bsp/pinebook/pinebook-restore-sound-after-resume.service $destination/lib/systemd/system/
fi
}

View File

@@ -51,10 +51,11 @@ family_tweaks()
# SD card is elsewhere
sed 's/mmcblk0p1/mmcblk1p1/' -i $CACHEDIR/$SDCARD/etc/fstab
# firmware for M4
# TODO: move to the u-boot package as a patch?
mkdir -p $CACHEDIR/$SDCARD/boot/bin/
cp $SRC/lib/bin/m4startup.fw* $CACHEDIR/$SDCARD/boot/bin/
cp $SRC/lib/packages/blobs/udoo/m4startup.fw* $CACHEDIR/$SDCARD/boot/bin/
# fix for BT
cp $SRC/lib/bin/udoo-neo-debs/udooneo-bluetooth_1.2-1_armhf.deb $CACHEDIR/$SDCARD/tmp
cp $SRC/lib/packages/blobs/udoo/udooneo-bluetooth_1.2-1_armhf.deb $CACHEDIR/$SDCARD/tmp
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg -i /tmp/udooneo-bluetooth_1.2-1_armhf.deb >/dev/null 2>&1"
fi
}

View File

@@ -56,10 +56,11 @@ family_tweaks()
# SD card is elsewhere
sed 's/mmcblk0p1/mmcblk1p1/' -i $CACHEDIR/$SDCARD/etc/fstab
# firmware for M4
# TODO: move to the u-boot package as a patch?
mkdir -p $CACHEDIR/$SDCARD/boot/bin/
cp $SRC/lib/bin/m4startup.fw* $CACHEDIR/$SDCARD/boot/bin/
cp $SRC/lib/packages/blobs/udoo/m4startup.fw* $CACHEDIR/$SDCARD/boot/bin/
# fix for BT
cp $SRC/lib/bin/udoo-neo-debs/udooneo-bluetooth_1.2-1_armhf.deb $CACHEDIR/$SDCARD/tmp
cp $SRC/lib/packages/blobs/udoo/udooneo-bluetooth_1.2-1_armhf.deb $CACHEDIR/$SDCARD/tmp
chroot $CACHEDIR/$SDCARD /bin/bash -c "dpkg -i /tmp/udooneo-bluetooth_1.2-1_armhf.deb >/dev/null 2>&1"
fi
}

View File

@@ -181,7 +181,7 @@ create_rootfs_cache()
# stage: add armbian repository and install key
echo "deb http://apt.armbian.com $RELEASE main utils ${RELEASE}-desktop" > $CACHEDIR/$SDCARD/etc/apt/sources.list.d/armbian.list
cp $SRC/lib/bin/armbian.key $CACHEDIR/$SDCARD
cp $SRC/lib/config/armbian.key $CACHEDIR/$SDCARD
eval 'chroot $CACHEDIR/$SDCARD /bin/bash -c "cat armbian.key | apt-key add -"' \
${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'}
rm $CACHEDIR/$SDCARD/armbian.key

View File

@@ -137,7 +137,7 @@ install_common()
cp $SRC/lib/bin/splash/armbian-u-boot.bmp $CACHEDIR/$SDCARD/boot/boot.bmp
cp $SRC/lib/bin/splash/armbian-desktop.png $CACHEDIR/$SDCARD/boot/boot-desktop.png
# execute $LINUXFAMILY-specific tweaks from $BOARD.conf
# execute $LINUXFAMILY-specific tweaks
[[ $(type -t family_tweaks) == function ]] && family_tweaks
install -m 755 $SRC/lib/scripts/resize2fs $CACHEDIR/$SDCARD/etc/init.d/

View File

@@ -88,9 +88,6 @@ create_board_package()
if [ -f "/etc/systemd/system/log2ram.service" ]; then
mv /etc/systemd/system/log2ram.service /etc/systemd/system/log2ram-service.dpkg-old
fi
if [ -f "/lib/systemd/system/pinebook-enable-sound.service" ]; then
systemctl enable pinebook-enable-sound.service
fi
exit 0
EOF
@@ -242,10 +239,8 @@ create_board_package()
cp $SRC/lib/packages/bsp/mpv/mpv_mainline.conf $destination/etc/mpv/mpv.conf
fi
#TODO: move to sources.conf and to a subdirectory in packages/bsp
if [[ $BOARD == pinebook-a64 ]]; then
cp $SRC/lib/packages/bsp/pinebook-enable-sound.service $destination/lib/systemd/system/
fi
# execute $LINUXFAMILY-specific tweaks
[[ $(type -t family_tweaks_bsp) == function ]] && family_tweaks_bsp
# add some summary to the image
fingerprint_image "$destination/etc/armbian.txt"

View File

Before

Width:  |  Height:  |  Size: 4.0 MiB

After

Width:  |  Height:  |  Size: 4.0 MiB

View File

Before

Width:  |  Height:  |  Size: 4.0 MiB

After

Width:  |  Height:  |  Size: 4.0 MiB

View File

Before

Width:  |  Height:  |  Size: 4.0 MiB

After

Width:  |  Height:  |  Size: 4.0 MiB

View File

Before

Width:  |  Height:  |  Size: 3.0 MiB

After

Width:  |  Height:  |  Size: 3.0 MiB

View File

@@ -0,0 +1,14 @@
[Unit]
Description=Odroid C1 HDMI init
DefaultDependencies=no
Wants=rsyslog.service systemd-journald.service
Before=syslog.target sysinit.target
After=local-fs.target
[Service]
Type=oneshot
ExecStart=/usr/lib/armbian/c1_init.sh
RemainAfterExit=no
[Install]
WantedBy=sysinit.target

View File

@@ -0,0 +1,14 @@
[Unit]
Description=Odroid C2 HDMI init
DefaultDependencies=no
Wants=rsyslog.service systemd-journald.service
Before=syslog.target sysinit.target
After=local-fs.target
[Service]
Type=oneshot
ExecStart=/usr/lib/armbian/c2_init.sh
RemainAfterExit=no
[Install]
WantedBy=sysinit.target

View File

@@ -3,7 +3,7 @@ Description=Realtek H5 bluetooth support
Before=bluetooth.service
[Service]
ExecStart=/usr/local/bin/rtk_hciattach -n -s 115200 /dev/ttyS1 rtk_h5
ExecStart=/usr/bin/rtk_hciattach -n -s 115200 /dev/ttyS1 rtk_h5
[Install]
WantedBy=multi-user.target

View File

@@ -47,12 +47,12 @@ compile_tools()
# brcm
cp $tmpdir/brcm/{brcm_bt_reset,brcm_patchram_plus} $tmpdir/armbian-tools-${RELEASE}_${REVISION}_${ARCH}/usr/bin
# brcm configs and service
install -m 644 $SRC/lib/scripts/brcm40183 $tmpdir/armbian-tools-${RELEASE}_${REVISION}_${ARCH}/etc/default
install -m 755 $SRC/lib/scripts/brcm40183-patch $tmpdir/armbian-tools-${RELEASE}_${REVISION}_${ARCH}/etc/init.d
install -m 644 $SRC/lib/packages/extras/tools/brcm40183 $tmpdir/armbian-tools-${RELEASE}_${REVISION}_${ARCH}/etc/default
install -m 755 $SRC/lib/packages/extras/tools/brcm40183-patch $tmpdir/armbian-tools-${RELEASE}_${REVISION}_${ARCH}/etc/init.d
# ap6212 configs and service
install -m 644 $SRC/lib/scripts/ap6212 $tmpdir/armbian-tools-${RELEASE}_${REVISION}_${ARCH}/etc/default
install -m 755 $SRC/lib/scripts/ap6212-bluetooth $tmpdir/armbian-tools-${RELEASE}_${REVISION}_${ARCH}/etc/init.d
install -m 644 $SRC/lib/packages/extras/tools/ap6212 $tmpdir/armbian-tools-${RELEASE}_${REVISION}_${ARCH}/etc/default
install -m 755 $SRC/lib/packages/extras/tools/ap6212-bluetooth $tmpdir/armbian-tools-${RELEASE}_${REVISION}_${ARCH}/etc/init.d
cd $tmpdir/armbian-tools-${RELEASE}_${REVISION}_${ARCH}
find . -type f ! -regex '.*.hg.*' ! -regex '.*?debian-binary.*' ! -regex '.*?DEBIAN.*' -printf '%P ' | xargs md5sum > DEBIAN/md5sums

View File

@@ -22,7 +22,7 @@ install_usb_redirector()
EXTRA_BUILD_FLAGS=""
fi
else
cp $SRC/lib/bin/usb-redirector-old.tgz usb-redirector-linux-arm-eabi.tar.gz
cp $SRC/lib/packages/extras/usb-redirector/usb-redirector-old.tgz usb-redirector-linux-arm-eabi.tar.gz
fi
tar xfz usb-redirector-linux-arm-eabi.tar.gz

View File

@@ -27,7 +27,7 @@ source general.sh
addtorepo
# add a key to repo
cp bin/armbian.key ../output/repository/public
cp config/armbian.key ../output/repository/public
cd ../output/repository/public
echo "done."