View | Details | Raw Unified | Return to bug 34481
Collapse All | Expand All

(-)a/rpm/extlinux-config (-18 / +39 lines)
Lines 30-36 show_help() { Link Here
30
30
31
print_version() {
31
print_version() {
32
	cat <<-EOF
32
	cat <<-EOF
33
	$PROG version 2.0
33
	$PROG version 2.1
34
	Written by Alexey Gladkov.
34
	Written by Alexey Gladkov.
35
35
36
	Copyright (C) 2010-2012  Alexey Gladkov <gladkov.alexey@gmail.com>
36
	Copyright (C) 2010-2012  Alexey Gladkov <gladkov.alexey@gmail.com>
Lines 40-45 print_version() { Link Here
40
	exit
40
	exit
41
}
41
}
42
42
43
read_gpt() {
44
	local offset=$(($1 + 512)) len=${2:-1}
45
	local x=$(dd if="$dev" bs=1 skip=$offset count=$len 2>/dev/null | od -A n -t u$len)
46
	echo "${x// /}"
47
}
48
49
43
GETOPT_ALLOW_UNKNOWN=1
50
GETOPT_ALLOW_UNKNOWN=1
44
TEMP=`getopt -n $PROG -o b:,d,r:,v,V,h -l boot:,dry-run,root:,verbose,version,help -- "$@"` ||
51
TEMP=`getopt -n $PROG -o b:,d,r:,v,V,h -l boot:,dry-run,root:,verbose,version,help -- "$@"` ||
45
	show_help
52
	show_help
Lines 86-111 sysfs_path="$(readlink -ev "/sys/dev/block/$boot_majmin" 2>/dev/null)" || Link Here
86
read partition < "$sysfs_path/partition"
93
read partition < "$sysfs_path/partition"
87
94
88
dev="$(sed -n -e 's,^DEVNAME=,/dev/,p' "${sysfs_path%/*}/uevent")"
95
dev="$(sed -n -e 's,^DEVNAME=,/dev/,p' "${sysfs_path%/*}/uevent")"
89
partition_table="$(LANG=C parted -ms "$dev" print | grep ^/ |cut -d: -f6)"
96
97
magic="$(dd if="$dev" bs=2 skip=255 count=1 2>/dev/null)"
98
[ "$magic" = $'\x55\xAA' ] ||
99
	fatal "Unknown partition table"
100
101
magic="$(dd if="$dev" bs=8 skip=64 count=1 2>/dev/null)"
102
if [ "$magic" != "EFI PART" ]; then
103
	partition_table='msdos'
104
	magic=4
105
else
106
	partition_table='gpt'
107
	magic=$(read_gpt 80 4)
108
fi
90
109
91
verbose "Partition table: $partition_table"
110
verbose "Partition table: $partition_table"
92
111
93
case "$partition_table" in
112
[ $partition -ge 1 -a $partition -le $magic ] ||
94
	gpt)
113
	fatal "invalid partition number"
95
		mbr_bin='gptmbr.bin'
114
96
		flag='legacy_boot'
115
if [ "$partition_table" = "msdos" ]; then
97
		;;
116
	magic=$(($((partition - 1)) * 16 + 446))
98
	msdos)
117
	magic="$(dd if="$dev" bs=1 skip=$magic count=1 2>/dev/null)"
99
		mbr_bin='mbr.bin'
118
	[ "$magic" = $'\x80' ] ||
100
		flag='boot'
119
		fatal "partiton not bootable"
101
		;;
120
	mbr_bin='mbr.bin'
102
	*)	fatal "Unknown partition table: $partition_table" ;;
121
else
103
esac
122
	entry_size=$(read_gpt 84 4)
104
123
	magic=$(($((partition - 1)) * $entry_size + 552))
105
bootflags="$(LANG=C parted -ms "$dev" print | grep "^$partition:" |cut -d: -f7)"
124
	magic="$(read_gpt $magic)"
106
125
	magic=$((magic & 2))
107
[ -z "${bootflags##*$flag*}" ] ||
126
	[ "$magic" = "2" ] ||
108
	fatal "partiton not bootable"
127
		fatal "partiton not bootable"
128
	mbr_bin='gptmbr.bin'
129
fi
109
130
110
DEVNAME=
131
DEVNAME=
111
dir="$(readlink -m "$ROOTDIR/")"
132
dir="$(readlink -m "$ROOTDIR/")"
(-)a/rpm/extlinux.spec (-2 / +5 lines)
Lines 1-7 Link Here
1
Summary: The EXTLINUX bootloader, for booting the local system.
1
Summary: The EXTLINUX bootloader, for booting the local system.
2
Name: extlinux
2
Name: extlinux
3
Version: 6.03
3
Version: 6.03
4
Release: alt1
4
Release: alt2
5
License: GPL2
5
License: GPL2
6
Group: System/Base
6
Group: System/Base
7
Url: http://www.syslinux.org/wiki/index.php/The_Syslinux_Project
7
Url: http://www.syslinux.org/wiki/index.php/The_Syslinux_Project
Lines 15-21 Source4: extlinux.filetrigger Link Here
15
15
16
BuildRequires: libe2fs-devel libuuid-devel nasm
16
BuildRequires: libe2fs-devel libuuid-devel nasm
17
17
18
Requires: libshell util-linux parted
18
Requires: libshell util-linux
19
19
20
Conflicts: syslinux-extlinux
20
Conflicts: syslinux-extlinux
21
Obsoletes: syslinux4-extlinux
21
Obsoletes: syslinux4-extlinux
Lines 100-105 ln -s ../boot/extlinux/extlinux.conf.d . Link Here
100
%doc sample
100
%doc sample
101
101
102
%changelog
102
%changelog
103
* Fri Mar 16 2017 Leonid Krivoshein <klark@altlinux.org> 6.03-alt2
104
- Removed dependency to parted (ALT#34481).
105
103
* Tue Dec 26 2017 Alexey Gladkov <legion@altlinux.ru> 6.03-alt1
106
* Tue Dec 26 2017 Alexey Gladkov <legion@altlinux.ru> 6.03-alt1
104
- New release (6.03).
107
- New release (6.03).
105
108

Return to bug 34481