diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2013-12-06 15:21:26 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2013-12-06 15:22:30 +0000 |
commit | a79c90880c50e2225fe1600e9f7b6aaa777c54cd (patch) | |
tree | a76b18e3c2e604d18d541b314a72f0c59b6bed86 | |
parent | be38e44a7d8e243722c40679605fbb40a489d675 (diff) | |
download | aports-a79c90880c50e2225fe1600e9f7b6aaa777c54cd.tar.bz2 aports-a79c90880c50e2225fe1600e9f7b6aaa777c54cd.tar.xz |
main/alpine-conf: fix creating boot usb of v2.7
ref #2363
-rw-r--r-- | main/alpine-conf/0001-setup-bootable-move-syslinux.cfg-to-boot-syslinux-if.patch | 120 | ||||
-rw-r--r-- | main/alpine-conf/APKBUILD | 12 |
2 files changed, 128 insertions, 4 deletions
diff --git a/main/alpine-conf/0001-setup-bootable-move-syslinux.cfg-to-boot-syslinux-if.patch b/main/alpine-conf/0001-setup-bootable-move-syslinux.cfg-to-boot-syslinux-if.patch new file mode 100644 index 0000000000..1b81d5fa0d --- /dev/null +++ b/main/alpine-conf/0001-setup-bootable-move-syslinux.cfg-to-boot-syslinux-if.patch @@ -0,0 +1,120 @@ +From 1d006a11c9a2e42ea4b3b60e1bed82373a1d027e Mon Sep 17 00:00:00 2001 +From: Natanael Copa <ncopa@alpinelinux.org> +Date: Thu, 7 Nov 2013 14:14:03 +0100 +Subject: [PATCH] setup-bootable: move syslinux.cfg to /boot/syslinux/ if + needed + +(cherry picked from commit e8c99e12ef55bbc4d5a3bbb1d4075fb9d8bb8cae) +--- + setup-bootable.in | 55 +++++++++++++++++++++++++++++++++++++------------------ + 1 file changed, 37 insertions(+), 18 deletions(-) + +diff --git a/setup-bootable.in b/setup-bootable.in +index 2c16bc5..30cebde 100644 +--- a/setup-bootable.in ++++ b/setup-bootable.in +@@ -175,7 +175,7 @@ parent_dev=$(find_disk_dev $dev) + # check if this files exist and not in upgrade mode + if [ -z "$upgrade" ] && [ -z "$force" ]; then + for i in boot apks syslinux.cfg .alpine-release; do +- [ -e "$destdir"/$i ] && die "$destdir/$i already exists. Aborting" ++ [ -e "$destdir"/$i ] && die "$destdir/$i already exists. Use -u to upgrade." + done + fi + +@@ -208,15 +208,17 @@ available_space=$(( $free_blocks / $blocks_per_mb )) + vecho "Available space: $available_space MiB" + + if [ -n "$srcdir" ]; then +- needed_space=$(cd "$srcdir" && du -m -s -c boot apks syslinux.cfg .alpine-release | awk '$2 == "total" {print $1}') ++ needed_space=$(cd "$srcdir" && du -m -s -c boot apks .alpine-release | awk '$2 == "total" {print $1}') + vecho "Needed space: $needed_space MiB" + [ $available_space -lt $needed_space ] \ + && die "Not enough space on $destdir. Aborting." + + # copy the files to .new + for i in boot apks syslinux.cfg .alpine-release; do +- vecho "Copying $srcdir/$i to $destdir/.new/" +- cp -a "$srcdir"/$i "$destdir"/.new/ ++ if [ -e "$srcdir"/$i ]; then ++ vecho "Copying $srcdir/$i to $destdir/.new/" ++ cp -a "$srcdir"/$i "$destdir"/.new/ ++ fi + done + elif [ -n "$srcurl" ]; then + cd "$destdir"/.new +@@ -225,6 +227,19 @@ elif [ -n "$srcurl" ]; then + echo "" + fi + ++# find where new syslinux.cfg is ++for i in boot/syslinux/syslinux.cfg syslinux.cfg; do ++ if [ -e "$destdir"/.new/$i ]; then ++ syslinux_cfg=$i ++ vecho "Found $syslinux_cfg" ++ break ++ fi ++done ++# abort early in case unexpected trouble ++if [ -z "$syslinux_cfg" ]; then ++ die "Could not find any syslinux.cfg on new iso?" ++fi ++ + # make sure files are really there before we replace existing + vecho "Flushing cache..." + sync +@@ -232,18 +247,7 @@ sync + vecho "Replacing existing files..." + mkdir -p "$destdir"/.old || die "Failed to create $destdir/.old" + +-# do we want keep existing syslinux.cfg? +-tomove="boot apks .alpine-release" +-if [ -n "$force" ] || ! [ -e "$destdir"/syslinux.cfg ]; then +- tomove="$tomove syslinux.cfg" +- # update syslinux.cfg unless device is on usb bus +- # this is so we can boot from CF's and harddisk +- if ! on_usb_bus $parent_dev; then +- vecho "Updating syslinux.cfg to use $dest" +- sed -i -e "s/usbdisk/${dest##*/}/g" \ +- "$destdir"/.new/syslinux.cfg +- fi +-fi ++tomove="boot apks syslinux.cfg .alpine-release" + + # move current files to .old + for i in $tomove; do +@@ -252,14 +256,29 @@ for i in $tomove; do + fi + done + ++# keep any existing syslinux.cfg ++if [ -e "$destdir"/.old/$syslinux_cfg ]; then ++ mv "$destdir"/.old/$syslinux_cfg "$destdir"/.new/$syslinux_cfg ++elif [ -e "$destdir"/.old/syslinux.cfg ] \ ++ && [ -e "$destdir"/.new/boot/syslinux/syslinux.cfg ]; then ++ echo "Warning: moving syslinux.cfg to boot/syslinux/syslinux.cfg" >&2 ++ mv "$destdir"/.old/syslinux.cfg "$destdir"/.new/boot/syslinux ++ if [ -z "$syslinux" ]; then ++ echo " You might need run: syslinux $dest" >&2 ++ fi ++fi ++ + # move .new to current + for i in $tomove; do +- mv "$destdir"/.new/$i "$destdir"/ || die "Failed to move $destdir/.new/ to $destdir" ++ if [ -e "$destdir"/.new/$i ]; then ++ mv "$destdir"/.new/$i "$destdir"/ \ ++ || die "Failed to move $destdir/.new/ to $destdir" ++ fi + done + + if [ -z "$keep_alpine_dev" ] && [ -n "$UUID" ]; then + sed -i -e "s/alpine_dev=[^ \t:]\+/alpine_dev=UUID=$UUID/" \ +- "$destdir"/syslinux.cfg ++ "$destdir"/$syslinux_cfg + fi + + # cleanup +-- +1.8.5.1 + diff --git a/main/alpine-conf/APKBUILD b/main/alpine-conf/APKBUILD index 375d528811..eb70c86a1b 100644 --- a/main/alpine-conf/APKBUILD +++ b/main/alpine-conf/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=alpine-conf pkgver=2.12.0 -pkgrel=4 +pkgrel=5 pkgdesc="Alpine configuration management scripts" url=http://git.alpinelinux.org/cgit/$pkgname depends="openrc" @@ -10,6 +10,7 @@ source="http://dev.alpinelinux.org/archive/alpine-conf/alpine-conf-$pkgver.tar.b 0001-setup-interfaces-fix-vlan-raw-device.patch 0001-setup-disk-fix-running-update-extlinux-in-chroot.patch 0001-setup-disk-add-swap-to-etc-fstab.patch + 0001-setup-bootable-move-syslinux.cfg-to-boot-syslinux-if.patch " arch="all" @@ -44,14 +45,17 @@ md5sums="4038a3be9a785ead649d913e208e2bd8 alpine-conf-2.12.0.tar.bz2 1f2ee5791a9bb40bd5e9862f60299ce2 0001-setup-interfaces-fix-ip-can-t-find-device-eth1.3-mes.patch 8e528859d2ea4d24e2de9436c499a64d 0001-setup-interfaces-fix-vlan-raw-device.patch 5f8c8ef78f6ff53e4683a9daacf16355 0001-setup-disk-fix-running-update-extlinux-in-chroot.patch -ef759a251cd383dcb3b6b0b4cfb9bb0b 0001-setup-disk-add-swap-to-etc-fstab.patch" +ef759a251cd383dcb3b6b0b4cfb9bb0b 0001-setup-disk-add-swap-to-etc-fstab.patch +149c5ced712830b860dc7530e8ba51fe 0001-setup-bootable-move-syslinux.cfg-to-boot-syslinux-if.patch" sha256sums="d3f2a2e9a14ff2152731ed97aad9435da4be698b192400dc8dc942fc7830f0c4 alpine-conf-2.12.0.tar.bz2 4e24ab7e3c0c851af03ea48016aeaa7e066962ceddc96cdc9cdd5566f25b2bfd 0001-setup-interfaces-fix-ip-can-t-find-device-eth1.3-mes.patch 591cb749663bf0c1b0caff12e5e340cb468257409580e56b0dbecf4abba2ed94 0001-setup-interfaces-fix-vlan-raw-device.patch 3320a82abd79daa893a34cb9a235b27f539af12f8d32806b5630a7cef62d7aa6 0001-setup-disk-fix-running-update-extlinux-in-chroot.patch -930b4f225a06f42f4fdd47d3d01470bfe90f1413b0e5ad05f514138ee8e99104 0001-setup-disk-add-swap-to-etc-fstab.patch" +930b4f225a06f42f4fdd47d3d01470bfe90f1413b0e5ad05f514138ee8e99104 0001-setup-disk-add-swap-to-etc-fstab.patch +bd540386e907e8edd7f1a5a7f515319f89791529f5eadfe4bd1aece6c28878b2 0001-setup-bootable-move-syslinux.cfg-to-boot-syslinux-if.patch" sha512sums="93cc71a83d9e773b92a9993003c0b8b5ed98b5ee42db74c69cde635ca9230c59be0ce99588828729ec41c1a4262bbe9fdb60a81adf282c3f063ff916666e1140 alpine-conf-2.12.0.tar.bz2 400b527ada2dff3662a55f6046a9e2ae762e91456574ee3cb665bc2c469e1c0f29b2d9f9c1ea2e4bdf5d02554f20df0a6ebe78b06e957cce17e21233fd08a097 0001-setup-interfaces-fix-ip-can-t-find-device-eth1.3-mes.patch 2cb3c59f9edce7d4ebc821571314af41310ec94a543783ed67c738258434133d70be3cacc9d552e75381036ad014c2a38dec611101ce9d3649e326f120378cdf 0001-setup-interfaces-fix-vlan-raw-device.patch 1dd5132cd0179083cf06c11e1a8513b6e49d1d75f0d14c0f402997641537c29afe3fb709910eb7b9b6ecb17a89fd77224d16dd1478725296f5bacfdcfff240fd 0001-setup-disk-fix-running-update-extlinux-in-chroot.patch -42909ca1429c1b9e9683af8374b6787190f55131ba65fcccad1012fa2e633d0724559caec1c8bef56fb820462b72c528d3f53f40dda82fa65e22d903d718259a 0001-setup-disk-add-swap-to-etc-fstab.patch" +42909ca1429c1b9e9683af8374b6787190f55131ba65fcccad1012fa2e633d0724559caec1c8bef56fb820462b72c528d3f53f40dda82fa65e22d903d718259a 0001-setup-disk-add-swap-to-etc-fstab.patch +54c9bbcbc95591fd7dc008769da3ece993a5c92a7789bede7681006bb3be454daca8c6556c0fcb6d8a644338865babe09b881f2b0ca00306cc02b8589d58f3e1 0001-setup-bootable-move-syslinux.cfg-to-boot-syslinux-if.patch" |