tazlito rev 501

Clean efi/boot to build loram
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun May 20 13:25:56 2018 +0200 (2018-05-20)
parents 35f0bc818f6a
children 293ad3520cc0
files tazlito
line diff
     1.1 --- a/tazlito	Fri May 18 11:51:11 2018 +0200
     1.2 +++ b/tazlito	Sun May 20 13:25:56 2018 +0200
     1.3 @@ -1258,6 +1258,20 @@
     1.4  }
     1.5  
     1.6  
     1.7 +# Remove duplicated files in $1/efi/boot from $1/boot
     1.8 +
     1.9 +cleanup_efi_boot() {
    1.10 +	for i in $1/efi/boot/* ; do
    1.11 +		[ -f $i ] || continue
    1.12 +		cmp $i ${i/\/efi\//\/} 2> /dev/null || continue
    1.13 +		rm -f $i
    1.14 +		case "$i" in
    1.15 +		*vmlinuz*) sed -i '$d' $(dirname $i)/startup.nsh
    1.16 +		esac
    1.17 +	done
    1.18 +}
    1.19 +
    1.20 +
    1.21  # Build initial rootfs for loram ISO ram/cdrom/http
    1.22  
    1.23  build_initfs() {
    1.24 @@ -1561,6 +1575,7 @@
    1.25  build_loram_cdrom() {
    1.26  	build_initfs cdrom || return 1
    1.27  	cp -a $TMP_DIR/iso $TMP_DIR/loramiso
    1.28 +	cleanup_efi_boot $TMP_DIR/loramiso
    1.29  	mkdir $TMP_DIR/loramiso/fs
    1.30  	cd $TMP_DIR/loramiso/fs
    1.31  	for i in $( ls ../boot/root* | sort -r ) ; do
    1.32 @@ -1586,6 +1601,7 @@
    1.33  build_loram_http() {
    1.34  	build_initfs http || return 1
    1.35  	cp -a $TMP_DIR/iso $TMP_DIR/loramiso
    1.36 +	cleanup_efi_boot $TMP_DIR/loramiso
    1.37  	rm -f $TMP_DIR/loramiso/boot/rootfs*
    1.38  	mv $TMP_DIR/initfs.gz $TMP_DIR/loramiso/boot/rootfs.gz
    1.39  	unmeta_boot
    1.40 @@ -1636,6 +1652,7 @@
    1.41  	build_initfs ram || return 1
    1.42  	build_loram_rootfs    "$1"
    1.43  	cp -a $TMP_DIR/iso    $TMP_DIR/loramiso
    1.44 +	cleanup_efi_boot      $TMP_DIR/loramiso
    1.45  	mv $TMP_DIR/initfs.gz $TMP_DIR/loramiso/boot/rootfs.gz
    1.46  	cp $TMP_DIR/rootfs*   $TMP_DIR/loramiso/boot
    1.47  	update_metaiso_sizes