Skip to content

Commit

Permalink
added working extconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
reey authored Jan 17, 2019
1 parent a7ecb2b commit 47923e4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 15 deletions.
16 changes: 2 additions & 14 deletions alarm/uboot-nyan-big/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,15 @@ arch=('armv7h')
url="http://git.denx.de/u-boot.git/"
license=('GPL')
makedepends=('git' 'bc' 'dtc' 'vboot-utils' 'python2' 'swig')
conflicts=('linux-armv7-chromebook' 'linux-armv7-rc-chromebook' 'linux-nyan-chromebook')
conflicts=('linux-armv7-chromebook' 'linux-armv7-rc-chromebook')
install=${pkgname}.install
source=("ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver/rc/-rc}.tar.bz2"
'boot.txt'
'mkscr'
'uboot.patch')
md5sums=('SKIP'
'029cb473f59f08834b54cdc3e34c9672'
'021623a04afd29ac3f368977140cfbfd'
'SKIP')
'SKIP')

prepare() {
cd u-boot-${pkgver/rc/-rc}
# git apply --verbose --no-index --directory ./ ../add-padding-to-its-file.patch
# git apply --verbose --no-index --directory ./ ../change-spi-delay.patch
patch -p1 -i ../uboot.patch
}

Expand All @@ -46,10 +40,4 @@ build() {
package() {
cd u-boot-${pkgver/rc/-rc}
install -Dm644 u-boot.kpart "${pkgdir}"/boot/u-boot.kpart

install -Dm644 ../boot.txt "${pkgdir}"/boot/boot.txt
sed -i "s/@@FDTFILE@@/${dtb}/" "${pkgdir}"/boot/boot.txt
./b/${name}/tools/mkimage -A arm -O linux -T script -C none -n "U-Boot
boot script" -d "${pkgdir}"/boot/boot.txt "${pkgdir}"/boot/boot.scr
install -Dm755 ../mkscr "${pkgdir}"/boot/mkscr
}
27 changes: 26 additions & 1 deletion alarm/uboot-nyan-big/uboot-nyan-big.install
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ flash_uboot() {
major=$(mountpoint -d / | cut -f 1 -d ':')
minor=$(mountpoint -d / | cut -f 2 -d ':')
device=$(cat /proc/partitions | awk {'if ($1 == "'${major}'" && $2 == "'${minor}'") print $4 '})
deviceroot="/dev/${device}"
rootfsPARTUUID="$(blkid -s PARTUUID -o value ${deviceroot})"
device="/dev/${device/%2/1}"

sed -i "s/@@PARTUUID@@/${rootfsPARTUUID}/" /extlinux/extlinux.conf
echo "A new U-Boot version needs to be flashed onto ${device}."
echo "Do you want to do this now? [y|N]"
read -r shouldwe
Expand All @@ -16,6 +18,29 @@ flash_uboot() {
fi
}

create_extlinuxconf() {
if [ ! -f /extlinux/extlinux.conf ]
then
if [ ! -d /extlinux ]
then
echo "Creating /extlinux directory"
mkdir /extlinux
fi
echo "Creating /extlinux/extlinux.conf file"
echo -e "TIMEOUT 50 \n\nMENU TITLE Nyan-big boot options\n\nLABEL nyan-big1\n MENU LABEL ../boot/zImage nyan-big1\n LINUX ../boot/zImage\n FDTDIR ../boot/dtbs\n APPEND console=tty0 noinitrd rw rootwait root=PARTUUID=@@PARTUUID@@" > /extlinux/extlinux.conf
else
echo "Existing extlinux.conf found at /extlinux/extlinux.conf"
fi
}

pre_install() {
create_extlinuxconf
}

pre_upgrade() {
create_extlinuxconf
}

post_install() {
flash_uboot
}
Expand Down

0 comments on commit 47923e4

Please sign in to comment.