summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Juszkiewicz <marcin.juszkiewicz@linaro.org>2012-05-21 21:53:14 +0200
committerMarcin Juszkiewicz <marcin.juszkiewicz@linaro.org>2012-05-21 21:54:45 +0200
commitb6101b8d635efcf4720fade6b67f22e7ad466c9f (patch)
tree5b4cb5778855c3f6cddefd1758b41b787f46f634
parent62323ba1fdddf8e798bb5614ea2f22e4712fcc36 (diff)
hooks: change symlinks to relative, move sysroot to binary/libc
-rwxr-xr-xprecise-armhf-alip-dev/customization/hooks/50-remove-gcc-related-packages.binary10
-rwxr-xr-xprecise-armhf-alip-dev/customization/hooks/60-remove_not_needed.binary5
-rwxr-xr-xprecise-armhf-alip-dev/customization/hooks/65-remove-gcc-related-packages.binary3
-rwxr-xr-xprecise-armhf-alip-dev/customization/hooks/70-kill_all_symlinks.binary11
-rwxr-xr-xprecise-armhf-alip-dev/customization/hooks/90-change-symlinks-to-relative.binary22
-rwxr-xr-xprecise-armhf-alip-dev/customization/hooks/99-move-to-libc.binary6
-rwxr-xr-xprecise-armhf-libc-dev/customization/hooks/60-remove_not_needed.binary (renamed from precise-armhf-libc-dev/customization/hooks/90-remove_not_needed.binary)0
-rwxr-xr-xprecise-armhf-libc-dev/customization/hooks/90-change-symlinks-to-relative.binary22
-rwxr-xr-xprecise-armhf-libc-dev/customization/hooks/99-move-to-libc.binary6
-rwxr-xr-xprecise-armhf-nano-dev/customization/hooks/50-remove-gcc-related-packages.binary10
-rwxr-xr-xprecise-armhf-nano-dev/customization/hooks/65-remove-gcc-related-packages.binary3
-rwxr-xr-xprecise-armhf-nano-dev/customization/hooks/70-kill_all_symlinks.binary12
-rwxr-xr-xprecise-armhf-nano-dev/customization/hooks/90-change-symlinks-to-relative.binary22
-rwxr-xr-xprecise-armhf-nano-dev/customization/hooks/99-move-to-libc.binary6
-rwxr-xr-xprecise-armhf-ubuntu-desktop-dev/customization/hooks/50-remove-gcc-related-packages.binary10
-rwxr-xr-xprecise-armhf-ubuntu-desktop-dev/customization/hooks/60-remove_not_needed.binary5
-rwxr-xr-xprecise-armhf-ubuntu-desktop-dev/customization/hooks/65-remove-gcc-related-packages.binary3
-rwxr-xr-xprecise-armhf-ubuntu-desktop-dev/customization/hooks/70-kill_all_symlinks.binary11
-rwxr-xr-xprecise-armhf-ubuntu-desktop-dev/customization/hooks/90-change-symlinks-to-relative.binary22
-rwxr-xr-xprecise-armhf-ubuntu-desktop-dev/customization/hooks/99-move-to-libc.binary6
20 files changed, 146 insertions, 49 deletions
diff --git a/precise-armhf-alip-dev/customization/hooks/50-remove-gcc-related-packages.binary b/precise-armhf-alip-dev/customization/hooks/50-remove-gcc-related-packages.binary
new file mode 100755
index 0000000..8d19db6
--- /dev/null
+++ b/precise-armhf-alip-dev/customization/hooks/50-remove-gcc-related-packages.binary
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+for pkg in libgcc1 libmudflap0 libmudflap0-4.6-dev libstdc++6 libstdc++6-4.6-dev gcc gcc-4.6
+do
+ LIST=`sed -e 's+^\/++g' var/lib/dpkg/info/${pkg}.list`
+ for file in $LIST
+ do
+ rm $file
+ done
+done
diff --git a/precise-armhf-alip-dev/customization/hooks/60-remove_not_needed.binary b/precise-armhf-alip-dev/customization/hooks/60-remove_not_needed.binary
index c7dd7a5..55a7447 100755
--- a/precise-armhf-alip-dev/customization/hooks/60-remove_not_needed.binary
+++ b/precise-armhf-alip-dev/customization/hooks/60-remove_not_needed.binary
@@ -6,9 +6,8 @@ rm -rf usr/share/{groff,linda,lintian,info,man,perl,locale,fonts,icons,i18n,gtk-
boot lib/modules \
lib/firmware dev home lib/init lib/lsb lib/systemd lib/terminfo \
usr/lib/firefox*/searchplugins/common \
- usr/bin/X11 lib64 \
- lib/udev lib/xtables media mnt opt proc root run selinux srv sys tmp
-onsoleKit,initramfs-tools,ldscripts,mime,sasl2,ssl,tc,upstart,user-setup,valgrind}\
+ etc bin usr/bin sbin usr/sbin var usr/local usr/games lib64 \
+ usr/lib/{locale,gnupg,apt,ConsoleKit,initramfs-tools,ldscripts,mime,sasl2,ssl,tc,upstart,user-setup,valgrind}\
lib/udev lib/xtables media mnt opt proc root run selinux srv sys tmp
rmdir -p `find . -type d -empty` || true
diff --git a/precise-armhf-alip-dev/customization/hooks/65-remove-gcc-related-packages.binary b/precise-armhf-alip-dev/customization/hooks/65-remove-gcc-related-packages.binary
deleted file mode 100755
index 15dc1da..0000000
--- a/precise-armhf-alip-dev/customization/hooks/65-remove-gcc-related-packages.binary
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-#dpkg --purge --force-all libgcc1 libmudflap0 libmudflap0-*-dev libstdc++6 libstdc++6-*-dev gcc gcc-4.6*
diff --git a/precise-armhf-alip-dev/customization/hooks/70-kill_all_symlinks.binary b/precise-armhf-alip-dev/customization/hooks/70-kill_all_symlinks.binary
deleted file mode 100755
index 0d9f552..0000000
--- a/precise-armhf-alip-dev/customization/hooks/70-kill_all_symlinks.binary
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-cd binary/boot/
-
-mv filesystem.dir old
-mkdir filesystem.dir
-
-cd old
-
-tar -cf - --no-same-owner --ignore-case --dereference . | tar -xf - -C ../filesystem.dir && rm -rf ../old
-- -C ../filesystem.dir && rm -rf ../old
diff --git a/precise-armhf-alip-dev/customization/hooks/90-change-symlinks-to-relative.binary b/precise-armhf-alip-dev/customization/hooks/90-change-symlinks-to-relative.binary
new file mode 100755
index 0000000..ec2a448
--- /dev/null
+++ b/precise-armhf-alip-dev/customization/hooks/90-change-symlinks-to-relative.binary
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+# Taken from http://bazaar.launchpad.net/~linaro-toolchain-dev/crosstool-ng/linaro/view/head:/contrib/linaro/make-sysroot.sh
+
+sysroot=binary/boot/filesystem.dir
+
+# Some packages include absolute links in sysroot/usr/lib.
+# Convert to relative links instead
+for lib in $( find $sysroot -type l ); do
+ target=$( readlink $lib )
+ base=$( basename $target )
+
+ case $target in
+ /*)
+ v=$( echo $lib | sed -r "s#^$sysroot/##" | tr -cd / | sed "s#/#../#g" )
+ p=$( echo $target | sed "s#^/##" )
+ rm $lib
+ ln -s $v$p $lib
+ ;;
+ *) ;;
+ esac
+done
diff --git a/precise-armhf-alip-dev/customization/hooks/99-move-to-libc.binary b/precise-armhf-alip-dev/customization/hooks/99-move-to-libc.binary
new file mode 100755
index 0000000..bc3b315
--- /dev/null
+++ b/precise-armhf-alip-dev/customization/hooks/99-move-to-libc.binary
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+cd binary
+mkdir libc
+mv boot/filesystem.dir/* libc
+rm -rf boot
diff --git a/precise-armhf-libc-dev/customization/hooks/90-remove_not_needed.binary b/precise-armhf-libc-dev/customization/hooks/60-remove_not_needed.binary
index 55a7447..55a7447 100755
--- a/precise-armhf-libc-dev/customization/hooks/90-remove_not_needed.binary
+++ b/precise-armhf-libc-dev/customization/hooks/60-remove_not_needed.binary
diff --git a/precise-armhf-libc-dev/customization/hooks/90-change-symlinks-to-relative.binary b/precise-armhf-libc-dev/customization/hooks/90-change-symlinks-to-relative.binary
new file mode 100755
index 0000000..ec2a448
--- /dev/null
+++ b/precise-armhf-libc-dev/customization/hooks/90-change-symlinks-to-relative.binary
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+# Taken from http://bazaar.launchpad.net/~linaro-toolchain-dev/crosstool-ng/linaro/view/head:/contrib/linaro/make-sysroot.sh
+
+sysroot=binary/boot/filesystem.dir
+
+# Some packages include absolute links in sysroot/usr/lib.
+# Convert to relative links instead
+for lib in $( find $sysroot -type l ); do
+ target=$( readlink $lib )
+ base=$( basename $target )
+
+ case $target in
+ /*)
+ v=$( echo $lib | sed -r "s#^$sysroot/##" | tr -cd / | sed "s#/#../#g" )
+ p=$( echo $target | sed "s#^/##" )
+ rm $lib
+ ln -s $v$p $lib
+ ;;
+ *) ;;
+ esac
+done
diff --git a/precise-armhf-libc-dev/customization/hooks/99-move-to-libc.binary b/precise-armhf-libc-dev/customization/hooks/99-move-to-libc.binary
new file mode 100755
index 0000000..bc3b315
--- /dev/null
+++ b/precise-armhf-libc-dev/customization/hooks/99-move-to-libc.binary
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+cd binary
+mkdir libc
+mv boot/filesystem.dir/* libc
+rm -rf boot
diff --git a/precise-armhf-nano-dev/customization/hooks/50-remove-gcc-related-packages.binary b/precise-armhf-nano-dev/customization/hooks/50-remove-gcc-related-packages.binary
new file mode 100755
index 0000000..8d19db6
--- /dev/null
+++ b/precise-armhf-nano-dev/customization/hooks/50-remove-gcc-related-packages.binary
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+for pkg in libgcc1 libmudflap0 libmudflap0-4.6-dev libstdc++6 libstdc++6-4.6-dev gcc gcc-4.6
+do
+ LIST=`sed -e 's+^\/++g' var/lib/dpkg/info/${pkg}.list`
+ for file in $LIST
+ do
+ rm $file
+ done
+done
diff --git a/precise-armhf-nano-dev/customization/hooks/65-remove-gcc-related-packages.binary b/precise-armhf-nano-dev/customization/hooks/65-remove-gcc-related-packages.binary
deleted file mode 100755
index 15dc1da..0000000
--- a/precise-armhf-nano-dev/customization/hooks/65-remove-gcc-related-packages.binary
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-#dpkg --purge --force-all libgcc1 libmudflap0 libmudflap0-*-dev libstdc++6 libstdc++6-*-dev gcc gcc-4.6*
diff --git a/precise-armhf-nano-dev/customization/hooks/70-kill_all_symlinks.binary b/precise-armhf-nano-dev/customization/hooks/70-kill_all_symlinks.binary
deleted file mode 100755
index c581602..0000000
--- a/precise-armhf-nano-dev/customization/hooks/70-kill_all_symlinks.binary
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-exit # we may enable this script later
-
-cd binary/boot/
-
-mv filesystem.dir old
-mkdir filesystem.dir
-
-cd old
-
-tar -cf - --no-same-owner --ignore-case --dereference . | tar -xf - -C ../filesystem.dir && rm -rf ../old
diff --git a/precise-armhf-nano-dev/customization/hooks/90-change-symlinks-to-relative.binary b/precise-armhf-nano-dev/customization/hooks/90-change-symlinks-to-relative.binary
new file mode 100755
index 0000000..ec2a448
--- /dev/null
+++ b/precise-armhf-nano-dev/customization/hooks/90-change-symlinks-to-relative.binary
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+# Taken from http://bazaar.launchpad.net/~linaro-toolchain-dev/crosstool-ng/linaro/view/head:/contrib/linaro/make-sysroot.sh
+
+sysroot=binary/boot/filesystem.dir
+
+# Some packages include absolute links in sysroot/usr/lib.
+# Convert to relative links instead
+for lib in $( find $sysroot -type l ); do
+ target=$( readlink $lib )
+ base=$( basename $target )
+
+ case $target in
+ /*)
+ v=$( echo $lib | sed -r "s#^$sysroot/##" | tr -cd / | sed "s#/#../#g" )
+ p=$( echo $target | sed "s#^/##" )
+ rm $lib
+ ln -s $v$p $lib
+ ;;
+ *) ;;
+ esac
+done
diff --git a/precise-armhf-nano-dev/customization/hooks/99-move-to-libc.binary b/precise-armhf-nano-dev/customization/hooks/99-move-to-libc.binary
new file mode 100755
index 0000000..bc3b315
--- /dev/null
+++ b/precise-armhf-nano-dev/customization/hooks/99-move-to-libc.binary
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+cd binary
+mkdir libc
+mv boot/filesystem.dir/* libc
+rm -rf boot
diff --git a/precise-armhf-ubuntu-desktop-dev/customization/hooks/50-remove-gcc-related-packages.binary b/precise-armhf-ubuntu-desktop-dev/customization/hooks/50-remove-gcc-related-packages.binary
new file mode 100755
index 0000000..8d19db6
--- /dev/null
+++ b/precise-armhf-ubuntu-desktop-dev/customization/hooks/50-remove-gcc-related-packages.binary
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+for pkg in libgcc1 libmudflap0 libmudflap0-4.6-dev libstdc++6 libstdc++6-4.6-dev gcc gcc-4.6
+do
+ LIST=`sed -e 's+^\/++g' var/lib/dpkg/info/${pkg}.list`
+ for file in $LIST
+ do
+ rm $file
+ done
+done
diff --git a/precise-armhf-ubuntu-desktop-dev/customization/hooks/60-remove_not_needed.binary b/precise-armhf-ubuntu-desktop-dev/customization/hooks/60-remove_not_needed.binary
index c7dd7a5..55a7447 100755
--- a/precise-armhf-ubuntu-desktop-dev/customization/hooks/60-remove_not_needed.binary
+++ b/precise-armhf-ubuntu-desktop-dev/customization/hooks/60-remove_not_needed.binary
@@ -6,9 +6,8 @@ rm -rf usr/share/{groff,linda,lintian,info,man,perl,locale,fonts,icons,i18n,gtk-
boot lib/modules \
lib/firmware dev home lib/init lib/lsb lib/systemd lib/terminfo \
usr/lib/firefox*/searchplugins/common \
- usr/bin/X11 lib64 \
- lib/udev lib/xtables media mnt opt proc root run selinux srv sys tmp
-onsoleKit,initramfs-tools,ldscripts,mime,sasl2,ssl,tc,upstart,user-setup,valgrind}\
+ etc bin usr/bin sbin usr/sbin var usr/local usr/games lib64 \
+ usr/lib/{locale,gnupg,apt,ConsoleKit,initramfs-tools,ldscripts,mime,sasl2,ssl,tc,upstart,user-setup,valgrind}\
lib/udev lib/xtables media mnt opt proc root run selinux srv sys tmp
rmdir -p `find . -type d -empty` || true
diff --git a/precise-armhf-ubuntu-desktop-dev/customization/hooks/65-remove-gcc-related-packages.binary b/precise-armhf-ubuntu-desktop-dev/customization/hooks/65-remove-gcc-related-packages.binary
deleted file mode 100755
index 15dc1da..0000000
--- a/precise-armhf-ubuntu-desktop-dev/customization/hooks/65-remove-gcc-related-packages.binary
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-#dpkg --purge --force-all libgcc1 libmudflap0 libmudflap0-*-dev libstdc++6 libstdc++6-*-dev gcc gcc-4.6*
diff --git a/precise-armhf-ubuntu-desktop-dev/customization/hooks/70-kill_all_symlinks.binary b/precise-armhf-ubuntu-desktop-dev/customization/hooks/70-kill_all_symlinks.binary
deleted file mode 100755
index 0d9f552..0000000
--- a/precise-armhf-ubuntu-desktop-dev/customization/hooks/70-kill_all_symlinks.binary
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-cd binary/boot/
-
-mv filesystem.dir old
-mkdir filesystem.dir
-
-cd old
-
-tar -cf - --no-same-owner --ignore-case --dereference . | tar -xf - -C ../filesystem.dir && rm -rf ../old
-- -C ../filesystem.dir && rm -rf ../old
diff --git a/precise-armhf-ubuntu-desktop-dev/customization/hooks/90-change-symlinks-to-relative.binary b/precise-armhf-ubuntu-desktop-dev/customization/hooks/90-change-symlinks-to-relative.binary
new file mode 100755
index 0000000..ec2a448
--- /dev/null
+++ b/precise-armhf-ubuntu-desktop-dev/customization/hooks/90-change-symlinks-to-relative.binary
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+# Taken from http://bazaar.launchpad.net/~linaro-toolchain-dev/crosstool-ng/linaro/view/head:/contrib/linaro/make-sysroot.sh
+
+sysroot=binary/boot/filesystem.dir
+
+# Some packages include absolute links in sysroot/usr/lib.
+# Convert to relative links instead
+for lib in $( find $sysroot -type l ); do
+ target=$( readlink $lib )
+ base=$( basename $target )
+
+ case $target in
+ /*)
+ v=$( echo $lib | sed -r "s#^$sysroot/##" | tr -cd / | sed "s#/#../#g" )
+ p=$( echo $target | sed "s#^/##" )
+ rm $lib
+ ln -s $v$p $lib
+ ;;
+ *) ;;
+ esac
+done
diff --git a/precise-armhf-ubuntu-desktop-dev/customization/hooks/99-move-to-libc.binary b/precise-armhf-ubuntu-desktop-dev/customization/hooks/99-move-to-libc.binary
new file mode 100755
index 0000000..bc3b315
--- /dev/null
+++ b/precise-armhf-ubuntu-desktop-dev/customization/hooks/99-move-to-libc.binary
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+cd binary
+mkdir libc
+mv boot/filesystem.dir/* libc
+rm -rf boot