From 67573768e70e6669178df5ae358dbc52c813d116 Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Tue, 4 Jul 2017 19:44:58 +0000 Subject: [PATCH] Move all patches to single directory --- build.sh | 33 +++++++++++-------- patches/{01 => }/01-bashrc.diff | 0 patches/{01 => }/02-persistant-net.diff | 0 patches/02/series | 3 -- patches/{01 => }/03-no-root-login.diff | 0 .../{02/01-useradd.diff => 04-useradd.diff} | 0 patches/{02/02-swap.diff => 05-swap.diff} | 0 patches/{02/05-path.diff => 06-path.diff} | 0 patches/{01 => }/series | 3 ++ 9 files changed, 22 insertions(+), 17 deletions(-) rename patches/{01 => }/01-bashrc.diff (100%) rename patches/{01 => }/02-persistant-net.diff (100%) delete mode 100644 patches/02/series rename patches/{01 => }/03-no-root-login.diff (100%) rename patches/{02/01-useradd.diff => 04-useradd.diff} (100%) rename patches/{02/02-swap.diff => 05-swap.diff} (100%) rename patches/{02/05-path.diff => 06-path.diff} (100%) rename patches/{01 => }/series (58%) diff --git a/build.sh b/build.sh index 5acb65f..91e9381 100755 --- a/build.sh +++ b/build.sh @@ -54,21 +54,13 @@ on_chroot() { } apply_patches() { - if [ ! -d "$1" ]; then - echo "Patches directory does not exist: $1" - exit 1 - fi - pushd "$ROOTFS_DIR" > /dev/null - export QUILT_PATCHES="$1" - - rm -rf .pc - mkdir -p .pc + export QUILT_PATCHES="$BASE_DIR/patches" quilt upgrade RC=0 - quilt push -a || RC=$? + quilt push "$1" || RC=$? case "$RC" in 0|2) @@ -78,8 +70,6 @@ apply_patches() { ;; esac - rm -rf .pc - popd > /dev/null } @@ -154,6 +144,12 @@ if [ ! -d "$ROOTFS_DIR" ]; then http://mirrordirector.raspbian.org/raspbian/" || rmdir "$ROOTFS_DIR/debootstrap" fi +## +# Prepare for Quilt patching. +# +rm -rf "$ROOTFS_DIR/.pc" +mkdir "$ROOTFS_DIR/.pc" + ## # Mount virtual file systems. # @@ -194,7 +190,9 @@ EOF install -m 644 files/cmdline.txt "$ROOTFS_DIR/boot" install -m 644 files/config.txt "$ROOTFS_DIR/boot" -apply_patches "$BASE_DIR/patches/01" +apply_patches '01-bashrc.diff' +apply_patches '02-persistant-net.diff' +apply_patches '03-no-root-login.diff' install -m 644 files/fstab "$ROOTFS_DIR/etc/fstab" install -m 644 files/ipv6.conf "$ROOTFS_DIR/etc/modprobe.d/ipv6.conf" @@ -262,7 +260,9 @@ apt-listchanges \ usb-modeswitch EOF -apply_patches "$BASE_DIR/patches/02" +apply_patches '04-useradd.diff' +apply_patches '05-swap.diff' +apply_patches '06-path.diff' install -m 644 files/50raspi "$ROOTFS_DIR/etc/apt/apt.conf.d/" @@ -307,6 +307,11 @@ umount "$ROOTFS_DIR/proc" umount "$ROOTFS_DIR/dev/pts" umount "$ROOTFS_DIR/dev" +## +# Cleanup after Quilt patching. +# +rm -rf "$ROOTFS_DIR/.pc" + ## # Prepare image file systems. # diff --git a/patches/01/01-bashrc.diff b/patches/01-bashrc.diff similarity index 100% rename from patches/01/01-bashrc.diff rename to patches/01-bashrc.diff diff --git a/patches/01/02-persistant-net.diff b/patches/02-persistant-net.diff similarity index 100% rename from patches/01/02-persistant-net.diff rename to patches/02-persistant-net.diff diff --git a/patches/02/series b/patches/02/series deleted file mode 100644 index c31d69f..0000000 --- a/patches/02/series +++ /dev/null @@ -1,3 +0,0 @@ -01-useradd.diff -02-swap.diff -05-path.diff diff --git a/patches/01/03-no-root-login.diff b/patches/03-no-root-login.diff similarity index 100% rename from patches/01/03-no-root-login.diff rename to patches/03-no-root-login.diff diff --git a/patches/02/01-useradd.diff b/patches/04-useradd.diff similarity index 100% rename from patches/02/01-useradd.diff rename to patches/04-useradd.diff diff --git a/patches/02/02-swap.diff b/patches/05-swap.diff similarity index 100% rename from patches/02/02-swap.diff rename to patches/05-swap.diff diff --git a/patches/02/05-path.diff b/patches/06-path.diff similarity index 100% rename from patches/02/05-path.diff rename to patches/06-path.diff diff --git a/patches/01/series b/patches/series similarity index 58% rename from patches/01/series rename to patches/series index 5ef5242..7af8b9d 100644 --- a/patches/01/series +++ b/patches/series @@ -1,3 +1,6 @@ 01-bashrc.diff 02-persistant-net.diff 03-no-root-login.diff +04-useradd.diff +05-swap.diff +06-path.diff