Bug#738922: parted3 preparation
On Thu, Feb 13, 2014 at 04:53:16PM -0500, Phillip Susi wrote: In preparation for the parted3 transition, this patch fixes format_swap to go straight to using mkswap instead of trying to use parted_server first. It also removes ext2 support, which will be picked up by partman-ext3 and depends on dosfstools-udeb for fsck/mkfs. Finally, it removes check_swap, since there really is no such thing as fscking swap. I think it would be very helpful to split up the logical chunks of this. Moving ext2 support means that we need to make sure that partman-basicfilesystems and partman-ext3 land in unstable and testing at the same time, and derived distributions need to do that too. Given the general lack of tool support for this sort of lockstep change in udebs, I'm uncomfortable with bundling it into this change. Was there a good reason for that or did you just think it was tidier? If the latter, I think it would in fact be better avoided. In any case, the presence of this change bundled in with everything else makes the rest of it much harder to read. diff -Nru partman-basicfilesystems-90/check.d/check_basicfilesystems partman-basicfilesystems-91/check.d/check_basicfilesystems --- partman-basicfilesystems-90/check.d/check_basicfilesystems 2011-05-03 21:00:32.0 -0400 +++ partman-basicfilesystems-91/check.d/check_basicfilesystems 2014-02-13 16:30:28.0 -0500 @@ -30,9 +30,14 @@ db_subst $template PARTITION $num db_subst $template DEVICE $(humandev $(cat device)) name_progress_bar $template - open_dialog CHECK_FILE_SYSTEM $id - read_line status - close_dialog + if log-output -t partman --pass-stdout \ + dosfsck $device /dev/null; then + status=OK + else + status=failed + fi + db_progress STOP + if [ $status != good ]; then db_subst partman-basicfilesystems/check_failed TYPE $filesystem db_subst partman-basicfilesystems/check_failed PARTITION $num The name_progress_bar call now has no effect and should be removed. Contrariwise, the effect of this change is that no progress bar is displayed while dosfsck is running. This is the sort of thing we need to be careful about throughout this work. Given that we don't have useful steps, I would suggest replacing the name_progress_bar call with something like: db_progress START 0 1 partman/text/please_wait db_progress INFO $template [log-output dosfsck, etc.] db_progress STOP I also don't think you can possibly have tested this, because you set status=OK on success, but then the check below is [ $status != good ], so the effect of this change will be that partman-basicfilesystems always displays an error dialog. Unlike CREATE_FILE_SYSTEM, parted_server CHECK_FILE_SYSTEM sets status to good or bad; I suggest following that. diff -Nru partman-basicfilesystems-90/check.d/check_swap partman-basicfilesystems-91/check.d/check_swap --- partman-basicfilesystems-90/check.d/check_swap2011-01-18 23:57:21.0 -0500 +++ partman-basicfilesystems-91/check.d/check_swap1969-12-31 19:00:00.0 -0500 @@ -1,58 +0,0 @@ -#!/bin/sh - -. /lib/partman/lib/base.sh - -swap=false - -for dev in $DEVICES/*; do - [ -d $dev ] || continue - cd $dev - partitions= - open_dialog PARTITIONS - while { read_line num id size type fs path name; [ $id ]; }; do - [ $fs != free ] || continue - partitions=$partitions $id,$num - done - close_dialog - - for part in $partitions; do - id=${part%,*} - num=${part#*,} - [ -f $id/method ] || continue - method=$(cat $id/method) - if [ $method = swap ]; then - swap=: - fi - [ ! -f $id/format ] || continue - if [ $method = swap ]; then - log Check the swap space in $dev/$id - template=partman-basicfilesystems/progress_swap_checking - db_subst $template PARTITION $num - db_subst $template DEVICE $(humandev $(cat device)) - name_progress_bar $template - open_dialog CHECK_FILE_SYSTEM $id - read_line status - close_dialog - if [ $status != good ]; then - db_subst partman-basicfilesystems/swap_check_failed PARTITION $num - db_subst partman-basicfilesystems/swap_check_failed DEVICE $(humandev $(cat device)) - db_set
Bug#738922: parted3 preparation
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 3/12/2014 9:34 AM, Colin Watson wrote: I think it would be very helpful to split up the logical chunks of this. Moving ext2 support means that we need to make sure that partman-basicfilesystems and partman-ext3 land in unstable and testing at the same time, and derived distributions need to do that too. Given the general lack of tool support for this sort of lockstep change in udebs, I'm uncomfortable with bundling it into this change. Was there a good reason for that or did you just think it was tidier? If the latter, I think it would in fact be better avoided. The purpose of the patch is to stop depending on libparted. The existing ext2 support thus needed removed and transitioned to the code that is currently in partman-ext3. I suppose I could have copied and pasted that code into partman-basicfilesystems, but needlessly duplicating code seemed silly. I think it would be a good idea to keep the sync call in place, at least in the event that mkfs succeeds. What for? If the system crashes 3 seconds later, who cares if the disk was properly formatted or not? -Template: partman-basicfilesystems/text/noatime -Type: text -# :sl2: -# Note to translators: Please keep your translations of this string below -# a 65 columns limit (which means 65 characters in single-byte languages) -_Description: noatime - do not update inode access times at each access Even aside from my comments about moving ext2 support, you must not remove all these mount option templates. select_mountoptions always picks up the templates from partman-basicfilesystems/text/$op, and these mount options are made available for various different file systems. It looks to me like these templates were duplicated in basicfilesystems and -ext3 because both ext2 and ext[34] needed them. With ext2 removed from basicfilesystems, they seem to be unreferenced cruft now. If the system always looks for them in -basicfilesystems, then why are they duplicated in -ext3? I'm pretty sure I checked the menu and they still showed up properly. -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.17 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJTIGjoAAoJEI5FoCIzSKrwercIAJr53yNvtcbBdPgYr8j2tjkS XRfTtnCe37UNcR0cETq1A4egd/BudtgHCzpRwaJbahehjU7gPDebJA0rLGOmgjB+ DcCumNTyI3air5/dgvZVokopIiJ7HutnxNVpq91y6wvXrX4u5F0FNcrDOy3NfKMe sc/qfonTE1ILEvJ1CrLbREK7kreKZDbVWN90CWIt0qaLvyaxzSHaD54NrkKtxez2 1gmbj/syx/sr400Rc3LCKifIZfY86R2m61xeLhgR2cWebkP899dAh+lqsTMoxs6t 1C5eaZYHnAkWUjrFdsbZk02chrHMmxaNopMThxNK1oSAKu4Zopf/QPhBxHY04BQ= =H65F -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#738922: parted3 preparation
On Wed, Mar 12, 2014 at 10:02:16AM -0400, Phillip Susi wrote: On 3/12/2014 9:34 AM, Colin Watson wrote: I think it would be very helpful to split up the logical chunks of this. Moving ext2 support means that we need to make sure that partman-basicfilesystems and partman-ext3 land in unstable and testing at the same time, and derived distributions need to do that too. Given the general lack of tool support for this sort of lockstep change in udebs, I'm uncomfortable with bundling it into this change. Was there a good reason for that or did you just think it was tidier? If the latter, I think it would in fact be better avoided. The purpose of the patch is to stop depending on libparted. The existing ext2 support thus needed removed and transitioned to the code that is currently in partman-ext3. I suppose I could have copied and pasted that code into partman-basicfilesystems, but needlessly duplicating code seemed silly. Please do it anyway - moving this around is going to be a pain. I think it would be a good idea to keep the sync call in place, at least in the event that mkfs succeeds. What for? If the system crashes 3 seconds later, who cares if the disk was properly formatted or not? In the past there've been some problems with things like udev not picking changes up properly, I think. Memory is fuzzy. In any event, my point is that you should be decoupling things from the parted 3 transition when at all possible. We can always try removing syncs later; if it's done separately it will be easier to see when problems are down to that, rather than a giant debugging nightmare. -Template: partman-basicfilesystems/text/noatime -Type: text -# :sl2: -# Note to translators: Please keep your translations of this string below -# a 65 columns limit (which means 65 characters in single-byte languages) -_Description: noatime - do not update inode access times at each access Even aside from my comments about moving ext2 support, you must not remove all these mount option templates. select_mountoptions always picks up the templates from partman-basicfilesystems/text/$op, and these mount options are made available for various different file systems. It looks to me like these templates were duplicated in basicfilesystems and -ext3 because both ext2 and ext[34] needed them. With ext2 removed from basicfilesystems, they seem to be unreferenced cruft now. If the system always looks for them in -basicfilesystems, then why are they duplicated in -ext3? I'm pretty sure I checked the menu and they still showed up properly. There's no noatime template in -ext3, so I don't know what you're talking about here. Please just put these templates back; they are absolutely *not* unreferenced cruft. Cheers, -- Colin Watson [cjwat...@debian.org] -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#738922: parted3 preparation
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I made one small mistake with this patch. It turns out there aren't symlinks for mkfs.fat{16,32}, so the mkfs line needs changed from mkfs.$filesystem to mkfs.vfat -F ${filesystem#fat}. -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.17 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJS/kuwAAoJEI5FoCIzSKrwhGYIAJf88Y1Zmd42mFRxYD2jlcqj 3YRN/CQvkKmcqae3DvBm+pRnepGLkSuKmda5RvfRlmqRgfMh/S9n91TmiH38oJeY PA7Oc7K0jctIHGTt4R7sqexZxEcZKK398vaAuX65H9Pe9xJ7D7sHx6jfFBY1GiTI wrNA/CpTYZxGjWZKxSKBJGvS10uAUk3AkPE3d+x3QvGvOVIuDOfKwAC5vx8H7BYO jJ2X+3PA1tjKL6KymLVLpYub8KZ8Zo4b0Me5lw6y2OuF2a6B5gPtTUxKFM6tr5jq uktFPjxEa/M4dtA5IrogDGxiawZxSYT7oFwgrao7AAqC6ixKPC2/nEAXEFYSoiU= =vGcJ -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#738922: parted3 preparation
Package: partman-basicfilesystems Tags: patch In preparation for the parted3 transition, this patch fixes format_swap to go straight to using mkswap instead of trying to use parted_server first. It also removes ext2 support, which will be picked up by partman-ext3 and depends on dosfstools-udeb for fsck/mkfs. Finally, it removes check_swap, since there really is no such thing as fscking swap. diff -Nru partman-basicfilesystems-90/active_partition/basicfilesystems/choices partman-basicfilesystems-91/active_partition/basicfilesystems/choices --- partman-basicfilesystems-90/active_partition/basicfilesystems/choices 2011-01-18 23:57:21.0 -0500 +++ partman-basicfilesystems-91/active_partition/basicfilesystems/choices 2014-02-13 15:03:12.0 -0500 @@ -16,7 +16,7 @@ filesystem=$(cat $part/acting_filesystem) case $filesystem in -ext2|fat16|fat32) +fat16|fat32) : ;; *) @@ -26,7 +26,7 @@ choice_mountpoint () { case $filesystem in - ext2|fat16|fat32) + fat16|fat32) if [ -f $part/mountpoint ]; then mp=$(cat $part/mountpoint) else @@ -66,16 +66,6 @@ -o $part/formatted -ot $part/method \ -o $part/formatted -ot $part/filesystem ] || return 0 case $filesystem in - ext2) - if [ -f $part/label ]; then - label=$(cat $part/label) - else - db_metaget partman-basicfilesystems/text/none description - label=$RET - fi - db_metaget partman-basicfilesystems/text/specify_label description - printf label\t%s\${!TAB}%s\n $RET $label - ;; _no_fat16|_no_fat32) # we dont have tools to set label of FAT file systems if [ -f $part/label ]; then label=$(cat $part/label) @@ -89,41 +79,6 @@ esac } -choice_reserved () { - local reserved - [ $filesystem = ext2 ] || return 0 - # allow to set reserved space only if the partition is to be formatted - [ -f $part/format ] || return 0 - [ ! -f $part/formatted \ - -o $part/formatted -ot $part/method \ - -o $part/formatted -ot $part/filesystem ] || return 0 - if [ -f $part/reserved_for_root ]; then - reserved=$(cat $part/reserved_for_root) - else - reserved=5 - fi - db_metaget partman-basicfilesystems/text/reserved_for_root description - printf reserved_for_root\t%s\${!TAB}%s\n $RET $reserved% -} - -choice_usage () { - local usage - [ $filesystem = ext2 ] || return 0 - # allow to set usage only if the partition is to be formatted - [ -f $part/format ] || return 0 - [ ! -f $part/formatted \ - -o $part/formatted -ot $part/method \ - -o $part/formatted -ot $part/filesystem ] || return 0 - if [ -f $part/usage ]; then - usage=$(cat $part/usage) - else - db_metaget partman-basicfilesystems/text/typical_usage description - usage=$RET - fi - db_metaget partman-basicfilesystems/text/usage description - printf usage\t%s\${!TAB}%s\n $RET $usage -} - choice_mountpoint choice_options @@ -131,7 +86,3 @@ choice_format_swap choice_label - -choice_reserved - -choice_usage diff -Nru partman-basicfilesystems-90/active_partition/basicfilesystems/do_option partman-basicfilesystems-91/active_partition/basicfilesystems/do_option --- partman-basicfilesystems-90/active_partition/basicfilesystems/do_option 2011-01-18 23:57:21.0 -0500 +++ partman-basicfilesystems-91/active_partition/basicfilesystems/do_option 2014-02-13 15:04:38.0 -0500 @@ -119,43 +119,6 @@ fi db_reset partman-basicfilesystems/choose_label ;; -reserved_for_root) - if [ -f $part/reserved_for_root ]; then - reserved=$(cat $part/reserved_for_root) - else - reserved=5 - fi - db_set partman-basicfilesystems/specify_reserved $reserved% - db_input critical partman-basicfilesystems/specify_reserved || true - db_go || exit 1 - db_get partman-basicfilesystems/specify_reserved - RET=`expr $RET : '\([0-9][0-9]\?\)\([,. %].*\)\?$'` - if [ $RET ]; then - echo $RET $part/reserved_for_root - else - rm -f $part/reserved_for_root - fi - db_reset partman-basicfilesystems/specify_reserved - ;; -usage) - db_metaget partman-basicfilesystems/text/typical_usage description - typical_usage=$RET - if [ -f $part/usage ]; then - usage=$(cat $part/usage) - else - usage=$typical_usage - fi - db_subst partman-basicfilesystems/specify_usage CHOICES $typical_usage, news, largefile, largefile4 - db_set